Revision: 4382 http://geany.svn.sourceforge.net/geany/?rev=4382&view=rev Author: ntrel Date: 2009-10-27 18:10:39 +0000 (Tue, 27 Oct 2009)
Log Message: ----------- Share a single Format submenu for menubar Edit and popup menu.
Modified Paths: -------------- trunk/ChangeLog trunk/geany.glade trunk/src/interface.c trunk/src/keybindings.c trunk/src/tools.c trunk/src/ui_utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-10-27 17:47:23 UTC (rev 4381) +++ trunk/ChangeLog 2009-10-27 18:10:39 UTC (rev 4382) @@ -18,6 +18,9 @@ * src/interface.c, src/keybindings.c, src/ui_utils.c, geany.glade: Change editor popup Commands submenu to start as child of menubar Edit menu, as this is more usual e.g. for keybindings initialization. + * src/interface.c, src/keybindings.c, src/tools.c, src/ui_utils.c, + geany.glade: + Share a single Format submenu for menubar Edit and popup menu.
2009-10-26 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2009-10-27 17:47:23 UTC (rev 4381) +++ trunk/geany.glade 2009-10-27 18:10:39 UTC (rev 4382) @@ -2454,136 +2454,6 @@ <property name="visible">True</property> <property name="label" translatable="yes">_Format</property> <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="menu_format2_menu"> - - <child> - <widget class="GtkMenuItem" id="toggle_case1"> - <property name="visible">True</property> - <property name="label" translatable="yes">T_oggle Case of Selection</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_toggle_case1_activate" last_modification_time="Thu, 06 Sep 2007 18:17:18 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator30"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menu_comment_line2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Comment Line(s)</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_menu_comment_line1_activate" last_modification_time="Tue, 01 Aug 2006 10:31:38 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menu_uncomment_line2"> - <property name="visible">True</property> - <property name="label" translatable="yes">U_ncomment Line(s)</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_menu_uncomment_line1_activate" last_modification_time="Tue, 01 Aug 2006 10:31:38 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="menu_toggle_line_commentation2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Toggle Line Commentation</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_menu_toggle_line_commentation1_activate" last_modification_time="Tue, 12 Sep 2006 08:07:58 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator31"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menu_increase_indent2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Increase Indent</property> - <property name="use_underline">True</property> - <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="image3011"> - <property name="visible">True</property> - <property name="stock">gtk-indent</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkImageMenuItem" id="menu_decrease_indent2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Decrease Indent</property> - <property name="use_underline">True</property> - <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="image3012"> - <property name="visible">True</property> - <property name="stock">gtk-unindent</property> - <property name="icon_size">1</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkSeparatorMenuItem" id="separator38"> - <property name="visible">True</property> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="send_selection_to_vte2"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Send Selection to Terminal</property> - <property name="use_underline">True</property> - <signal name="activate" handler="on_send_selection_to_vte1_activate" last_modification_time="Wed, 25 Feb 2009 17:52:11 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkMenuItem" id="send_selection_to1"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Send Selection to</property> - <property name="use_underline">True</property> - - <child> - <widget class="GtkMenu" id="send_selection_to1_menu"> - - <child> - <widget class="GtkMenuItem" id="invisible12"> - <property name="label" translatable="yes">invisible</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> - </widget> - </child> - </widget> - </child> </widget> </child>
@@ -2608,7 +2478,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image3015"> + <widget class="GtkImage" id="image3043"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2687,7 +2557,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image3016"> + <widget class="GtkImage" id="image3044"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2719,7 +2589,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image3017"> + <widget class="GtkImage" id="image3045"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -2758,7 +2628,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="image3018"> + <widget class="GtkImage" id="image3046"> <property name="visible">True</property> <property name="stock">gtk-find</property> <property name="icon_size">1</property> @@ -2779,7 +2649,7 @@ <signal name="activate" handler="on_find_document_usage1_activate" last_modification_time="Thu, 17 Jul 2008 13:42:25 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image3019"> + <widget class="GtkImage" id="image3047"> <property name="visible">True</property> <property name="stock">gtk-find</property> <property name="icon_size">1</property> @@ -2833,7 +2703,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="image3020"> + <widget class="GtkImage" id="image3048"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property>
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2009-10-27 17:47:23 UTC (rev 4381) +++ trunk/src/interface.c 2009-10-27 18:10:39 UTC (rev 4382) @@ -1962,26 +1962,10 @@ GtkWidget *menu_open_selected_file2; GtkWidget *separator36; GtkWidget *menu_format2; - GtkWidget *menu_format2_menu; - GtkWidget *toggle_case1; - GtkWidget *separator30; - GtkWidget *menu_comment_line2; - GtkWidget *menu_uncomment_line2; - GtkWidget *menu_toggle_line_commentation2; - GtkWidget *separator31; - GtkWidget *menu_increase_indent2; - GtkWidget *image3011; - GtkWidget *menu_decrease_indent2; - GtkWidget *image3012; - GtkWidget *separator38; - GtkWidget *send_selection_to_vte2; - GtkWidget *send_selection_to1; - GtkWidget *send_selection_to1_menu; - GtkWidget *invisible12; GtkWidget *commands1; GtkWidget *separator17; GtkWidget *comments; - GtkWidget *image3015; + GtkWidget *image3043; GtkWidget *comments_menu; GtkWidget *add_changelog_entry2; GtkWidget *insert_file_header2; @@ -1990,24 +1974,24 @@ GtkWidget *insert_gpl_notice1; GtkWidget *insert_bsd_license_notice1; GtkWidget *insert_date2; - GtkWidget *image3016; + GtkWidget *image3044; GtkWidget *insert_date2_menu; GtkWidget *invisible10; GtkWidget *insert_include1; - GtkWidget *image3017; + GtkWidget *image3045; GtkWidget *insert_include1_menu; GtkWidget *invisible3; GtkWidget *separator7; GtkWidget *find_usage1; - GtkWidget *image3018; + GtkWidget *image3046; GtkWidget *find_document_usage1; - GtkWidget *image3019; + GtkWidget *image3047; GtkWidget *goto_tag_definition1; GtkWidget *goto_tag_declaration1; GtkWidget *context_action1; GtkWidget *separator15; GtkWidget *go_to_line; - GtkWidget *image3020; + GtkWidget *image3048; GtkAccelGroup *accel_group;
accel_group = gtk_accel_group_new (); @@ -2070,70 +2054,6 @@ gtk_widget_show (menu_format2); gtk_container_add (GTK_CONTAINER (edit_menu1), menu_format2);
- menu_format2_menu = gtk_menu_new (); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_format2), menu_format2_menu); - - toggle_case1 = gtk_menu_item_new_with_mnemonic (_("T_oggle Case of Selection")); - gtk_widget_show (toggle_case1); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), toggle_case1); - - separator30 = gtk_separator_menu_item_new (); - gtk_widget_show (separator30); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), separator30); - gtk_widget_set_sensitive (separator30, FALSE); - - menu_comment_line2 = gtk_menu_item_new_with_mnemonic (_("_Comment Line(s)")); - gtk_widget_show (menu_comment_line2); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_comment_line2); - - menu_uncomment_line2 = gtk_menu_item_new_with_mnemonic (_("U_ncomment Line(s)")); - gtk_widget_show (menu_uncomment_line2); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_uncomment_line2); - - menu_toggle_line_commentation2 = gtk_menu_item_new_with_mnemonic (_("_Toggle Line Commentation")); - gtk_widget_show (menu_toggle_line_commentation2); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_toggle_line_commentation2); - - separator31 = gtk_separator_menu_item_new (); - gtk_widget_show (separator31); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), separator31); - gtk_widget_set_sensitive (separator31, FALSE); - - menu_increase_indent2 = gtk_image_menu_item_new_with_mnemonic (_("_Increase Indent")); - gtk_widget_show (menu_increase_indent2); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), menu_increase_indent2); - - image3011 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3011); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent2), image3011); - - 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); - - image3012 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3012); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent2), image3012); - - separator38 = gtk_separator_menu_item_new (); - gtk_widget_show (separator38); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), separator38); - gtk_widget_set_sensitive (separator38, FALSE); - - send_selection_to_vte2 = gtk_menu_item_new_with_mnemonic (_("_Send Selection to Terminal")); - gtk_widget_show (send_selection_to_vte2); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), send_selection_to_vte2); - - send_selection_to1 = gtk_menu_item_new_with_mnemonic (_("_Send Selection to")); - gtk_widget_show (send_selection_to1); - gtk_container_add (GTK_CONTAINER (menu_format2_menu), send_selection_to1); - - send_selection_to1_menu = gtk_menu_new (); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (send_selection_to1), send_selection_to1_menu); - - invisible12 = gtk_menu_item_new_with_mnemonic (_("invisible")); - gtk_container_add (GTK_CONTAINER (send_selection_to1_menu), invisible12); - commands1 = gtk_menu_item_new_with_mnemonic (_("_Commands")); gtk_widget_show (commands1); gtk_container_add (GTK_CONTAINER (edit_menu1), commands1); @@ -2147,9 +2067,9 @@ gtk_widget_show (comments); gtk_container_add (GTK_CONTAINER (edit_menu1), comments);
- image3015 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3015); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (comments), image3015); + image3043 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image3043); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (comments), image3043);
comments_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (comments), comments_menu); @@ -2182,9 +2102,9 @@ gtk_widget_show (insert_date2); gtk_container_add (GTK_CONTAINER (edit_menu1), insert_date2);
- image3016 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3016); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date2), image3016); + image3044 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image3044); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date2), image3044);
insert_date2_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_date2), insert_date2_menu); @@ -2196,9 +2116,9 @@ gtk_widget_show (insert_include1); gtk_container_add (GTK_CONTAINER (edit_menu1), insert_include1);
- image3017 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3017); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include1), image3017); + image3045 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image3045); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include1), image3045);
insert_include1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include1), insert_include1_menu); @@ -2215,17 +2135,17 @@ gtk_widget_show (find_usage1); gtk_container_add (GTK_CONTAINER (edit_menu1), find_usage1);
- image3018 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3018); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_usage1), image3018); + image3046 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); + gtk_widget_show (image3046); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_usage1), image3046);
find_document_usage1 = gtk_image_menu_item_new_with_mnemonic (_("Find _Document Usage")); gtk_widget_show (find_document_usage1); gtk_container_add (GTK_CONTAINER (edit_menu1), find_document_usage1);
- image3019 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3019); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_document_usage1), image3019); + image3047 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU); + gtk_widget_show (image3047); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (find_document_usage1), image3047);
goto_tag_definition1 = gtk_menu_item_new_with_mnemonic (_("Go to _Tag Definition")); gtk_widget_show (goto_tag_definition1); @@ -2248,9 +2168,9 @@ gtk_widget_show (go_to_line); gtk_container_add (GTK_CONTAINER (edit_menu1), go_to_line);
- image3020 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image3020); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line), image3020); + image3048 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image3048); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line), image3048);
g_signal_connect ((gpointer) undo1, "activate", G_CALLBACK (on_undo1_activate), @@ -2276,27 +2196,6 @@ g_signal_connect ((gpointer) menu_open_selected_file2, "activate", G_CALLBACK (on_menu_open_selected_file1_activate), NULL); - g_signal_connect ((gpointer) toggle_case1, "activate", - G_CALLBACK (on_toggle_case1_activate), - NULL); - g_signal_connect ((gpointer) menu_comment_line2, "activate", - G_CALLBACK (on_menu_comment_line1_activate), - NULL); - g_signal_connect ((gpointer) menu_uncomment_line2, "activate", - G_CALLBACK (on_menu_uncomment_line1_activate), - NULL); - g_signal_connect ((gpointer) menu_toggle_line_commentation2, "activate", - G_CALLBACK (on_menu_toggle_line_commentation1_activate), - NULL); - g_signal_connect ((gpointer) menu_increase_indent2, "activate", - G_CALLBACK (on_menu_increase_indent1_activate), - NULL); - g_signal_connect ((gpointer) menu_decrease_indent2, "activate", - G_CALLBACK (on_menu_decrease_indent1_activate), - NULL); - g_signal_connect ((gpointer) send_selection_to_vte2, "activate", - G_CALLBACK (on_send_selection_to_vte1_activate), - NULL); g_signal_connect ((gpointer) add_changelog_entry2, "activate", G_CALLBACK (on_comments_changelog_activate), NULL); @@ -2349,26 +2248,10 @@ GLADE_HOOKUP_OBJECT (edit_menu1, menu_open_selected_file2, "menu_open_selected_file2"); GLADE_HOOKUP_OBJECT (edit_menu1, separator36, "separator36"); GLADE_HOOKUP_OBJECT (edit_menu1, menu_format2, "menu_format2"); - GLADE_HOOKUP_OBJECT (edit_menu1, menu_format2_menu, "menu_format2_menu"); - GLADE_HOOKUP_OBJECT (edit_menu1, toggle_case1, "toggle_case1"); - GLADE_HOOKUP_OBJECT (edit_menu1, separator30, "separator30"); - GLADE_HOOKUP_OBJECT (edit_menu1, menu_comment_line2, "menu_comment_line2"); - GLADE_HOOKUP_OBJECT (edit_menu1, menu_uncomment_line2, "menu_uncomment_line2"); - GLADE_HOOKUP_OBJECT (edit_menu1, menu_toggle_line_commentation2, "menu_toggle_line_commentation2"); - GLADE_HOOKUP_OBJECT (edit_menu1, separator31, "separator31"); - GLADE_HOOKUP_OBJECT (edit_menu1, menu_increase_indent2, "menu_increase_indent2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image3011, "image3011"); - GLADE_HOOKUP_OBJECT (edit_menu1, menu_decrease_indent2, "menu_decrease_indent2"); - GLADE_HOOKUP_OBJECT (edit_menu1, image3012, "image3012"); - GLADE_HOOKUP_OBJECT (edit_menu1, separator38, "separator38"); - GLADE_HOOKUP_OBJECT (edit_menu1, send_selection_to_vte2, "send_selection_to_vte2"); - 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, commands1, "commands1"); GLADE_HOOKUP_OBJECT (edit_menu1, separator17, "separator17"); GLADE_HOOKUP_OBJECT (edit_menu1, comments, "comments"); - GLADE_HOOKUP_OBJECT (edit_menu1, image3015, "image3015"); + GLADE_HOOKUP_OBJECT (edit_menu1, image3043, "image3043"); 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"); @@ -2377,24 +2260,24 @@ 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, image3016, "image3016"); + GLADE_HOOKUP_OBJECT (edit_menu1, image3044, "image3044"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_date2_menu, "insert_date2_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible10, "invisible10"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_include1, "insert_include1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image3017, "image3017"); + GLADE_HOOKUP_OBJECT (edit_menu1, image3045, "image3045"); GLADE_HOOKUP_OBJECT (edit_menu1, insert_include1_menu, "insert_include1_menu"); GLADE_HOOKUP_OBJECT (edit_menu1, invisible3, "invisible3"); GLADE_HOOKUP_OBJECT (edit_menu1, separator7, "separator7"); GLADE_HOOKUP_OBJECT (edit_menu1, find_usage1, "find_usage1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image3018, "image3018"); + GLADE_HOOKUP_OBJECT (edit_menu1, image3046, "image3046"); GLADE_HOOKUP_OBJECT (edit_menu1, find_document_usage1, "find_document_usage1"); - GLADE_HOOKUP_OBJECT (edit_menu1, image3019, "image3019"); + GLADE_HOOKUP_OBJECT (edit_menu1, image3047, "image3047"); 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, image3020, "image3020"); + GLADE_HOOKUP_OBJECT (edit_menu1, image3048, "image3048");
gtk_menu_set_accel_group (GTK_MENU (edit_menu1), accel_group);
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2009-10-27 17:47:23 UTC (rev 4381) +++ trunk/src/keybindings.c 2009-10-27 18:10:39 UTC (rev 4382) @@ -721,16 +721,8 @@ GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_GOTO_TAGDEFINITION, goto_tag_definition1); GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_GOTO_TAGDECLARATION, goto_tag_declaration1);
- group = g_ptr_array_index(keybinding_groups, GEANY_KEY_GROUP_FORMAT); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_TOGGLECASE, toggle_case1); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_COMMENTLINE, menu_comment_line2); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_UNCOMMENTLINE, menu_uncomment_line2); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_COMMENTLINETOGGLE, menu_toggle_line_commentation2); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_INCREASEINDENT, menu_increase_indent2); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_DECREASEINDENT, menu_decrease_indent2); - GEANY_ADD_POPUP_ACCEL(GEANY_KEYS_FORMAT_SENDTOVTE, send_selection_to_vte2); - - /* the build menu items are set if the build menus are created */ + /* Format and Commands share the menu bar submenus */ + /* Build menu items are set if the build menus are created */ }
Modified: trunk/src/tools.c =================================================================== --- trunk/src/tools.c 2009-10-27 17:47:23 UTC (rev 4381) +++ trunk/src/tools.c 2009-10-27 18:10:39 UTC (rev 4382) @@ -441,7 +441,7 @@ }
-static void cc_insert_custom_command_items(GtkMenu *me, GtkMenu *mp, gchar *label, gint idx) +static void cc_insert_custom_command_items(GtkMenu *me, gchar *label, gint idx) { GtkWidget *item; gint key_idx = -1; @@ -465,36 +465,21 @@ gtk_widget_show(item); g_signal_connect(item, "activate", G_CALLBACK(cc_on_custom_command_activate), GINT_TO_POINTER(idx)); - - item = gtk_menu_item_new_with_label(label); - if (key_idx != -1) - gtk_widget_add_accelerator(item, "activate", gtk_accel_group_new(), - kb->key, kb->mods, GTK_ACCEL_VISIBLE); - gtk_container_add(GTK_CONTAINER(mp), item); - gtk_widget_show(item); - g_signal_connect(item, "activate", G_CALLBACK(cc_on_custom_command_activate), - GINT_TO_POINTER(idx)); }
void tools_create_insert_custom_command_menu_items(void) { GtkMenu *menu_edit = GTK_MENU(ui_lookup_widget(main_widgets.window, "send_selection_to2_menu")); - GtkMenu *menu_popup = GTK_MENU(ui_lookup_widget(main_widgets.editor_menu, "send_selection_to1_menu")); GtkWidget *item; GList *me_children, *node; - GList *mp_children; static gboolean signal_set = FALSE;
/* first clean the menus to be able to rebuild them */ me_children = gtk_container_get_children(GTK_CONTAINER(menu_edit)); - mp_children = gtk_container_get_children(GTK_CONTAINER(menu_popup)); foreach_list(node, me_children) gtk_widget_destroy(GTK_WIDGET(node->data)); - foreach_list(node, mp_children) - gtk_widget_destroy(GTK_WIDGET(node->data)); g_list_free(me_children); - g_list_free(mp_children);
if (ui_prefs.custom_commands == NULL || g_strv_length(ui_prefs.custom_commands) == 0) { @@ -502,10 +487,6 @@ gtk_container_add(GTK_CONTAINER(menu_edit), item); gtk_widget_set_sensitive(item, FALSE); gtk_widget_show(item); - item = gtk_menu_item_new_with_label(_("No custom commands defined.")); - gtk_container_add(GTK_CONTAINER(menu_popup), item); - gtk_widget_set_sensitive(item, FALSE); - gtk_widget_show(item); } else { @@ -516,7 +497,7 @@ { if (ui_prefs.custom_commands[i][0] != '\0') /* skip empty fields */ { - cc_insert_custom_command_items(menu_edit, menu_popup, ui_prefs.custom_commands[i], idx); + cc_insert_custom_command_items(menu_edit, ui_prefs.custom_commands[i], idx); idx++; } } @@ -526,16 +507,11 @@ item = gtk_separator_menu_item_new(); gtk_container_add(GTK_CONTAINER(menu_edit), item); gtk_widget_show(item); - item = gtk_separator_menu_item_new(); - gtk_container_add(GTK_CONTAINER(menu_popup), item); - gtk_widget_show(item);
- cc_insert_custom_command_items(menu_edit, menu_popup, _("Set Custom Commands"), -1); + cc_insert_custom_command_items(menu_edit, _("Set Custom Commands"), -1);
if (! signal_set) { - g_signal_connect(ui_lookup_widget(main_widgets.editor_menu, "send_selection_to1"), - "activate", G_CALLBACK(cc_on_custom_command_menu_activate), menu_popup); g_signal_connect(ui_lookup_widget(main_widgets.window, "send_selection_to2"), "activate", G_CALLBACK(cc_on_custom_command_menu_activate), menu_edit); signal_set = TRUE;
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2009-10-27 17:47:23 UTC (rev 4381) +++ trunk/src/ui_utils.c 2009-10-27 18:10:39 UTC (rev 4382) @@ -71,6 +71,7 @@ GtkWidget *save_buttons[4]; GtkWidget *config_files_menu; GtkWidget *commands_menu; + GtkWidget *format_menu; } widgets;
@@ -1870,6 +1871,10 @@ GtkWidget *bar = ui_lookup_widget(main_widgets.window, "commands2");
ui_menu_move(widgets.commands_menu, bar, popup); + + popup = ui_lookup_widget(main_widgets.editor_menu, "menu_format2"); + bar = ui_lookup_widget(main_widgets.window, "menu_format1"); + ui_menu_move(widgets.format_menu, bar, popup); }
@@ -1879,6 +1884,10 @@ GtkWidget *bar = ui_lookup_widget(main_widgets.window, "commands2");
ui_menu_move(widgets.commands_menu, popup, bar); + + popup = ui_lookup_widget(main_widgets.editor_menu, "menu_format2"); + bar = ui_lookup_widget(main_widgets.window, "menu_format1"); + ui_menu_move(widgets.format_menu, popup, bar); }
@@ -1912,6 +1921,8 @@ widgets.undo_items[0] = ui_lookup_widget(main_widgets.editor_menu, "undo1"); widgets.undo_items[1] = ui_lookup_widget(main_widgets.window, "menu_undo2");
+ item = ui_lookup_widget(main_widgets.window, "menu_format1"); + widgets.format_menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(item)); item = ui_lookup_widget(main_widgets.window, "commands2"); widgets.commands_menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(item));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.