SF.net SVN: geany:[4686] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sun Feb 21 18:06:42 UTC 2010


Revision: 4686
          http://geany.svn.sourceforge.net/geany/?rev=4686&view=rev
Author:   eht16
Date:     2010-02-21 18:06:42 +0000 (Sun, 21 Feb 2010)

Log Message:
-----------
Add keybindings to switch to the sidebar's Document and Symbol list as well as to the Message Window's current tab (patch by Eugene Arshinov, thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/keybindings.c
    trunk/src/keybindings.h
    trunk/src/plugindata.h
    trunk/src/sidebar.c
    trunk/src/sidebar.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/ChangeLog	2010-02-21 18:06:42 UTC (rev 4686)
@@ -10,6 +10,11 @@
    src/filetypes.c, src/symbols.c, tagmanager/Makefile.am,
    tagmanager/makefile.win32, tagmanager/parsers.h, wscript, THANKS:
    Add R tagmanager symbol parser (patch by Jon Senior, thanks).
+ * doc/geany.html, doc/geany.txt, src/keybindings.c, src/keybindings.h,
+   src/plugindata.h, src/sidebar.c, src/sidebar.h:
+   Add keybindings to switch to the sidebar's Document and Symbol list
+   as well as to the Message Window's current tab
+   (patch by Eugene Arshinov, thanks).
 
 
 2010-02-20 Dominic Hopf <dmaphy(at)googlemail(dot)com>

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/doc/geany.html	2010-02-21 18:06:42 UTC (rev 4686)
@@ -6,7 +6,7 @@
 <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
 <title>Geany</title>
 <meta name="authors" content="Enrico Tröger  Nick Treleaven  Frank Lanitz" />
-<meta name="date" content="2010-01-24" />
+<meta name="date" content="2010-02-20" />
 <style type="text/css">
 
 /*
@@ -139,7 +139,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2010-01-24</td></tr>
+<td>2010-02-20</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.19</td></tr>
 </tbody>
@@ -1458,10 +1458,10 @@
 the code point for the character you want, then let go of Ctrl-Shift and
 hit Enter or Return.</p>
 <p>For this to work in Geany, you'll need to first unbind Ctrl-Shift-u
-in the <a class="reference internal" href="#keybinding-preferences">keybinding preferences</a>, then restart Geany.
-Note that it works slightly differently from other GTK applications,
-in that you'll need to continue to hold down the Ctrl and Shift keys
-while typing the code point hex digits.</p>
+in the <a class="reference internal" href="#keybinding-preferences">keybinding preferences</a>, then select <em>Tools->Reload Configuration</em>
+or restart Geany. Note that it works slightly differently from other GTK
+applications, in that you'll need to continue to hold down the Ctrl and Shift
+keys while typing the code point hex digits.</p>
 <p>For GTK < 2.10, it is also possible, but typing the first Ctrl-Shift-u
 is not necessary. One problem is that you may find the alphabetic
 keys conflict with other Geany keybindings.</p>
@@ -2426,7 +2426,8 @@
 you want to use in your template files.</p>
 <div class="note">
 <p class="first admonition-title">Note</p>
-<p class="last">For changes made here to take effect a restart of geany is required.</p>
+<p class="last">For changes made here to take effect, either selecting
+<em>Tools->Reload Configuration</em> or restarting Geany is required.</p>
 </div>
 <img alt="./images/pref_dialog_templ.png" src="./images/pref_dialog_templ.png" />
 <div class="section" id="template-data">
@@ -3724,8 +3725,8 @@
 <h4><a class="toc-backref" href="#id164">Focus keybindings</a></h4>
 <table border="1" class="docutils">
 <colgroup>
-<col width="29%" />
-<col width="24%" />
+<col width="30%" />
+<col width="23%" />
 <col width="47%" />
 </colgroup>
 <thead valign="bottom">
@@ -3764,6 +3765,20 @@
 <td> </td>
 <td>Focus the Messages message window tab.</td>
 </tr>
+<tr><td>Switch to Message Window</td>
+<td> </td>
+<td>Focus the Message Window's current tab.</td>
+</tr>
+<tr><td>Switch to Sidebar Document List</td>
+<td> </td>
+<td>Focus the Document list tab in the Sidebar
+(if visible)</td>
+</tr>
+<tr><td>Switch to Sidebar Symbol List</td>
+<td> </td>
+<td>Focus the Symbol list tab in the Sidebar
+(if visible)</td>
+</tr>
 </tbody>
 </table>
 </div>
@@ -3991,17 +4006,19 @@
 reload the file after you have saved it.</p>
 <div class="note">
 <p class="first admonition-title">Note</p>
-<p class="last">Other configuration files are not shown here and you will need to open
-them manually and usually restart Geany to see any changes.</p>
+<p class="last">Other configuration files not shown here will need to be opened
+manually, and will not be automatically reloaded when saved.
+(see <em>Reload Configuration</em> below).</p>
 </div>
 <p>There's also a <em>Reload Configuration</em> item which can be used if you
-updated a configuration file outside of the current instance. This
-item is also necessary to update syntax highlighting colors.</p>
+updated one of the other configuration files, or modified or added
+template files.</p>
+<p><em>Reload Configuration</em> is also necessary to update syntax highlighting colors.</p>
 <div class="note">
 <p class="first admonition-title">Note</p>
-<p class="last">Syntax highlighting colors aren't updated after saving
-filetypes.common as this can take a short while depending on which
-documents are open.</p>
+<p class="last">Syntax highlighting colors aren't updated in open documents after
+saving filetypes.common as this can possibly take a significant
+amount of time.</p>
 </div>
 </div>
 <div class="section" id="global-configuration-file">
@@ -4517,7 +4534,8 @@
 <h3><a class="toc-backref" href="#id190">Hidden preferences</a></h3>
 <p>There are some rarely used preferences that are not shown in the Preferences
 dialog. These can be set by editing the preferences file, then
-restarting Geany. Search for the key name, then edit the value. Example:</p>
+selecting <em>Tools->Reload Configuration</em> or restarting Geany. Search for the
+key name, then edit the value. Example:</p>
 <blockquote>
 <tt class="docutils literal">brace_match_ltgt=true</tt></blockquote>
 <p>The table below show the key names of hidden preferences in the
@@ -4732,10 +4750,9 @@
 <p>Meta data can be used with all templates, but by default user set
 meta data is only used for the ChangeLog and File header templates.</p>
 <p>In the configuration dialog you can find a tab "Templates" (see
-<a class="reference internal" href="#template-preferences">Template preferences</a>). You can define the
-default values which will be inserted in the templates. You should
-restart Geany after making changes, because they are only read
-at startup.</p>
+<a class="reference internal" href="#template-preferences">Template preferences</a>). You can define the default values
+which will be inserted in the templates. You should select
+<em>Tools->Reload Configuration</em> or restart Geany after making changes.</p>
 </div>
 <div class="section" id="file-templates">
 <h3><a class="toc-backref" href="#id196">File templates</a></h3>
@@ -4744,7 +4761,8 @@
 menu.</p>
 <p>By default, file templates are installed for some filetypes. Custom
 file templates can be added by creating the appropriate template file
-and restarting Geany. You can also edit the default file templates.</p>
+and then selecting <em>Tools->Reload Configuration</em> or restarting Geany. You can
+also edit the default file templates.</p>
 <p>The file's contents are just the text to place in the document, with
 optional template wildcards like <tt class="docutils literal">{fileheader}</tt>. The fileheader
 wildcard can be placed anywhere, but it's usually put on the first
@@ -4761,8 +4779,8 @@
 any. For example, creating a file <tt class="docutils literal">module.c</tt> would add a menu item
 which created a new document with the filetype set to 'C'.</p>
 <p>The template file is read from disk when the corresponding menu item is
-clicked, so you don't need to restart Geany after editing a custom file
-template, only after adding a new one.</p>
+clicked, so you don't need to select <em>Tools->Reload Configuration</em> or restart
+Geany after editing a custom file template.</p>
 </div>
 <div class="section" id="filetype-templates">
 <h4><a class="toc-backref" href="#id198">Filetype templates</a></h4>
@@ -5902,7 +5920,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference external" href="geany.txt">View document source</a>.
-Generated on: 2010-01-24 16:15 UTC.
+Generated on: 2010-02-21 18:00 UTC.
 Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/doc/geany.txt	2010-02-21 18:06:42 UTC (rev 4686)
@@ -1068,8 +1068,8 @@
 hit Enter or Return.
 
 For this to work in Geany, you'll need to first unbind Ctrl-Shift-u
-in the `keybinding preferences`_, then select *Tools->Reload Configuration* 
-or restart Geany. Note that it works slightly differently from other GTK 
+in the `keybinding preferences`_, then select *Tools->Reload Configuration*
+or restart Geany. Note that it works slightly differently from other GTK
 applications, in that you'll need to continue to hold down the Ctrl and Shift
 keys while typing the code point hex digits.
 
@@ -2137,7 +2137,7 @@
 a document, such as the file header. You only need to set fields that
 you want to use in your template files.
 
-.. note:: 
+.. note::
     For changes made here to take effect, either selecting
     *Tools->Reload Configuration* or restarting Geany is required.
 
@@ -3187,26 +3187,34 @@
 
 Focus keybindings
 `````````````````
-=============================== ========================= ==================================================
-Action                          Default shortcut          Description
-=============================== ========================= ==================================================
-Switch to Editor                F2                        Switches to editor widget.
+================================ ========================= ==================================================
+Action                           Default shortcut          Description
+================================ ========================= ==================================================
+Switch to Editor                 F2                        Switches to editor widget.
 
-Switch to Scribble              F6                        Switches to scribble widget.
+Switch to Scribble               F6                        Switches to scribble widget.
 
-Switch to VTE                   F4                        Switches to VTE widget.
+Switch to VTE                    F4                        Switches to VTE widget.
 
-Switch to Search Bar            F7                        Switches to the search bar in the toolbar (if
-                                                          visible).
+Switch to Search Bar             F7                        Switches to the search bar in the toolbar (if
+                                                           visible).
 
-Switch to Sidebar                                         Focus the Sidebar.
+Switch to Sidebar                                          Focus the Sidebar.
 
-Switch to Compiler                                        Focus the Compiler message window tab.
+Switch to Compiler                                         Focus the Compiler message window tab.
 
-Switch to Messages                                        Focus the Messages message window tab.
-=============================== ========================= ==================================================
+Switch to Messages                                         Focus the Messages message window tab.
 
+Switch to Message Window                                   Focus the Message Window's current tab.
 
+Switch to Sidebar Document List                            Focus the Document list tab in the Sidebar
+                                                           (if visible)
+
+Switch to Sidebar Symbol List                              Focus the Symbol list tab in the Sidebar
+                                                           (if visible)
+================================ ========================= ==================================================
+
+
 Notebook tab keybindings
 ````````````````````````
 =============================== ========================= ==================================================
@@ -3328,14 +3336,14 @@
     (see *Reload Configuration* below).
 
 There's also a *Reload Configuration* item which can be used if you
-updated one of the other configuration files, or modified or added 
+updated one of the other configuration files, or modified or added
 template files.
 
 *Reload Configuration* is also necessary to update syntax highlighting colors.
 
 .. note::
-    Syntax highlighting colors aren't updated in open documents after 
-    saving filetypes.common as this can possibly take a significant 
+    Syntax highlighting colors aren't updated in open documents after
+    saving filetypes.common as this can possibly take a significant
     amount of time.
 
 
@@ -3919,7 +3927,7 @@
 
 There are some rarely used preferences that are not shown in the Preferences
 dialog. These can be set by editing the preferences file, then
-selecting *Tools->Reload Configuration* or restarting Geany. Search for the 
+selecting *Tools->Reload Configuration* or restarting Geany. Search for the
 key name, then edit the value. Example:
 
     ``brace_match_ltgt=true``
@@ -4090,8 +4098,8 @@
 meta data is only used for the ChangeLog and File header templates.
 
 In the configuration dialog you can find a tab "Templates" (see
-`Template preferences`_). You can define the default values 
-which will be inserted in the templates. You should select 
+`Template preferences`_). You can define the default values
+which will be inserted in the templates. You should select
 *Tools->Reload Configuration* or restart Geany after making changes.
 
 
@@ -4104,7 +4112,7 @@
 
 By default, file templates are installed for some filetypes. Custom
 file templates can be added by creating the appropriate template file
-and then selecting *Tools->Reload Configuration* or restarting Geany. You can 
+and then selecting *Tools->Reload Configuration* or restarting Geany. You can
 also edit the default file templates.
 
 The file's contents are just the text to place in the document, with
@@ -4126,7 +4134,7 @@
 which created a new document with the filetype set to 'C'.
 
 The template file is read from disk when the corresponding menu item is
-clicked, so you don't need to select *Tools->Reload Configuration* or restart 
+clicked, so you don't need to select *Tools->Reload Configuration* or restart
 Geany after editing a custom file template.
 
 Filetype templates

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/src/keybindings.c	2010-02-21 18:06:42 UTC (rev 4686)
@@ -481,6 +481,12 @@
 		0, 0, "switch_compiler", _("Switch to Compiler"), NULL);
 	keybindings_set_item(group, GEANY_KEYS_FOCUS_MESSAGES, NULL,
 		0, 0, "switch_messages", _("Switch to Messages"), NULL);
+	keybindings_set_item(group, GEANY_KEYS_FOCUS_MESSAGE_WINDOW, NULL,
+		0, 0, "switch_message_window", _("Switch to Message Window"), NULL);
+	keybindings_set_item(group, GEANY_KEYS_FOCUS_SIDEBAR_DOCUMENT_LIST, NULL,
+		0, 0, "switch_sidebar_doc_list", _("Switch to Sidebar Document List"), NULL);
+	keybindings_set_item(group, GEANY_KEYS_FOCUS_SIDEBAR_SYMBOL_LIST, NULL,
+		0, 0, "switch_sidebar_symbol_list", _("Switch to Sidebar Symbol List"), NULL);
 
 	group = ADD_KB_GROUP(NOTEBOOK, _("Notebook tab"), NULL);
 
@@ -1611,6 +1617,18 @@
 }
 
 
+static void focus_msgwindow(void)
+{
+	if (ui_prefs.msgwindow_visible)
+	{
+		gint page_num = gtk_notebook_get_current_page(GTK_NOTEBOOK(msgwindow.notebook));
+		GtkWidget *page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(msgwindow.notebook), page_num);
+
+		gtk_widget_grab_focus(gtk_bin_get_child(GTK_BIN(page)));
+	}
+}
+
+
 static gboolean cb_func_switch_action(guint key_id)
 {
 	switch (key_id)
@@ -1645,6 +1663,15 @@
 		case GEANY_KEYS_FOCUS_MESSAGES:
 			msgwin_switch_tab(MSG_MESSAGE, TRUE);
 			break;
+		case GEANY_KEYS_FOCUS_MESSAGE_WINDOW:
+			focus_msgwindow();
+			break;
+		case GEANY_KEYS_FOCUS_SIDEBAR_DOCUMENT_LIST:
+			sidebar_focus_openfiles_tab();
+			break;
+		case GEANY_KEYS_FOCUS_SIDEBAR_SYMBOL_LIST:
+			sidebar_focus_symbols_tab();
+			break;
 	}
 	return TRUE;
 }

Modified: trunk/src/keybindings.h
===================================================================
--- trunk/src/keybindings.h	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/src/keybindings.h	2010-02-21 18:06:42 UTC (rev 4686)
@@ -268,6 +268,7 @@
 };
 
 /** Focus group keybinding command IDs */
+/* TODO when the plugin get increased the next time, re-arrange these keybindings */
 enum
 {
 	GEANY_KEYS_FOCUS_EDITOR,
@@ -277,6 +278,9 @@
 	GEANY_KEYS_FOCUS_SIDEBAR,
 	GEANY_KEYS_FOCUS_COMPILER,
 	GEANY_KEYS_FOCUS_MESSAGES,
+	GEANY_KEYS_FOCUS_MESSAGE_WINDOW,
+	GEANY_KEYS_FOCUS_SIDEBAR_DOCUMENT_LIST,
+	GEANY_KEYS_FOCUS_SIDEBAR_SYMBOL_LIST,
 	GEANY_KEYS_FOCUS_COUNT
 };
 

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/src/plugindata.h	2010-02-21 18:06:42 UTC (rev 4686)
@@ -50,7 +50,7 @@
 enum {
 	/** The Application Programming Interface (API) version, incremented
 	 * whenever any plugin data types are modified or appended to. */
-	GEANY_API_VERSION = 172,
+	GEANY_API_VERSION = 173,
 
 	/** The Application Binary Interface (ABI) version, incremented whenever
 	 * existing fields in the plugin data types have to be changed or reordered. */

Modified: trunk/src/sidebar.c
===================================================================
--- trunk/src/sidebar.c	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/src/sidebar.c	2010-02-21 18:06:42 UTC (rev 4686)
@@ -926,3 +926,29 @@
 	if (WIDGET(openfiles_popup_menu))
 		gtk_widget_destroy(openfiles_popup_menu);
 }
+
+
+void sidebar_focus_openfiles_tab(void)
+{
+	if (ui_prefs.sidebar_visible && interface_prefs.sidebar_openfiles_visible)
+	{
+		GtkNotebook *notebook = GTK_NOTEBOOK(main_widgets.sidebar_notebook);
+
+		gtk_notebook_set_current_page(notebook, TREEVIEW_OPENFILES);
+		gtk_widget_grab_focus(tv.tree_openfiles);
+	}
+}
+
+
+void sidebar_focus_symbols_tab(void)
+{
+	if (ui_prefs.sidebar_visible && interface_prefs.sidebar_symbol_visible)
+	{
+		GtkNotebook *notebook = GTK_NOTEBOOK(main_widgets.sidebar_notebook);
+		GtkWidget *symbol_list_scrollwin = gtk_notebook_get_nth_page(notebook, TREEVIEW_SYMBOL);
+
+		gtk_notebook_set_current_page(notebook, TREEVIEW_SYMBOL);
+		gtk_widget_grab_focus(gtk_bin_get_child(GTK_BIN(symbol_list_scrollwin)));
+	}
+}
+

Modified: trunk/src/sidebar.h
===================================================================
--- trunk/src/sidebar.h	2010-02-21 14:54:53 UTC (rev 4685)
+++ trunk/src/sidebar.h	2010-02-21 18:06:42 UTC (rev 4686)
@@ -64,4 +64,8 @@
 
 void sidebar_add_common_menu_items(GtkMenu *menu);
 
+void sidebar_focus_openfiles_tab(void);
+
+void sidebar_focus_symbols_tab(void);
+
 #endif


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