Revision: 1222 http://svn.sourceforge.net/geany/?rev=1222&view=rev Author: ntrel Date: 2007-01-23 09:51:30 -0800 (Tue, 23 Jan 2007)
Log Message: ----------- Applied patch from Jeff Pohlmeyer to add 'Find Selected' and 'Find Prev Selected' Search commands and keybindings (thanks).
Modified Paths: -------------- trunk/ChangeLog trunk/geany.glade trunk/src/callbacks.c trunk/src/callbacks.h trunk/src/interface.c trunk/src/keybindings.c trunk/src/keybindings.h trunk/src/search.c trunk/src/search.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/ChangeLog 2007-01-23 17:51:30 UTC (rev 1222) @@ -1,3 +1,12 @@ +2007-01-23 Nick Treleaven nick.treleaven@btinternet.com + + * src/interface.c, src/keybindings.c, src/keybindings.h, + src/callbacks.c, src/callbacks.h, src/search.c, src/search.h, + geany.glade: + Applied patch from Jeff Pohlmeyer to add 'Find Selected' and + 'Find Prev Selected' Search commands and keybindings (thanks). + + 2007-01-21 Enrico Tröger enrico.troeger@uvena.de
* src/project.c: Implemented loading and saving of the project file
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/geany.glade 2007-01-23 17:51:30 UTC (rev 1222) @@ -57,7 +57,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1424"> + <widget class="GtkImage" id="image1454"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -138,7 +138,7 @@ <signal name="activate" handler="on_save_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1425"> + <widget class="GtkImage" id="image1455"> <property name="visible">True</property> <property name="stock">gtk-save</property> <property name="icon_size">1</property> @@ -159,7 +159,7 @@ <signal name="activate" handler="on_toolbutton23_clicked" last_modification_time="Mon, 24 Jul 2006 19:26:04 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1426"> + <widget class="GtkImage" id="image1456"> <property name="visible">True</property> <property name="stock">gtk-revert-to-saved</property> <property name="icon_size">1</property> @@ -179,7 +179,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1427"> + <widget class="GtkImage" id="image1457"> <property name="visible">True</property> <property name="stock">gtk-revert-to-saved</property> <property name="icon_size">1</property> @@ -259,7 +259,7 @@ <signal name="activate" handler="on_close_all1_activate" last_modification_time="Thu, 02 Jun 2005 14:15:30 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1428"> + <widget class="GtkImage" id="image1458"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -467,7 +467,7 @@ <signal name="activate" handler="on_menu_increase_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:28:54 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1429"> + <widget class="GtkImage" id="image1459"> <property name="visible">True</property> <property name="stock">gtk-indent</property> <property name="icon_size">1</property> @@ -488,7 +488,7 @@ <signal name="activate" handler="on_menu_decrease_indent1_activate" last_modification_time="Tue, 01 Aug 2006 10:28:54 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1430"> + <widget class="GtkImage" id="image1460"> <property name="visible">True</property> <property name="stock">gtk-unindent</property> <property name="icon_size">1</property> @@ -518,7 +518,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1431"> + <widget class="GtkImage" id="image1461"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -550,7 +550,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image1432"> + <widget class="GtkImage" id="image1462"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -618,7 +618,7 @@ <widget class="GtkMenuItem" id="insert_bsd_license_notice2"> <property name="visible">True</property> <property name="tooltip" translatable="yes">Inserts a BSD licence notice (should be done at the beginning of the file)</property> - <property name="label" translatable="yes">Insert BSD license Notice</property> + <property name="label" translatable="yes">Insert BSD License Notice</property> <property name="use_underline">True</property> <signal name="activate" handler="on_menu_comments_bsd_activate" last_modification_time="Fri, 05 Jan 2007 13:29:27 GMT"/> </widget> @@ -720,7 +720,7 @@ <signal name="activate" handler="on_replace1_activate" last_modification_time="Sun, 23 Oct 2005 13:22:36 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1433"> + <widget class="GtkImage" id="image1463"> <property name="visible">True</property> <property name="stock">gtk-find-and-replace</property> <property name="icon_size">1</property> @@ -740,6 +740,30 @@ </child>
<child> + <widget class="GtkMenuItem" id="find_nextsel1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Find _Selected</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_find_nextsel1_activate" last_modification_time="Sun, 21 Jan 2007 03:42:32 GMT"/> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="find_prevsel1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Find Pre_v Selected</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_find_prevsel1_activate" last_modification_time="Tue, 23 Jan 2007 17:22:40 GMT"/> + </widget> + </child> + + <child> + <widget class="GtkSeparatorMenuItem" id="separator35"> + <property name="visible">True</property> + </widget> + </child> + + <child> <widget class="GtkMenuItem" id="next_message1"> <property name="visible">True</property> <property name="label" translatable="yes">Next _Message</property> @@ -762,7 +786,7 @@ <signal name="activate" handler="on_go_to_line1_activate" last_modification_time="Tue, 23 May 2006 17:10:49 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1434"> + <widget class="GtkImage" id="image1464"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property> @@ -797,7 +821,7 @@ <signal name="activate" handler="on_change_font1_activate" last_modification_time="Fri, 22 Apr 2005 18:58:45 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1435"> + <widget class="GtkImage" id="image1465"> <property name="visible">True</property> <property name="stock">gtk-select-font</property> <property name="icon_size">1</property> @@ -1028,7 +1052,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Convert and Set to _CR/LF (Win)</property> <property name="use_underline">True</property> - <property name="active">True</property> + <property name="active">False</property> <signal name="activate" handler="on_crlf_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/> </widget> </child> @@ -1038,7 +1062,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Convert and Set to _LF (Unix)</property> <property name="use_underline">True</property> - <property name="active">True</property> + <property name="active">False</property> <property name="group">crlf</property> <signal name="activate" handler="on_lf_activate" last_modification_time="Thu, 28 Apr 2005 16:27:24 GMT"/> </widget> @@ -1139,7 +1163,7 @@ <signal name="activate" handler="on_project_new1_activate" last_modification_time="Thu, 18 Jan 2007 22:16:24 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1436"> + <widget class="GtkImage" id="image1466"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -1160,7 +1184,7 @@ <signal name="activate" handler="on_project_open1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1437"> + <widget class="GtkImage" id="image1467"> <property name="visible">True</property> <property name="stock">gtk-open</property> <property name="icon_size">1</property> @@ -1181,7 +1205,7 @@ <signal name="activate" handler="on_project_close1_activate" last_modification_time="Mon, 15 Jan 2007 17:34:17 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1438"> + <widget class="GtkImage" id="image1468"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -1239,7 +1263,7 @@ <signal name="activate" handler="on_show_color_chooser1_activate" last_modification_time="Wed, 22 Jun 2005 18:10:21 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image1439"> + <widget class="GtkImage" id="image1469"> <property name="visible">True</property> <property name="stock">gtk-select-color</property> <property name="icon_size">1</property>
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/callbacks.c 2007-01-23 17:51:30 UTC (rev 1222) @@ -1327,6 +1327,22 @@
void +on_find_nextsel1_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + search_find_selection(document_get_cur_idx(), FALSE); +} + + +void +on_find_prevsel1_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + search_find_selection(document_get_cur_idx(), TRUE); +} + + +void on_replace1_activate (GtkMenuItem *menuitem, gpointer user_data) {
Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/callbacks.h 2007-01-23 17:51:30 UTC (rev 1222) @@ -308,6 +308,12 @@ void on_find_previous1_activate (GtkMenuItem *menuitem, gpointer user_data); +void +on_find_nextsel1_activate (GtkMenuItem *menuitem, + gpointer user_data); +void +on_find_prevsel1_activate (GtkMenuItem *menuitem, + gpointer user_data);
void on_replace1_activate (GtkMenuItem *menuitem,
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/interface.c 2007-01-23 17:51:30 UTC (rev 1222) @@ -37,7 +37,7 @@ GtkWidget *menuitem1_menu; GtkWidget *menu_new1; GtkWidget *menu_new_with_template1; - GtkWidget *image1424; + GtkWidget *image1454; GtkWidget *menu_new_with_template1_menu; GtkWidget *invisible2; GtkWidget *separator12; @@ -47,11 +47,11 @@ GtkWidget *menu_save1; GtkWidget *menu_save_as1; GtkWidget *menu_save_all1; - GtkWidget *image1425; + GtkWidget *image1455; GtkWidget *menu_reload1; - GtkWidget *image1426; + GtkWidget *image1456; GtkWidget *menu_reload_as1; - GtkWidget *image1427; + GtkWidget *image1457; GtkWidget *menu_reload_as1_menu; GtkWidget *invisible7; GtkWidget *separator21; @@ -61,7 +61,7 @@ GtkWidget *separator14; GtkWidget *menu_close1; GtkWidget *menu_close_all1; - GtkWidget *image1428; + GtkWidget *image1458; GtkWidget *menu_separatormenuitem1; GtkWidget *menu_quit1; GtkWidget *edit1; @@ -87,16 +87,16 @@ GtkWidget *menu_duplicate_line1; GtkWidget *separator29; GtkWidget *menu_increase_indent1; - GtkWidget *image1429; + GtkWidget *image1459; GtkWidget *menu_decrease_indent1; - GtkWidget *image1430; + GtkWidget *image1460; GtkWidget *separator18; GtkWidget *insert_include2; - GtkWidget *image1431; + GtkWidget *image1461; GtkWidget *insert_include2_menu; GtkWidget *invisible4; GtkWidget *add_comments1; - GtkWidget *image1432; + GtkWidget *image1462; GtkWidget *add_comments1_menu; GtkWidget *menu_add_changelog_entry1; GtkWidget *insert_file_header1; @@ -116,16 +116,19 @@ GtkWidget *find_previous1; GtkWidget *find_in_files1; GtkWidget *replace1; - GtkWidget *image1433; + GtkWidget *image1463; GtkWidget *separator33; + GtkWidget *find_nextsel1; + GtkWidget *find_prevsel1; + GtkWidget *separator35; GtkWidget *next_message1; GtkWidget *separator32; GtkWidget *go_to_line1; - GtkWidget *image1434; + GtkWidget *image1464; GtkWidget *menuitem3; GtkWidget *menuitem3_menu; GtkWidget *menu_change_font1; - GtkWidget *image1435; + GtkWidget *image1465; GtkWidget *menu_separator4; GtkWidget *menu_fullscreen1; GtkWidget *menu_show_messages_window1; @@ -166,18 +169,18 @@ GtkWidget *menu_project1; GtkWidget *menu_project1_menu; GtkWidget *project_new1; - GtkWidget *image1436; + GtkWidget *image1466; GtkWidget *project_open1; - GtkWidget *image1437; + GtkWidget *image1467; GtkWidget *project_close1; - GtkWidget *image1438; + GtkWidget *image1468; GtkWidget *separator34; GtkWidget *project_properties1; GtkWidget *menu_build1; GtkWidget *tools1; GtkWidget *tools1_menu; GtkWidget *menu_choose_color1; - GtkWidget *image1439; + GtkWidget *image1469; GtkWidget *menu_count_words1; GtkWidget *menu_insert_special_chars1; GtkWidget *menu_item5; @@ -278,9 +281,9 @@ gtk_widget_show (menu_new_with_template1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_new_with_template1);
- image1424 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1424); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1424); + image1454 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1454); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image1454);
menu_new_with_template1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_new_with_template1), menu_new_with_template1_menu); @@ -319,25 +322,25 @@ gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_save_all1); gtk_tooltips_set_tip (tooltips, menu_save_all1, _("Saves all open files"), NULL);
- image1425 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1425); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1425); + image1455 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1455); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image1455);
menu_reload1 = gtk_image_menu_item_new_with_mnemonic (_("_Reload")); gtk_widget_show (menu_reload1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload1);
- image1426 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1426); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1426); + image1456 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1456); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image1456);
menu_reload_as1 = gtk_image_menu_item_new_with_mnemonic (_("R_eload As")); gtk_widget_show (menu_reload_as1); gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_reload_as1);
- image1427 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1427); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1427); + image1457 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1457); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image1457);
menu_reload_as1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_reload_as1), menu_reload_as1_menu); @@ -378,9 +381,9 @@ gtk_container_add (GTK_CONTAINER (menuitem1_menu), menu_close_all1); gtk_tooltips_set_tip (tooltips, menu_close_all1, _("Closes all open files"), NULL);
- image1428 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1428); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1428); + image1458 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1458); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image1458);
menu_separatormenuitem1 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separatormenuitem1); @@ -488,17 +491,17 @@ gtk_widget_show (menu_increase_indent1); gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_increase_indent1);
- image1429 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1429); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1429); + image1459 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1459); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image1459);
menu_decrease_indent1 = gtk_image_menu_item_new_with_mnemonic (_("_Decrease Indent")); gtk_widget_show (menu_decrease_indent1); gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_decrease_indent1);
- image1430 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1430); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1430); + image1460 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1460); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image1460);
separator18 = gtk_separator_menu_item_new (); gtk_widget_show (separator18); @@ -509,9 +512,9 @@ gtk_widget_show (insert_include2); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
- image1431 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1431); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1431); + image1461 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1461); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image1461);
insert_include2_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu); @@ -523,9 +526,9 @@ gtk_widget_show (add_comments1); gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
- image1432 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1432); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1432); + image1462 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1462); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image1462);
add_comments1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu); @@ -555,7 +558,7 @@ gtk_container_add (GTK_CONTAINER (add_comments1_menu), insert_gpl_notice2); gtk_tooltips_set_tip (tooltips, insert_gpl_notice2, _("Inserts a GPL notice (should be done at the beginning of the file)"), NULL);
- insert_bsd_license_notice2 = gtk_menu_item_new_with_mnemonic (_("Insert BSD license Notice")); + insert_bsd_license_notice2 = gtk_menu_item_new_with_mnemonic (_("Insert BSD License Notice")); gtk_widget_show (insert_bsd_license_notice2); gtk_container_add (GTK_CONTAINER (add_comments1_menu), insert_bsd_license_notice2); gtk_tooltips_set_tip (tooltips, insert_bsd_license_notice2, _("Inserts a BSD licence notice (should be done at the beginning of the file)"), NULL); @@ -606,15 +609,28 @@ gtk_widget_show (replace1); gtk_container_add (GTK_CONTAINER (search1_menu), replace1);
- image1433 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1433); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1433); + image1463 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1463); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image1463);
separator33 = gtk_separator_menu_item_new (); gtk_widget_show (separator33); gtk_container_add (GTK_CONTAINER (search1_menu), separator33); gtk_widget_set_sensitive (separator33, FALSE);
+ find_nextsel1 = gtk_menu_item_new_with_mnemonic (_("Find _Selected")); + gtk_widget_show (find_nextsel1); + gtk_container_add (GTK_CONTAINER (search1_menu), find_nextsel1); + + find_prevsel1 = gtk_menu_item_new_with_mnemonic (_("Find Pre_v Selected")); + gtk_widget_show (find_prevsel1); + gtk_container_add (GTK_CONTAINER (search1_menu), find_prevsel1); + + separator35 = gtk_separator_menu_item_new (); + gtk_widget_show (separator35); + gtk_container_add (GTK_CONTAINER (search1_menu), separator35); + gtk_widget_set_sensitive (separator35, FALSE); + next_message1 = gtk_menu_item_new_with_mnemonic (_("Next _Message")); gtk_widget_show (next_message1); gtk_container_add (GTK_CONTAINER (search1_menu), next_message1); @@ -628,9 +644,9 @@ gtk_widget_show (go_to_line1); gtk_container_add (GTK_CONTAINER (search1_menu), go_to_line1);
- image1434 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1434); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1434); + image1464 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1464); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image1464);
menuitem3 = gtk_menu_item_new_with_mnemonic (_("_View")); gtk_widget_show (menuitem3); @@ -644,9 +660,9 @@ gtk_container_add (GTK_CONTAINER (menuitem3_menu), menu_change_font1); gtk_tooltips_set_tip (tooltips, menu_change_font1, _("Change the default font"), NULL);
- image1435 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1435); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1435); + image1465 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1465); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image1465);
menu_separator4 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separator4); @@ -766,13 +782,11 @@ crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (crlf)); gtk_widget_show (crlf); gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), crlf); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (crlf), TRUE);
lf = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and Set to _LF (Unix)")); crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (lf)); gtk_widget_show (lf); gtk_container_add (GTK_CONTAINER (menu_line_endings1_menu), lf); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (lf), TRUE);
cr = gtk_radio_menu_item_new_with_mnemonic (crlf_group, _("Convert and Set to CR (_Mac)")); crlf_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (cr)); @@ -826,25 +840,25 @@ gtk_widget_show (project_new1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_new1);
- image1436 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1436); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_new1), image1436); + image1466 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1466); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_new1), image1466);
project_open1 = gtk_image_menu_item_new_with_mnemonic (_("_Open")); gtk_widget_show (project_open1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_open1);
- image1437 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1437); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_open1), image1437); + image1467 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1467); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_open1), image1467);
project_close1 = gtk_image_menu_item_new_with_mnemonic (_("_Close")); gtk_widget_show (project_close1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_close1);
- image1438 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1438); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_close1), image1438); + image1468 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1468); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_close1), image1468);
separator34 = gtk_separator_menu_item_new (); gtk_widget_show (separator34); @@ -871,9 +885,9 @@ gtk_container_add (GTK_CONTAINER (tools1_menu), menu_choose_color1); gtk_tooltips_set_tip (tooltips, menu_choose_color1, _("Open a color chooser dialog, to interactively pick colors from a palette."), NULL);
- image1439 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); - gtk_widget_show (image1439); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1439); + image1469 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); + gtk_widget_show (image1469); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image1469);
menu_count_words1 = gtk_menu_item_new_with_mnemonic (_("_Word Count")); gtk_widget_show (menu_count_words1); @@ -1302,6 +1316,12 @@ g_signal_connect ((gpointer) replace1, "activate", G_CALLBACK (on_replace1_activate), NULL); + g_signal_connect ((gpointer) find_nextsel1, "activate", + G_CALLBACK (on_find_nextsel1_activate), + NULL); + g_signal_connect ((gpointer) find_prevsel1, "activate", + G_CALLBACK (on_find_prevsel1_activate), + NULL); g_signal_connect ((gpointer) next_message1, "activate", G_CALLBACK (on_next_message1_activate), NULL); @@ -1486,7 +1506,7 @@ GLADE_HOOKUP_OBJECT (window1, menuitem1_menu, "menuitem1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_new1, "menu_new1"); GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1, "menu_new_with_template1"); - GLADE_HOOKUP_OBJECT (window1, image1424, "image1424"); + GLADE_HOOKUP_OBJECT (window1, image1454, "image1454"); GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1_menu, "menu_new_with_template1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible2, "invisible2"); GLADE_HOOKUP_OBJECT (window1, separator12, "separator12"); @@ -1496,11 +1516,11 @@ GLADE_HOOKUP_OBJECT (window1, menu_save1, "menu_save1"); GLADE_HOOKUP_OBJECT (window1, menu_save_as1, "menu_save_as1"); GLADE_HOOKUP_OBJECT (window1, menu_save_all1, "menu_save_all1"); - GLADE_HOOKUP_OBJECT (window1, image1425, "image1425"); + GLADE_HOOKUP_OBJECT (window1, image1455, "image1455"); GLADE_HOOKUP_OBJECT (window1, menu_reload1, "menu_reload1"); - GLADE_HOOKUP_OBJECT (window1, image1426, "image1426"); + GLADE_HOOKUP_OBJECT (window1, image1456, "image1456"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1, "menu_reload_as1"); - GLADE_HOOKUP_OBJECT (window1, image1427, "image1427"); + GLADE_HOOKUP_OBJECT (window1, image1457, "image1457"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1_menu, "menu_reload_as1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible7, "invisible7"); GLADE_HOOKUP_OBJECT (window1, separator21, "separator21"); @@ -1510,7 +1530,7 @@ GLADE_HOOKUP_OBJECT (window1, separator14, "separator14"); GLADE_HOOKUP_OBJECT (window1, menu_close1, "menu_close1"); GLADE_HOOKUP_OBJECT (window1, menu_close_all1, "menu_close_all1"); - GLADE_HOOKUP_OBJECT (window1, image1428, "image1428"); + GLADE_HOOKUP_OBJECT (window1, image1458, "image1458"); GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1"); GLADE_HOOKUP_OBJECT (window1, menu_quit1, "menu_quit1"); GLADE_HOOKUP_OBJECT (window1, edit1, "edit1"); @@ -1536,16 +1556,16 @@ GLADE_HOOKUP_OBJECT (window1, menu_duplicate_line1, "menu_duplicate_line1"); GLADE_HOOKUP_OBJECT (window1, separator29, "separator29"); GLADE_HOOKUP_OBJECT (window1, menu_increase_indent1, "menu_increase_indent1"); - GLADE_HOOKUP_OBJECT (window1, image1429, "image1429"); + GLADE_HOOKUP_OBJECT (window1, image1459, "image1459"); GLADE_HOOKUP_OBJECT (window1, menu_decrease_indent1, "menu_decrease_indent1"); - GLADE_HOOKUP_OBJECT (window1, image1430, "image1430"); + GLADE_HOOKUP_OBJECT (window1, image1460, "image1460"); GLADE_HOOKUP_OBJECT (window1, separator18, "separator18"); GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2"); - GLADE_HOOKUP_OBJECT (window1, image1431, "image1431"); + GLADE_HOOKUP_OBJECT (window1, image1461, "image1461"); GLADE_HOOKUP_OBJECT (window1, insert_include2_menu, "insert_include2_menu"); GLADE_HOOKUP_OBJECT (window1, invisible4, "invisible4"); GLADE_HOOKUP_OBJECT (window1, add_comments1, "add_comments1"); - GLADE_HOOKUP_OBJECT (window1, image1432, "image1432"); + GLADE_HOOKUP_OBJECT (window1, image1462, "image1462"); GLADE_HOOKUP_OBJECT (window1, add_comments1_menu, "add_comments1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_add_changelog_entry1, "menu_add_changelog_entry1"); GLADE_HOOKUP_OBJECT (window1, insert_file_header1, "insert_file_header1"); @@ -1565,16 +1585,19 @@ GLADE_HOOKUP_OBJECT (window1, find_previous1, "find_previous1"); GLADE_HOOKUP_OBJECT (window1, find_in_files1, "find_in_files1"); GLADE_HOOKUP_OBJECT (window1, replace1, "replace1"); - GLADE_HOOKUP_OBJECT (window1, image1433, "image1433"); + GLADE_HOOKUP_OBJECT (window1, image1463, "image1463"); GLADE_HOOKUP_OBJECT (window1, separator33, "separator33"); + GLADE_HOOKUP_OBJECT (window1, find_nextsel1, "find_nextsel1"); + GLADE_HOOKUP_OBJECT (window1, find_prevsel1, "find_prevsel1"); + GLADE_HOOKUP_OBJECT (window1, separator35, "separator35"); GLADE_HOOKUP_OBJECT (window1, next_message1, "next_message1"); GLADE_HOOKUP_OBJECT (window1, separator32, "separator32"); GLADE_HOOKUP_OBJECT (window1, go_to_line1, "go_to_line1"); - GLADE_HOOKUP_OBJECT (window1, image1434, "image1434"); + GLADE_HOOKUP_OBJECT (window1, image1464, "image1464"); GLADE_HOOKUP_OBJECT (window1, menuitem3, "menuitem3"); GLADE_HOOKUP_OBJECT (window1, menuitem3_menu, "menuitem3_menu"); GLADE_HOOKUP_OBJECT (window1, menu_change_font1, "menu_change_font1"); - GLADE_HOOKUP_OBJECT (window1, image1435, "image1435"); + GLADE_HOOKUP_OBJECT (window1, image1465, "image1465"); GLADE_HOOKUP_OBJECT (window1, menu_separator4, "menu_separator4"); GLADE_HOOKUP_OBJECT (window1, menu_fullscreen1, "menu_fullscreen1"); GLADE_HOOKUP_OBJECT (window1, menu_show_messages_window1, "menu_show_messages_window1"); @@ -1614,18 +1637,18 @@ GLADE_HOOKUP_OBJECT (window1, menu_project1, "menu_project1"); GLADE_HOOKUP_OBJECT (window1, menu_project1_menu, "menu_project1_menu"); GLADE_HOOKUP_OBJECT (window1, project_new1, "project_new1"); - GLADE_HOOKUP_OBJECT (window1, image1436, "image1436"); + GLADE_HOOKUP_OBJECT (window1, image1466, "image1466"); GLADE_HOOKUP_OBJECT (window1, project_open1, "project_open1"); - GLADE_HOOKUP_OBJECT (window1, image1437, "image1437"); + GLADE_HOOKUP_OBJECT (window1, image1467, "image1467"); GLADE_HOOKUP_OBJECT (window1, project_close1, "project_close1"); - GLADE_HOOKUP_OBJECT (window1, image1438, "image1438"); + GLADE_HOOKUP_OBJECT (window1, image1468, "image1468"); GLADE_HOOKUP_OBJECT (window1, separator34, "separator34"); GLADE_HOOKUP_OBJECT (window1, project_properties1, "project_properties1"); GLADE_HOOKUP_OBJECT (window1, menu_build1, "menu_build1"); GLADE_HOOKUP_OBJECT (window1, tools1, "tools1"); GLADE_HOOKUP_OBJECT (window1, tools1_menu, "tools1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_choose_color1, "menu_choose_color1"); - GLADE_HOOKUP_OBJECT (window1, image1439, "image1439"); + GLADE_HOOKUP_OBJECT (window1, image1469, "image1469"); GLADE_HOOKUP_OBJECT (window1, menu_count_words1, "menu_count_words1"); GLADE_HOOKUP_OBJECT (window1, menu_insert_special_chars1, "menu_insert_special_chars1"); GLADE_HOOKUP_OBJECT (window1, menu_item5, "menu_item5");
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/keybindings.c 2007-01-23 17:51:30 UTC (rev 1222) @@ -65,6 +65,8 @@ static void cb_func_menu_insert_date(guint key_id); static void cb_func_menu_findnext(guint key_id); static void cb_func_menu_findprevious(guint key_id); +static void cb_func_menu_findnextsel(guint key_id); +static void cb_func_menu_findprevsel(guint key_id); static void cb_func_menu_replace(guint key_id); static void cb_func_menu_findinfiles(guint key_id); static void cb_func_menu_nextmessage(guint key_id); @@ -138,6 +140,10 @@ GDK_F3, 0, "menu_findnext", _("Find Next")); keys[GEANY_KEYS_MENU_FINDPREVIOUS] = fill(cb_func_menu_findprevious, GDK_F3, GDK_SHIFT_MASK, "menu_findprevious", _("Find Previous")); + keys[GEANY_KEYS_MENU_FINDNEXTSEL] = fill(cb_func_menu_findnextsel, + 0, 0, "menu_findnextsel", _("Find Next Selection")); + keys[GEANY_KEYS_MENU_FINDPREVSEL] = fill(cb_func_menu_findprevsel, + 0, 0, "menu_findprevsel", _("Find Previous Selection")); keys[GEANY_KEYS_MENU_REPLACE] = fill(cb_func_menu_replace, GDK_e, GDK_CONTROL_MASK, "menu_replace", _("Replace")); keys[GEANY_KEYS_MENU_FINDINFILES] = fill(cb_func_menu_findinfiles, GDK_f, @@ -294,6 +300,8 @@ GEANY_ADD_ACCEL(GEANY_KEYS_MENU_PREFERENCES, preferences1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDNEXT, find_next1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDPREVIOUS, find_previous1); + GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDNEXTSEL, find_nextsel1); + GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDPREVSEL, find_prevsel1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_REPLACE, replace1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_FINDINFILES, find_in_files1); GEANY_ADD_ACCEL(GEANY_KEYS_MENU_NEXTMESSAGE, next_message1); @@ -526,6 +534,17 @@ on_find_previous1_activate(NULL, NULL); }
+static void cb_func_menu_findprevsel(G_GNUC_UNUSED guint key_id) +{ + on_find_prevsel1_activate(NULL, NULL); +} + +static void cb_func_menu_findnextsel(G_GNUC_UNUSED guint key_id) +{ + on_find_nextsel1_activate(NULL, NULL); +} + + static void cb_func_menu_replace(G_GNUC_UNUSED guint key_id) { on_replace1_activate(NULL, NULL);
Modified: trunk/src/keybindings.h =================================================================== --- trunk/src/keybindings.h 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/keybindings.h 2007-01-23 17:51:30 UTC (rev 1222) @@ -60,8 +60,10 @@ GEANY_KEYS_MENU_PREFERENCES, GEANY_KEYS_MENU_FINDNEXT, GEANY_KEYS_MENU_FINDPREVIOUS, + GEANY_KEYS_MENU_FINDINFILES, GEANY_KEYS_MENU_REPLACE, - GEANY_KEYS_MENU_FINDINFILES, + GEANY_KEYS_MENU_FINDNEXTSEL, + GEANY_KEYS_MENU_FINDPREVSEL, GEANY_KEYS_MENU_NEXTMESSAGE, GEANY_KEYS_MENU_GOTOLINE, GEANY_KEYS_MENU_OPENCOLORCHOOSER,
Modified: trunk/src/search.c =================================================================== --- trunk/src/search.c 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/search.c 2007-01-23 17:51:30 UTC (rev 1222) @@ -240,6 +240,39 @@ }
+/* Search for next match of the current "selection" + * For X11 based systems, this will try to use the system-wide + * x-selection first. If it doesn't find anything suitable in + * the x-selection (or if we are on Win32) it will try to use + * the scintilla selection or current token instead. + * Search flags are always zero. + */ +void search_find_selection(gint idx, gboolean search_backwards) +{ + gchar *s = NULL; + GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); + + if ( idx < 0 ) { return; } +#ifdef G_OS_UNIX + s=gtk_clipboard_wait_for_text(clipboard); + if (s) + { + if (strchr(s,'\n') || strchr(s, '\r')) + { + g_free(s); + s=NULL; + }; + } +#endif + if (!s) { s=get_default_text(idx); } + if (s) + { + document_find_text(idx, s, 0, search_backwards, TRUE); + g_free(s); + } +} + + void search_show_find_dialog() { gint idx = document_get_cur_idx();
Modified: trunk/src/search.h =================================================================== --- trunk/src/search.h 2007-01-23 17:34:10 UTC (rev 1221) +++ trunk/src/search.h 2007-01-23 17:51:30 UTC (rev 1222) @@ -48,4 +48,6 @@
void search_find_usage(const gchar *search_text, gint flags, gboolean in_session);
+void search_find_selection(gint idx, gboolean search_backwards); + #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.