Revision: 3452 http://geany.svn.sourceforge.net/geany/?rev=3452&view=rev Author: ntrel Date: 2009-01-08 17:14:18 +0000 (Thu, 08 Jan 2009)
Log Message: ----------- Fix using prefs dialog editor & files tab spin button values when they've just been edited and Alt-O is used to close the dialog without moving the focus.
Modified Paths: -------------- trunk/ChangeLog trunk/src/keyfile.c trunk/src/prefs.c trunk/src/stash.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-01-06 17:13:45 UTC (rev 3451) +++ trunk/ChangeLog 2009-01-08 17:14:18 UTC (rev 3452) @@ -1,3 +1,11 @@ +2009-01-08 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/prefs.c, src/stash.c, src/keyfile.c: + Fix using prefs dialog editor & files tab spin button values when + they've just been edited and Alt-O is used to close the dialog + without moving the focus. + + 2009-01-06 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* tagmanager/basic.c:
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2009-01-06 17:13:45 UTC (rev 3451) +++ trunk/src/keyfile.c 2009-01-08 17:14:18 UTC (rev 3452) @@ -126,6 +126,7 @@ stash_group_add_toggle_button(group, &search_prefs.use_current_word, "pref_main_search_use_current_word", TRUE, "check_search_use_current_word");
+ /* editor */ stash_group_add_toggle_button(group, &editor_prefs.indentation->detect_type, "check_detect_indent", FALSE, "check_detect_indent"); stash_group_add_toggle_button(group, &editor_prefs.use_tab_to_indent, @@ -146,6 +147,12 @@ "autocompletion_max_entries", GEANY_MAX_AUTOCOMPLETE_WORDS, "spin_autocompletion_max_entries");
+ /* files */ + stash_group_add_spin_button_integer(group, (gint*)&file_prefs.mru_length, + "mru_length", GEANY_DEFAULT_MRU_LENGTH, "spin_mru"); + stash_group_add_spin_button_integer(group, &file_prefs.disk_check_timeout, + "disk_check_timeout", GEANY_DISK_CHECK_TIMEOUT, "spin_disk_check"); + /* hidden prefs (don't overwrite them so users can edit them manually) */ group = stash_group_new(PACKAGE); configuration_add_pref_group(group, FALSE); @@ -365,8 +372,6 @@ g_key_file_set_boolean(config, PACKAGE, "pref_editor_new_line", file_prefs.final_new_line); g_key_file_set_boolean(config, PACKAGE, "pref_editor_replace_tabs", file_prefs.replace_tabs); g_key_file_set_boolean(config, PACKAGE, "pref_editor_trail_space", file_prefs.strip_trailing_spaces); - g_key_file_set_integer(config, PACKAGE, "mru_length", file_prefs.mru_length); - g_key_file_set_integer(config, PACKAGE, "disk_check_timeout", file_prefs.disk_check_timeout);
/* toolbar */ g_key_file_set_boolean(config, PACKAGE, "pref_toolbar_show", toolbar_prefs.visible); @@ -658,9 +663,6 @@ file_prefs.replace_tabs = utils_get_setting_boolean(config, PACKAGE, "pref_editor_replace_tabs", FALSE); file_prefs.final_new_line = utils_get_setting_boolean(config, PACKAGE, "pref_editor_new_line", TRUE); file_prefs.strip_trailing_spaces = utils_get_setting_boolean(config, PACKAGE, "pref_editor_trail_space", FALSE); - file_prefs.mru_length = utils_get_setting_integer(config, PACKAGE, "mru_length", GEANY_DEFAULT_MRU_LENGTH); - file_prefs.disk_check_timeout = utils_get_setting_integer(config, PACKAGE, - "disk_check_timeout", GEANY_DISK_CHECK_TIMEOUT);
/* toolbar */ toolbar_prefs.visible = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show", TRUE);
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2009-01-06 17:13:45 UTC (rev 3451) +++ trunk/src/prefs.c 2009-01-08 17:14:18 UTC (rev 3452) @@ -334,13 +334,7 @@ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_tab_left"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
- widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_mru"); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), file_prefs.mru_length);
- widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_disk_check"); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), file_prefs.disk_check_timeout); - - widget = ui_lookup_widget(ui_widgets.prefs_dialog, "combo_new_encoding"); /* luckily the index of the combo box items match the index of the encodings array */ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), file_prefs.default_new_encoding); @@ -726,12 +720,6 @@ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_tab_right"); file_prefs.tab_order_ltr = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
- widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_mru"); - file_prefs.mru_length = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); - - widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_disk_check"); - file_prefs.disk_check_timeout = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); - widget = ui_lookup_widget(ui_widgets.prefs_dialog, "combo_new_encoding"); file_prefs.default_new_encoding = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
Modified: trunk/src/stash.c =================================================================== --- trunk/src/stash.c 2009-01-06 17:13:45 UTC (rev 3451) +++ trunk/src/stash.c 2009-01-08 17:14:18 UTC (rev 3452) @@ -354,6 +354,8 @@ gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), *setting); break; case PREF_UPDATE: + /* if the widget is focussed, the value might not be updated */ + gtk_spin_button_update(GTK_SPIN_BUTTON(widget)); *setting = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); break; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.