Revision: 943 http://svn.sourceforge.net/geany/?rev=943&view=rev Author: eht16 Date: 2006-10-28 18:28:58 -0700 (Sat, 28 Oct 2006)
Log Message: ----------- Added an Apply button to preferences dialog. New setting to show/hide the Quit toolbar item. New setting to show/hide notebook tabs.
Modified Paths: -------------- trunk/ChangeLog trunk/geany.glade trunk/src/geany.h trunk/src/interface.c trunk/src/keyfile.c trunk/src/main.c trunk/src/prefs.c trunk/src/prefs.h trunk/src/ui_utils.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/ChangeLog 2006-10-29 01:28:58 UTC (rev 943) @@ -1,3 +1,12 @@ +2006-10-29 Enrico Tröger enrico.troeger@uvena.de + + * geany.glade, src/interface.c, src/prefs.c, src/geany.h, + src/keyfile.c, src/ui_utils.c, src/main.c: + Added an Apply button to preferences dialog. + New setting to show/hide the Quit toolbar item. + New setting to show/hide notebook tabs. + + 2006-10-28 Nick Treleaven nick.treleaven@btinternet.com
* src/ui_utils.c:
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/geany.glade 2006-10-29 01:28:58 UTC (rev 943) @@ -2672,11 +2672,23 @@ <property name="layout_style">GTK_BUTTONBOX_END</property>
<child> - <widget class="GtkButton" id="cancelbutton1"> + <widget class="GtkButton" id="button3"> <property name="visible">True</property> <property name="can_default">True</property> <property name="can_focus">True</property> - <property name="has_focus">True</property> + <property name="label">gtk-apply</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-10</property> + </widget> + </child> + + <child> + <widget class="GtkButton" id="button4"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> <property name="label">gtk-cancel</property> <property name="use_stock">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> @@ -2686,9 +2698,10 @@ </child>
<child> - <widget class="GtkButton" id="okbutton1"> + <widget class="GtkButton" id="button5"> <property name="visible">True</property> <property name="can_default">True</property> + <property name="has_default">True</property> <property name="can_focus">True</property> <property name="label">gtk-ok</property> <property name="use_stock">True</property> @@ -2882,73 +2895,159 @@ </child>
<child> - <widget class="GtkHBox" id="hbox2"> + <widget class="GtkFrame" id="frame15"> <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">20</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_NONE</property>
<child> - <widget class="GtkLabel" id="label147"> + <widget class="GtkAlignment" id="alignment18"> <property name="visible">True</property> - <property name="label" translatable="yes">Recent files list length:</property> - <property name="use_underline">False</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> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">1</property> + + <child> + <widget class="GtkLabel" id="label150"> + <property name="visible">True</property> + <property name="label" translatable="yes">Placement of new file tabs: </property> + <property name="use_underline">False</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> + + <child> + <widget class="GtkRadioButton" id="radio_tab_left"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">New file tabs will be placed to the left of the tab list</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Left</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</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="label149"> + <property name="visible">True</property> + <property name="label"> </property> + <property name="use_underline">False</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> + + <child> + <widget class="GtkRadioButton" id="radio_tab_right"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">New file tabs will be placed to the right of the tab list</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Right</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radio_tab_left</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> </child>
<child> - <widget class="GtkSpinButton" id="spin_mru"> + <widget class="GtkCheckButton" id="check_show_notebook_tabs"> <property name="visible">True</property> - <property name="tooltip" translatable="yes">Specifies the number of files which are stored in the Recent files list.</property> <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">True</property> - <property name="adjustment">4 1 50 1 10 10</property> + <property name="label" translatable="yes">Show file tabs</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> + <property name="type">label_item</property> </packing> </child> </widget> <packing> <property name="padding">0</property> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> </packing> </child>
<child> - <widget class="GtkHBox" id="hbox3"> + <widget class="GtkHBox" id="hbox2"> <property name="visible">True</property> <property name="homogeneous">False</property> - <property name="spacing">1</property> + <property name="spacing">20</property>
<child> - <widget class="GtkLabel" id="label150"> + <widget class="GtkLabel" id="label147"> <property name="visible">True</property> - <property name="label" translatable="yes">Placement of new file tabs: </property> + <property name="label" translatable="yes">Recent files list length:</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2957,7 +3056,7 @@ <property name="xalign">0.5</property> <property name="yalign">0.5</property> <property name="xpad">0</property> - <property name="ypad">0</property> + <property name="ypad">7</property> <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> <property name="width_chars">-1</property> <property name="single_line_mode">False</property> @@ -2971,75 +3070,29 @@ </child>
<child> - <widget class="GtkRadioButton" id="radio_tab_left"> + <widget class="GtkSpinButton" id="spin_mru"> <property name="visible">True</property> - <property name="tooltip" translatable="yes">New file tabs will be placed to the left of the tab list</property> + <property name="tooltip" translatable="yes">Specifies the number of files which are stored in the Recent files list.</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Left</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">True</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">4 1 50 1 10 10</property> </widget> <packing> <property name="padding">0</property> <property name="expand">False</property> - <property name="fill">False</property> + <property name="fill">True</property> </packing> </child> - - <child> - <widget class="GtkLabel" id="label149"> - <property name="visible">True</property> - <property name="label"> </property> - <property name="use_underline">False</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> - - <child> - <widget class="GtkRadioButton" id="radio_tab_right"> - <property name="visible">True</property> - <property name="tooltip" translatable="yes">New file tabs will be placed to the right of the tab list</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Right</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radio_tab_left</property> - </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">True</property> + <property name="fill">False</property> </packing> </child> </widget> @@ -4145,6 +4198,25 @@ <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="check_toolbar_quit"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Display the quit button in the toolbar</property> + <property name="label" translatable="yes">Show Quit button</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> </child> </widget>
Modified: trunk/src/geany.h =================================================================== --- trunk/src/geany.h 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/geany.h 2006-10-29 01:28:58 UTC (rev 943) @@ -88,6 +88,7 @@ gboolean fullscreen; gboolean beep_on_errors; gboolean switch_msgwin_pages; + gboolean show_notebook_tabs; gboolean tab_order_ltr; gboolean show_markers_margin; gboolean show_linenumber_margin; @@ -119,6 +120,7 @@ gboolean pref_toolbar_show_zoom; gboolean pref_toolbar_show_colour; gboolean pref_toolbar_show_fileops; + gboolean pref_toolbar_show_quit; gint tab_pos_editor; gint tab_pos_msgwin; gint tab_pos_sidebar;
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/interface.c 2006-10-29 01:28:58 UTC (rev 943) @@ -2143,16 +2143,19 @@ GtkWidget *check_vte; GtkWidget *check_ask_for_quit; GtkWidget *label163; - GtkWidget *hbox2; - GtkWidget *label147; - GtkObject *spin_mru_adj; - GtkWidget *spin_mru; + GtkWidget *frame15; + GtkWidget *alignment18; GtkWidget *hbox3; GtkWidget *label150; GtkWidget *radio_tab_left; GSList *radio_tab_left_group = NULL; GtkWidget *label149; GtkWidget *radio_tab_right; + GtkWidget *check_show_notebook_tabs; + GtkWidget *hbox2; + GtkWidget *label147; + GtkObject *spin_mru_adj; + GtkWidget *spin_mru; GtkWidget *label162; GtkWidget *label94; GtkWidget *vbox14; @@ -2213,6 +2216,7 @@ GtkWidget *check_toolbar_undo; GtkWidget *check_toolbar_search; GtkWidget *check_toolbar_goto; + GtkWidget *check_toolbar_quit; GtkWidget *label165; GtkWidget *frame13; GtkWidget *alignment16; @@ -2316,8 +2320,9 @@ GtkWidget *button2; GtkWidget *label151; GtkWidget *dialog_action_area3; - GtkWidget *cancelbutton1; - GtkWidget *okbutton1; + GtkWidget *button3; + GtkWidget *button4; + GtkWidget *button5; GtkTooltips *tooltips;
tooltips = gtk_tooltips_new (); @@ -2394,25 +2399,19 @@ gtk_widget_show (label163); gtk_box_pack_start (GTK_BOX (vbox4), label163, FALSE, FALSE, 0);
- hbox2 = gtk_hbox_new (FALSE, 20); - gtk_widget_show (hbox2); - gtk_box_pack_start (GTK_BOX (vbox4), hbox2, FALSE, TRUE, 0); + frame15 = gtk_frame_new (NULL); + gtk_widget_show (frame15); + gtk_box_pack_start (GTK_BOX (vbox4), frame15, FALSE, FALSE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame15), GTK_SHADOW_NONE);
- label147 = gtk_label_new (_("Recent files list length:")); - gtk_widget_show (label147); - gtk_box_pack_start (GTK_BOX (hbox2), label147, FALSE, FALSE, 0); + alignment18 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment18); + gtk_container_add (GTK_CONTAINER (frame15), alignment18); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment18), 0, 0, 12, 0);
- spin_mru_adj = gtk_adjustment_new (4, 1, 50, 1, 10, 10); - spin_mru = gtk_spin_button_new (GTK_ADJUSTMENT (spin_mru_adj), 1, 0); - gtk_widget_show (spin_mru); - gtk_box_pack_start (GTK_BOX (hbox2), spin_mru, FALSE, TRUE, 0); - gtk_tooltips_set_tip (tooltips, spin_mru, _("Specifies the number of files which are stored in the Recent files list."), NULL); - gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_mru), TRUE); - gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spin_mru), TRUE); - hbox3 = gtk_hbox_new (FALSE, 1); gtk_widget_show (hbox3); - gtk_box_pack_start (GTK_BOX (vbox4), hbox3, FALSE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (alignment18), hbox3);
label150 = gtk_label_new (_("Placement of new file tabs: ")); gtk_widget_show (label150); @@ -2437,6 +2436,27 @@ gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_tab_right), radio_tab_left_group); radio_tab_left_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_tab_right));
+ check_show_notebook_tabs = gtk_check_button_new_with_mnemonic (_("Show file tabs")); + gtk_widget_show (check_show_notebook_tabs); + gtk_frame_set_label_widget (GTK_FRAME (frame15), check_show_notebook_tabs); + + hbox2 = gtk_hbox_new (FALSE, 20); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (vbox4), hbox2, FALSE, FALSE, 0); + + label147 = gtk_label_new (_("Recent files list length:")); + gtk_widget_show (label147); + gtk_box_pack_start (GTK_BOX (hbox2), label147, FALSE, FALSE, 0); + gtk_misc_set_padding (GTK_MISC (label147), 0, 7); + + spin_mru_adj = gtk_adjustment_new (4, 1, 50, 1, 10, 10); + spin_mru = gtk_spin_button_new (GTK_ADJUSTMENT (spin_mru_adj), 1, 0); + gtk_widget_show (spin_mru); + gtk_box_pack_start (GTK_BOX (hbox2), spin_mru, FALSE, TRUE, 0); + gtk_tooltips_set_tip (tooltips, spin_mru, _("Specifies the number of files which are stored in the Recent files list."), NULL); + gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_mru), TRUE); + gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spin_mru), TRUE); + label162 = gtk_label_new (""); gtk_widget_show (label162); gtk_frame_set_label_widget (GTK_FRAME (frame10), label162); @@ -2797,6 +2817,13 @@ gtk_tooltips_set_tip (tooltips, check_toolbar_goto, _("Display the line number field and button in the toolbar"), NULL); gtk_button_set_focus_on_click (GTK_BUTTON (check_toolbar_goto), FALSE);
+ check_toolbar_quit = gtk_check_button_new_with_mnemonic (_("Show Quit button")); + gtk_widget_show (check_toolbar_quit); + gtk_box_pack_start (GTK_BOX (vbox16), check_toolbar_quit, FALSE, FALSE, 0); + GTK_WIDGET_UNSET_FLAGS (check_toolbar_quit, GTK_CAN_FOCUS); + gtk_tooltips_set_tip (tooltips, check_toolbar_quit, _("Display the quit button in the toolbar"), NULL); + gtk_button_set_focus_on_click (GTK_BUTTON (check_toolbar_quit), FALSE); + label165 = gtk_label_new (_("<b>Items</b>")); gtk_widget_show (label165); gtk_frame_set_label_widget (GTK_FRAME (frame11), label165); @@ -3364,16 +3391,21 @@ gtk_widget_show (dialog_action_area3); gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area3), GTK_BUTTONBOX_END);
- cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel"); - gtk_widget_show (cancelbutton1); - gtk_dialog_add_action_widget (GTK_DIALOG (prefs_dialog), cancelbutton1, GTK_RESPONSE_CANCEL); - GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT); + button3 = gtk_button_new_from_stock ("gtk-apply"); + gtk_widget_show (button3); + gtk_dialog_add_action_widget (GTK_DIALOG (prefs_dialog), button3, GTK_RESPONSE_APPLY); + GTK_WIDGET_SET_FLAGS (button3, GTK_CAN_DEFAULT);
- okbutton1 = gtk_button_new_from_stock ("gtk-ok"); - gtk_widget_show (okbutton1); - gtk_dialog_add_action_widget (GTK_DIALOG (prefs_dialog), okbutton1, GTK_RESPONSE_OK); - GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT); + button4 = gtk_button_new_from_stock ("gtk-cancel"); + gtk_widget_show (button4); + gtk_dialog_add_action_widget (GTK_DIALOG (prefs_dialog), button4, GTK_RESPONSE_CANCEL); + GTK_WIDGET_SET_FLAGS (button4, GTK_CAN_DEFAULT);
+ button5 = gtk_button_new_from_stock ("gtk-ok"); + gtk_widget_show (button5); + gtk_dialog_add_action_widget (GTK_DIALOG (prefs_dialog), button5, GTK_RESPONSE_OK); + GTK_WIDGET_SET_FLAGS (button5, GTK_CAN_DEFAULT); + /* 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"); @@ -3388,14 +3420,17 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, check_vte, "check_vte"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_ask_for_quit, "check_ask_for_quit"); GLADE_HOOKUP_OBJECT (prefs_dialog, label163, "label163"); - GLADE_HOOKUP_OBJECT (prefs_dialog, hbox2, "hbox2"); - GLADE_HOOKUP_OBJECT (prefs_dialog, label147, "label147"); - GLADE_HOOKUP_OBJECT (prefs_dialog, spin_mru, "spin_mru"); + GLADE_HOOKUP_OBJECT (prefs_dialog, frame15, "frame15"); + GLADE_HOOKUP_OBJECT (prefs_dialog, alignment18, "alignment18"); GLADE_HOOKUP_OBJECT (prefs_dialog, hbox3, "hbox3"); GLADE_HOOKUP_OBJECT (prefs_dialog, label150, "label150"); GLADE_HOOKUP_OBJECT (prefs_dialog, radio_tab_left, "radio_tab_left"); GLADE_HOOKUP_OBJECT (prefs_dialog, label149, "label149"); GLADE_HOOKUP_OBJECT (prefs_dialog, radio_tab_right, "radio_tab_right"); + GLADE_HOOKUP_OBJECT (prefs_dialog, check_show_notebook_tabs, "check_show_notebook_tabs"); + GLADE_HOOKUP_OBJECT (prefs_dialog, hbox2, "hbox2"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label147, "label147"); + GLADE_HOOKUP_OBJECT (prefs_dialog, spin_mru, "spin_mru"); GLADE_HOOKUP_OBJECT (prefs_dialog, label162, "label162"); GLADE_HOOKUP_OBJECT (prefs_dialog, label94, "label94"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox14, "vbox14"); @@ -3454,6 +3489,7 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, check_toolbar_undo, "check_toolbar_undo"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_toolbar_search, "check_toolbar_search"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_toolbar_goto, "check_toolbar_goto"); + GLADE_HOOKUP_OBJECT (prefs_dialog, check_toolbar_quit, "check_toolbar_quit"); GLADE_HOOKUP_OBJECT (prefs_dialog, label165, "label165"); GLADE_HOOKUP_OBJECT (prefs_dialog, frame13, "frame13"); GLADE_HOOKUP_OBJECT (prefs_dialog, alignment16, "alignment16"); @@ -3553,11 +3589,12 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, button2, "button2"); GLADE_HOOKUP_OBJECT (prefs_dialog, label151, "label151"); GLADE_HOOKUP_OBJECT_NO_REF (prefs_dialog, dialog_action_area3, "dialog_action_area3"); - GLADE_HOOKUP_OBJECT (prefs_dialog, cancelbutton1, "cancelbutton1"); - GLADE_HOOKUP_OBJECT (prefs_dialog, okbutton1, "okbutton1"); + GLADE_HOOKUP_OBJECT (prefs_dialog, button3, "button3"); + GLADE_HOOKUP_OBJECT (prefs_dialog, button4, "button4"); + GLADE_HOOKUP_OBJECT (prefs_dialog, button5, "button5"); GLADE_HOOKUP_OBJECT_NO_REF (prefs_dialog, tooltips, "tooltips");
- gtk_widget_grab_focus (cancelbutton1); + gtk_widget_grab_default (button5); return prefs_dialog; }
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/keyfile.c 2006-10-29 01:28:58 UTC (rev 943) @@ -113,6 +113,7 @@ g_key_file_set_boolean(config, PACKAGE, "show_line_endings", app->pref_editor_show_line_endings); g_key_file_set_boolean(config, PACKAGE, "fullscreen", app->fullscreen); g_key_file_set_boolean(config, PACKAGE, "tab_order_ltr", app->tab_order_ltr); + g_key_file_set_boolean(config, PACKAGE, "show_notebook_tabs", app->show_notebook_tabs); g_key_file_set_boolean(config, PACKAGE, "brace_match_ltgt", app->brace_match_ltgt); g_key_file_set_boolean(config, PACKAGE, "switch_msgwin_pages", app->switch_msgwin_pages); g_key_file_set_boolean(config, PACKAGE, "auto_close_xml_tags", app->pref_editor_auto_close_xml_tags); @@ -165,6 +166,7 @@ g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show_compile", app->pref_toolbar_show_compile); g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show_colour", app->pref_toolbar_show_colour); g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show_fileops", app->pref_toolbar_show_fileops); + g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show_quit", app->pref_toolbar_show_quit); g_key_file_set_integer(config, PACKAGE, "pref_toolbar_icon_style", app->toolbar_icon_style); g_key_file_set_integer(config, PACKAGE, "pref_toolbar_icon_size", app->toolbar_icon_size); g_key_file_set_boolean(config, PACKAGE, "pref_editor_new_line", app->pref_editor_new_line); @@ -313,6 +315,7 @@ app->show_linenumber_margin = utils_get_setting_boolean(config, PACKAGE, "show_linenumber_margin", TRUE); app->fullscreen = utils_get_setting_boolean(config, PACKAGE, "fullscreen", FALSE); app->tab_order_ltr = utils_get_setting_boolean(config, PACKAGE, "tab_order_ltr", FALSE); + app->show_notebook_tabs = utils_get_setting_boolean(config, PACKAGE, "show_notebook_tabs", TRUE); app->brace_match_ltgt = utils_get_setting_boolean(config, PACKAGE, "brace_match_ltgt", FALSE); app->switch_msgwin_pages = utils_get_setting_boolean(config, PACKAGE, "switch_msgwin_pages", FALSE); app->custom_date_format = utils_get_setting_string(config, PACKAGE, "custom_date_format", ""); @@ -365,6 +368,7 @@ app->pref_toolbar_show_undo = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_undo", FALSE); app->pref_toolbar_show_colour = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_colour", TRUE); app->pref_toolbar_show_fileops = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_fileops", TRUE); + app->pref_toolbar_show_quit = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_quit", TRUE); #ifdef HAVE_VTE vte_info.load_vte = utils_get_setting_boolean(config, "VTE", "load_vte", TRUE); if (vte_info.load_vte)
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/main.c 2006-10-29 01:28:58 UTC (rev 943) @@ -217,6 +217,9 @@ gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->treeview_notebook), app->tab_pos_sidebar);
ui_update_toolbar_items(); + + // whether to show notebook tabs or not + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), app->show_notebook_tabs); }
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/prefs.c 2006-10-29 01:28:58 UTC (rev 943) @@ -57,6 +57,8 @@ static gboolean on_keytype_dialog_response(GtkWidget *dialog, GdkEventKey *event, gpointer user_data); static void on_dialog_response(GtkWidget *dialog, gint response, gpointer user_data); static gboolean find_duplicate(guint idx, guint key, GdkModifierType mods, const gchar *action); +static void on_pref_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data); +static void on_pref_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data);
void prefs_init_dialog(void) @@ -86,6 +88,12 @@ widget = lookup_widget(app->prefs_dialog, "check_ask_for_quit"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_confirm_exit);
+ widget = lookup_widget(app->prefs_dialog, "check_show_notebook_tabs"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->show_notebook_tabs); + // disable following setting if notebook tabs are hidden + on_pref_show_notebook_tabs_toggled(GTK_TOGGLE_BUTTON( + lookup_widget(app->prefs_dialog, "check_show_notebook_tabs")), NULL); + if (app->tab_order_ltr) widget = lookup_widget(app->prefs_dialog, "radio_tab_right"); else @@ -161,7 +169,10 @@ widget = lookup_widget(app->prefs_dialog, "check_toolbar_fileops"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_toolbar_show_fileops);
+ widget = lookup_widget(app->prefs_dialog, "check_toolbar_quit"); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_toolbar_show_quit);
+ switch (app->toolbar_icon_style) { case 0: widget = lookup_widget(app->prefs_dialog, "radio_toolbar_image"); break; @@ -356,14 +367,13 @@ #endif }
-//gtk_notebook_set_tab_pos
/* * callbacks */ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_data) { - if (response == GTK_RESPONSE_OK) + if (response == GTK_RESPONSE_OK || response == GTK_RESPONSE_APPLY) { GtkWidget *widget; guint i; @@ -390,7 +400,10 @@ widget = lookup_widget(app->prefs_dialog, "radio_tab_right"); app->tab_order_ltr = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = lookup_widget(app->prefs_dialog, "check_show_notebook_tabs"); + app->show_notebook_tabs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ // Interface settings widget = lookup_widget(app->prefs_dialog, "check_list_symbol"); app->sidebar_symbol_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); @@ -446,6 +459,9 @@ widget = lookup_widget(app->prefs_dialog, "check_toolbar_fileops"); app->pref_toolbar_show_fileops = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ widget = lookup_widget(app->prefs_dialog, "check_toolbar_quit"); + app->pref_toolbar_show_quit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); + widget = lookup_widget(app->prefs_dialog, "radio_toolbar_imagetext"); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) app->toolbar_icon_style = 2; else @@ -603,6 +619,7 @@ ui_update_toolbar_icons(app->toolbar_icon_size); gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), app->toolbar_icon_style); ui_treeviews_show_hide(FALSE); + gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), app->show_notebook_tabs);
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->notebook), app->tab_pos_editor); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(msgwindow.notebook), app->tab_pos_msgwin); @@ -621,8 +638,12 @@ // store all settings configuration_save(); } - gtk_list_store_clear(store); - gtk_widget_hide(GTK_WIDGET(dialog)); + + if (response != GTK_RESPONSE_APPLY) + { + gtk_list_store_clear(store); + gtk_widget_hide(GTK_WIDGET(dialog)); + } }
@@ -724,7 +745,6 @@ }
- static gboolean on_prefs_tree_view_button_press_event( GtkWidget *widget, GdkEventButton *event, gpointer user_data) { @@ -883,7 +903,7 @@ }
-void on_pref_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data) +static void on_pref_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data) { gboolean sens = gtk_toggle_button_get_active(togglebutton);
@@ -892,6 +912,14 @@ }
+static void on_pref_show_notebook_tabs_toggled(GtkToggleButton *togglebutton, gpointer user_data) +{ + gboolean sens = gtk_toggle_button_get_active(togglebutton); + + gtk_widget_set_sensitive(lookup_widget(app->prefs_dialog, "hbox3"), sens); +} + + void dialogs_show_prefs_dialog(void) { if (app->prefs_dialog == NULL) @@ -1120,6 +1148,8 @@
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "check_toolbar_show"), "toggled", G_CALLBACK(on_pref_toolbar_show_toggled), NULL); + g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "check_show_notebook_tabs"), + "toggled", G_CALLBACK(on_pref_show_notebook_tabs_toggled), NULL);
}
Modified: trunk/src/prefs.h =================================================================== --- trunk/src/prefs.h 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/prefs.h 2006-10-29 01:28:58 UTC (rev 943) @@ -33,8 +33,6 @@
void on_prefs_color_choosed(GtkColorButton *widget, gpointer user_data);
-void on_pref_toolbar_show_toggled(GtkToggleButton *togglebutton, gpointer user_data); - void dialogs_show_prefs_dialog(void);
#endif
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2006-10-29 01:25:47 UTC (rev 942) +++ trunk/src/ui_utils.c 2006-10-29 01:28:58 UTC (rev 943) @@ -767,6 +767,9 @@ ui_widget_show_hide(lookup_widget(app->window, "toolbutton_undo"), app->pref_toolbar_show_undo); ui_widget_show_hide(lookup_widget(app->window, "toolbutton_redo"), app->pref_toolbar_show_undo); ui_widget_show_hide(lookup_widget(app->window, "separatortoolitem9"), app->pref_toolbar_show_undo); + // quit + ui_widget_show_hide(lookup_widget(app->window, "toolbutton19"), app->pref_toolbar_show_quit); + ui_widget_show_hide(lookup_widget(app->window, "separatortoolitem8"), app->pref_toolbar_show_quit); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.