[Goodies-commits] r2997 - in xfce4-places-plugin/trunk: . panel-plugin

Diego Ongaro ongardie at xfce.org
Wed Aug 15 07:19:02 CEST 2007


Author: ongardie
Date: 2007-08-15 05:19:02 +0000 (Wed, 15 Aug 2007)
New Revision: 2997

Modified:
   xfce4-places-plugin/trunk/ChangeLog
   xfce4-places-plugin/trunk/panel-plugin/view.c
Log:
2007-08-15	Diego Ongaro <ongardie at gmail.com>

* view.c: If left-click is disabled, do right-click action.


Modified: xfce4-places-plugin/trunk/ChangeLog
===================================================================
--- xfce4-places-plugin/trunk/ChangeLog	2007-08-13 21:26:26 UTC (rev 2996)
+++ xfce4-places-plugin/trunk/ChangeLog	2007-08-15 05:19:02 UTC (rev 2997)
@@ -1,3 +1,7 @@
+2007-08-15	Diego Ongaro <ongardie at gmail.com>
+
+	* view.c: If left-click is disabled, do right-click action.
+
 2007-08-12	Diego Ongaro <ongardie at gmail.com>
 
 	* model_volumes.c: set changed when volumes added/removed

Modified: xfce4-places-plugin/trunk/panel-plugin/view.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/view.c	2007-08-13 21:26:26 UTC (rev 2996)
+++ xfce4-places-plugin/trunk/panel-plugin/view.c	2007-08-15 05:19:02 UTC (rev 2997)
@@ -654,12 +654,9 @@
 
     gboolean ctrl =  (event->state & GDK_CONTROL_MASK) && 
                     !(event->state & (GDK_MOD1_MASK|GDK_SHIFT_MASK|GDK_MOD4_MASK));
-    
-    if(event->button == 3 || (event->button == 1 && ctrl))
+    gboolean sensitive = GTK_WIDGET_IS_SENSITIVE(gtk_bin_get_child(GTK_BIN(menu_item)));
+    if(event->button == 3 || (event->button == 1 && (ctrl || !sensitive)))
         return places_view_cb_menu_item_do_alt(pd, menu_item);
-    else if(event->button == 1 && !ctrl)
-        /* If it's insensitive, don't close the menu */
-        return !GTK_WIDGET_IS_SENSITIVE(gtk_bin_get_child(GTK_BIN(menu_item)));
     else
         return FALSE;
 }
@@ -687,7 +684,15 @@
 
 /********** Model Visitor Callbacks **********/
 
+static void
+places_view_load_thunar_wrapper(PlacesBookmarkAction *act)
+{
+    g_assert(act != NULL);
+    places_load_terminal((gchar*) act->priv);
+}
 
+
+
 static void
 places_view_load_terminal_wrapper(PlacesBookmarkAction *act)
 {
@@ -728,12 +733,18 @@
 
         if(bookmark->uri_scheme != PLACES_URI_SCHEME_TRASH){
             PlacesBookmarkAction *terminal  = g_new0(PlacesBookmarkAction, 1);
-            terminal->label                 = "Open Terminal Here";
-            terminal->priv                  = (gchar*) bookmark->uri;
+            terminal->label                 = _("Open Terminal Here");
+            terminal->priv                  = bookmark->uri;
             terminal->action                = places_view_load_terminal_wrapper;
-            bookmark->actions = g_list_append(bookmark->actions, terminal);
+            bookmark->actions = g_list_prepend(bookmark->actions, terminal);
         }
 
+        PlacesBookmarkAction *open  = g_new0(PlacesBookmarkAction, 1);
+        open->label                 = _("Open");
+        open->priv                  = bookmark->uri;
+        open->action                = places_view_load_thunar_wrapper;
+        bookmark->actions = g_list_prepend(bookmark->actions, open);
+
     }else{
         /* Probably an unmounted volume. Gray it out. */
         gtk_widget_set_sensitive(gtk_bin_get_child(GTK_BIN(item)), FALSE);




More information about the Goodies-commits mailing list