summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtkfilechooserdefault.c5
-rw-r--r--gtk/gtkfilechooserprivate.h6
-rw-r--r--gtk/org.gtk.Settings.FileChooser.gschema.xml8
3 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 2d1923d77e..57a445eed9 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -275,6 +275,7 @@ typedef enum {
#define SETTINGS_KEY_SORT_ORDER "sort-order"
#define SETTINGS_KEY_WINDOW_POSITION "window-position"
#define SETTINGS_KEY_WINDOW_SIZE "window-size"
+#define SETTINGS_KEY_STARTUP_MODE "startup-mode"
static void gtk_file_chooser_default_iface_init (GtkFileChooserIface *iface);
static void gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface);
@@ -6155,6 +6156,7 @@ settings_load (GtkFileChooserDefault *impl)
gboolean show_size_column;
gint sort_column;
GtkSortType sort_order;
+ StartupMode startup_mode;
settings_ensure (impl);
@@ -6163,6 +6165,7 @@ settings_load (GtkFileChooserDefault *impl)
show_size_column = g_settings_get_boolean (impl->settings, SETTINGS_KEY_SHOW_SIZE_COLUMN);
sort_column = g_settings_get_enum (impl->settings, SETTINGS_KEY_SORT_COLUMN);
sort_order = g_settings_get_enum (impl->settings, SETTINGS_KEY_SORT_ORDER);
+ startup_mode = g_settings_get_enum (impl->settings, SETTINGS_KEY_STARTUP_MODE);
location_mode_set (impl, location_mode, TRUE);
@@ -6177,6 +6180,8 @@ settings_load (GtkFileChooserDefault *impl)
* created yet. The individual functions that create and set the models will
* call set_sort_column() themselves.
*/
+
+ impl->startup_mode = startup_mode;
}
static void
diff --git a/gtk/gtkfilechooserprivate.h b/gtk/gtkfilechooserprivate.h
index 7be9a56d60..3256fd9560 100644
--- a/gtk/gtkfilechooserprivate.h
+++ b/gtk/gtkfilechooserprivate.h
@@ -151,6 +151,11 @@ typedef enum {
OPERATION_MODE_RECENT
} OperationMode;
+typedef enum {
+ STARTUP_MODE_RECENT,
+ STARTUP_MODE_CWD
+} StartupMode;
+
#define REMOVE_FOR_PLACES_SIDEBAR 0
struct _GtkFileChooserDefault
@@ -199,6 +204,7 @@ struct _GtkFileChooserDefault
char *browse_files_last_selected_name;
GtkWidget *places_sidebar;
+ StartupMode startup_mode;
/* OPERATION_MODE_SEARCH */
GtkWidget *search_hbox;
diff --git a/gtk/org.gtk.Settings.FileChooser.gschema.xml b/gtk/org.gtk.Settings.FileChooser.gschema.xml
index 849e8ff77b..5bef095cee 100644
--- a/gtk/org.gtk.Settings.FileChooser.gschema.xml
+++ b/gtk/org.gtk.Settings.FileChooser.gschema.xml
@@ -33,6 +33,11 @@
<value nick='descending' value='1'/>
</enum>
+ <enum id='org.gtk.Settings.FileChooser.StartupMode'>
+ <value nick='recent' value='0'/>
+ <value nick='cwd' value='1'/>
+ </enum>
+
<schema id='org.gtk.Settings.FileChooser'>
<key name='last-folder-uri' type='s'>
<default>""</default>
@@ -61,6 +66,9 @@
<key name='window-size' type='(ii)'>
<default>(-1, -1)</default>
</key>
+ <key name='startup-mode' enum='org.gtk.Settings.FileChooser.StartupMode'>
+ <default>'recent'</default>
+ </key>
</schema>
</schemalist>