Revision: 5108 http://geany.svn.sourceforge.net/geany/?rev=5108&view=rev Author: eht16 Date: 2010-07-29 18:28:37 +0000 (Thu, 29 Jul 2010)
Log Message: ----------- Implement 'Select All' for the VTE widget.
Modified Paths: -------------- trunk/ChangeLog trunk/src/keybindings.c trunk/src/vte.c trunk/src/vte.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-07-25 11:11:04 UTC (rev 5107) +++ trunk/ChangeLog 2010-07-29 18:28:37 UTC (rev 5108) @@ -1,3 +1,9 @@ +2010-07-29 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/keybindings.cm src/vte.cm src/vte.h: + Implement 'Select All' for the VTE widget. + + 2010-07-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* geany.nsi:
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2010-07-25 11:11:04 UTC (rev 5107) +++ trunk/src/keybindings.c 2010-07-29 18:28:37 UTC (rev 5108) @@ -57,6 +57,9 @@ #include "geanywraplabel.h" #include "main.h" #include "search.h" +#ifdef HAVE_VTE +# include "vte.h" +#endif
GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */ @@ -2479,6 +2482,14 @@ g_signal_emit_by_name(msgwindow.scribble, "select-all", TRUE); return TRUE; } + /* special case for Select All in the VTE widget */ +#ifdef HAVE_VTE + else if (key_id == GEANY_KEYS_SELECT_ALL && vte_info.load_vte && focusw == vc->vte) + { + vte_select_all(); + return TRUE; + } +#endif /* special case for Select All in the toolbar search widget */ else if (key_id == GEANY_KEYS_SELECT_ALL && focusw == toolbar_search_entry) {
Modified: trunk/src/vte.c =================================================================== --- trunk/src/vte.c 2010-07-25 11:11:04 UTC (rev 5107) +++ trunk/src/vte.c 2010-07-29 18:28:37 UTC (rev 5108) @@ -114,6 +114,7 @@ void (*vte_terminal_set_cursor_blink_mode) (VteTerminal *terminal, VteTerminalCursorBlinkMode mode); void (*vte_terminal_set_cursor_blinks) (VteTerminal *terminal, gboolean blink); + void (*vte_terminal_select_all) (VteTerminal *terminal); };
@@ -135,6 +136,7 @@ { POPUP_COPY, POPUP_PASTE, + POPUP_SELECTALL, POPUP_CHANGEPATH, POPUP_RESTARTTERMINAL, POPUP_PREFERENCES, @@ -429,6 +431,7 @@ /* vte_terminal_set_cursor_blink_mode() is only available since 0.17.1, so if we don't find * this symbol, we are probably on an older version and use the old API instead */ g_module_symbol(mod, "vte_terminal_set_cursor_blinks", (void*)&vf->vte_terminal_set_cursor_blinks); + g_module_symbol(mod, "vte_terminal_select_all", (void*)&vf->vte_terminal_select_all); }
@@ -466,6 +469,11 @@ vf->vte_terminal_paste_clipboard(VTE_TERMINAL(vc->vte)); break; } + case POPUP_SELECTALL: + { + vte_select_all(); + break; + } case POPUP_CHANGEPATH: { GeanyDocument *doc = document_get_current(); @@ -513,6 +521,15 @@ gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item);
+ item = gtk_image_menu_item_new_from_stock(GTK_STOCK_SELECT_ALL, NULL); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(menu), item); + g_signal_connect(item, "activate", G_CALLBACK(vte_popup_menu_clicked), GINT_TO_POINTER(POPUP_SELECTALL)); + + item = gtk_separator_menu_item_new(); + gtk_widget_show(item); + gtk_container_add(GTK_CONTAINER(menu), item); + item = gtk_image_menu_item_new_with_mnemonic(_("_Set Path From Document")); gtk_widget_show(item); gtk_container_add(GTK_CONTAINER(menu), item); @@ -881,6 +898,13 @@ }
+void vte_select_all(void) +{ + if (vf->vte_terminal_select_all != NULL) + vf->vte_terminal_select_all(VTE_TERMINAL(vc->vte)); +} + + void vte_send_selection_to_vte(void) { GeanyDocument *doc;
Modified: trunk/src/vte.h =================================================================== --- trunk/src/vte.h 2010-07-25 11:11:04 UTC (rev 5107) +++ trunk/src/vte.h 2010-07-29 18:28:37 UTC (rev 5108) @@ -79,6 +79,8 @@
void vte_send_selection_to_vte(void);
+void vte_select_all(void); + #endif
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.