Revision: 3899 http://geany.svn.sourceforge.net/geany/?rev=3899&view=rev Author: eht16 Date: 2009-06-25 17:29:37 +0000 (Thu, 25 Jun 2009)
Log Message: ----------- Add a button in the preferences dialog and an item for the toolbar popup menu to run the toolbar editor dialog.
Modified Paths: -------------- trunk/ChangeLog trunk/geany.glade trunk/src/callbacks.c trunk/src/callbacks.h trunk/src/interface.c trunk/src/prefs.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-06-25 17:21:45 UTC (rev 3898) +++ trunk/ChangeLog 2009-06-25 17:29:37 UTC (rev 3899) @@ -4,6 +4,10 @@ src/toolbar.c, src/toolbar.h: Remove ui_toolbar.xml Configuration Files menu item. Add a real toolbar editor dialog. + * geany.glade, src/callbacks.c, src/callbacks.h, src/interface.c, + src/prefs.c: + Add a button in the preferences dialog and an item for the toolbar + popup menu to run the toolbar editor dialog.
2009-06-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2009-06-25 17:21:45 UTC (rev 3898) +++ trunk/geany.glade 2009-06-25 17:29:37 UTC (rev 3899) @@ -2096,7 +2096,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">Images _and Text</property> <property name="use_underline">True</property> - <property name="active">True</property> + <property name="active">False</property> <signal name="activate" handler="on_images_and_text2_activate" last_modification_time="Sat, 30 Apr 2005 19:42:24 GMT"/> </widget> </child> @@ -2106,7 +2106,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">_Images Only</property> <property name="use_underline">True</property> - <property name="active">True</property> + <property name="active">False</property> <property name="group">images_and_text2</property> <signal name="activate" handler="on_images_only2_activate" last_modification_time="Sat, 30 Apr 2005 19:42:29 GMT"/> </widget> @@ -2134,7 +2134,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">_Large Icons</property> <property name="use_underline">True</property> - <property name="active">True</property> + <property name="active">False</property> <signal name="activate" handler="on_toolbar_large_icons1_activate" last_modification_time="Sat, 22 Oct 2005 11:52:26 GMT"/> </widget> </child> @@ -2144,7 +2144,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">_Small Icons</property> <property name="use_underline">True</property> - <property name="active">True</property> + <property name="active">False</property> <property name="group">large_icons1</property> <signal name="activate" handler="on_toolbar_small_icons1_activate" last_modification_time="Sat, 22 Oct 2005 11:52:26 GMT"/> </widget> @@ -2155,7 +2155,7 @@ <property name="visible">True</property> <property name="label" translatable="yes">_Very Small Icons</property> <property name="use_underline">True</property> - <property name="active">False</property> + <property name="active">True</property> <property name="group">large_icons1</property> <signal name="activate" handler="on_very_small_icons1_activate" last_modification_time="Sun, 29 Mar 2009 18:51:50 GMT"/> </widget> @@ -2168,14 +2168,35 @@ </child>
<child> + <widget class="GtkImageMenuItem" id="customize_toolbar1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Customize Toolbar</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_customize_toolbar1_activate" last_modification_time="Thu, 25 Jun 2009 17:08:08 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image2878"> + <property name="visible">True</property> + <property name="stock">gtk-properties</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="hide_toolbar1"> <property name="visible">True</property> - <property name="label" translatable="yes">_Hide toolbar</property> + <property name="label" translatable="yes">_Hide Toolbar</property> <property name="use_underline">True</property> <signal name="activate" handler="on_hide_toolbar1_activate" last_modification_time="Sat, 30 Apr 2005 20:23:03 GMT"/>
<child internal-child="image"> - <widget class="GtkImage" id="image2853"> + <widget class="GtkImage" id="image2879"> <property name="visible">True</property> <property name="stock">gtk-cancel</property> <property name="icon_size">1</property> @@ -4944,6 +4965,98 @@ <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkHBox" id="hbox15"> + <property name="visible">True</property> + <property name="homogeneous">True</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkButton" id="button_customize_toolbar"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button_customize_toolbar_clicked" last_modification_time="Thu, 25 Jun 2009 17:09:43 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment45"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox16"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2877"> + <property name="visible">True</property> + <property name="stock">gtk-properties</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label236"> + <property name="visible">True</property> + <property name="label" translatable="yes">Customize Toolbar</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> <packing> <property name="tab_expand">False</property>
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2009-06-25 17:21:45 UTC (rev 3898) +++ trunk/src/callbacks.c 2009-06-25 17:29:37 UTC (rev 3899) @@ -2245,3 +2245,19 @@ return FALSE; }
+ +void +on_customize_toolbar1_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + toolbar_configure(); +} + + +void +on_button_customize_toolbar_clicked (GtkButton *button, + gpointer user_data) +{ + toolbar_configure(); +} +
Modified: trunk/src/callbacks.h =================================================================== --- trunk/src/callbacks.h 2009-06-25 17:21:45 UTC (rev 3898) +++ trunk/src/callbacks.h 2009-06-25 17:29:37 UTC (rev 3899) @@ -606,3 +606,11 @@ gboolean on_window_state_event (GtkWidget *widget, GdkEventWindowState *event, gpointer user_data); + +void +on_customize_toolbar1_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_button_customize_toolbar_clicked (GtkButton *button, + gpointer user_data);
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2009-06-25 17:21:45 UTC (rev 3898) +++ trunk/src/interface.c 2009-06-25 17:29:37 UTC (rev 3899) @@ -1717,8 +1717,10 @@ GtkWidget *small_icons1; GtkWidget *very_small_icons1; GtkWidget *separator20; + GtkWidget *customize_toolbar1; + GtkWidget *image2878; GtkWidget *hide_toolbar1; - GtkWidget *image2853; + GtkWidget *image2879;
toolbar_popup_menu1 = gtk_menu_new ();
@@ -1726,13 +1728,11 @@ images_and_text2_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (images_and_text2)); gtk_widget_show (images_and_text2); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), images_and_text2); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (images_and_text2), TRUE);
images_only2 = gtk_radio_menu_item_new_with_mnemonic (images_and_text2_group, _("_Images Only")); images_and_text2_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (images_only2)); gtk_widget_show (images_only2); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), images_only2); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (images_only2), TRUE);
text_only2 = gtk_radio_menu_item_new_with_mnemonic (images_and_text2_group, _("_Text Only")); images_and_text2_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (text_only2)); @@ -1749,31 +1749,38 @@ large_icons1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (large_icons1)); gtk_widget_show (large_icons1); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), large_icons1); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (large_icons1), TRUE);
small_icons1 = gtk_radio_menu_item_new_with_mnemonic (large_icons1_group, _("_Small Icons")); large_icons1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (small_icons1)); gtk_widget_show (small_icons1); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), small_icons1); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (small_icons1), TRUE);
very_small_icons1 = gtk_radio_menu_item_new_with_mnemonic (large_icons1_group, _("_Very Small Icons")); large_icons1_group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (very_small_icons1)); gtk_widget_show (very_small_icons1); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), very_small_icons1); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (very_small_icons1), TRUE);
separator20 = gtk_separator_menu_item_new (); gtk_widget_show (separator20); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), separator20); gtk_widget_set_sensitive (separator20, FALSE);
- hide_toolbar1 = gtk_image_menu_item_new_with_mnemonic (_("_Hide toolbar")); + customize_toolbar1 = gtk_image_menu_item_new_with_mnemonic (_("_Customize Toolbar")); + gtk_widget_show (customize_toolbar1); + gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), customize_toolbar1); + + image2878 = gtk_image_new_from_stock ("gtk-properties", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2878); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (customize_toolbar1), image2878); + + hide_toolbar1 = gtk_image_menu_item_new_with_mnemonic (_("_Hide Toolbar")); gtk_widget_show (hide_toolbar1); gtk_container_add (GTK_CONTAINER (toolbar_popup_menu1), hide_toolbar1);
- image2853 = gtk_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_MENU); - gtk_widget_show (image2853); - gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (hide_toolbar1), image2853); + image2879 = gtk_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_MENU); + gtk_widget_show (image2879); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (hide_toolbar1), image2879);
g_signal_connect ((gpointer) images_and_text2, "activate", G_CALLBACK (on_images_and_text2_activate), @@ -1793,6 +1800,9 @@ g_signal_connect ((gpointer) very_small_icons1, "activate", G_CALLBACK (on_very_small_icons1_activate), NULL); + g_signal_connect ((gpointer) customize_toolbar1, "activate", + G_CALLBACK (on_customize_toolbar1_activate), + NULL); g_signal_connect ((gpointer) hide_toolbar1, "activate", G_CALLBACK (on_hide_toolbar1_activate), NULL); @@ -1807,8 +1817,10 @@ GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, small_icons1, "small_icons1"); GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, very_small_icons1, "very_small_icons1"); GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, separator20, "separator20"); + GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, customize_toolbar1, "customize_toolbar1"); + GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, image2878, "image2878"); GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, hide_toolbar1, "hide_toolbar1"); - GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, image2853, "image2853"); + GLADE_HOOKUP_OBJECT (toolbar_popup_menu1, image2879, "image2879");
return toolbar_popup_menu1; } @@ -2400,6 +2412,12 @@ GtkWidget *radio_toolbar_image; GtkWidget *radio_toolbar_verysmall; GtkWidget *label167; + GtkWidget *hbox15; + GtkWidget *button_customize_toolbar; + GtkWidget *alignment45; + GtkWidget *hbox16; + GtkWidget *image2877; + GtkWidget *label236; GtkWidget *label164; GtkWidget *notebook4; GtkWidget *vbox5; @@ -3316,6 +3334,30 @@ gtk_frame_set_label_widget (GTK_FRAME (frame13), label167); gtk_label_set_use_markup (GTK_LABEL (label167), TRUE);
+ hbox15 = gtk_hbox_new (TRUE, 0); + gtk_widget_show (hbox15); + gtk_box_pack_start (GTK_BOX (vbox15), hbox15, FALSE, FALSE, 0); + + button_customize_toolbar = gtk_button_new (); + gtk_widget_show (button_customize_toolbar); + gtk_box_pack_start (GTK_BOX (hbox15), button_customize_toolbar, FALSE, FALSE, 0); + + alignment45 = gtk_alignment_new (0.5, 0.5, 0, 0); + gtk_widget_show (alignment45); + gtk_container_add (GTK_CONTAINER (button_customize_toolbar), alignment45); + + hbox16 = gtk_hbox_new (FALSE, 2); + gtk_widget_show (hbox16); + gtk_container_add (GTK_CONTAINER (alignment45), hbox16); + + image2877 = gtk_image_new_from_stock ("gtk-properties", GTK_ICON_SIZE_BUTTON); + gtk_widget_show (image2877); + gtk_box_pack_start (GTK_BOX (hbox16), image2877, FALSE, FALSE, 0); + + label236 = gtk_label_new_with_mnemonic (_("Customize Toolbar")); + gtk_widget_show (label236); + gtk_box_pack_start (GTK_BOX (hbox16), label236, FALSE, FALSE, 0); + label164 = gtk_label_new (_("Toolbar")); gtk_widget_show (label164); gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 2), label164); @@ -4585,6 +4627,10 @@ gtk_dialog_add_action_widget (GTK_DIALOG (prefs_dialog), button5, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS (button5, GTK_CAN_DEFAULT);
+ g_signal_connect ((gpointer) button_customize_toolbar, "clicked", + G_CALLBACK (on_button_customize_toolbar_clicked), + NULL); + /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF (prefs_dialog, prefs_dialog, "prefs_dialog"); GLADE_HOOKUP_OBJECT_NO_REF (prefs_dialog, dialog_vbox3, "dialog_vbox3"); @@ -4708,6 +4754,12 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, radio_toolbar_image, "radio_toolbar_image"); GLADE_HOOKUP_OBJECT (prefs_dialog, radio_toolbar_verysmall, "radio_toolbar_verysmall"); GLADE_HOOKUP_OBJECT (prefs_dialog, label167, "label167"); + GLADE_HOOKUP_OBJECT (prefs_dialog, hbox15, "hbox15"); + GLADE_HOOKUP_OBJECT (prefs_dialog, button_customize_toolbar, "button_customize_toolbar"); + GLADE_HOOKUP_OBJECT (prefs_dialog, alignment45, "alignment45"); + GLADE_HOOKUP_OBJECT (prefs_dialog, hbox16, "hbox16"); + GLADE_HOOKUP_OBJECT (prefs_dialog, image2877, "image2877"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label236, "label236"); GLADE_HOOKUP_OBJECT (prefs_dialog, label164, "label164"); GLADE_HOOKUP_OBJECT (prefs_dialog, notebook4, "notebook4"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox5, "vbox5");
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2009-06-25 17:21:45 UTC (rev 3898) +++ trunk/src/prefs.c 2009-06-25 17:29:37 UTC (rev 3899) @@ -1536,12 +1536,6 @@ gtk_label_set_use_markup(GTK_LABEL(label), TRUE); gtk_box_pack_start(GTK_BOX(ui_lookup_widget(ui_widgets.prefs_dialog, "vbox27")), label, FALSE, TRUE, 5); - /* page Toolbar */ - label = geany_wrap_label_new(_("<i>Notice: To customize the toolbar elements, edit the file 'ui_toolbar.xml'. Please see the documentation for details.</i>")); - gtk_widget_show(label); - gtk_label_set_use_markup(GTK_LABEL(label), TRUE); - gtk_box_pack_start(GTK_BOX(ui_lookup_widget(ui_widgets.prefs_dialog, "vbox15")), - label, FALSE, TRUE, 5); /* page Editor->Indentation */ label = geany_wrap_label_new(_("<i>Warning: these settings are overridden by the current project. See <b>Project->Properties</b>.</i>")); gtk_widget_show(label);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.