Revision: 4279 http://geany.svn.sourceforge.net/geany/?rev=4279&view=rev Author: ntrel Date: 2009-10-01 14:40:42 +0000 (Thu, 01 Oct 2009)
Log Message: ----------- Only use one 'New with template' submenu - reparent as needed.
Modified Paths: -------------- trunk/ChangeLog trunk/geany.glade trunk/src/geanymenubuttonaction.c trunk/src/interface.c trunk/src/templates.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-10-01 11:56:04 UTC (rev 4278) +++ trunk/ChangeLog 2009-10-01 14:40:42 UTC (rev 4279) @@ -9,6 +9,9 @@ Group 'New with template' items by filetype submenu (currently only for toolbar menu). Show custom file template items before filetype template items. + * src/templates.c, src/interface.c, src/geanymenubuttonaction.c, + geany.glade: + Only use one 'New with template' submenu - reparent as needed.
2009-09-30 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2009-10-01 11:56:04 UTC (rev 4278) +++ trunk/geany.glade 2009-10-01 14:40:42 UTC (rev 4279) @@ -67,7 +67,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image2854"> + <widget class="GtkImage" id="image2880"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -77,19 +77,6 @@ <property name="ypad">0</property> </widget> </child> - - <child> - <widget class="GtkMenu" id="menu_new_with_template1_menu"> - - <child> - <widget class="GtkMenuItem" id="invisible2"> - <property name="tooltip" translatable="yes">dummy tooltip, don't translate this.</property> - <property name="label" translatable="yes">invisible</property> - <property name="use_underline">True</property> - </widget> - </child> - </widget> - </child> </widget> </child>
@@ -157,7 +144,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="image2855"> + <widget class="GtkImage" id="image2881"> <property name="visible">True</property> <property name="stock">gtk-save</property> <property name="icon_size">1</property> @@ -178,7 +165,7 @@ <signal name="activate" handler="on_toolbutton_reload_clicked" last_modification_time="Mon, 01 Sep 2008 16:57:06 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2856"> + <widget class="GtkImage" id="image2882"> <property name="visible">True</property> <property name="stock">gtk-revert-to-saved</property> <property name="icon_size">1</property> @@ -198,7 +185,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image2857"> + <widget class="GtkImage" id="image2883"> <property name="visible">True</property> <property name="stock">gtk-revert-to-saved</property> <property name="icon_size">1</property> @@ -285,7 +272,7 @@ <signal name="activate" handler="on_close_other_documents1_activate" last_modification_time="Fri, 27 Jun 2008 15:19:28 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2858"> + <widget class="GtkImage" id="image2884"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -306,7 +293,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="image2859"> + <widget class="GtkImage" id="image2885"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -503,7 +490,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="image2860"> + <widget class="GtkImage" id="image2886"> <property name="visible">True</property> <property name="stock">gtk-indent</property> <property name="icon_size">1</property> @@ -524,7 +511,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="image2861"> + <widget class="GtkImage" id="image2887"> <property name="visible">True</property> <property name="stock">gtk-unindent</property> <property name="icon_size">1</property> @@ -589,7 +576,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image2862"> + <widget class="GtkImage" id="image2888"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -668,7 +655,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image2863"> + <widget class="GtkImage" id="image2889"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -700,7 +687,7 @@ <property name="use_underline">True</property>
<child internal-child="image"> - <widget class="GtkImage" id="image2864"> + <widget class="GtkImage" id="image2890"> <property name="visible">True</property> <property name="stock">gtk-add</property> <property name="icon_size">1</property> @@ -739,7 +726,7 @@ <signal name="activate" handler="on_preferences1_activate" last_modification_time="Wed, 08 Jun 2005 11:35:19 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2865"> + <widget class="GtkImage" id="image2891"> <property name="visible">True</property> <property name="stock">gtk-preferences</property> <property name="icon_size">1</property> @@ -810,7 +797,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="image2866"> + <widget class="GtkImage" id="image2892"> <property name="visible">True</property> <property name="stock">gtk-find-and-replace</property> <property name="icon_size">1</property> @@ -885,7 +872,7 @@ <signal name="activate" handler="on_go_to_line_activate" last_modification_time="Sat, 06 Dec 2008 17:41:21 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2867"> + <widget class="GtkImage" id="image2893"> <property name="visible">True</property> <property name="stock">gtk-jump-to</property> <property name="icon_size">1</property> @@ -919,7 +906,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="image2868"> + <widget class="GtkImage" id="image2894"> <property name="visible">True</property> <property name="stock">gtk-select-font</property> <property name="icon_size">1</property> @@ -1391,7 +1378,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="image2869"> + <widget class="GtkImage" id="image2895"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -1412,7 +1399,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="image2870"> + <widget class="GtkImage" id="image2896"> <property name="visible">True</property> <property name="stock">gtk-open</property> <property name="icon_size">1</property> @@ -1441,7 +1428,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="image2871"> + <widget class="GtkImage" id="image2897"> <property name="visible">True</property> <property name="stock">gtk-close</property> <property name="icon_size">1</property> @@ -1498,7 +1485,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="image2872"> + <widget class="GtkImage" id="image2898"> <property name="visible">True</property> <property name="stock">gtk-select-color</property> <property name="icon_size">1</property> @@ -1537,7 +1524,7 @@ <signal name="activate" handler="on_menu_reload_configuration1_activate" last_modification_time="Mon, 30 Jun 2008 16:19:40 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2873"> + <widget class="GtkImage" id="image2899"> <property name="visible">True</property> <property name="stock">gtk-refresh</property> <property name="icon_size">1</property> @@ -1571,7 +1558,7 @@ <signal name="activate" handler="on_help1_activate" last_modification_time="Sun, 24 Jul 2005 15:23:11 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2874"> + <widget class="GtkImage" id="image2900"> <property name="visible">True</property> <property name="stock">gtk-help</property> <property name="icon_size">1</property>
Modified: trunk/src/geanymenubuttonaction.c =================================================================== --- trunk/src/geanymenubuttonaction.c 2009-10-01 11:56:04 UTC (rev 4278) +++ trunk/src/geanymenubuttonaction.c 2009-10-01 14:40:42 UTC (rev 4279) @@ -132,7 +132,6 @@ GSList *l;
g_return_if_fail(action != NULL); - g_return_if_fail(menu != NULL);
priv = GEANY_MENU_BUTTON_ACTION_GET_PRIVATE(action);
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2009-10-01 11:56:04 UTC (rev 4278) +++ trunk/src/interface.c 2009-10-01 14:40:42 UTC (rev 4279) @@ -38,9 +38,7 @@ GtkWidget *file1_menu; GtkWidget *menu_new1; GtkWidget *menu_new_with_template1; - GtkWidget *image2854; - GtkWidget *menu_new_with_template1_menu; - GtkWidget *invisible2; + GtkWidget *image2880; GtkWidget *separator12; GtkWidget *menu_open1; GtkWidget *menu_open_selected_file1; @@ -49,11 +47,11 @@ GtkWidget *menu_save1; GtkWidget *menu_save_as1; GtkWidget *menu_save_all1; - GtkWidget *image2855; + GtkWidget *image2881; GtkWidget *menu_reload1; - GtkWidget *image2856; + GtkWidget *image2882; GtkWidget *menu_reload_as1; - GtkWidget *image2857; + GtkWidget *image2883; GtkWidget *menu_reload_as1_menu; GtkWidget *invisible7; GtkWidget *separator21; @@ -64,9 +62,9 @@ GtkWidget *separator14; GtkWidget *menu_close1; GtkWidget *close_other_documents1; - GtkWidget *image2858; + GtkWidget *image2884; GtkWidget *menu_close_all1; - GtkWidget *image2859; + GtkWidget *image2885; GtkWidget *menu_separatormenuitem1; GtkWidget *menu_quit1; GtkWidget *edit1; @@ -91,9 +89,9 @@ GtkWidget *menu_duplicate_line1; GtkWidget *separator29; GtkWidget *menu_increase_indent1; - GtkWidget *image2860; + GtkWidget *image2886; GtkWidget *menu_decrease_indent1; - GtkWidget *image2861; + GtkWidget *image2887; GtkWidget *separator37; GtkWidget *send_selection_to_vte1; GtkWidget *send_selection_to2; @@ -101,7 +99,7 @@ GtkWidget *invisible13; GtkWidget *separator18; GtkWidget *add_comments1; - GtkWidget *image2862; + GtkWidget *image2888; GtkWidget *add_comments1_menu; GtkWidget *menu_add_changelog_entry1; GtkWidget *insert_file_header1; @@ -110,16 +108,16 @@ GtkWidget *insert_gpl_notice2; GtkWidget *insert_bsd_license_notice2; GtkWidget *insert_date1; - GtkWidget *image2863; + GtkWidget *image2889; GtkWidget *insert_date1_menu; GtkWidget *invisible8; GtkWidget *insert_include2; - GtkWidget *image2864; + GtkWidget *image2890; GtkWidget *insert_include2_menu; GtkWidget *invisible4; GtkWidget *separator9; GtkWidget *preferences1; - GtkWidget *image2865; + GtkWidget *image2891; GtkWidget *search1; GtkWidget *search1_menu; GtkWidget *find1; @@ -127,7 +125,7 @@ GtkWidget *find_previous1; GtkWidget *find_in_files1; GtkWidget *replace1; - GtkWidget *image2866; + GtkWidget *image2892; GtkWidget *separator33; GtkWidget *find_nextsel1; GtkWidget *find_prevsel1; @@ -136,11 +134,11 @@ GtkWidget *previous_message1; GtkWidget *separator32; GtkWidget *go_to_line1; - GtkWidget *image2867; + GtkWidget *image2893; GtkWidget *menu_view1; GtkWidget *menu_view1_menu; GtkWidget *menu_change_font1; - GtkWidget *image2868; + GtkWidget *image2894; GtkWidget *menu_separator4; GtkWidget *menu_toggle_all_additional_widgets1; GtkWidget *menu_fullscreen1; @@ -198,27 +196,27 @@ GtkWidget *menu_project1; GtkWidget *menu_project1_menu; GtkWidget *project_new1; - GtkWidget *image2869; + GtkWidget *image2895; GtkWidget *project_open1; - GtkWidget *image2870; + GtkWidget *image2896; GtkWidget *recent_projects1; GtkWidget *project_close1; - GtkWidget *image2871; + GtkWidget *image2897; GtkWidget *separator34; GtkWidget *project_properties1; GtkWidget *menu_build1; GtkWidget *tools1; GtkWidget *tools1_menu; GtkWidget *menu_choose_color1; - GtkWidget *image2872; + GtkWidget *image2898; GtkWidget *menu_count_words1; GtkWidget *load_tags1; GtkWidget *menu_reload_configuration1; - GtkWidget *image2873; + GtkWidget *image2899; GtkWidget *menu_help1; GtkWidget *menu_help1_menu; GtkWidget *help1; - GtkWidget *image2874; + GtkWidget *image2900; GtkWidget *website1; GtkWidget *keyboard_shortcuts1; GtkWidget *debug_messages1; @@ -252,10 +250,7 @@ GtkWidget *hbox1; GtkWidget *statusbar; GtkAccelGroup *accel_group; - GtkTooltips *tooltips;
- tooltips = gtk_tooltips_new (); - accel_group = gtk_accel_group_new ();
window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL); @@ -288,17 +283,10 @@ gtk_widget_show (menu_new_with_template1); gtk_container_add (GTK_CONTAINER (file1_menu), menu_new_with_template1);
- image2854 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2854); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image2854); + image2880 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2880); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_new_with_template1), image2880);
- 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); - - invisible2 = gtk_menu_item_new_with_mnemonic (_("invisible")); - gtk_container_add (GTK_CONTAINER (menu_new_with_template1_menu), invisible2); - gtk_tooltips_set_tip (tooltips, invisible2, _("dummy tooltip, don't translate this."), NULL); - separator12 = gtk_separator_menu_item_new (); gtk_widget_show (separator12); gtk_container_add (GTK_CONTAINER (file1_menu), separator12); @@ -333,25 +321,25 @@ gtk_widget_show (menu_save_all1); gtk_container_add (GTK_CONTAINER (file1_menu), menu_save_all1);
- image2855 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2855); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image2855); + image2881 = gtk_image_new_from_stock ("gtk-save", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2881); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_save_all1), image2881);
menu_reload1 = gtk_image_menu_item_new_with_mnemonic (_("_Reload")); gtk_widget_show (menu_reload1); gtk_container_add (GTK_CONTAINER (file1_menu), menu_reload1);
- image2856 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2856); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image2856); + image2882 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2882); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload1), image2882);
menu_reload_as1 = gtk_image_menu_item_new_with_mnemonic (_("R_eload As")); gtk_widget_show (menu_reload_as1); gtk_container_add (GTK_CONTAINER (file1_menu), menu_reload_as1);
- image2857 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2857); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image2857); + image2883 = gtk_image_new_from_stock ("gtk-revert-to-saved", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2883); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_as1), image2883);
menu_reload_as1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_reload_as1), menu_reload_as1_menu); @@ -394,17 +382,17 @@ gtk_widget_show (close_other_documents1); gtk_container_add (GTK_CONTAINER (file1_menu), close_other_documents1);
- image2858 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2858); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (close_other_documents1), image2858); + image2884 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2884); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (close_other_documents1), image2884);
menu_close_all1 = gtk_image_menu_item_new_with_mnemonic (_("C_lose All")); gtk_widget_show (menu_close_all1); gtk_container_add (GTK_CONTAINER (file1_menu), menu_close_all1);
- image2859 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2859); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image2859); + image2885 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2885); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_close_all1), image2885);
menu_separatormenuitem1 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separatormenuitem1); @@ -506,17 +494,17 @@ gtk_widget_show (menu_increase_indent1); gtk_container_add (GTK_CONTAINER (menu_format1_menu), menu_increase_indent1);
- image2860 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2860); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image2860); + image2886 = gtk_image_new_from_stock ("gtk-indent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2886); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_increase_indent1), image2886);
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);
- image2861 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2861); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image2861); + image2887 = gtk_image_new_from_stock ("gtk-unindent", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2887); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_decrease_indent1), image2887);
separator37 = gtk_separator_menu_item_new (); gtk_widget_show (separator37); @@ -546,9 +534,9 @@ gtk_widget_show (add_comments1); gtk_container_add (GTK_CONTAINER (edit1_menu), add_comments1);
- image2862 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2862); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image2862); + image2888 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2888); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (add_comments1), image2888);
add_comments1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (add_comments1), add_comments1_menu); @@ -581,9 +569,9 @@ gtk_widget_show (insert_date1); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_date1);
- image2863 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2863); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date1), image2863); + image2889 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2889); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_date1), image2889);
insert_date1_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_date1), insert_date1_menu); @@ -595,9 +583,9 @@ gtk_widget_show (insert_include2); gtk_container_add (GTK_CONTAINER (edit1_menu), insert_include2);
- image2864 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2864); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image2864); + image2890 = gtk_image_new_from_stock ("gtk-add", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2890); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (insert_include2), image2890);
insert_include2_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (insert_include2), insert_include2_menu); @@ -614,9 +602,9 @@ gtk_widget_show (preferences1); gtk_container_add (GTK_CONTAINER (edit1_menu), preferences1);
- image2865 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2865); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (preferences1), image2865); + image2891 = gtk_image_new_from_stock ("gtk-preferences", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2891); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (preferences1), image2891);
search1 = gtk_menu_item_new_with_mnemonic (_("_Search")); gtk_widget_show (search1); @@ -645,9 +633,9 @@ gtk_widget_show (replace1); gtk_container_add (GTK_CONTAINER (search1_menu), replace1);
- image2866 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2866); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image2866); + image2892 = gtk_image_new_from_stock ("gtk-find-and-replace", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2892); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (replace1), image2892);
separator33 = gtk_separator_menu_item_new (); gtk_widget_show (separator33); @@ -684,9 +672,9 @@ gtk_widget_show (go_to_line1); gtk_container_add (GTK_CONTAINER (search1_menu), go_to_line1);
- image2867 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2867); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image2867); + image2893 = gtk_image_new_from_stock ("gtk-jump-to", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2893); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (go_to_line1), image2893);
menu_view1 = gtk_menu_item_new_with_mnemonic (_("_View")); gtk_widget_show (menu_view1); @@ -699,9 +687,9 @@ gtk_widget_show (menu_change_font1); gtk_container_add (GTK_CONTAINER (menu_view1_menu), menu_change_font1);
- image2868 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2868); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image2868); + image2894 = gtk_image_new_from_stock ("gtk-select-font", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2894); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_change_font1), image2894);
menu_separator4 = gtk_separator_menu_item_new (); gtk_widget_show (menu_separator4); @@ -940,17 +928,17 @@ gtk_widget_show (project_new1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_new1);
- image2869 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2869); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_new1), image2869); + image2895 = gtk_image_new_from_stock ("gtk-new", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2895); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_new1), image2895);
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);
- image2870 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2870); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_open1), image2870); + image2896 = gtk_image_new_from_stock ("gtk-open", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2896); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_open1), image2896);
recent_projects1 = gtk_menu_item_new_with_mnemonic (_("_Recent Projects")); gtk_widget_show (recent_projects1); @@ -960,9 +948,9 @@ gtk_widget_show (project_close1); gtk_container_add (GTK_CONTAINER (menu_project1_menu), project_close1);
- image2871 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2871); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_close1), image2871); + image2897 = gtk_image_new_from_stock ("gtk-close", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2897); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (project_close1), image2897);
separator34 = gtk_separator_menu_item_new (); gtk_widget_show (separator34); @@ -988,9 +976,9 @@ gtk_widget_show (menu_choose_color1); gtk_container_add (GTK_CONTAINER (tools1_menu), menu_choose_color1);
- image2872 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2872); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image2872); + image2898 = gtk_image_new_from_stock ("gtk-select-color", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2898); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_choose_color1), image2898);
menu_count_words1 = gtk_menu_item_new_with_mnemonic (_("_Word Count")); gtk_widget_show (menu_count_words1); @@ -1004,9 +992,9 @@ gtk_widget_show (menu_reload_configuration1); gtk_container_add (GTK_CONTAINER (tools1_menu), menu_reload_configuration1);
- image2873 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2873); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_configuration1), image2873); + image2899 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2899); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_reload_configuration1), image2899);
menu_help1 = gtk_menu_item_new_with_mnemonic (_("_Help")); gtk_widget_show (menu_help1); @@ -1019,9 +1007,9 @@ gtk_widget_show (help1); gtk_container_add (GTK_CONTAINER (menu_help1_menu), help1);
- image2874 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2874); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (help1), image2874); + image2900 = gtk_image_new_from_stock ("gtk-help", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2900); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (help1), image2900);
website1 = gtk_menu_item_new_with_mnemonic (_("_Website")); gtk_widget_show (website1); @@ -1485,9 +1473,7 @@ GLADE_HOOKUP_OBJECT (window1, file1_menu, "file1_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, image2854, "image2854"); - GLADE_HOOKUP_OBJECT (window1, menu_new_with_template1_menu, "menu_new_with_template1_menu"); - GLADE_HOOKUP_OBJECT (window1, invisible2, "invisible2"); + GLADE_HOOKUP_OBJECT (window1, image2880, "image2880"); GLADE_HOOKUP_OBJECT (window1, separator12, "separator12"); GLADE_HOOKUP_OBJECT (window1, menu_open1, "menu_open1"); GLADE_HOOKUP_OBJECT (window1, menu_open_selected_file1, "menu_open_selected_file1"); @@ -1496,11 +1482,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, image2855, "image2855"); + GLADE_HOOKUP_OBJECT (window1, image2881, "image2881"); GLADE_HOOKUP_OBJECT (window1, menu_reload1, "menu_reload1"); - GLADE_HOOKUP_OBJECT (window1, image2856, "image2856"); + GLADE_HOOKUP_OBJECT (window1, image2882, "image2882"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1, "menu_reload_as1"); - GLADE_HOOKUP_OBJECT (window1, image2857, "image2857"); + GLADE_HOOKUP_OBJECT (window1, image2883, "image2883"); GLADE_HOOKUP_OBJECT (window1, menu_reload_as1_menu, "menu_reload_as1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible7, "invisible7"); GLADE_HOOKUP_OBJECT (window1, separator21, "separator21"); @@ -1511,9 +1497,9 @@ GLADE_HOOKUP_OBJECT (window1, separator14, "separator14"); GLADE_HOOKUP_OBJECT (window1, menu_close1, "menu_close1"); GLADE_HOOKUP_OBJECT (window1, close_other_documents1, "close_other_documents1"); - GLADE_HOOKUP_OBJECT (window1, image2858, "image2858"); + GLADE_HOOKUP_OBJECT (window1, image2884, "image2884"); GLADE_HOOKUP_OBJECT (window1, menu_close_all1, "menu_close_all1"); - GLADE_HOOKUP_OBJECT (window1, image2859, "image2859"); + GLADE_HOOKUP_OBJECT (window1, image2885, "image2885"); GLADE_HOOKUP_OBJECT (window1, menu_separatormenuitem1, "menu_separatormenuitem1"); GLADE_HOOKUP_OBJECT (window1, menu_quit1, "menu_quit1"); GLADE_HOOKUP_OBJECT (window1, edit1, "edit1"); @@ -1538,9 +1524,9 @@ 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, image2860, "image2860"); + GLADE_HOOKUP_OBJECT (window1, image2886, "image2886"); GLADE_HOOKUP_OBJECT (window1, menu_decrease_indent1, "menu_decrease_indent1"); - GLADE_HOOKUP_OBJECT (window1, image2861, "image2861"); + GLADE_HOOKUP_OBJECT (window1, image2887, "image2887"); GLADE_HOOKUP_OBJECT (window1, separator37, "separator37"); GLADE_HOOKUP_OBJECT (window1, send_selection_to_vte1, "send_selection_to_vte1"); GLADE_HOOKUP_OBJECT (window1, send_selection_to2, "send_selection_to2"); @@ -1548,7 +1534,7 @@ GLADE_HOOKUP_OBJECT (window1, invisible13, "invisible13"); GLADE_HOOKUP_OBJECT (window1, separator18, "separator18"); GLADE_HOOKUP_OBJECT (window1, add_comments1, "add_comments1"); - GLADE_HOOKUP_OBJECT (window1, image2862, "image2862"); + GLADE_HOOKUP_OBJECT (window1, image2888, "image2888"); 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"); @@ -1557,16 +1543,16 @@ GLADE_HOOKUP_OBJECT (window1, insert_gpl_notice2, "insert_gpl_notice2"); GLADE_HOOKUP_OBJECT (window1, insert_bsd_license_notice2, "insert_bsd_license_notice2"); GLADE_HOOKUP_OBJECT (window1, insert_date1, "insert_date1"); - GLADE_HOOKUP_OBJECT (window1, image2863, "image2863"); + GLADE_HOOKUP_OBJECT (window1, image2889, "image2889"); GLADE_HOOKUP_OBJECT (window1, insert_date1_menu, "insert_date1_menu"); GLADE_HOOKUP_OBJECT (window1, invisible8, "invisible8"); GLADE_HOOKUP_OBJECT (window1, insert_include2, "insert_include2"); - GLADE_HOOKUP_OBJECT (window1, image2864, "image2864"); + GLADE_HOOKUP_OBJECT (window1, image2890, "image2890"); GLADE_HOOKUP_OBJECT (window1, insert_include2_menu, "insert_include2_menu"); GLADE_HOOKUP_OBJECT (window1, invisible4, "invisible4"); GLADE_HOOKUP_OBJECT (window1, separator9, "separator9"); GLADE_HOOKUP_OBJECT (window1, preferences1, "preferences1"); - GLADE_HOOKUP_OBJECT (window1, image2865, "image2865"); + GLADE_HOOKUP_OBJECT (window1, image2891, "image2891"); GLADE_HOOKUP_OBJECT (window1, search1, "search1"); GLADE_HOOKUP_OBJECT (window1, search1_menu, "search1_menu"); GLADE_HOOKUP_OBJECT (window1, find1, "find1"); @@ -1574,7 +1560,7 @@ 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, image2866, "image2866"); + GLADE_HOOKUP_OBJECT (window1, image2892, "image2892"); GLADE_HOOKUP_OBJECT (window1, separator33, "separator33"); GLADE_HOOKUP_OBJECT (window1, find_nextsel1, "find_nextsel1"); GLADE_HOOKUP_OBJECT (window1, find_prevsel1, "find_prevsel1"); @@ -1583,11 +1569,11 @@ GLADE_HOOKUP_OBJECT (window1, previous_message1, "previous_message1"); GLADE_HOOKUP_OBJECT (window1, separator32, "separator32"); GLADE_HOOKUP_OBJECT (window1, go_to_line1, "go_to_line1"); - GLADE_HOOKUP_OBJECT (window1, image2867, "image2867"); + GLADE_HOOKUP_OBJECT (window1, image2893, "image2893"); GLADE_HOOKUP_OBJECT (window1, menu_view1, "menu_view1"); GLADE_HOOKUP_OBJECT (window1, menu_view1_menu, "menu_view1_menu"); GLADE_HOOKUP_OBJECT (window1, menu_change_font1, "menu_change_font1"); - GLADE_HOOKUP_OBJECT (window1, image2868, "image2868"); + GLADE_HOOKUP_OBJECT (window1, image2894, "image2894"); GLADE_HOOKUP_OBJECT (window1, menu_separator4, "menu_separator4"); GLADE_HOOKUP_OBJECT (window1, menu_toggle_all_additional_widgets1, "menu_toggle_all_additional_widgets1"); GLADE_HOOKUP_OBJECT (window1, menu_fullscreen1, "menu_fullscreen1"); @@ -1643,27 +1629,27 @@ 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, image2869, "image2869"); + GLADE_HOOKUP_OBJECT (window1, image2895, "image2895"); GLADE_HOOKUP_OBJECT (window1, project_open1, "project_open1"); - GLADE_HOOKUP_OBJECT (window1, image2870, "image2870"); + GLADE_HOOKUP_OBJECT (window1, image2896, "image2896"); GLADE_HOOKUP_OBJECT (window1, recent_projects1, "recent_projects1"); GLADE_HOOKUP_OBJECT (window1, project_close1, "project_close1"); - GLADE_HOOKUP_OBJECT (window1, image2871, "image2871"); + GLADE_HOOKUP_OBJECT (window1, image2897, "image2897"); 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, image2872, "image2872"); + GLADE_HOOKUP_OBJECT (window1, image2898, "image2898"); GLADE_HOOKUP_OBJECT (window1, menu_count_words1, "menu_count_words1"); GLADE_HOOKUP_OBJECT (window1, load_tags1, "load_tags1"); GLADE_HOOKUP_OBJECT (window1, menu_reload_configuration1, "menu_reload_configuration1"); - GLADE_HOOKUP_OBJECT (window1, image2873, "image2873"); + GLADE_HOOKUP_OBJECT (window1, image2899, "image2899"); GLADE_HOOKUP_OBJECT (window1, menu_help1, "menu_help1"); GLADE_HOOKUP_OBJECT (window1, menu_help1_menu, "menu_help1_menu"); GLADE_HOOKUP_OBJECT (window1, help1, "help1"); - GLADE_HOOKUP_OBJECT (window1, image2874, "image2874"); + GLADE_HOOKUP_OBJECT (window1, image2900, "image2900"); GLADE_HOOKUP_OBJECT (window1, website1, "website1"); GLADE_HOOKUP_OBJECT (window1, keyboard_shortcuts1, "keyboard_shortcuts1"); GLADE_HOOKUP_OBJECT (window1, debug_messages1, "debug_messages1"); @@ -1696,7 +1682,6 @@ GLADE_HOOKUP_OBJECT (window1, notebook_info_label_scribble, "notebook_info_label_scribble"); GLADE_HOOKUP_OBJECT (window1, hbox1, "hbox1"); GLADE_HOOKUP_OBJECT (window1, statusbar, "statusbar"); - GLADE_HOOKUP_OBJECT_NO_REF (window1, tooltips, "tooltips");
gtk_window_add_accel_group (GTK_WINDOW (window1), accel_group);
Modified: trunk/src/templates.c =================================================================== --- trunk/src/templates.c 2009-10-01 11:56:04 UTC (rev 4278) +++ trunk/src/templates.c 2009-10-01 14:40:42 UTC (rev 4279) @@ -43,8 +43,7 @@
GeanyTemplatePrefs template_prefs;
-static GtkWidget *new_with_template_menu = NULL; /* File menu submenu */ -static GtkWidget *toolbar_new_file_menu = NULL; +static GtkWidget *new_with_template_menu = NULL; /* submenu used for both file menu and toolbar */
/* TODO: implement custom insertion templates, put these into files in data/templates */ @@ -266,7 +265,7 @@ foreach_slist(node, filetypes_by_title) { GeanyFiletype *ft = node->data; - GtkWidget *tmp_menu, *tmp_button; + GtkWidget *tmp_menu; const gchar *label = ft->title;
if (ft->id >= GEANY_MAX_BUILT_IN_FILETYPES || ft_templates[ft->id] == NULL) @@ -277,11 +276,6 @@ gtk_container_add(GTK_CONTAINER(new_with_template_menu), tmp_menu); g_signal_connect(tmp_menu, "activate", G_CALLBACK(on_new_with_filetype_template), ft);
- tmp_button = gtk_menu_item_new_with_label(label); - gtk_widget_show(tmp_button); - gtk_container_add(GTK_CONTAINER(toolbar_new_file_menu), tmp_button); - g_signal_connect(tmp_button, "activate", G_CALLBACK(on_new_with_filetype_template), ft); - ret = TRUE; } return ret; @@ -352,7 +346,7 @@
static void add_file_item(const gchar *fname, GtkWidget *menu) { - GtkWidget *tmp_menu, *tmp_button; + GtkWidget *tmp_button; gchar *label;
g_return_if_fail(fname); @@ -360,11 +354,6 @@
label = utils_get_utf8_from_locale(fname);
- tmp_menu = gtk_menu_item_new_with_label(label); - gtk_widget_show(tmp_menu); - gtk_container_add(GTK_CONTAINER(new_with_template_menu), tmp_menu); - g_signal_connect(tmp_menu, "activate", G_CALLBACK(on_new_with_file_template), NULL); - tmp_button = gtk_menu_item_new_with_label(label); gtk_widget_show(tmp_button); gtk_container_add(GTK_CONTAINER(menu), tmp_button); @@ -395,7 +384,7 @@ menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu); gtk_widget_show_all(item); - gtk_container_add(GTK_CONTAINER(toolbar_new_file_menu), item); + gtk_container_add(GTK_CONTAINER(new_with_template_menu), item); menus[ft->id] = menu; } add_file_item(fname, menu); @@ -469,32 +458,45 @@ }
-static void create_file_template_menus(void) +static void create_file_template_menu(void) { - GtkWidget *sep1 = NULL, *sep2 = NULL; + GtkWidget *sep = NULL;
- new_with_template_menu = ui_lookup_widget(main_widgets.window, "menu_new_with_template1_menu"); - toolbar_new_file_menu = gtk_menu_new(); - /* we hold our own ref on the menu in case it is not used in the toolbar */ - g_object_ref(toolbar_new_file_menu); + new_with_template_menu = gtk_menu_new();
if (add_custom_template_items()) { - sep1 = gtk_separator_menu_item_new(); - gtk_container_add(GTK_CONTAINER(new_with_template_menu), sep1); - sep2 = gtk_separator_menu_item_new(); - gtk_container_add(GTK_CONTAINER(toolbar_new_file_menu), sep2); + sep = gtk_separator_menu_item_new(); + gtk_container_add(GTK_CONTAINER(new_with_template_menu), sep); } - if (create_new_filetype_items() && sep1) + if (create_new_filetype_items() && sep) { - gtk_widget_show(sep1); - gtk_widget_show(sep2); + gtk_widget_show(sep); } + /* unless the file menu is showing, menu should be in the toolbar widget */ geany_menu_button_action_set_menu(GEANY_MENU_BUTTON_ACTION( - toolbar_get_action_by_name("New")), toolbar_new_file_menu); + toolbar_get_action_by_name("New")), new_with_template_menu); }
+static void on_menu_new_with_template1_show(GtkWidget *item) +{ + geany_menu_button_action_set_menu( + GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("New")), NULL); + item = ui_lookup_widget(main_widgets.window, "menu_new_with_template1"); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), new_with_template_menu); +} + + +static void on_menu_new_with_template1_hide(GtkWidget *item) +{ + item = ui_lookup_widget(main_widgets.window, "menu_new_with_template1"); + gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), NULL); + geany_menu_button_action_set_menu( + GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("New")), new_with_template_menu); +} + + void templates_init(void) { gchar *year = utils_get_date_time(template_prefs.year_format, NULL); @@ -508,7 +510,16 @@ g_free(datetime); g_free(year);
- create_file_template_menus(); + create_file_template_menu(); + /* we hold our own ref on the menu as it has no parent whilst being moved */ + g_object_ref(new_with_template_menu); + { + GtkWidget *item = ui_lookup_widget(main_widgets.window, "file1"); + /* reparent the menu as needed */ + g_signal_connect(item, "activate", G_CALLBACK(on_menu_new_with_template1_show), NULL); + item = gtk_menu_item_get_submenu(GTK_MENU_ITEM(item)); + g_signal_connect(item, "hide", G_CALLBACK(on_menu_new_with_template1_hide), NULL); + } }
@@ -713,17 +724,14 @@ g_free(ft_templates[i]); } /* destroy "New with template" sub menu items (in case we want to reload the templates) */ - children = gtk_container_get_children(GTK_CONTAINER(toolbar_new_file_menu)); - foreach_list(item, children) - { - gtk_widget_destroy(GTK_WIDGET(item->data)); - } - g_object_unref(toolbar_new_file_menu); children = gtk_container_get_children(GTK_CONTAINER(new_with_template_menu)); foreach_list(item, children) { gtk_widget_destroy(GTK_WIDGET(item->data)); } + /* Shouldn't unrefing destroy children anyway? */ + g_object_unref(new_with_template_menu); + new_with_template_menu = NULL; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.