summaryrefslogtreecommitdiff
path: root/src/dlg-extract.c
diff options
context:
space:
mode:
authorzhuyaliang <[email protected]>2023-05-12 11:38:10 +0800
committerLuke from DC <[email protected]>2023-05-15 17:49:50 +0000
commit41a0cad8fafe515f56854462dd62c1b1bd94a393 (patch)
treec66e666ccf09229d60bf1d1a18e6dd01fb0e76fa /src/dlg-extract.c
parent77bc1e4361f2f5fe2f94615b675e6c454e6f8748 (diff)
downloadengrampa-41a0cad8fafe515f56854462dd62c1b1bd94a393.tar.bz2
engrampa-41a0cad8fafe515f56854462dd62c1b1bd94a393.tar.xz
Set the current folder of the file chooser dialog using a local file name
Diffstat (limited to 'src/dlg-extract.c')
-rw-r--r--src/dlg-extract.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dlg-extract.c b/src/dlg-extract.c
index c00552d..263528b 100644
--- a/src/dlg-extract.c
+++ b/src/dlg-extract.c
@@ -295,6 +295,7 @@ dlg_extract__common (FrWindow *window,
{
DialogData *data;
GtkWidget *button;
+ const char *extract_default_dir;
data = g_new0 (DialogData, 1);
data->builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "dlg-extract.ui");
@@ -307,7 +308,12 @@ dlg_extract__common (FrWindow *window,
/* Set widgets data. */
- gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (data->dialog), fr_window_get_extract_default_dir (window));
+ extract_default_dir = fr_window_get_extract_default_dir (window);
+ if (uri_is_local (extract_default_dir))
+ {
+ extract_default_dir = g_filename_from_uri (extract_default_dir, NULL, NULL);
+ }
+ gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (data->dialog), extract_default_dir);
if (data->selected_files != NULL)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("selected_files_radiobutton")), TRUE);