Revision: 2130 http://geany.svn.sourceforge.net/geany/?rev=2130&view=rev Author: ntrel Date: 2007-12-25 06:00:18 -0800 (Tue, 25 Dec 2007)
Log Message: ----------- Add configurable keybindings for Cut, Copy and Paste.
Modified Paths: -------------- trunk/ChangeLog trunk/src/keybindings.c trunk/src/keybindings.h trunk/src/plugindata.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-12-23 17:06:11 UTC (rev 2129) +++ trunk/ChangeLog 2007-12-25 14:00:18 UTC (rev 2130) @@ -1,3 +1,9 @@ +2007-12-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/keybindings.c, src/keybindings.h, src/plugindata.h: + Add configurable keybindings for Cut, Copy and Paste. + + 2007-12-23 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/keybindings.c: Fix inverted move tab first/last commands.
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2007-12-23 17:06:11 UTC (rev 2129) +++ trunk/src/keybindings.c 2007-12-25 14:00:18 UTC (rev 2130) @@ -58,6 +58,7 @@
static void cb_func_menu_undo(guint key_id); static void cb_func_menu_redo(guint key_id); +static void cb_func_clipboard(guint key_id); static void cb_func_menu_selectall(guint key_id); static void cb_func_menu_help(guint key_id); static void cb_func_menu_preferences(guint key_id); @@ -135,6 +136,12 @@ GDK_z, GDK_CONTROL_MASK, "menu_undo", _("Undo")); keys[GEANY_KEYS_MENU_REDO] = fill(cb_func_menu_redo, GDK_y, GDK_CONTROL_MASK, "menu_redo", _("Redo")); + keys[GEANY_KEYS_MENU_CUT] = fill(cb_func_clipboard, + GDK_x, GDK_CONTROL_MASK, "menu_cut", _("Cut")); + keys[GEANY_KEYS_MENU_COPY] = fill(cb_func_clipboard, + GDK_c, GDK_CONTROL_MASK, "menu_copy", _("Copy")); + keys[GEANY_KEYS_MENU_PASTE] = fill(cb_func_clipboard, + GDK_v, GDK_CONTROL_MASK, "menu_paste", _("Paste")); keys[GEANY_KEYS_MENU_SELECTALL] = fill(cb_func_menu_selectall, GDK_a, GDK_CONTROL_MASK, "menu_selectall", _("Select All")); keys[GEANY_KEYS_MENU_INSERTDATE] = fill(cb_func_menu_insert_date, @@ -1132,6 +1139,29 @@ }
+static void cb_func_clipboard(guint key_id) +{ + GtkWidget *item = NULL; + + switch (key_id) + { + case GEANY_KEYS_MENU_CUT: + item = lookup_widget(app->window, "menu_cut1"); + break; + case GEANY_KEYS_MENU_COPY: + item = lookup_widget(app->window, "menu_copy1"); + break; + case GEANY_KEYS_MENU_PASTE: + item = lookup_widget(app->window, "menu_paste1"); + break; + } + if (item && GTK_WIDGET_IS_SENSITIVE(item)) + { + gtk_menu_item_activate(GTK_MENU_ITEM(item)); + } +} + + /* Common function for editing keybindings that don't change any text, and are * useful even when sci doesn't have focus. */ static void cb_func_edit_global(guint key_id)
Modified: trunk/src/keybindings.h =================================================================== --- trunk/src/keybindings.h 2007-12-23 17:06:11 UTC (rev 2129) +++ trunk/src/keybindings.h 2007-12-25 14:00:18 UTC (rev 2130) @@ -64,6 +64,9 @@ GEANY_KEYS_GROUP_EDIT, GEANY_KEYS_MENU_UNDO = GEANY_KEYS_GROUP_EDIT, GEANY_KEYS_MENU_REDO, + GEANY_KEYS_MENU_CUT, + GEANY_KEYS_MENU_COPY, + GEANY_KEYS_MENU_PASTE, GEANY_KEYS_MENU_SELECTALL, GEANY_KEYS_MENU_INSERTDATE, GEANY_KEYS_MENU_PREFERENCES,
Modified: trunk/src/plugindata.h =================================================================== --- trunk/src/plugindata.h 2007-12-23 17:06:11 UTC (rev 2129) +++ trunk/src/plugindata.h 2007-12-25 14:00:18 UTC (rev 2130) @@ -93,12 +93,12 @@
/* The API version should be incremented whenever any plugin data types below are * modified or appended to. */ -static const gint api_version = 35; +static const gint api_version = 36;
/* 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 = 18; +static const gint abi_version = 19;
/* 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.