[gthumb] Don't offer to rename imported files - bug 506605



commit 775e25e65f6f64411d762c006b6bce0ad1809724
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Thu May 21 13:43:30 2009 -0400

    Don't offer to rename imported files - bug 506605
---
 data/glade/gthumb_camera.glade |   70 ++++++++++++++--------------------------
 data/gthumb.schemas.in         |   13 -------
 doc/C/gthumb.xml               |    5 ---
 libgthumb/preferences.h        |    1 -
 src/dlg-photo-importer.c       |   53 ++----------------------------
 5 files changed, 28 insertions(+), 114 deletions(-)

diff --git a/data/glade/gthumb_camera.glade b/data/glade/gthumb_camera.glade
index 2ef43ca..e9efa78 100644
--- a/data/glade/gthumb_camera.glade
+++ b/data/glade/gthumb_camera.glade
@@ -234,7 +234,7 @@
 	      <child>
 		<widget class="GtkTable" id="i_commands_table">
 		  <property name="visible">True</property>
-		  <property name="n_rows">8</property>
+		  <property name="n_rows">7</property>
 		  <property name="n_columns">2</property>
 		  <property name="homogeneous">False</property>
 		  <property name="row_spacing">6</property>
@@ -356,51 +356,6 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkCheckButton" id="reset_exif_tag_on_import_checkbutton">
-		      <property name="visible">True</property>
-		      <property name="tooltip" translatable="yes">If this checkbox is enabled and the imported photo contains an Exif orientation tag, the image data will be physically transformed (losslessly) so that the viewed image looks the same as before but the orientation tag is reset to &quot;top left&quot;. If this checkbox is not enabled, the image data and the orientation tag are both left unchanged. The image will be displayed identically by gthumb for both possibilities, but for maximum compatibility with other applications this checkbox should be enabled.</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">_Rotate images physically</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
-		      <property name="active">False</property>
-		      <property name="inconsistent">False</property>
-		      <property name="draw_indicator">True</property>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">7</property>
-		      <property name="bottom_attach">8</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options"></property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkCheckButton" id="keep_names_checkbutton">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">_Keep original filenames</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
-		      <property name="active">False</property>
-		      <property name="inconsistent">False</property>
-		      <property name="draw_indicator">True</property>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">6</property>
-		      <property name="bottom_attach">7</property>
-		      <property name="x_options">fill</property>
-		      <property name="y_options"></property>
-		    </packing>
-		  </child>
-
-		  <child>
 		    <widget class="GtkCheckButton" id="delete_checkbutton">
 		      <property name="visible">True</property>
 		      <property name="tooltip" translatable="yes">If valuable photos have been deleted accidently, download the excellent PhotoRec tool from http://www.cgsecurity.org. PhotoRec can usually recover images that have been recently deleted from flash cards and other media.</property>
@@ -557,6 +512,29 @@
 		      <property name="y_options"></property>
 		    </packing>
 		  </child>
+
+		  <child>
+		    <widget class="GtkCheckButton" id="reset_exif_tag_on_import_checkbutton">
+		      <property name="visible">True</property>
+		      <property name="tooltip" translatable="yes">If this checkbox is enabled and the imported photo contains an Exif orientation tag, the image data will be physically transformed (losslessly) so that the viewed image looks the same as before but the orientation tag is reset to &quot;top left&quot;. If this checkbox is not enabled, the image data and the orientation tag are both left unchanged. The image will be displayed identically by gthumb for both possibilities, but for maximum compatibility with other applications this checkbox should be enabled.</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">_Rotate images physically</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">6</property>
+		      <property name="bottom_attach">7</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
diff --git a/data/gthumb.schemas.in b/data/gthumb.schemas.in
index 12ab893..dbe2e2e 100644
--- a/data/gthumb.schemas.in
+++ b/data/gthumb.schemas.in
@@ -2221,19 +2221,6 @@
       </schema>
 
       <schema>
-	<key>/schemas/apps/gthumb/dialogs/photo_importer/keep_original_filenames</key>
-	<applyto>/apps/gthumb/dialogs/photo_importer/keep_original_filenames</applyto>
-	<owner>gthumb</owner>
-	<type>bool</type>
-	<default>FALSE</default>
-	<locale name="C">
-	  <short></short>
-	  <long>
-	  </long>
-	</locale>
-      </schema>
-
-      <schema>
 	<key>/schemas/apps/gthumb/dialogs/photo_importer/reset_exif_orientation_on_import</key>
 	<applyto>/apps/gthumb/dialogs/photo_importer/reset_exif_orientation_on_import</applyto>
 	<owner>gthumb</owner>
diff --git a/doc/C/gthumb.xml b/doc/C/gthumb.xml
index 98fecfc..2a8dfcd 100644
--- a/doc/C/gthumb.xml
+++ b/doc/C/gthumb.xml
@@ -3013,11 +3013,6 @@
          after they have been imported.
        </para>
        <para>
-         &app; will rename the images (in numerical re-order) when they
- 	 are imported, unless the
-         <guilabel>Keep original filenames</guilabel> checkbox is selected.
-       </para>
-       <para>
          If the <guilabel>Rotate images physically</guilabel> checkbox is selected,
          and the imported photo contains an Exif orientation tag, the image data
          will be physically transformed (losslessly) so that the viewed image
diff --git a/libgthumb/preferences.h b/libgthumb/preferences.h
index ca8a67f..2067dbf 100644
--- a/libgthumb/preferences.h
+++ b/libgthumb/preferences.h
@@ -221,7 +221,6 @@
 #define  PREF_PHOTO_IMPORT_SUBFOLDER      "/apps/gthumb/dialogs/photo_importer/subfolder"
 #define  PREF_PHOTO_IMPORT_CUSTOM_FORMAT  "/apps/gthumb/dialogs/photo_importer/custom_format_code"
 #define  PREF_PHOTO_IMPORT_DELETE         "/apps/gthumb/dialogs/photo_importer/delete_from_camera"
-#define  PREF_PHOTO_IMPORT_KEEP_FILENAMES "/apps/gthumb/dialogs/photo_importer/keep_original_filenames"
 #define  PREF_PHOTO_IMPORT_RESET_EXIF_ORIENTATION	"/apps/gthumb/dialogs/photo_importer/reset_exif_orientation_on_import"
 #define  PREF_PHOTO_IMPORT_MODEL          "/apps/gthumb/dialogs/photo_importer/model"
 #define  PREF_PHOTO_IMPORT_PORT           "/apps/gthumb/dialogs/photo_importer/port"
diff --git a/src/dlg-photo-importer.c b/src/dlg-photo-importer.c
index 2764710..011bda8 100644
--- a/src/dlg-photo-importer.c
+++ b/src/dlg-photo-importer.c
@@ -90,7 +90,6 @@ struct _DialogData {
 	GtkWidget           *subfolder_combobox;
 	GtkWidget           *format_code_entry;
 	GtkWidget           *format_code_label;
-	GtkWidget           *keep_names_checkbutton;
 	GtkWidget           *delete_checkbutton;
 	GtkWidget           *choose_tags_button;
 	GtkWidget           *tags_entry;
@@ -119,7 +118,6 @@ struct _DialogData {
 	CameraAbilitiesList *abilities_list;
 	GPPortInfoList      *port_list;
 
-	gboolean             keep_original_filename;
 	gboolean             delete_from_camera;
 	gboolean             adjust_orientation;
 
@@ -1132,33 +1130,6 @@ get_folder_name (DialogData *data)
 }
 
 
-static void
-set_lowercase (char *name)
-{
-	char *s;
-	for (s = name; *s != 0; s++)
-		*s = g_ascii_tolower (*s);
-}
-
-
-static char *
-get_extension_lowercase (const char *path)
-{
-	const char *filename = file_name_from_path (path);
-	const char *ext;
-	char       *new_ext;
-
-	ext = strrchr (filename, '.');
-	if (ext == NULL)
-		return NULL;
-
-	new_ext = g_strdup (ext);
-	set_lowercase (new_ext);
-
-	return new_ext;
-}
-
-
 static char*
 get_file_name (DialogData *data,
 	       const char *camera_path,
@@ -1169,22 +1140,7 @@ get_file_name (DialogData *data,
 	char *file_path;
 	int   m = 1;
 
-	if (data->keep_original_filename) {
-		file_name = g_strdup (file_name_from_path (camera_path));
-		/* set_lowercase (file_name); see #339291 */
-	} 
-	else {
-		char *s, *new_ext;
-
-		new_ext = get_extension_lowercase (camera_path);
-		file_name = g_strdup_printf ("%5d%s", n, new_ext);
-		g_free (new_ext);
-
-		for (s = file_name; *s != 0; s++)
-			if (*s == ' ')
-				*s = '0';
-	}
-
+	file_name = g_strdup (file_name_from_path (camera_path));
 	file_path = g_build_filename (local_folder, file_name, NULL);
 
 	while (path_is_file (file_path)) {
@@ -1650,11 +1606,9 @@ ok_clicked_cb (GtkButton  *button,
 	if (data->local_folder == NULL)
 		return;
 
-	data->keep_original_filename = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->keep_names_checkbutton));
 	data->delete_from_camera = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->delete_checkbutton));
 	data->adjust_orientation = eel_gconf_get_boolean (PREF_PHOTO_IMPORT_RESET_EXIF_ORIENTATION, TRUE);
 
-	eel_gconf_set_boolean (PREF_PHOTO_IMPORT_KEEP_FILENAMES, data->keep_original_filename);
 	eel_gconf_set_boolean (PREF_PHOTO_IMPORT_DELETE, data->delete_from_camera);
 
 	/**/
@@ -2067,7 +2021,6 @@ dlg_photo_importer (GthBrowser *browser)
         data->subfolder_combobox = glade_xml_get_widget(data->gui, "group_into_subfolderscombobutton");
 	data->format_code_entry = glade_xml_get_widget (data->gui, "format_code_entry");
 	data->format_code_label = glade_xml_get_widget (data->gui, "format_code_label");
-	data->keep_names_checkbutton = glade_xml_get_widget (data->gui, "keep_names_checkbutton");
 	data->delete_checkbutton = glade_xml_get_widget (data->gui, "delete_checkbutton");
 	data->choose_tags_button = glade_xml_get_widget (data->gui, "choose_tags_button");
 	data->tags_entry = glade_xml_get_widget (data->gui, "tags_entry");
@@ -2115,9 +2068,11 @@ dlg_photo_importer (GthBrowser *browser)
 
 	gtk_image_set_from_pixbuf (GTK_IMAGE (data->progress_camera_image), data->no_camera_pixbuf);
 
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->keep_names_checkbutton), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_KEEP_FILENAMES, FALSE));
+printf ("delete_checkbutton\n");
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->delete_checkbutton), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_DELETE, FALSE));
+printf ("reset_exif_tag_on_import_checkbutton\n");
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->reset_exif_tag_on_import_checkbutton), eel_gconf_get_boolean (PREF_PHOTO_IMPORT_RESET_EXIF_ORIENTATION, TRUE));
+printf ("done\n");
 
 	default_path = eel_gconf_get_path (PREF_PHOTO_IMPORT_DESTINATION, NULL);
 	if ((default_path == NULL) || (*default_path == 0))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]