[gthumb] temporarily select the folder to which the context menu referes to



commit 926ee2510fbd25159f68ac3ebb96ce2f149482c0
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Apr 28 18:16:14 2010 +0200

    temporarily select the folder to which the context menu referes to
    
    in order to make it clear what folder the user selected.

 gthumb/gth-browser.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 8cf4dd6..6ffab92 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -2410,10 +2410,36 @@ folder_tree_folder_popup_cb (GthFolderTree *folder_tree,
 			3,
 			(guint32) time);
 
+	if (file_data != NULL) {
+		GtkTreePath *path;
+
+		path = gth_folder_tree_get_path (GTH_FOLDER_TREE (browser->priv->folder_tree), file_data->file);
+		gth_folder_tree_select_path (GTH_FOLDER_TREE (browser->priv->folder_tree), path);
+
+		gtk_tree_path_free (path);
+	}
+
 	_g_object_unref (file_source);
 }
 
 
+static void
+folder_popup_hide_cb (GtkWidget *widget,
+		      gpointer   user_data)
+{
+	GthBrowser  *browser = user_data;
+	GtkTreePath *path;
+
+	if (browser->priv->location == NULL)
+		return;
+
+	path = gth_folder_tree_get_path (GTH_FOLDER_TREE (browser->priv->folder_tree), browser->priv->location->file);
+	gth_folder_tree_select_path (GTH_FOLDER_TREE (browser->priv->folder_tree), path);
+
+	gtk_tree_path_free (path);
+}
+
+
 GthFileData *
 gth_browser_get_folder_popup_file_data (GthBrowser *browser)
 {
@@ -3649,6 +3675,10 @@ _gth_browser_construct (GthBrowser *browser)
 #endif
 	gth_window_attach (GTH_WINDOW (browser), menubar, GTH_WINDOW_MENUBAR);
 	browser->priv->folder_popup = gtk_ui_manager_get_widget (browser->priv->ui, "/FolderListPopup");
+	g_signal_connect (browser->priv->folder_popup,
+			  "hide",
+			  G_CALLBACK (folder_popup_hide_cb),
+			  browser);
 
 	/* toolbar */
 



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