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



commit d3b209cd17f0d31de3ec17b3ebe2a5241b24e0bd
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat Jun 19 19:27:33 2010 +0200

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

 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 055468f..86d621c 100644
--- a/src/gnome-cmd-dir-indicator.cc
+++ b/src/gnome-cmd-dir-indicator.cc
@@ -281,12 +281,23 @@ static void on_dir_history_item_selected (GtkMenuItem *item, const gchar *path)
 {
     g_return_if_fail (path != 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(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, path));
+        indicator->priv->fs->new_tab(dir);
+    }
+    else
+        indicator->priv->fs->goto_directory(path);
 }
 
 



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