Revision: 1453 http://svn.sourceforge.net/geany/?rev=1453&view=rev Author: eht16 Date: 2007-04-15 11:09:59 -0700 (Sun, 15 Apr 2007)
Log Message: ----------- Added context actions to run custom commands on current selection or the current word below cursor.
Modified Paths: -------------- trunk/ChangeLog trunk/data/filetypes.asm trunk/data/filetypes.c trunk/data/filetypes.caml trunk/data/filetypes.conf trunk/data/filetypes.cpp trunk/data/filetypes.css trunk/data/filetypes.d trunk/data/filetypes.diff trunk/data/filetypes.docbook trunk/data/filetypes.ferite trunk/data/filetypes.fortran trunk/data/filetypes.html trunk/data/filetypes.java trunk/data/filetypes.javascript trunk/data/filetypes.latex trunk/data/filetypes.lua trunk/data/filetypes.makefile trunk/data/filetypes.oms trunk/data/filetypes.pascal trunk/data/filetypes.perl trunk/data/filetypes.php trunk/data/filetypes.python trunk/data/filetypes.ruby trunk/data/filetypes.sh trunk/data/filetypes.sql trunk/data/filetypes.tcl trunk/data/filetypes.vhdl trunk/data/filetypes.xml trunk/doc/geany.docbook trunk/geany.glade trunk/src/callbacks.c trunk/src/callbacks.h trunk/src/filetypes.c trunk/src/filetypes.h trunk/src/geany.h trunk/src/interface.c trunk/src/keybindings.c trunk/src/keybindings.h trunk/src/keyfile.c trunk/src/main.c trunk/src/prefs.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/ChangeLog 2007-04-15 18:09:59 UTC (rev 1453) @@ -1,3 +1,13 @@ +2007-04-15 Enrico Tröger enrico.troeger@uvena.de + + * geany.glade, data/filetypes.*, doc/geany.docbook, src/callbacks.c, + src/callbacks.h, src/filetypes.c, src/filetypes.h, src/geany.h, + src/interface.c, src/keybindings.c, src/keybindings.h, src/keyfile.c, + src/main.c, src/prefs.c: + Added context actions to run custom commands on current selection or + the current word below cursor. + + 2007-04-15 Nick Treleaven nick.treleaven@btinternet.com
* src/sci_cb.c:
Modified: trunk/data/filetypes.asm =================================================================== --- trunk/data/filetypes.asm 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.asm 2007-04-15 18:09:59 UTC (rev 1453) @@ -41,6 +41,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.c =================================================================== --- trunk/data/filetypes.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -51,6 +51,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.caml =================================================================== --- trunk/data/filetypes.caml 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.caml 2007-04-15 18:09:59 UTC (rev 1453) @@ -38,6 +38,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.conf =================================================================== --- trunk/data/filetypes.conf 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.conf 2007-04-15 18:09:59 UTC (rev 1453) @@ -26,3 +26,6 @@ # command_example(); # This setting works only for single line comments comment_use_indent=true + +# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/data/filetypes.cpp =================================================================== --- trunk/data/filetypes.cpp 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.cpp 2007-04-15 18:09:59 UTC (rev 1453) @@ -51,6 +51,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.css =================================================================== --- trunk/data/filetypes.css 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.css 2007-04-15 18:09:59 UTC (rev 1453) @@ -39,3 +39,6 @@ # command_example(); # This setting works only for single line comments comment_use_indent=true + +# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/data/filetypes.d =================================================================== --- trunk/data/filetypes.d 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.d 2007-04-15 18:09:59 UTC (rev 1453) @@ -50,6 +50,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.diff =================================================================== --- trunk/data/filetypes.diff 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.diff 2007-04-15 18:09:59 UTC (rev 1453) @@ -18,3 +18,6 @@ comment_open= comment_close=
+# context action command (please see Geany's main documentation for details) +context_action_cmd= +
Modified: trunk/data/filetypes.docbook =================================================================== --- trunk/data/filetypes.docbook 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.docbook 2007-04-15 18:09:59 UTC (rev 1453) @@ -52,3 +52,6 @@ # command_example(); # This setting works only for single line comments comment_use_indent=true + +# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/data/filetypes.ferite =================================================================== --- trunk/data/filetypes.ferite 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.ferite 2007-04-15 18:09:59 UTC (rev 1453) @@ -47,6 +47,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.fortran =================================================================== --- trunk/data/filetypes.fortran 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.fortran 2007-04-15 18:09:59 UTC (rev 1453) @@ -42,7 +42,10 @@ # This setting works only for single line comments comment_use_indent=false
+# context action command (please see Geany's main documentation for details) +context_action_cmd=
+ [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.html =================================================================== --- trunk/data/filetypes.html 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.html 2007-04-15 18:09:59 UTC (rev 1453) @@ -20,6 +20,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.java =================================================================== --- trunk/data/filetypes.java 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.java 2007-04-15 18:09:59 UTC (rev 1453) @@ -46,7 +46,10 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd=
+ [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.javascript =================================================================== --- trunk/data/filetypes.javascript 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.javascript 2007-04-15 18:09:59 UTC (rev 1453) @@ -42,6 +42,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.latex =================================================================== --- trunk/data/filetypes.latex 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.latex 2007-04-15 18:09:59 UTC (rev 1453) @@ -28,6 +28,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.lua =================================================================== --- trunk/data/filetypes.lua 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.lua 2007-04-15 18:09:59 UTC (rev 1453) @@ -56,6 +56,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.makefile =================================================================== --- trunk/data/filetypes.makefile 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.makefile 2007-04-15 18:09:59 UTC (rev 1453) @@ -27,3 +27,6 @@ # command_example(); # This setting works only for single line comments comment_use_indent=true + +# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/data/filetypes.oms =================================================================== --- trunk/data/filetypes.oms 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.oms 2007-04-15 18:09:59 UTC (rev 1453) @@ -33,3 +33,6 @@ # command_example(); # This setting works only for single line comments comment_use_indent=true + +# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/data/filetypes.pascal =================================================================== --- trunk/data/filetypes.pascal 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.pascal 2007-04-15 18:09:59 UTC (rev 1453) @@ -34,6 +34,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.perl =================================================================== --- trunk/data/filetypes.perl 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.perl 2007-04-15 18:09:59 UTC (rev 1453) @@ -52,6 +52,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.php =================================================================== --- trunk/data/filetypes.php 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.php 2007-04-15 18:09:59 UTC (rev 1453) @@ -20,6 +20,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.python =================================================================== --- trunk/data/filetypes.python 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.python 2007-04-15 18:09:59 UTC (rev 1453) @@ -37,6 +37,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.ruby =================================================================== --- trunk/data/filetypes.ruby 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.ruby 2007-04-15 18:09:59 UTC (rev 1453) @@ -56,6 +56,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.sh =================================================================== --- trunk/data/filetypes.sh 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.sh 2007-04-15 18:09:59 UTC (rev 1453) @@ -33,6 +33,9 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.sql =================================================================== --- trunk/data/filetypes.sql 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.sql 2007-04-15 18:09:59 UTC (rev 1453) @@ -37,3 +37,6 @@ # command_example(); # This setting works only for single line comments comment_use_indent=true + +# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/data/filetypes.tcl =================================================================== --- trunk/data/filetypes.tcl 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.tcl 2007-04-15 18:09:59 UTC (rev 1453) @@ -44,7 +44,13 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd=
+# context action command (please see Geany's main documentation for details) +context_action_cmd= + + [build_settings] # %f will be replaced by the complete filename # %e will be replaced by the filename without extension
Modified: trunk/data/filetypes.vhdl =================================================================== --- trunk/data/filetypes.vhdl 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.vhdl 2007-04-15 18:09:59 UTC (rev 1453) @@ -43,4 +43,7 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd=
+
Modified: trunk/data/filetypes.xml =================================================================== --- trunk/data/filetypes.xml 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/data/filetypes.xml 2007-04-15 18:09:59 UTC (rev 1453) @@ -90,3 +90,5 @@ # This setting works only for single line comments comment_use_indent=true
+# context action command (please see Geany's main documentation for details) +context_action_cmd=
Modified: trunk/doc/geany.docbook =================================================================== --- trunk/doc/geany.docbook 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/doc/geany.docbook 2007-04-15 18:09:59 UTC (rev 1453) @@ -5,7 +5,7 @@ <!ENTITY appversion "0.11"> <!ENTITY appurl "http://geany.uvena.de"> <!ENTITY author_mail "enrico.troeger@uvena.de"> -<!ENTITY date "March 08, 2007"> +<!ENTITY date "April 15, 2007"> <!ENTITY legal SYSTEM "geany_gpl.docbook"> <!ENTITY scikeybinding SYSTEM "scikeybinding.docbook"> ]> @@ -608,6 +608,37 @@ automatically. </para> </section> + <section id="editing_context_actions"> + <title>Context actions</title> + <para> + You can execute a specified command on the current word near the cursor + position or an available selection and this word is passed as an argument + to this command. It can be used for example to open some API documentation + in a browser window or open any other external program. To do this, + there is an menu entry in the popup menu of the editor widget and also a + keyboard shortcut(see <xref linkend="keybindings"/>). + </para> + <para> + The command can be specified in the preferences dialog and additionally for + each filetype (see "context_action_cmd" in <xref linkend="filetypes_format"/>). + At executing, the filetype specific command is used if available otherwise the + command specified in the preferences dialog is executed. + </para> + <para> + The passed word can be referred with the wildcard "%s" everywhere in the + command, before executing it will be replaced by the current word. + For example, the command to open the PHP API documentation would be: + </para> + <para> + <command>firefox "http://www.php.net/%s"</command> + </para> + <para> + when executing the command, the %s is substituted by the word near the + cursor position or by the current selection. If the cursor is at the word + "echo", a browser window will open(assumed your browser is called firefox) + and it will open the address: http://www.php.net/echo. + </para> + </section> </section> <section id="search_replace"> <title>Search, replace and go to</title> @@ -1649,8 +1680,8 @@ </row> <row> <entry>Find Usage</entry> - <entry>Finds all occurrences of the current word (near the - keyboard cursor) and displays them in the messages window. + <entry>Finds all occurrences of the current word (near the keyboard + cursor) or selection and displays them in the messages window. </entry> </row> <row> @@ -1669,6 +1700,13 @@ will beep and do nothing. See <xref linkend="search_gototag"/>. </entry> </row> + <row> + <entry>Context Action</entry> + <entry>Executes a command and passes the current word (near the + cursor postion) or selection as an argument. See + <xref linkend="editing_context_actions"/>. + </entry> + </row> </tbody> </tgroup> </table> @@ -1803,6 +1841,31 @@ </entry> <entry>comment_use_indent=true</entry> </row> + <row> + <entry>context_action_cmd</entry> + <entry><para> + A command which can be executed on a certain word or + the current selection. Example usage: Open the API + documentation for the current function call at the + cursor position. The command can be set for every + filetype or if not set, a global command will be used. + The command itself can be specified without the full + path, then it is searched in $PATH. But for security + reasons, it is recommended to specify the full path + to the command. The wildcard %s will be replaced + by the current word at the cursor position or by + the current selection. + </para> + <para> + Hint: for PHP files the following could be quite + useful: + <emphasis> + context_action_cmd=firefox "http://www.php.net/%s" + </emphasis> + </para> + </entry> + <entry>context_action_cmd=devhelp -s "%s"</entry> + </row> </tbody> </tgroup> </table>
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/geany.glade 2007-04-15 18:09:59 UTC (rev 1453) @@ -2569,7 +2569,7 @@ <signal name="activate" handler="on_menu_increase_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:31:38 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1669"> + <widget class="GtkImage" id="image1693"> <property name="visible">True</property> <property name="stock">gtk-indent</property> <property name="icon_size">1</property> @@ -2590,7 +2590,7 @@ <signal name="activate" handler="on_menu_decrease_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:31:38 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1670"> + <widget class="GtkImage" id="image1694"> <property name="visible">True</property> <property name="stock">gtk-unindent</property> <property name="icon_size">1</property> @@ -2646,7 +2646,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1671"> + <widget class="GtkImage" id="image1695"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2678,7 +2678,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1672"> + <widget class="GtkImage" id="image1696"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2763,7 +2763,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1673"> + <widget class="GtkImage" id="image1697"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2802,7 +2802,7 @@ <signal name="activate" handler="on_find_usage1_activate" last_modification_time="Fri, 27 May 2005 21:55:12 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1674"> + <widget class="GtkImage" id="image1698"> <property name="visible">True</property> <property name="stock">gtk-find</property> <property name="icon_size">1</property> @@ -2834,6 +2834,15 @@ </child>
<child> + <widget class="GtkMenuItem" id="context_action1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Context Action</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_context_action1_activate" last_modification_time="Fri, 13 Apr 2007 18:37:55 GMT"/> + </widget> + </child> + + <child> <widget class="GtkSeparatorMenuItem" id="separator15"> <property name="visible">True</property> </widget> @@ -2848,7 +2857,7 @@ <signal name="activate" handler="on_go_to_line_activate" last_modification_time="Sat, 16 Jul 2005 11:20:32 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1675"> + <widget class="GtkImage" id="image1699"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property> @@ -3204,6 +3213,110 @@ <property name="fill">True</property> </packing> </child> + + <child> + <widget class="GtkFrame" id="frame24"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + + <child> + <widget class="GtkAlignment" id="alignment27"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox8"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkLabel" id="label189"> + <property name="visible">True</property> + <property name="label" translatable="yes">Context Action command:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="entry_contextaction"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Context action command. The current selected word can be used with %s. It can be everywhere in the given command and will be replaced before execution.</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label188"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Context Action</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> </widget> <packing> <property name="tab_expand">False</property>
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/callbacks.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -2084,3 +2084,52 @@ sci_marker_delete_all(doc_list[idx].sci, 1); // delete user markers }
+ +void +on_context_action1_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + gint idx; + gchar *word, *command; + GError *error = NULL; + + idx = document_get_cur_idx(); + if (! DOC_IDX_VALID(idx)) return; + + if (sci_can_copy(doc_list[idx].sci)) + { // take selected text if there is a selection + word = g_malloc(sci_get_selected_text_length(doc_list[idx].sci) + 1); + sci_get_selected_text(doc_list[idx].sci, word); + } + else + { + word = g_strdup(editor_info.current_word); + } + + // use the filetype specific command if available, fallback to global command otherwise + if (doc_list[idx].file_type != NULL && + doc_list[idx].file_type->context_action_cmd != NULL && + *doc_list[idx].file_type->context_action_cmd != '\0') + { + command = g_strdup(doc_list[idx].file_type->context_action_cmd); + } + else + { + command = g_strdup(app->context_action_cmd); + } + + // substitute the wildcard %s and run the command if it is non empty + if (command != NULL && *command != '\0') + { + command = utils_str_replace(command, "%s", word); + + if (! g_spawn_command_line_async(command, &error)) + { + msgwin_status_add("Context action command failed: %s", error->message); + g_error_free(error); + } + } + g_free(word); + g_free(command); +} +
Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/callbacks.h 2007-04-15 18:09:59 UTC (rev 1453) @@ -595,3 +595,7 @@ void on_remove_markers1_activate (GtkMenuItem *menuitem, gpointer user_data); + +void +on_context_action1_activate (GtkMenuItem *menuitem, + gpointer user_data);
Modified: trunk/src/filetypes.c =================================================================== --- trunk/src/filetypes.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/filetypes.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -782,6 +782,7 @@ g_free(filetypes[i]->extension); g_free(filetypes[i]->comment_open); g_free(filetypes[i]->comment_close); + g_free(filetypes[i]->context_action_cmd); g_free(filetypes[i]->programs->compiler); g_free(filetypes[i]->programs->linker); g_free(filetypes[i]->programs->run_cmd); @@ -832,6 +833,14 @@ } else filetypes[ft]->comment_use_indent = tmp;
+ // read context action + result = g_key_file_get_string(configh, "settings", "context_action_cmd", NULL); + if (result == NULL) result = g_key_file_get_string(config, "settings", "context_action_cmd", NULL); + if (result != NULL) + { + filetypes[ft]->context_action_cmd = result; + } + // read build settings result = g_key_file_get_string(configh, "build_settings", "compiler", NULL); if (result == NULL) result = g_key_file_get_string(config, "build_settings", "compiler", NULL); @@ -951,7 +960,7 @@ gint i;
g_return_val_if_fail(ft != NULL, NULL); - + new_filter = gtk_file_filter_new(); gtk_file_filter_set_name(new_filter, ft->title);
Modified: trunk/src/filetypes.h =================================================================== --- trunk/src/filetypes.h 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/filetypes.h 2007-04-15 18:09:59 UTC (rev 1453) @@ -100,6 +100,7 @@ gchar *title; // will be shown in the file open dialog gchar *extension; gchar **pattern; + gchar *context_action_cmd; gchar *comment_open; gchar *comment_close; gboolean comment_use_indent;
Modified: trunk/src/geany.h =================================================================== --- trunk/src/geany.h 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/geany.h 2007-04-15 18:09:59 UTC (rev 1453) @@ -144,6 +144,7 @@ gint long_line_type; gint long_line_column; gchar *long_line_color; + gchar *context_action_cmd; gchar *pref_template_developer; gchar *pref_template_company; gchar *pref_template_mail;
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/interface.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -1893,20 +1893,20 @@ GtkWidget *menu_duplicate_line2; GtkWidget *separator31; GtkWidget *menu_increase_indent2; - GtkWidget *image1669; + GtkWidget *image1693; GtkWidget *menu_decrease_indent2; - GtkWidget *image1670; + GtkWidget *image1694; GtkWidget *separator38; GtkWidget *send_selection_to1; GtkWidget *send_selection_to1_menu; GtkWidget *invisible12; GtkWidget *separator17; GtkWidget *insert_include1; - GtkWidget *image1671; + GtkWidget *image1695; GtkWidget *insert_include1_menu; GtkWidget *invisible3; GtkWidget *comments; - GtkWidget *image1672; + GtkWidget *image1696; GtkWidget *comments_menu; GtkWidget *add_changelog_entry2; GtkWidget *insert_file_header2; @@ -1915,17 +1915,18 @@ GtkWidget *insert_gpl_notice1; GtkWidget *insert_bsd_license_notice1; GtkWidget *insert_date2; - GtkWidget *image1673; + GtkWidget *image1697; GtkWidget *insert_date2_menu; GtkWidget *invisible10; GtkWidget *separator7; GtkWidget *find_usage1; - GtkWidget *image1674; + GtkWidget *image1698; GtkWidget *goto_tag_definition1; GtkWidget *goto_tag_declaration1; + GtkWidget *context_action1; GtkWidget *separator15; GtkWidget *go_to_line; - GtkWidget *image1675; + GtkWidget *image1699; GtkAccelGroup *accel_group; GtkTooltips *tooltips;
@@ -2032,17 +2033,17 @@ gtk_widget_show (menu_increase_indent2); gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_increase_indent2);
- image1669 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1669); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent2), image1669); + image1693 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1693); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent2), image1693);
menu_decrease_indent2 = gtk_image_menu_item_new_with_mnemonic (_("_Decrease Indent")); gtk_widget_show (menu_decrease_indent2); gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_decrease_indent2);
- image1670 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1670); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent2), image1670); + image1694 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1694); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent2), image1694);
separator38 = gtk_separator_menu_item_new (); gtk_widget_show (separator38); @@ -2068,9 +2069,9 @@ gtk_widget_show (insert_include1); gtk_container_add (GTK_CONTAINER (edit_menu1), insert_include1);
- image1671 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1671); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include1), image1671); + image1695 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1695); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include1), image1695);
insert_include1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include1), insert_include1_menu); @@ -2082,9 +2083,9 @@ gtk_widget_show (comments); gtk_container_add (GTK_CONTAINER (edit_menu1), comments);
- image1672 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1672); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (comments), image1672); + image1696 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1696); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (comments), image1696);
comments_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (comments), comments_menu); @@ -2123,9 +2124,9 @@ gtk_widget_show (insert_date2); gtk_container_add (GTK_CONTAINER (edit_menu1), insert_date2);
- image1673 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1673); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date2), image1673); + image1697 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1697); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date2), image1697);
insert_date2_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_date2), insert_date2_menu); @@ -2142,9 +2143,9 @@ gtk_widget_show (find_usage1); gtk_container_add (GTK_CONTAINER (edit_menu1), find_usage1);
- image1674 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1674); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_usage1), image1674); + image1698 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1698); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_usage1), image1698);
goto_tag_definition1 = gtk_menu_item_new_with_mnemonic (_("Go to Tag Definition")); gtk_widget_show (goto_tag_definition1); @@ -2154,6 +2155,10 @@ gtk_widget_show (goto_tag_declaration1); gtk_container_add (GTK_CONTAINER (edit_menu1), goto_tag_declaration1);
+ context_action1 = gtk_menu_item_new_with_mnemonic (_("Context Action")); + gtk_widget_show (context_action1); + gtk_container_add (GTK_CONTAINER (edit_menu1), context_action1); + separator15 = gtk_separator_menu_item_new (); gtk_widget_show (separator15); gtk_container_add (GTK_CONTAINER (edit_menu1), separator15); @@ -2164,9 +2169,9 @@ gtk_container_add (GTK_CONTAINER (edit_menu1), go_to_line); gtk_tooltips_set_tip (tooltips, go_to_line, _("Goto to the entered line"), NULL);
- image1675 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1675); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line), image1675); + image1699 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1699); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line), image1699);
g_signal_connect ((gpointer) undo1, "activate", G_CALLBACK (on_undo1_activate), @@ -2243,6 +2248,9 @@ g_signal_connect ((gpointer) goto_tag_declaration1, "activate", G_CALLBACK (on_goto_tag_activate), NULL); + g_signal_connect ((gpointer) context_action1, "activate", + G_CALLBACK (on_context_action1_activate), + NULL); g_signal_connect ((gpointer) go_to_line, "activate", G_CALLBACK (on_go_to_line_activate), NULL); @@ -2272,20 +2280,20 @@ GLADE_HOOKUP_OBJECT (edit_menu1, menu_duplicate_line2, "menu_duplicate_line2"); GLADE_HOOKUP_OBJECT (edit_menu1, separator31, "separator31"); GLADE_HOOKUP_OBJECT (edit_menu1, menu_increase_indent2, "menu_increase_indent2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1669, "image1669"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1693, "image1693"); GLADE_HOOKUP_OBJECT (edit_menu1, menu_decrease_indent2, "menu_decrease_indent2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1670, "image1670"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1694, "image1694"); GLADE_HOOKUP_OBJECT (edit_menu1, separator38, "separator38"); GLADE_HOOKUP_OBJECT (edit_menu1, send_selection_to1, "send_selection_to1"); GLADE_HOOKUP_OBJECT (edit_menu1, send_selection_to1_menu, "send_selection_to1_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible12, "invisible12"); GLADE_HOOKUP_OBJECT (edit_menu1, separator17, "separator17"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_include1, "insert_include1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1671, "image1671"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1695, "image1695"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_include1_menu, "insert_include1_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible3, "invisible3"); GLADE_HOOKUP_OBJECT (edit_menu1, comments, "comments"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1672, "image1672"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1696, "image1696"); GLADE_HOOKUP_OBJECT (edit_menu1, comments_menu, "comments_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, add_changelog_entry2, "add_changelog_entry2"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_file_header2, "insert_file_header2"); @@ -2294,17 +2302,18 @@ GLADE_HOOKUP_OBJECT (edit_menu1, insert_gpl_notice1, "insert_gpl_notice1"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_bsd_license_notice1, "insert_bsd_license_notice1"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_date2, "insert_date2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1673, "image1673"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1697, "image1697"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_date2_menu, "insert_date2_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible10, "invisible10"); GLADE_HOOKUP_OBJECT (edit_menu1, separator7, "separator7"); GLADE_HOOKUP_OBJECT (edit_menu1, find_usage1, "find_usage1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1674, "image1674"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1698, "image1698"); GLADE_HOOKUP_OBJECT (edit_menu1, goto_tag_definition1, "goto_tag_definition1"); GLADE_HOOKUP_OBJECT (edit_menu1, goto_tag_declaration1, "goto_tag_declaration1"); + GLADE_HOOKUP_OBJECT (edit_menu1, context_action1, "context_action1"); GLADE_HOOKUP_OBJECT (edit_menu1, separator15, "separator15"); GLADE_HOOKUP_OBJECT (edit_menu1, go_to_line, "go_to_line"); - GLADE_HOOKUP_OBJECT (edit_menu1, image1675, "image1675"); + GLADE_HOOKUP_OBJECT (edit_menu1, image1699, "image1699"); GLADE_HOOKUP_OBJECT_NO_REF (edit_menu1, tooltips, "tooltips");
gtk_menu_set_accel_group (GTK_MENU (edit_menu1), accel_group); @@ -2334,6 +2343,12 @@ GtkWidget *check_switch_pages; GtkWidget *check_ask_suppress_search_dialogs; GtkWidget *label178; + GtkWidget *frame24; + GtkWidget *alignment27; + GtkWidget *hbox8; + GtkWidget *label189; + GtkWidget *entry_contextaction; + GtkWidget *label188; GtkWidget *label94; GtkWidget *vbox14; GtkWidget *frame7; @@ -2649,6 +2664,35 @@ gtk_frame_set_label_widget (GTK_FRAME (frame19), label178); gtk_label_set_use_markup (GTK_LABEL (label178), TRUE);
+ frame24 = gtk_frame_new (NULL); + gtk_widget_show (frame24); + gtk_box_pack_start (GTK_BOX (vbox20), frame24, FALSE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame24), GTK_SHADOW_NONE); + + alignment27 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment27); + gtk_container_add (GTK_CONTAINER (frame24), alignment27); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment27), 0, 0, 12, 0); + + hbox8 = gtk_hbox_new (FALSE, 0); + gtk_widget_show (hbox8); + gtk_container_add (GTK_CONTAINER (alignment27), hbox8); + + label189 = gtk_label_new (_("Context Action command:")); + gtk_widget_show (label189); + gtk_box_pack_start (GTK_BOX (hbox8), label189, FALSE, FALSE, 0); + + entry_contextaction = gtk_entry_new (); + gtk_widget_show (entry_contextaction); + gtk_box_pack_start (GTK_BOX (hbox8), entry_contextaction, TRUE, TRUE, 0); + gtk_tooltips_set_tip (tooltips, entry_contextaction, _("Context action command. The current selected word can be used with %s. It can be everywhere in the given command and will be replaced before execution."), NULL); + gtk_entry_set_invisible_char (GTK_ENTRY (entry_contextaction), 9679); + + label188 = gtk_label_new (_("<b>Context Action</b>")); + gtk_widget_show (label188); + gtk_frame_set_label_widget (GTK_FRAME (frame24), label188); + gtk_label_set_use_markup (GTK_LABEL (label188), TRUE); + label94 = gtk_label_new (_("General")); gtk_widget_show (label94); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 0), label94); @@ -3836,6 +3880,12 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, check_switch_pages, "check_switch_pages"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_ask_suppress_search_dialogs, "check_ask_suppress_search_dialogs"); GLADE_HOOKUP_OBJECT (prefs_dialog, label178, "label178"); + GLADE_HOOKUP_OBJECT (prefs_dialog, frame24, "frame24"); + GLADE_HOOKUP_OBJECT (prefs_dialog, alignment27, "alignment27"); + GLADE_HOOKUP_OBJECT (prefs_dialog, hbox8, "hbox8"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label189, "label189"); + GLADE_HOOKUP_OBJECT (prefs_dialog, entry_contextaction, "entry_contextaction"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label188, "label188"); GLADE_HOOKUP_OBJECT (prefs_dialog, label94, "label94"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox14, "vbox14"); GLADE_HOOKUP_OBJECT (prefs_dialog, frame7, "frame7");
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/keybindings.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -274,6 +274,8 @@ 0, 0, "popup_gototagdefinition", _("Go to tag definition")); keys[GEANY_KEYS_POPUP_GOTOTAGDECLARATION] = fill(cb_func_current_word, 0, 0, "popup_gototagdeclaration", _("Go to tag declaration")); + keys[GEANY_KEYS_POPUP_CONTEXTACTION] = fill(cb_func_current_word, + 0, 0, "popup_contextaction", _("Context Action"));
// now load user defined keys if (g_key_file_load_from_file(config, configfile, G_KEY_FILE_KEEP_COMMENTS, NULL)) @@ -363,6 +365,7 @@ GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_POPUP_FINDUSAGE, find_usage1); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_POPUP_GOTOTAGDEFINITION, goto_tag_definition1); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_POPUP_GOTOTAGDECLARATION, goto_tag_declaration1); + GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_POPUP_CONTEXTACTION, context_action1); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_MENU_GOTOLINE, go_to_line); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_EDIT_TOLOWERCASE, to_lower_case1); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_EDIT_TOUPPERCASE, to_upper_case1); @@ -746,7 +749,6 @@ on_find_nextsel1_activate(NULL, NULL); }
- static void cb_func_menu_replace(G_GNUC_UNUSED guint key_id) { on_replace1_activate(NULL, NULL); @@ -905,6 +907,10 @@ on_goto_tag_activate(GTK_MENU_ITEM(lookup_widget(app->popup_menu, "goto_tag_declaration1")), NULL); break; + case GEANY_KEYS_POPUP_CONTEXTACTION: + on_context_action1_activate(GTK_MENU_ITEM(lookup_widget(app->popup_menu, + "context_action1")), NULL); + break; } }
Modified: trunk/src/keybindings.h =================================================================== --- trunk/src/keybindings.h 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/keybindings.h 2007-04-15 18:09:59 UTC (rev 1453) @@ -72,6 +72,7 @@ GEANY_KEYS_POPUP_FINDUSAGE, GEANY_KEYS_POPUP_GOTOTAGDEFINITION, GEANY_KEYS_POPUP_GOTOTAGDECLARATION, + GEANY_KEYS_POPUP_CONTEXTACTION,
GEANY_KEYS_MENU_FULLSCREEN, GEANY_KEYS_MENU_MESSAGEWINDOW,
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/keyfile.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -153,6 +153,7 @@ } #endif g_key_file_set_string(config, PACKAGE, "custom_date_format", app->custom_date_format); + g_key_file_set_string(config, PACKAGE, "context_action_cmd", app->context_action_cmd); if (app->custom_commands != NULL) { g_key_file_set_string_list(config, PACKAGE, "custom_commands", @@ -348,6 +349,7 @@ app->brace_match_ltgt = utils_get_setting_boolean(config, PACKAGE, "brace_match_ltgt", FALSE); app->switch_msgwin_pages = utils_get_setting_boolean(config, PACKAGE, "switch_msgwin_pages", FALSE); app->custom_date_format = utils_get_setting_string(config, PACKAGE, "custom_date_format", ""); + app->context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", ""); app->custom_commands = g_key_file_get_string_list(config, PACKAGE, "custom_commands", NULL, NULL); app->editor_font = utils_get_setting_string(config, PACKAGE, "editor_font", GEANY_DEFAULT_FONT_EDITOR); app->tagbar_font = utils_get_setting_string(config, PACKAGE, "tagbar_font", GEANY_DEFAULT_FONT_SYMBOL_LIST);
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/main.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -755,6 +755,7 @@ g_free(app->tagbar_font); g_free(app->msgwin_font); g_free(app->long_line_color); + g_free(app->context_action_cmd); g_free(app->pref_template_developer); g_free(app->pref_template_company); g_free(app->pref_template_mail);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2007-04-15 16:13:57 UTC (rev 1452) +++ trunk/src/prefs.c 2007-04-15 18:09:59 UTC (rev 1453) @@ -112,7 +112,10 @@ widget = lookup_widget(app->prefs_dialog, "radio_tab_left"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
+ widget = lookup_widget(app->prefs_dialog, "entry_contextaction"); + gtk_entry_set_text(GTK_ENTRY(widget), app->context_action_cmd);
+ // Interface settings widget = lookup_widget(app->prefs_dialog, "check_list_symbol"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->sidebar_symbol_visible); @@ -439,7 +442,11 @@ widget = lookup_widget(app->prefs_dialog, "check_show_notebook_tabs"); app->show_notebook_tabs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = lookup_widget(app->prefs_dialog, "entry_contextaction"); + g_free(app->context_action_cmd); + app->context_action_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
+ // Interface settings widget = lookup_widget(app->prefs_dialog, "check_list_symbol"); app->sidebar_symbol_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.