SF.net SVN: geany: [2390] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Mar 23 16:32:36 UTC 2008


Revision: 2390
          http://geany.svn.sourceforge.net/geany/?rev=2390&view=rev
Author:   eht16
Date:     2008-03-23 09:32:36 -0700 (Sun, 23 Mar 2008)

Log Message:
-----------
Add shortcut to switch to the sidebar.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/keybindings.c
    trunk/src/keybindings.h
    trunk/src/plugindata.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-03-23 16:29:43 UTC (rev 2389)
+++ trunk/ChangeLog	2008-03-23 16:32:36 UTC (rev 2390)
@@ -12,6 +12,8 @@
    geany.glade:
    Add preference for not using the current word under the cursor when
    opening Find dialogs.
+ * src/keybindings.c, src/keybindings.h, src/plugindata.h:
+   Add shortcut to switch to the sidebar.
 
 
 2008-03-21  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2008-03-23 16:29:43 UTC (rev 2389)
+++ trunk/src/keybindings.c	2008-03-23 16:32:36 UTC (rev 2390)
@@ -89,6 +89,7 @@
 static void cb_func_switch_scribble(guint key_id);
 static void cb_func_switch_vte(guint key_id);
 static void cb_func_switch_search_bar(guint key_id);
+static void cb_func_switch_sidebar(guint key_id);
 static void cb_func_switch_tableft(guint key_id);
 static void cb_func_switch_tabright(guint key_id);
 static void cb_func_switch_tablastused(guint key_id);
@@ -379,6 +380,8 @@
 		GDK_F4, 0, "switch_vte", _("Switch to VTE"), NULL);
 	keybindings_set_item(group, GEANY_KEYS_FOCUS_SEARCHBAR, cb_func_switch_search_bar,
 		GDK_F7, 0, "switch_search_bar", _("Switch to Search Bar"), NULL);
+	keybindings_set_item(group, GEANY_KEYS_FOCUS_SIDEBAR, cb_func_switch_sidebar,
+		0, 0, "switch_sidebar", _("Switch to Sidebar"), NULL);
 
 	group = ADD_KB_GROUP(NOTEBOOK, _("Notebook tab"));
 
@@ -1157,6 +1160,17 @@
 		gtk_widget_grab_focus(lookup_widget(app->window, "entry1"));
 }
 
+static void cb_func_switch_sidebar(G_GNUC_UNUSED guint key_id)
+{
+	if (ui_prefs.sidebar_visible)
+	{
+		gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(app->treeview_notebook));
+		GtkWidget *swin = gtk_notebook_get_nth_page(GTK_NOTEBOOK(app->treeview_notebook), page_num);
+
+		gtk_widget_grab_focus(gtk_bin_get_child(GTK_BIN(swin)));
+	}
+}
+
 static void cb_func_switch_vte(G_GNUC_UNUSED guint key_id)
 {
 	msgwin_switch_tab(MSG_VTE, TRUE);

Modified: trunk/src/keybindings.h
===================================================================
--- trunk/src/keybindings.h	2008-03-23 16:29:43 UTC (rev 2389)
+++ trunk/src/keybindings.h	2008-03-23 16:32:36 UTC (rev 2390)
@@ -241,6 +241,7 @@
 	GEANY_KEYS_FOCUS_SCRIBBLE,
 	GEANY_KEYS_FOCUS_VTE,
 	GEANY_KEYS_FOCUS_SEARCHBAR,
+	GEANY_KEYS_FOCUS_SIDEBAR,
 	GEANY_KEYS_FOCUS_COUNT
 };
 

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2008-03-23 16:29:43 UTC (rev 2389)
+++ trunk/src/plugindata.h	2008-03-23 16:32:36 UTC (rev 2390)
@@ -35,12 +35,12 @@
 
 /* The API version should be incremented whenever any plugin data types below are
  * modified or appended to. */
-static const gint api_version = 49;
+static const gint api_version = 50;
 
 /* The ABI version should be incremented whenever existing fields in the plugin
  * data types below have to be changed or reordered. It should stay the same if fields
  * are only appended, as this doesn't affect existing fields. */
-static const gint abi_version = 22;
+static const gint abi_version = 23;
 
 /** This performs runtime checks that try to ensure:
  * 1. Geany ABI data types are compatible with this plugin.


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list