Remove the expander in Save mode, and the configuration key

This effectively makes the file chooser always be in 'expanded' mode.
Later, we'll move the pathbar to the 'Save in folder:' line.
Signed-off-by: Federico Mena Quintero's avatarFederico Mena Quintero <federico@gnome.org>
parent c2fc707b
......@@ -252,7 +252,6 @@ typedef enum {
#define SETTINGS_KEY_LOCATION_MODE "location-mode"
#define SETTINGS_KEY_SHOW_HIDDEN "show-hidden"
#define SETTINGS_KEY_EXPAND_FOLDERS "expand-folders"
#define SETTINGS_KEY_SHOW_SIZE_COLUMN "show-size-column"
#define SETTINGS_KEY_SORT_COLUMN "sort-column"
#define SETTINGS_KEY_SORT_ORDER "sort-order"
......@@ -4508,16 +4507,6 @@ file_pane_create (GtkFileChooserDefault *impl,
return vbox;
}
/* Callback used when the "Browse for more folders" expander is toggled */
static void
expander_changed_cb (GtkExpander *expander,
GParamSpec *pspec,
GtkFileChooserDefault *impl)
{
impl->expand_folders = gtk_expander_get_expanded(GTK_EXPANDER (impl->save_expander));
update_appearance (impl);
}
/* Callback used when the selection changes in the save folder combo box */
static void
save_folder_combo_changed_cb (GtkComboBox *combo,
......@@ -4676,7 +4665,6 @@ save_widgets_create (GtkFileChooserDefault *impl)
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *widget;
GtkWidget *alignment;
if (impl->save_widgets != NULL)
return;
......@@ -4732,17 +4720,6 @@ save_widgets_create (GtkFileChooserDefault *impl)
0, 0);
gtk_label_set_mnemonic_widget (GTK_LABEL (impl->save_folder_label), impl->save_folder_combo);
/* Expander */
alignment = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
impl->save_expander = gtk_expander_new_with_mnemonic (_("_Browse for other folders"));
gtk_container_add (GTK_CONTAINER (alignment), impl->save_expander);
g_signal_connect (impl->save_expander, "notify::expanded",
G_CALLBACK (expander_changed_cb),
impl);
gtk_widget_show_all (alignment);
impl->save_widgets = vbox;
gtk_box_pack_start (GTK_BOX (impl), impl->save_widgets, FALSE, FALSE, 0);
gtk_box_reorder_child (GTK_BOX (impl), impl->save_widgets, 0);
......@@ -4761,7 +4738,6 @@ save_widgets_destroy (GtkFileChooserDefault *impl)
impl->location_entry = NULL;
impl->save_folder_label = NULL;
impl->save_folder_combo = NULL;
impl->save_expander = NULL;
}
/* Turns on the path bar widget. Can be called even if we are already in that
......@@ -5271,21 +5247,6 @@ update_appearance (GtkFileChooserDefault *impl)
gtk_label_set_text_with_mnemonic (GTK_LABEL (impl->save_folder_label), text);
if (gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)))
{
gtk_widget_set_sensitive (impl->save_folder_label, FALSE);
gtk_widget_set_sensitive (impl->save_folder_combo, FALSE);
gtk_widget_set_has_tooltip (impl->save_folder_combo, FALSE);
gtk_widget_show (impl->browse_widgets);
}
else
{
gtk_widget_set_sensitive (impl->save_folder_label, TRUE);
gtk_widget_set_sensitive (impl->save_folder_combo, TRUE);
gtk_widget_set_has_tooltip (impl->save_folder_combo, TRUE);
gtk_widget_hide (impl->browse_widgets);
}
if (impl->select_multiple)
{
g_warning ("Save mode cannot be set in conjunction with multiple selection mode. "
......@@ -5810,14 +5771,12 @@ settings_load (GtkFileChooserDefault *impl)
{
LocationMode location_mode;
gboolean show_hidden;
gboolean expand_folders;
gboolean show_size_column;
gint sort_column;
GtkSortType sort_order;
settings_ensure (impl);
expand_folders = g_settings_get_boolean (impl->settings, SETTINGS_KEY_EXPAND_FOLDERS);
location_mode = g_settings_get_enum (impl->settings, SETTINGS_KEY_LOCATION_MODE);
show_hidden = g_settings_get_boolean (impl->settings, SETTINGS_KEY_SHOW_HIDDEN);
show_size_column = g_settings_get_boolean (impl->settings, SETTINGS_KEY_SHOW_SIZE_COLUMN);
......@@ -5828,10 +5787,6 @@ settings_load (GtkFileChooserDefault *impl)
gtk_file_chooser_set_show_hidden (GTK_FILE_CHOOSER (impl), show_hidden);
impl->expand_folders = expand_folders;
if (impl->save_expander)
gtk_expander_set_expanded (GTK_EXPANDER (impl->save_expander), expand_folders);
impl->show_size_column = show_size_column;
gtk_tree_view_column_set_visible (impl->list_size_column, show_size_column);
......@@ -5849,14 +5804,6 @@ save_dialog_geometry (GtkFileChooserDefault *impl)
GtkWindow *toplevel;
int x, y, width, height;
/* We don't save the geometry in non-expanded "save" mode, so that the "little
* dialog" won't make future Open dialogs too small.
*/
if (!(impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
|| impl->expand_folders))
return;
toplevel = get_toplevel (GTK_WIDGET (impl));
if (!(toplevel && GTK_IS_FILE_CHOOSER_DIALOG (toplevel)))
......@@ -5875,7 +5822,6 @@ settings_save (GtkFileChooserDefault *impl)
settings_ensure (impl);
g_settings_set_enum (impl->settings, SETTINGS_KEY_LOCATION_MODE, impl->location_mode);
g_settings_set_boolean (impl->settings, SETTINGS_KEY_EXPAND_FOLDERS, impl->expand_folders);
g_settings_set_boolean (impl->settings, SETTINGS_KEY_SHOW_HIDDEN,
gtk_file_chooser_get_show_hidden (GTK_FILE_CHOOSER (impl)));
g_settings_set_boolean (impl->settings, SETTINGS_KEY_SHOW_SIZE_COLUMN, impl->show_size_column);
......@@ -7931,52 +7877,39 @@ gtk_file_chooser_default_get_default_size (GtkFileChooserEmbed *chooser_embed,
{
GtkFileChooserDefault *impl;
GtkRequisition req;
int x, y, width, height;
impl = GTK_FILE_CHOOSER_DEFAULT (chooser_embed);
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER
|| impl->expand_folders)
{
int x, y, width, height;
settings_ensure (impl);
settings_ensure (impl);
g_settings_get (impl->settings, SETTINGS_KEY_WINDOW_POSITION, "(ii)", &x, &y);
g_settings_get (impl->settings, SETTINGS_KEY_WINDOW_SIZE, "(ii)", &width, &height);
g_settings_get (impl->settings, SETTINGS_KEY_WINDOW_POSITION, "(ii)", &x, &y);
g_settings_get (impl->settings, SETTINGS_KEY_WINDOW_SIZE, "(ii)", &width, &height);
if (x >= 0 && y >= 0 && width > 0 && height > 0)
{
*default_width = width;
*default_height = height;
return;
}
find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
if (x >= 0 && y >= 0 && width > 0 && height > 0)
{
*default_width = width;
*default_height = height;
return;
}
if (impl->preview_widget_active &&
impl->preview_widget &&
gtk_widget_get_visible (impl->preview_widget))
{
gtk_widget_get_preferred_size (impl->preview_box,
&req, NULL);
*default_width += PREVIEW_HBOX_SPACING + req.width;
}
find_good_size_from_style (GTK_WIDGET (chooser_embed), default_width, default_height);
if (impl->extra_widget &&
gtk_widget_get_visible (impl->extra_widget))
{
gtk_widget_get_preferred_size (impl->extra_align,
&req, NULL);
*default_height += gtk_box_get_spacing (GTK_BOX (chooser_embed)) + req.height;
}
if (impl->preview_widget_active &&
impl->preview_widget &&
gtk_widget_get_visible (impl->preview_widget))
{
gtk_widget_get_preferred_size (impl->preview_box,
&req, NULL);
*default_width += PREVIEW_HBOX_SPACING + req.width;
}
else
if (impl->extra_widget &&
gtk_widget_get_visible (impl->extra_widget))
{
gtk_widget_get_preferred_size (GTK_WIDGET (impl),
&req, NULL);
*default_width = req.width;
*default_height = req.height;
gtk_widget_get_preferred_size (impl->extra_align,
&req, NULL);
*default_height += gtk_box_get_spacing (GTK_BOX (chooser_embed)) + req.height;
}
}
......
......@@ -165,7 +165,6 @@ struct _GtkFileChooserDefault
GtkWidget *save_folder_label;
GtkWidget *save_folder_combo;
GtkWidget *save_expander;
/* The file browsing widgets */
GtkWidget *browse_widgets;
......@@ -298,7 +297,6 @@ struct _GtkFileChooserDefault
guint list_sort_ascending : 1;
guint changing_folder : 1;
guint shortcuts_current_folder_active : 1;
guint expand_folders : 1;
guint has_home : 1;
guint has_desktop : 1;
guint has_search : 1;
......
......@@ -41,9 +41,6 @@
<key name='show-hidden' type='b'>
<default>false</default>
</key>
<key name='expand-folders' type='b'>
<default>false</default>
</key>
<key name='show-size-column' type='b'>
<default>true</default>
</key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment