[gthumb: 18/24] [copy_move] use a single key for the last selected folder



commit 0ed5281dfa12b4bf7457bf7a1e1e4f186273d7e2
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Nov 15 18:37:26 2010 +0100

    [copy_move] use a single key for the last selected folder
    
    no need to use two keys for the move and copy commands.

 extensions/copy_move_to_folder/actions.c           |   20 +++++-----
 .../data/gthumb-copy-move-to-folder.schemas.in     |   40 +-------------------
 extensions/copy_move_to_folder/preferences.h       |    5 +--
 3 files changed, 13 insertions(+), 52 deletions(-)
---
diff --git a/extensions/copy_move_to_folder/actions.c b/extensions/copy_move_to_folder/actions.c
index c8c97f1..228f4a8 100644
--- a/extensions/copy_move_to_folder/actions.c
+++ b/extensions/copy_move_to_folder/actions.c
@@ -106,6 +106,7 @@ copy_to_folder_dialog (GthBrowser *browser,
 {
 	GtkWidget *dialog;
 	char      *start_uri;
+	GtkWidget *box;
 	GtkWidget *view_destination_button;
 
 	dialog = gtk_file_chooser_dialog_new (move ? _("Move To") : _("Copy To"),
@@ -115,19 +116,21 @@ copy_to_folder_dialog (GthBrowser *browser,
 					      (move ? _("Move") : _("Copy")), GTK_RESPONSE_ACCEPT,
 					      NULL);
 
-	start_uri = eel_gconf_get_string (move ? PREF_COPY_MOVE_TO_FOLDER_MOVE_URI : PREF_COPY_MOVE_TO_FOLDER_COPY_URI, get_home_uri ());
+	start_uri = eel_gconf_get_string (PREF_FILE_MANAGER_COPY_LAST_FOLDER, get_home_uri ());
 	gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (dialog), start_uri);
 	g_free(start_uri);
 
+	box = gtk_vbox_new (FALSE, 6);
+	gtk_container_set_border_width (GTK_CONTAINER (box), 6);
+	gtk_widget_show (box);
+
 	view_destination_button = gtk_check_button_new_with_mnemonic (_("_View the destination"));
 	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view_destination_button),
 				      eel_gconf_get_boolean (PREF_FILE_MANAGER_COPY_VIEW_DESTINATION, FALSE));
 	gtk_widget_show (view_destination_button);
-	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
-			    view_destination_button,
-			    FALSE,
-			    FALSE,
-			    0);
+	gtk_box_pack_start (GTK_BOX (box), view_destination_button, FALSE, FALSE, 0);
+
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), box, FALSE, FALSE, 0);
 
 	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
 		char *destination_uri;
@@ -140,10 +143,7 @@ copy_to_folder_dialog (GthBrowser *browser,
 
 			view_destination = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (view_destination_button));
 			eel_gconf_set_boolean (PREF_FILE_MANAGER_COPY_VIEW_DESTINATION, view_destination);
-			if (move)
-				eel_gconf_set_string (PREF_COPY_MOVE_TO_FOLDER_MOVE_URI, destination_uri);
-			else
-				eel_gconf_set_string (PREF_COPY_MOVE_TO_FOLDER_COPY_URI, destination_uri);
+			eel_gconf_set_string (PREF_FILE_MANAGER_COPY_LAST_FOLDER, destination_uri);
 
 			/* copy / move the files */
 
diff --git a/extensions/copy_move_to_folder/data/gthumb-copy-move-to-folder.schemas.in b/extensions/copy_move_to_folder/data/gthumb-copy-move-to-folder.schemas.in
index 1bd2fdd..3b581e0 100644
--- a/extensions/copy_move_to_folder/data/gthumb-copy-move-to-folder.schemas.in
+++ b/extensions/copy_move_to_folder/data/gthumb-copy-move-to-folder.schemas.in
@@ -2,8 +2,8 @@
     <schemalist>
 
       <schema>
-	<key>/schemas/apps/gthumb/ext/copy_move_to_folder/copy_uri</key>
-	<applyto>/apps/gthumb/ext/copy_move_to_folder/copy_uri</applyto>
+	<key>/schemas/apps/gthumb/ext/file_manager/copy_move/last_folder</key>
+	<applyto>/apps/gthumb/ext/file_manager/copy_move/last_folder</applyto>
 	<owner>gthumb</owner>
 	<type>string</type>
 	<default></default>
@@ -14,42 +14,6 @@
       </schema>
 
       <schema>
-	<key>/schemas/apps/gthumb/ext/copy_move_to_folder/move_uri</key>
-	<applyto>/apps/gthumb/ext/copy_move_to_folder/move_uri</applyto>
-	<owner>gthumb</owner>
-	<type>string</type>
-	<default></default>
-	<locale name="C">
-	  <short></short>
-	  <long></long>
-	</locale>
-      </schema>
-
-      <schema>
-	<key>/schemas/apps/gthumb/ext/copy_move_to_folder/show_dialog</key>
-	<applyto>/apps/gthumb/ext/copy_move_to_folder/show_dialog</applyto>
-	<owner>gthumb</owner>
-	<type>bool</type>
-	<default>true</default>
-	<locale name="C">
-	  <short></short>
-	  <long></long>
-	</locale>
-      </schema>
-
-      <schema>
-	<key>/schemas/apps/gthumb/ext/copy_move_to_folder/always_open</key>
-	<applyto>/apps/gthumb/ext/copy_move_to_folder/always_open</applyto>
-	<owner>gthumb</owner>
-	<type>bool</type>
-	<default>true</default>
-	<locale name="C">
-	  <short></short>
-	  <long></long>
-	</locale>
-      </schema>
-
-      <schema>
 	<key>/schemas/apps/gthumb/ext/file_manager/copy_move/view_destination</key>
 	<applyto>/apps/gthumb/ext/file_manager/copy_move/view_destination</applyto>
 	<owner>gthumb</owner>
diff --git a/extensions/copy_move_to_folder/preferences.h b/extensions/copy_move_to_folder/preferences.h
index 7ac1704..c1a93b4 100644
--- a/extensions/copy_move_to_folder/preferences.h
+++ b/extensions/copy_move_to_folder/preferences.h
@@ -24,10 +24,7 @@
 
 G_BEGIN_DECLS
 
-#define  PREF_COPY_MOVE_TO_FOLDER_COPY_URI      "/apps/gthumb/ext/copy_move_to_folder/copy_uri"
-#define  PREF_COPY_MOVE_TO_FOLDER_MOVE_URI      "/apps/gthumb/ext/copy_move_to_folder/move_uri"
-#define  PREF_COPY_MOVE_TO_FOLDER_SHOW_DIALOG   "/apps/gthumb/ext/copy_move_to_folder/show_dialog"
-#define  PREF_COPY_MOVE_TO_FOLDER_ALWAYS_OPEN   "/apps/gthumb/ext/copy_move_to_folder/always_open"
+#define  PREF_FILE_MANAGER_COPY_LAST_FOLDER      "/apps/gthumb/ext/file_manager/copy_move/last_folder"
 #define  PREF_FILE_MANAGER_COPY_VIEW_DESTINATION "/apps/gthumb/ext/file_manager/copy_move/view_destination"
 
 G_END_DECLS



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