comparison src/preferences.c @ 1511:73cecf473802

startup path options simplified and moved to layout options
author nadvornik
date Sat, 04 Apr 2009 21:14:34 +0000
parents ad5018434476
children 0a1266bde95b
comparison
equal deleted inserted replaced
1510:ad5018434476 1511:73cecf473802
94 #ifdef DEBUG 94 #ifdef DEBUG
95 static gint debug_c; 95 static gint debug_c;
96 #endif 96 #endif
97 97
98 static GtkWidget *configwindow = NULL; 98 static GtkWidget *configwindow = NULL;
99 static GtkWidget *startup_path_entry;
100 static GtkListStore *filter_store = NULL; 99 static GtkListStore *filter_store = NULL;
101 100
102 static GtkWidget *safe_delete_path_entry; 101 static GtkWidget *safe_delete_path_entry;
103 102
104 static GtkWidget *color_profile_input_file_entry[COLOR_PROFILE_INPUTS]; 103 static GtkWidget *color_profile_input_file_entry[COLOR_PROFILE_INPUTS];
114 /* 113 /*
115 *----------------------------------------------------------------------------- 114 *-----------------------------------------------------------------------------
116 * option widget callbacks (private) 115 * option widget callbacks (private)
117 *----------------------------------------------------------------------------- 116 *-----------------------------------------------------------------------------
118 */ 117 */
119
120 static void startup_path_set_current(GtkWidget *widget, gpointer data)
121 {
122 gtk_entry_set_text(GTK_ENTRY(startup_path_entry), layout_get_path(NULL));
123 }
124 118
125 static void zoom_mode_cb(GtkWidget *widget, gpointer data) 119 static void zoom_mode_cb(GtkWidget *widget, gpointer data)
126 { 120 {
127 if (GTK_TOGGLE_BUTTON (widget)->active) 121 if (GTK_TOGGLE_BUTTON (widget)->active)
128 c_options->image.zoom_mode = GPOINTER_TO_INT(data); 122 c_options->image.zoom_mode = GPOINTER_TO_INT(data);
228 222
229 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE; 223 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE;
230 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE; 224 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE;
231 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE; 225 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE;
232 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE; 226 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE;
233
234 options->startup.restore_path = c_options->startup.restore_path;
235 options->startup.use_last_path = c_options->startup.use_last_path;
236 config_entry_to_option(startup_path_entry, &options->startup.path, remove_trailing_slash);
237 227
238 options->file_ops.confirm_delete = c_options->file_ops.confirm_delete; 228 options->file_ops.confirm_delete = c_options->file_ops.confirm_delete;
239 options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key; 229 options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key;
240 options->file_ops.safe_delete_enable = c_options->file_ops.safe_delete_enable; 230 options->file_ops.safe_delete_enable = c_options->file_ops.safe_delete_enable;
241 options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize; 231 options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize;
911 } 901 }
912 902
913 /* general options tab */ 903 /* general options tab */
914 static void config_tab_general(GtkWidget *notebook) 904 static void config_tab_general(GtkWidget *notebook)
915 { 905 {
916 GtkWidget *hbox;
917 GtkWidget *vbox; 906 GtkWidget *vbox;
918 GtkWidget *subvbox;
919 GtkWidget *group; 907 GtkWidget *group;
920 GtkWidget *subgroup; 908 GtkWidget *subgroup;
921 GtkWidget *button; 909 GtkWidget *button;
922 GtkWidget *tabcomp;
923 GtkWidget *ct_button; 910 GtkWidget *ct_button;
924 GtkWidget *table; 911 GtkWidget *table;
925 GtkWidget *spin; 912 GtkWidget *spin;
926 913
927 vbox = scrolled_notebook_page(notebook, _("General")); 914 vbox = scrolled_notebook_page(notebook, _("General"));
928
929 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL);
930
931 button = pref_checkbox_new_int(group, _("Restore folder on startup"),
932 options->startup.restore_path, &c_options->startup.restore_path);
933
934 subvbox = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE);
935 pref_checkbox_link_sensitivity(button, subvbox);
936
937 hbox = pref_box_new(subvbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
938
939 tabcomp = tab_completion_new(&startup_path_entry, options->startup.path, NULL, NULL);
940 tab_completion_add_select_button(startup_path_entry, NULL, TRUE);
941 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
942 gtk_widget_show(tabcomp);
943
944 button = pref_button_new(hbox, NULL, _("Use current"), FALSE,
945 G_CALLBACK(startup_path_set_current), NULL);
946
947 button = pref_checkbox_new_int(subvbox, _("Use last path"),
948 options->startup.use_last_path, &c_options->startup.use_last_path);
949 pref_checkbox_link_sensitivity_swap(button, hbox);
950
951 915
952 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); 916 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL);
953 917
954 table = pref_table_new(group, 2, 2, FALSE, FALSE); 918 table = pref_table_new(group, 2, 2, FALSE, FALSE);
955 add_thumb_size_menu(table, 0, 0, _("Size:")); 919 add_thumb_size_menu(table, 0, 0, _("Size:"));