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

Diego Ongaro ongardie at xfce.org
Wed Oct 17 00:13:45 CEST 2007


Author: ongardie
Date: 2007-10-16 22:13:45 +0000 (Tue, 16 Oct 2007)
New Revision: 3396

Modified:
   xfce4-places-plugin/trunk/ChangeLog
   xfce4-places-plugin/trunk/panel-plugin/model_volumes.c
Log:
2007-10-16	Diego Ongaro <ongardie at gmail.com>

* model_volumes.c: Added "Mount and Open" action


Modified: xfce4-places-plugin/trunk/ChangeLog
===================================================================
--- xfce4-places-plugin/trunk/ChangeLog	2007-10-16 20:44:29 UTC (rev 3395)
+++ xfce4-places-plugin/trunk/ChangeLog	2007-10-16 22:13:45 UTC (rev 3396)
@@ -4,6 +4,7 @@
 	~/.gtk-bookmarks is missing (resulted in menu "blinking")
 	* model*.c: Use places_bookmark_create() as counterpart to
 	places_bookmark_free()
+	* model_volumes.c: Added "Mount and Open" action
 
 2007-10-15	Diego Ongaro <ongardie at gmail.com>
 

Modified: xfce4-places-plugin/trunk/panel-plugin/model_volumes.c
===================================================================
--- xfce4-places-plugin/trunk/panel-plugin/model_volumes.c	2007-10-16 20:44:29 UTC (rev 3395)
+++ xfce4-places-plugin/trunk/panel-plugin/model_volumes.c	2007-10-16 22:13:45 UTC (rev 3396)
@@ -79,6 +79,24 @@
         thunar_vfs_volume_mount(volume, NULL, NULL);
 }
 
+static void
+pbvol_mount_and_open(PlacesBookmarkAction *action)
+{
+    DBG("Mount and open");
+
+    gchar *uri;
+    ThunarVfsVolume *volume = THUNAR_VFS_VOLUME(action->priv);
+
+    if(!thunar_vfs_volume_is_mounted(volume))
+        thunar_vfs_volume_mount(volume, NULL, NULL);
+
+    if(thunar_vfs_volume_is_mounted(volume)){
+        uri = thunar_vfs_path_dup_uri(thunar_vfs_volume_get_mount_point(volume));
+        places_load_thunar(uri);
+        g_free(uri);
+    }
+}
+
 static inline gboolean
 pbvol_show_volume(ThunarVfsVolume *volume){
     
@@ -172,6 +190,14 @@
 
                 g_object_ref(volume);
                 action          = g_new0(PlacesBookmarkAction, 1);
+                action->label   = _("Mount and Open");
+                action->priv    = volume;
+                action->action  = pbvol_mount_and_open;
+                action->free    = pbvol_bookmark_action_free;
+                bookmark->actions = g_list_append(bookmark->actions, action);
+
+                g_object_ref(volume);
+                action          = g_new0(PlacesBookmarkAction, 1);
                 action->label   = _("Mount");
                 action->priv    = volume;
                 action->action  = pbvol_mount;




More information about the Goodies-commits mailing list