mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-30 19:17:34 +00:00
Set the filename entry's base folder when a recent-folder is selected
This lets the filename entry do completion relative to the selected recent-folder. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This commit is contained in:
parent
03b50bd9a9
commit
91b8043397
@ -6559,7 +6559,6 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
|||||||
|
|
||||||
/* no need to update the file chooser's entry if there's no entry */
|
/* no need to update the file chooser's entry if there's no entry */
|
||||||
if (impl->operation_mode == OPERATION_MODE_SEARCH ||
|
if (impl->operation_mode == OPERATION_MODE_SEARCH ||
|
||||||
impl->operation_mode == OPERATION_MODE_RECENT ||
|
|
||||||
!impl->location_entry)
|
!impl->location_entry)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -6578,6 +6577,9 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
|||||||
|
|
||||||
if (closure.num_selected == 0)
|
if (closure.num_selected == 0)
|
||||||
{
|
{
|
||||||
|
if (impl->operation_mode == OPERATION_MODE_RECENT)
|
||||||
|
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), NULL);
|
||||||
|
else
|
||||||
goto maybe_clear_entry;
|
goto maybe_clear_entry;
|
||||||
}
|
}
|
||||||
else if (closure.num_selected == 1)
|
else if (closure.num_selected == 1)
|
||||||
@ -6619,6 +6621,20 @@ update_chooser_entry (GtkFileChooserDefault *impl)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (impl->operation_mode == OPERATION_MODE_RECENT
|
||||||
|
&& impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
||||||
|
{
|
||||||
|
GFile *folder;
|
||||||
|
|
||||||
|
/* Set the base folder on the name entry, so it will do completion relative to the correct recent-folder */
|
||||||
|
|
||||||
|
gtk_tree_model_get (GTK_TREE_MODEL (impl->recent_model), &closure.first_selected_iter,
|
||||||
|
MODEL_COL_FILE, &folder,
|
||||||
|
-1);
|
||||||
|
_gtk_file_chooser_entry_set_base_folder (GTK_FILE_CHOOSER_ENTRY (impl->location_entry), folder);
|
||||||
|
g_object_unref (folder);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user