Skip to content

Commit

Permalink
Use the Stash for the auto-sort settings
Browse files Browse the repository at this point in the history
  • Loading branch information
konsolebox committed Jul 24, 2016
1 parent 7e7d375 commit db8d823
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/keyfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ static void init_pref_groups(void)
"radio_msgwin_vertical", GTK_ORIENTATION_VERTICAL,
"radio_msgwin_horizontal", GTK_ORIENTATION_HORIZONTAL,
NULL);
stash_group_add_toggle_button(group, &interface_prefs.auto_sort_tabs_filename,
"auto_sort_tabs_filename", FALSE, "check_auto_sort_tabs_filename");
stash_group_add_toggle_button(group, &interface_prefs.auto_sort_tabs_pathname,
"auto_sort_tabs_pathname", FALSE, "check_auto_sort_tabs_pathname");

/* editor display */
stash_group_add_toggle_button(group, &interface_prefs.highlighting_invert_all,
Expand Down Expand Up @@ -430,8 +434,6 @@ static void save_dialog_prefs(GKeyFile *config)
g_key_file_set_string(config, PACKAGE, "tagbar_font", interface_prefs.tagbar_font);
g_key_file_set_string(config, PACKAGE, "msgwin_font", interface_prefs.msgwin_font);
g_key_file_set_boolean(config, PACKAGE, "show_notebook_tabs", interface_prefs.show_notebook_tabs);
g_key_file_set_boolean(config, PACKAGE, "auto_sort_tabs_filename", interface_prefs.auto_sort_tabs_filename);
g_key_file_set_boolean(config, PACKAGE, "auto_sort_tabs_pathname", interface_prefs.auto_sort_tabs_pathname);
g_key_file_set_boolean(config, PACKAGE, "show_tab_cross", file_prefs.show_tab_cross);
g_key_file_set_boolean(config, PACKAGE, "tab_order_ltr", file_prefs.tab_order_ltr);
g_key_file_set_boolean(config, PACKAGE, "tab_order_beside", file_prefs.tab_order_beside);
Expand Down Expand Up @@ -779,8 +781,6 @@ static void load_dialog_prefs(GKeyFile *config)
file_prefs.tab_order_ltr = utils_get_setting_boolean(config, PACKAGE, "tab_order_ltr", TRUE);
file_prefs.tab_order_beside = utils_get_setting_boolean(config, PACKAGE, "tab_order_beside", FALSE);
interface_prefs.show_notebook_tabs = utils_get_setting_boolean(config, PACKAGE, "show_notebook_tabs", TRUE);
interface_prefs.auto_sort_tabs_filename = utils_get_setting_boolean(config, PACKAGE, "auto_sort_tabs_filename", FALSE);
interface_prefs.auto_sort_tabs_pathname = utils_get_setting_boolean(config, PACKAGE, "auto_sort_tabs_pathname", FALSE);
if (interface_prefs.auto_sort_tabs_filename && interface_prefs.auto_sort_tabs_pathname)
interface_prefs.auto_sort_tabs_filename = FALSE;
file_prefs.show_tab_cross = utils_get_setting_boolean(config, PACKAGE, "show_tab_cross", TRUE);
Expand Down
8 changes: 2 additions & 6 deletions src/prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,10 @@ static void prefs_init_dialog(void)
ui_lookup_widget(ui_widgets.prefs_dialog, "check_show_notebook_tabs")), NULL);

widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_auto_sort_tabs_filename");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), interface_prefs.auto_sort_tabs_filename);
on_auto_sort_tabs_filename_toggled(GTK_TOGGLE_BUTTON(
ui_lookup_widget(ui_widgets.prefs_dialog, "check_auto_sort_tabs_filename")), NULL);
on_auto_sort_tabs_pathname_toggled(GTK_TOGGLE_BUTTON(widget), NULL);

widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_auto_sort_tabs_pathname");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), interface_prefs.auto_sort_tabs_pathname);
on_auto_sort_tabs_pathname_toggled(GTK_TOGGLE_BUTTON(
ui_lookup_widget(ui_widgets.prefs_dialog, "check_auto_sort_tabs_pathname")), NULL);
on_auto_sort_tabs_pathname_toggled(GTK_TOGGLE_BUTTON(widget), NULL);

widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_show_tab_cross");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), file_prefs.show_tab_cross);
Expand Down

0 comments on commit db8d823

Please sign in to comment.