nautilus r14241 - in branches/multiview: . src



Author: jaredm
Date: Sun Jun  8 13:28:06 2008
New Revision: 14241
URL: http://svn.gnome.org/viewvc/nautilus?rev=14241&view=rev

Log:
2008-06-08  Jared Moore  <jaredm svn gnome org>

	* src/nautilus-places-sidebar.c (bookmarks_button_press_event_cb):
	Middle click on entry in places sidebar to open a new tab.




Modified:
   branches/multiview/ChangeLog
   branches/multiview/src/nautilus-places-sidebar.c

Modified: branches/multiview/src/nautilus-places-sidebar.c
==============================================================================
--- branches/multiview/src/nautilus-places-sidebar.c	(original)
+++ branches/multiview/src/nautilus-places-sidebar.c	Sun Jun  8 13:28:06 2008
@@ -1802,7 +1802,8 @@
 }
 
 /* Callback used when a button is pressed on the shortcuts list.  
- * We trap button 3 to bring up a popup menu.
+ * We trap button 3 to bring up a popup menu, and button 2 to
+ * open in a new tab.
  */
 static gboolean
 bookmarks_button_press_event_cb (GtkWidget             *widget,
@@ -1811,6 +1812,24 @@
 {
 	if (event->button == 3) {
 		bookmarks_popup_menu (sidebar, event);
+	} else if (event->button == 2) {
+		GtkTreeModel *model;
+		GtkTreePath *path;
+		GtkTreeView *tree_view;
+
+		tree_view = GTK_TREE_VIEW (widget);
+		g_assert (tree_view == sidebar->tree_view);
+
+		model = gtk_tree_view_get_model (tree_view);
+
+		gtk_tree_view_get_path_at_pos (tree_view, (int) event->x, (int) event->y, 
+					       &path, NULL, NULL, NULL);
+
+		open_selected_bookmark (sidebar, model, path, NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB);
+
+		if (path != NULL) {
+			gtk_tree_path_free (path);
+		}
 	}
 	return FALSE;
 }



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