Branch: refs/heads/master Author: Nick Treleaven nick.treleaven@btinternet.com Committer: Nick Treleaven nick.treleaven@btinternet.com Date: Fri, 23 Nov 2012 16:30:18 UTC Commit: 0b63957e5961c90b081066cadd9d63001dec0d90 https://github.com/geany/geany/commit/0b63957e5961c90b081066cadd9d63001dec0d...
Log Message: ----------- Add 'Move Line(s)' menu items in Edit->Commands (and popup menu)
Although using menu items for these is not very practical, it helps discoverability, and they're more useful and intuitive than 'Transpose Current Line'.
Modified Paths: -------------- data/geany.glade src/callbacks.c src/callbacks.h src/keybindings.c
Modified: data/geany.glade 36 files changed, 26 insertions(+), 10 deletions(-) =================================================================== @@ -7700,6 +7700,32 @@ </object> </child> <child> + <object class="GtkSeparatorMenuItem" id="separator63"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="move_lines_up1"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_Move Line(s) Up</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_move_lines_up1_activate" swapped="no"/> + </object> + </child> + <child> + <object class="GtkMenuItem" id="move_lines_down1"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">_Move Line(s) Down</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_move_lines_down1_activate" swapped="no"/> + </object> + </child> + <child> <object class="GtkSeparatorMenuItem" id="separator52"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -7750,16 +7776,6 @@ </object> </child> <child> - <object class="GtkMenuItem" id="transpose_current_line1"> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">_Transpose Current Line</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_transpose_current_line1_activate" swapped="no"/> - </object> - </child> - <child> <object class="GtkSeparatorMenuItem" id="separator28"> <property name="visible">True</property> <property name="can_focus">False</property>
Modified: src/callbacks.c 10 files changed, 8 insertions(+), 2 deletions(-) =================================================================== @@ -2086,9 +2086,15 @@ G_MODULE_EXPORT void on_reflow_lines_block1_activate(GtkMenuItem *menuitem, gpoi }
-G_MODULE_EXPORT void on_transpose_current_line1_activate(GtkMenuItem *menuitem, gpointer user_data) +G_MODULE_EXPORT void on_move_lines_up1_activate(GtkMenuItem *menuitem, gpointer user_data) { - keybindings_send_command(GEANY_KEY_GROUP_EDITOR, GEANY_KEYS_EDITOR_TRANSPOSELINE); + keybindings_send_command(GEANY_KEY_GROUP_EDITOR, GEANY_KEYS_EDITOR_MOVELINEUP); +} + + +G_MODULE_EXPORT void on_move_lines_down1_activate(GtkMenuItem *menuitem, gpointer user_data) +{ + keybindings_send_command(GEANY_KEY_GROUP_EDITOR, GEANY_KEYS_EDITOR_MOVELINEDOWN); }
Modified: src/callbacks.h 4 files changed, 0 insertions(+), 4 deletions(-) =================================================================== @@ -643,10 +643,6 @@ gpointer user_data);
G_MODULE_EXPORT void -on_transpose_current_line1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -G_MODULE_EXPORT void on_smart_line_indent1_activate (GtkMenuItem *menuitem, gpointer user_data);
Modified: src/keybindings.c 11 files changed, 6 insertions(+), 5 deletions(-) =================================================================== @@ -300,10 +300,9 @@ static void init_default_kb(void) add_kb(group, GEANY_KEYS_EDITOR_DELETELINETOEND, NULL, GDK_Delete, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "edit_deletelinetoend", _("Delete to line end"), NULL); - /* transpose may fit better in format group */ + /* Note: transpose may fit better in format group, but that would break the API */ add_kb(group, GEANY_KEYS_EDITOR_TRANSPOSELINE, NULL, - 0, 0, "edit_transposeline", _("_Transpose Current Line"), - "transpose_current_line1"); + 0, 0, "edit_transposeline", _("_Transpose Current Line"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SCROLLTOLINE, NULL, GDK_l, GDK_SHIFT_MASK | GDK_CONTROL_MASK, "edit_scrolltoline", _("Scroll to current line"), NULL); add_kb(group, GEANY_KEYS_EDITOR_SCROLLLINEUP, NULL, @@ -327,9 +326,11 @@ static void init_default_kb(void) add_kb(group, GEANY_KEYS_EDITOR_WORDPARTCOMPLETION, NULL, GDK_Tab, 0, "edit_wordpartcompletion", _("Word part completion"), NULL); add_kb(group, GEANY_KEYS_EDITOR_MOVELINEUP, NULL, - GDK_Page_Up, GDK_MOD1_MASK, "edit_movelineup", _("Move line(s) up"), NULL); + GDK_Page_Up, GDK_MOD1_MASK, "edit_movelineup", + _("Move line(s) up"), "move_lines_up1"); add_kb(group, GEANY_KEYS_EDITOR_MOVELINEDOWN, NULL, - GDK_Page_Down, GDK_MOD1_MASK, "edit_movelinedown", _("Move line(s) down"), NULL); + GDK_Page_Down, GDK_MOD1_MASK, "edit_movelinedown", + _("Move line(s) down"), "move_lines_down1");
group = keybindings_get_core_group(GEANY_KEY_GROUP_CLIPBOARD);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).