[gnome-commander] tabs: start a new tab when CTRL+click/midclick on bookmark



commit f1721b3368a7b8011404aa6452db40baa45b40a8
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat Jun 19 19:26:06 2010 +0200

    tabs: start a new tab when CTRL+click/midclick on bookmark

 src/gnome-cmd-dir-indicator.cc |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-cmd-dir-indicator.cc b/src/gnome-cmd-dir-indicator.cc
index 382b33f..055468f 100644
--- a/src/gnome-cmd-dir-indicator.cc
+++ b/src/gnome-cmd-dir-indicator.cc
@@ -294,12 +294,23 @@ static void on_bookmark_item_selected (GtkMenuItem *item, GnomeCmdBookmark *bm)
 {
     g_return_if_fail (bm != NULL);
 
+    GdkModifierType mask;
+    gdk_window_get_pointer (NULL, NULL, NULL, &mask);
+
     GnomeCmdDirIndicator *indicator = (GnomeCmdDirIndicator *) gtk_object_get_data (GTK_OBJECT (item), "indicator");
 
     g_return_if_fail (GNOME_CMD_IS_DIR_INDICATOR (indicator));
 
     main_win->switch_fs(indicator->priv->fs);
-    indicator->priv->fs->goto_directory(bm->path);
+
+    if (mask&GDK_CONTROL_MASK)
+    {
+        GnomeCmdCon *con = indicator->priv->fs->get_connection();
+        GnomeCmdDir *dir = gnome_cmd_dir_new (con, gnome_cmd_con_create_path (con, bm->path));
+        indicator->priv->fs->new_tab(dir);
+    }
+    else
+        indicator->priv->fs->goto_directory(bm->path);
 }
 
 



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