comparison src/preferences.c @ 630:83d3ded39e49

An option to save and restore the last path used was added. This option appears as startup.use_last_path in rc file. Preferences > General > Startup was modified accordingly.
author zas_
date Sun, 11 May 2008 13:14:58 +0000
parents 1fa2cb6d9d65
children e34c1002e553
comparison
equal deleted inserted replaced
629:1fa2cb6d9d65 630:83d3ded39e49
171 buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i])); 171 buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i]));
172 if (buf && strlen(buf) > 0) options->editor_command[i] = g_strdup(buf); 172 if (buf && strlen(buf) > 0) options->editor_command[i] = g_strdup(buf);
173 } 173 }
174 layout_edit_update_all(); 174 layout_edit_update_all();
175 175
176 g_free(options->file_ops.safe_delete_path);
177 options->file_ops.safe_delete_path = NULL;
178 buf = gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry));
179 if (buf && strlen(buf) > 0) options->file_ops.safe_delete_path = remove_trailing_slash(buf);
180
181 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE;
182 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE;
183 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE;
184 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE;
185
186 options->startup.restore_path = c_options->startup.restore_path;
187 options->startup.use_last_path = c_options->startup.use_last_path;
176 g_free(options->startup.path); 188 g_free(options->startup.path);
177 options->startup.path = NULL; 189 options->startup.path = NULL;
178 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry)); 190 buf = gtk_entry_get_text(GTK_ENTRY(startup_path_entry));
179 if (buf && strlen(buf) > 0) options->startup.path = remove_trailing_slash(buf); 191 if (buf && strlen(buf) > 0) options->startup.path = remove_trailing_slash(buf);
180 192
181 g_free(options->file_ops.safe_delete_path);
182 options->file_ops.safe_delete_path = NULL;
183 buf = gtk_entry_get_text(GTK_ENTRY(safe_delete_path_entry));
184 if (buf && strlen(buf) > 0) options->file_ops.safe_delete_path = remove_trailing_slash(buf);
185
186 if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE;
187 if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE;
188 if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE;
189 if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE;
190
191 options->startup.restore_path = c_options->startup.restore_path;
192 options->file_ops.confirm_delete = c_options->file_ops.confirm_delete; 193 options->file_ops.confirm_delete = c_options->file_ops.confirm_delete;
193 options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key; 194 options->file_ops.enable_delete_key = c_options->file_ops.enable_delete_key;
194 options->file_ops.safe_delete_enable = c_options->file_ops.safe_delete_enable; 195 options->file_ops.safe_delete_enable = c_options->file_ops.safe_delete_enable;
195 options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize; 196 options->file_ops.safe_delete_folder_maxsize = c_options->file_ops.safe_delete_folder_maxsize;
196 options->layout.tools_restore_state = c_options->layout.tools_restore_state; 197 options->layout.tools_restore_state = c_options->layout.tools_restore_state;
839 static void config_tab_general(GtkWidget *notebook) 840 static void config_tab_general(GtkWidget *notebook)
840 { 841 {
841 GtkWidget *label; 842 GtkWidget *label;
842 GtkWidget *hbox; 843 GtkWidget *hbox;
843 GtkWidget *vbox; 844 GtkWidget *vbox;
845 GtkWidget *subvbox;
844 GtkWidget *group; 846 GtkWidget *group;
845 GtkWidget *subgroup; 847 GtkWidget *subgroup;
846 GtkWidget *button; 848 GtkWidget *button;
847 GtkWidget *tabcomp; 849 GtkWidget *tabcomp;
848 GtkWidget *ct_button; 850 GtkWidget *ct_button;
855 label = gtk_label_new(_("General")); 857 label = gtk_label_new(_("General"));
856 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label); 858 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, label);
857 859
858 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL); 860 group = pref_group_new(vbox, FALSE, _("Startup"), GTK_ORIENTATION_VERTICAL);
859 861
860 button = pref_checkbox_new_int(group, _("Change to folder:"), 862 button = pref_checkbox_new_int(group, _("Restore folder on startup"),
861 options->startup.restore_path, &c_options->startup.restore_path); 863 options->startup.restore_path, &c_options->startup.restore_path);
862 864
863 hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); 865 subvbox = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_SPACE);
864 pref_checkbox_link_sensitivity(button, hbox); 866 pref_checkbox_link_sensitivity(button, subvbox);
867
868 hbox = pref_box_new(subvbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
865 869
866 tabcomp = tab_completion_new(&startup_path_entry, options->startup.path, NULL, NULL); 870 tabcomp = tab_completion_new(&startup_path_entry, options->startup.path, NULL, NULL);
867 tab_completion_add_select_button(startup_path_entry, NULL, TRUE); 871 tab_completion_add_select_button(startup_path_entry, NULL, TRUE);
868 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0); 872 gtk_box_pack_start(GTK_BOX(hbox), tabcomp, TRUE, TRUE, 0);
869 gtk_widget_show(tabcomp); 873 gtk_widget_show(tabcomp);
870 874
871 button = pref_button_new(hbox, NULL, _("Use current"), FALSE, 875 button = pref_button_new(hbox, NULL, _("Use current"), FALSE,
872 G_CALLBACK(startup_path_set_current), NULL); 876 G_CALLBACK(startup_path_set_current), NULL);
877
878 button = pref_checkbox_new_int(subvbox, _("Use last path"),
879 options->startup.use_last_path, &c_options->startup.use_last_path);
880 pref_checkbox_link_sensitivity_swap(button, hbox);
881
873 882
874 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL); 883 group = pref_group_new(vbox, FALSE, _("Thumbnails"), GTK_ORIENTATION_VERTICAL);
875 884
876 table = pref_table_new(group, 2, 2, FALSE, FALSE); 885 table = pref_table_new(group, 2, 2, FALSE, FALSE);
877 add_thumb_size_menu(table, 0, 0, _("Size:")); 886 add_thumb_size_menu(table, 0, 0, _("Size:"));