summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/callbacks.c112
-rw-r--r--gtk/src/ghb.ui77
-rw-r--r--gtk/src/internal_defaults.xml4
-rw-r--r--gtk/src/presets.c8
-rw-r--r--gtk/src/resource_data.h129
-rw-r--r--gtk/src/resources.plist81
-rw-r--r--gtk/src/settings.c20
7 files changed, 177 insertions, 254 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 5f2a55a43..3223f91cd 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -216,40 +216,6 @@ ghb_check_all_depencencies(signal_user_data_t *ud)
}
}
-static gchar*
-expand_tilde(const gchar *path)
-{
- const gchar *user_home;
- gchar *home;
- const gchar *suffix;
- gchar *expanded_path = NULL;
-
- g_debug("expand_tilde ()");
- if (path[0] == '~')
- {
- user_home = g_get_home_dir();
- home = NULL; // squash warning about home uninitialized
- if (path[1] == 0)
- {
- home = g_strdup(user_home);
- suffix = "";
- }
- else if (path[1] == '/')
- {
- home = g_strdup(user_home);
- suffix = &path[2];
- }
- else
- {
- home = g_path_get_dirname(user_home);
- suffix = &path[1];
- }
- expanded_path = g_strdup_printf("%s/%s", home, suffix);
- g_free(home);
- }
- return expanded_path;
-}
-
void
on_quit1_activate(GtkMenuItem *quit, signal_user_data_t *ud)
{
@@ -278,11 +244,10 @@ set_destination(signal_user_data_t *ud)
if (ghb_settings_get_boolean(ud->settings, "use_source_name"))
{
gchar *vol_name, *filename, *extension;
- gchar *dir, *new_name;
+ gchar *new_name;
- filename = ghb_settings_get_string(ud->settings, "destination");
+ filename = ghb_settings_get_string(ud->settings, "dest_file");
extension = ghb_settings_get_string(ud->settings, "FileFormat");
- dir = g_path_get_dirname (filename);
vol_name = ghb_settings_get_string(ud->settings, "volume_label");
if (ghb_settings_get_boolean(ud->settings, "chapters_in_destination"))
{
@@ -292,24 +257,23 @@ set_destination(signal_user_data_t *ud)
end = ghb_settings_get_int(ud->settings, "end_chapter");
if (start == end)
{
- new_name = g_strdup_printf("%s/%s-%d.%s",
- dir, vol_name, start, extension);
+ new_name = g_strdup_printf("%s-%d.%s",
+ vol_name, start, extension);
}
else
{
- new_name = g_strdup_printf("%s/%s-%d-%d.%s",
- dir, vol_name, start, end, extension);
+ new_name = g_strdup_printf("%s-%d-%d.%s",
+ vol_name, start, end, extension);
}
}
else
{
- new_name = g_strdup_printf("%s/%s.%s", dir, vol_name, extension);
+ new_name = g_strdup_printf("%s.%s", vol_name, extension);
}
- ghb_ui_update(ud, "destination", ghb_string_value(new_name));
+ ghb_ui_update(ud, "dest_file", ghb_string_value(new_name));
g_free(filename);
g_free(extension);
g_free(vol_name);
- g_free(dir);
g_free(new_name);
}
}
@@ -705,7 +669,7 @@ update_destination_extension(signal_user_data_t *ud)
g_debug("update_destination_extension ()");
extension = ghb_settings_get_string(ud->settings, "FileFormat");
- entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "destination"));
+ entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "dest_file"));
filename = g_strdup(gtk_entry_get_text(entry));
for (ii = 0; containers[ii] != NULL; ii++)
{
@@ -727,7 +691,7 @@ update_destination_extension(signal_user_data_t *ud)
break;
}
new_name = g_strjoin(".", filename, extension, NULL);
- ghb_ui_update(ud, "destination", ghb_string_value(new_name));
+ ghb_ui_update(ud, "dest_file", ghb_string_value(new_name));
g_free(new_name);
break;
}
@@ -758,6 +722,7 @@ destination_select_title(GtkEntry *entry)
break;
}
}
+ if (start < 0) start = 0;
if (start < end)
{
gtk_editable_select_region(GTK_EDITABLE(entry), start, end);
@@ -776,20 +741,39 @@ destination_grab_cb(
static gboolean update_default_destination = FALSE;
void
-destination_entry_changed_cb(GtkEntry *entry, signal_user_data_t *ud)
+dest_dir_set_cb(GtkFileChooserButton *dest_chooser, signal_user_data_t *ud)
{
- gchar *dest;
+ gchar *dest_file, *dest_dir, *dest;
- g_debug("destination_entry_changed_cb ()");
- if ((dest = expand_tilde(gtk_entry_get_text(entry))) != NULL)
- {
- gtk_entry_set_text(entry, dest);
- g_free(dest);
- }
+ g_debug("dest_dir_set_cb ()");
+ ghb_widget_to_setting(ud->settings, (GtkWidget*)dest_chooser);
+ dest_file = ghb_settings_get_string(ud->settings, "dest_file");
+ dest_dir = ghb_settings_get_string(ud->settings, "dest_dir");
+ dest = g_strdup_printf("%s/%s", dest_dir, dest_file);
+ ghb_settings_set_string(ud->settings, "destination", dest);
+ g_free(dest_file);
+ g_free(dest_dir);
+ g_free(dest);
+ update_default_destination = TRUE;
+}
+
+void
+dest_file_changed_cb(GtkEntry *entry, signal_user_data_t *ud)
+{
+ gchar *dest_file, *dest_dir, *dest;
+
+ g_debug("dest_file_changed_cb ()");
update_destination_extension(ud);
ghb_widget_to_setting(ud->settings, (GtkWidget*)entry);
// This signal goes off with ever keystroke, so I'm putting this
// update on the timer.
+ dest_file = ghb_settings_get_string(ud->settings, "dest_file");
+ dest_dir = ghb_settings_get_string(ud->settings, "dest_dir");
+ dest = g_strdup_printf("%s/%s", dest_dir, dest_file);
+ ghb_settings_set_string(ud->settings, "destination", dest);
+ g_free(dest_file);
+ g_free(dest_dir);
+ g_free(dest);
update_default_destination = TRUE;
}
@@ -816,18 +800,18 @@ destination_browse_clicked_cb(GtkButton *button, signal_user_data_t *ud)
g_free(basename);
if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
- char *filename;
+ char *filename, *dirname;
+ GtkFileChooser *dest_chooser;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
- entry = (GtkEntry*)GHB_WIDGET(ud->builder, "destination");
- if (entry == NULL)
- {
- g_debug("Failed to find widget: %s", "destination");
- }
- else
- {
- gtk_entry_set_text(entry, filename);
- }
+ basename = g_path_get_basename(filename);
+ dirname = g_path_get_dirname(filename);
+ entry = (GtkEntry*)GHB_WIDGET(ud->builder, "dest_file");
+ gtk_entry_set_text(entry, basename);
+ dest_chooser = GTK_FILE_CHOOSER(GHB_WIDGET(ud->builder, "dest_dir"));
+ gtk_file_chooser_set_filename(dest_chooser, dirname);
+ g_free (dirname);
+ g_free (basename);
g_free (filename);
}
gtk_widget_destroy(dialog);
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 3e3e75fcc..6e013342a 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -714,78 +714,53 @@
<child>
<object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
+ <property name="spacing">5</property>
+
+
+
+
<child>
- <object class="GtkLabel" id="label8">
+ <object class="GtkFileChooserButton" id="dest_dir">
<property name="visible">True</property>
- <property name="label" translatable="yes">File:</property>
+ <property name="action">select-folder</property>
+ <property name="title" translatable="yes">Destination Directory</property>
+ <signal name="selection_changed" handler="dest_dir_set_cb"/>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkEntry" id="destination">
+ <object class="GtkLabel" id="label18">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip-text" translatable="yes">Destination path with file name for output.</property>
- <property name="width_chars">41</property>
- <signal handler="destination_entry_changed_cb" name="changed"/>
- <signal handler="destination_grab_cb" name="grab-focus" after="yes"/>
- <accelerator key="d" signal="grab-focus" modifiers="GDK_MOD1_MASK"/>
+ <property name="label" translatable="yes">File:</property>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="destination_browse">
+ <object class="GtkEntry" id="dest_file">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NONE</property>
- <signal handler="destination_browse_clicked_cb" name="clicked"/>
- <child>
- <object class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <object class="GtkHBox" id="hbox7">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <object class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="stock">gtk-open</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Browse</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
+ <property name="width_chars">20</property>
+ <accelerator key="d" signal="grab-focus" modifiers="GDK_MOD1_MASK"/>
+ <signal name="changed" handler="dest_file_changed_cb"/>
+ <signal name="grab_focus" handler="destination_grab_cb" after="yes"/>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
+
+
+
+
+
+
+
</object>
</child>
<child>
diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml
index be0d9e519..bdb599afe 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -8,6 +8,10 @@
<true />
<key>autoscale</key>
<false />
+ <key>dest_dir</key>
+ <string></string>
+ <key>dest_file</key>
+ <string>new_video.mp4</string>
<key>end_chapter</key>
<integer>100</integer>
<key>folder</key>
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index f7504d681..4153e38e4 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -1177,12 +1177,14 @@ ghb_prefs_to_ui(signal_user_data_t *ud)
}
gval = ghb_settings_get_value(ud->settings, "default_source");
ghb_settings_set_value (ud->settings, "source", gval);
+
str = ghb_settings_get_string(ud->settings, "destination_dir");
+ ghb_ui_update(ud, "dest_dir", ghb_string_value(str));
- gchar *path = g_strdup_printf ("%s/new_video.mp4", str);
- ghb_ui_update(ud, "destination", ghb_string_value(path));
+ gchar *file = g_strdup_printf ("new_video.mp4");
+ ghb_ui_update(ud, "dest_file", ghb_string_value(file));
g_free(str);
- g_free(path);
+ g_free(file);
prefs_initializing = FALSE;
}
diff --git a/gtk/src/resource_data.h b/gtk/src/resource_data.h
index a6fe4794e..7631d0249 100644
--- a/gtk/src/resource_data.h
+++ b/gtk/src/resource_data.h
@@ -1078,9 +1078,33 @@
"quot;hbox6&quot;&gt;\n"
" &lt;property name=&quot;visible&quot;&g"
"t;True&lt;/property&gt;\n"
+" &lt;property name=&quot;spacing&quot;&g"
+"t;5&lt;/property&gt;\n"
+"\n"
+"\n"
+"\n"
+"\n"
+" &lt;child&gt;\n"
+" &lt;object class=&quot;GtkFileChooser"
+"Button&quot; id=&quot;dest_dir&quot;&gt;\n"
+" &lt;property name=&quot;visible&quo"
+"t;&gt;True&lt;/property&gt;\n"
+" &lt;property name=&quot;action&quot"
+";&gt;select-folder&lt;/property&gt;\n"
+" &lt;property name=&quot;title&quot;"
+" translatable=&quot;yes&quot;&gt;Destination Directory&lt;/property&gt;"
+"\n"
+" &lt;signal name=&quot;selection_cha"
+"nged&quot; handler=&quot;dest_dir_set_cb&quot;/&gt;\n"
+" &lt;/object&gt;\n"
+" &lt;packing&gt;\n"
+" &lt;property name=&quot;position&qu"
+"ot;&gt;0&lt;/property&gt;\n"
+" &lt;/packing&gt;\n"
+" &lt;/child&gt;\n"
" &lt;child&gt;\n"
" &lt;object class=&quot;GtkLabel&quot;"
-" id=&quot;label8&quot;&gt;\n"
+" id=&quot;label18&quot;&gt;\n"
" &lt;property name=&quot;visible&quo"
"t;&gt;True&lt;/property&gt;\n"
" &lt;property name=&quot;label&quot;"
@@ -1091,107 +1115,38 @@
";&gt;False&lt;/property&gt;\n"
" &lt;property name=&quot;fill&quot;&"
"gt;False&lt;/property&gt;\n"
+" &lt;property name=&quot;position&qu"
+"ot;&gt;1&lt;/property&gt;\n"
" &lt;/packing&gt;\n"
" &lt;/child&gt;\n"
" &lt;child&gt;\n"
" &lt;object class=&quot;GtkEntry&quot;"
-" id=&quot;destination&quot;&gt;\n"
+" id=&quot;dest_file&quot;&gt;\n"
" &lt;property name=&quot;visible&quo"
"t;&gt;True&lt;/property&gt;\n"
" &lt;property name=&quot;can_focus&q"
"uot;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot;tooltip-tex"
-"t&quot; translatable=&quot;yes&quot;&gt;Destination path with file name"
-" for output.&lt;/property&gt;\n"
" &lt;property name=&quot;width_chars"
-"&quot;&gt;41&lt;/property&gt;\n"
-" &lt;signal handler=&quot;destinatio"
-"n_entry_changed_cb&quot; name=&quot;changed&quot;/&gt;\n"
-" &lt;signal handler=&quot;destinatio"
-"n_grab_cb&quot; name=&quot;grab-focus&quot; after=&quot;yes&quot;/&gt;\n"
+"&quot;&gt;20&lt;/property&gt;\n"
" &lt;accelerator key=&quot;d&quot; s"
"ignal=&quot;grab-focus&quot; modifiers=&quot;GDK_MOD1_MASK&quot;/&gt;\n"
+" &lt;signal name=&quot;changed&quot;"
+" handler=&quot;dest_file_changed_cb&quot;/&gt;\n"
+" &lt;signal name=&quot;grab_focus&qu"
+"ot; handler=&quot;destination_grab_cb&quot; after=&quot;yes&quot;/&gt;\n"
" &lt;/object&gt;\n"
" &lt;packing&gt;\n"
" &lt;property name=&quot;position&qu"
-"ot;&gt;1&lt;/property&gt;\n"
-" &lt;/packing&gt;\n"
-" &lt;/child&gt;\n"
-" &lt;child&gt;\n"
-" &lt;object class=&quot;GtkButton&quot"
-"; id=&quot;destination_browse&quot;&gt;\n"
-" &lt;property name=&quot;visible&quo"
-"t;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot;can_focus&q"
-"uot;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot;relief&quot"
-";&gt;GTK_RELIEF_NONE&lt;/property&gt;\n"
-" &lt;signal handler=&quot;destinatio"
-"n_browse_clicked_cb&quot; name=&quot;clicked&quot;/&gt;\n"
-" &lt;child&gt;\n"
-" &lt;object class=&quot;GtkAlignme"
-"nt&quot; id=&quot;alignment4&quot;&gt;\n"
-" &lt;property name=&quot;visible"
-"&quot;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot;xscale&"
-"quot;&gt;0&lt;/property&gt;\n"
-" &lt;property name=&quot;yscale&"
-"quot;&gt;0&lt;/property&gt;\n"
-" &lt;child&gt;\n"
-" &lt;object class=&quot;GtkHBo"
-"x&quot; id=&quot;hbox7&quot;&gt;\n"
-" &lt;property name=&quot;vis"
-"ible&quot;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot;spa"
-"cing&quot;&gt;2&lt;/property&gt;\n"
-" &lt;child&gt;\n"
-" &lt;object class=&quot;Gt"
-"kImage&quot; id=&quot;image2&quot;&gt;\n"
-" &lt;property name=&quot"
-";visible&quot;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot"
-";stock&quot;&gt;gtk-open&lt;/property&gt;\n"
-" &lt;/object&gt;\n"
-" &lt;packing&gt;\n"
-" &lt;property name=&quot"
-";expand&quot;&gt;False&lt;/property&gt;\n"
-" &lt;property name=&quot"
-";fill&quot;&gt;False&lt;/property&gt;\n"
-" &lt;/packing&gt;\n"
-" &lt;/child&gt;\n"
-" &lt;child&gt;\n"
-" &lt;object class=&quot;Gt"
-"kLabel&quot; id=&quot;label9&quot;&gt;\n"
-" &lt;property name=&quot"
-";visible&quot;&gt;True&lt;/property&gt;\n"
-" &lt;property name=&quot"
-";label&quot; translatable=&quot;yes&quot;&gt;Browse&lt;/property&gt;\n"
-" &lt;property name=&quot"
-";use_underline&quot;&gt;True&lt;/property&gt;\n"
-" &lt;/object&gt;\n"
-" &lt;packing&gt;\n"
-" &lt;property name=&quot"
-";expand&quot;&gt;False&lt;/property&gt;\n"
-" &lt;property name=&quot"
-";fill&quot;&gt;False&lt;/property&gt;\n"
-" &lt;property name=&quot"
-";position&quot;&gt;1&lt;/property&gt;\n"
-" &lt;/packing&gt;\n"
-" &lt;/child&gt;\n"
-" &lt;/object&gt;\n"
-" &lt;/child&gt;\n"
-" &lt;/object&gt;\n"
-" &lt;/child&gt;\n"
-" &lt;/object&gt;\n"
-" &lt;packing&gt;\n"
-" &lt;property name=&quot;expand&quot"
-";&gt;False&lt;/property&gt;\n"
-" &lt;property name=&quot;fill&quot;&"
-"gt;False&lt;/property&gt;\n"
-" &lt;property name=&quot;position&qu"
"ot;&gt;2&lt;/property&gt;\n"
" &lt;/packing&gt;\n"
" &lt;/child&gt;\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
+"\n"
" &lt;/object&gt;\n"
" &lt;/child&gt;\n"
" &lt;child&gt;\n"
@@ -10576,6 +10531,10 @@
" </array>\n"
" <key>autoscale</key>\n"
" <false />\n"
+" <key>dest_dir</key>\n"
+" <string></string>\n"
+" <key>dest_file</key>\n"
+" <string>new_video.mp4</string>\n"
" <key>end_chapter</key>\n"
" <integer>100</integer>\n"
" <key>folder</key>\n"
diff --git a/gtk/src/resources.plist b/gtk/src/resources.plist
index f01338942..72771ba72 100644
--- a/gtk/src/resources.plist
+++ b/gtk/src/resources.plist
@@ -719,78 +719,53 @@
&lt;child&gt;
&lt;object class=&quot;GtkHBox&quot; id=&quot;hbox6&quot;&gt;
&lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
+ &lt;property name=&quot;spacing&quot;&gt;5&lt;/property&gt;
+
+
+
+
&lt;child&gt;
- &lt;object class=&quot;GtkLabel&quot; id=&quot;label8&quot;&gt;
+ &lt;object class=&quot;GtkFileChooserButton&quot; id=&quot;dest_dir&quot;&gt;
&lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;File:&lt;/property&gt;
+ &lt;property name=&quot;action&quot;&gt;select-folder&lt;/property&gt;
+ &lt;property name=&quot;title&quot; translatable=&quot;yes&quot;&gt;Destination Directory&lt;/property&gt;
+ &lt;signal name=&quot;selection_changed&quot; handler=&quot;dest_dir_set_cb&quot;/&gt;
&lt;/object&gt;
&lt;packing&gt;
- &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
- &lt;property name=&quot;fill&quot;&gt;False&lt;/property&gt;
+ &lt;property name=&quot;position&quot;&gt;0&lt;/property&gt;
&lt;/packing&gt;
&lt;/child&gt;
&lt;child&gt;
- &lt;object class=&quot;GtkEntry&quot; id=&quot;destination&quot;&gt;
+ &lt;object class=&quot;GtkLabel&quot; id=&quot;label18&quot;&gt;
&lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;tooltip-text&quot; translatable=&quot;yes&quot;&gt;Destination path with file name for output.&lt;/property&gt;
- &lt;property name=&quot;width_chars&quot;&gt;41&lt;/property&gt;
- &lt;signal handler=&quot;destination_entry_changed_cb&quot; name=&quot;changed&quot;/&gt;
- &lt;signal handler=&quot;destination_grab_cb&quot; name=&quot;grab-focus&quot; after=&quot;yes&quot;/&gt;
- &lt;accelerator key=&quot;d&quot; signal=&quot;grab-focus&quot; modifiers=&quot;GDK_MOD1_MASK&quot;/&gt;
+ &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;File:&lt;/property&gt;
&lt;/object&gt;
&lt;packing&gt;
+ &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
+ &lt;property name=&quot;fill&quot;&gt;False&lt;/property&gt;
&lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
&lt;/packing&gt;
&lt;/child&gt;
&lt;child&gt;
- &lt;object class=&quot;GtkButton&quot; id=&quot;destination_browse&quot;&gt;
+ &lt;object class=&quot;GtkEntry&quot; id=&quot;dest_file&quot;&gt;
&lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
&lt;property name=&quot;can_focus&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;relief&quot;&gt;GTK_RELIEF_NONE&lt;/property&gt;
- &lt;signal handler=&quot;destination_browse_clicked_cb&quot; name=&quot;clicked&quot;/&gt;
- &lt;child&gt;
- &lt;object class=&quot;GtkAlignment&quot; id=&quot;alignment4&quot;&gt;
- &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;xscale&quot;&gt;0&lt;/property&gt;
- &lt;property name=&quot;yscale&quot;&gt;0&lt;/property&gt;
- &lt;child&gt;
- &lt;object class=&quot;GtkHBox&quot; id=&quot;hbox7&quot;&gt;
- &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;spacing&quot;&gt;2&lt;/property&gt;
- &lt;child&gt;
- &lt;object class=&quot;GtkImage&quot; id=&quot;image2&quot;&gt;
- &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;stock&quot;&gt;gtk-open&lt;/property&gt;
- &lt;/object&gt;
- &lt;packing&gt;
- &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
- &lt;property name=&quot;fill&quot;&gt;False&lt;/property&gt;
- &lt;/packing&gt;
- &lt;/child&gt;
- &lt;child&gt;
- &lt;object class=&quot;GtkLabel&quot; id=&quot;label9&quot;&gt;
- &lt;property name=&quot;visible&quot;&gt;True&lt;/property&gt;
- &lt;property name=&quot;label&quot; translatable=&quot;yes&quot;&gt;Browse&lt;/property&gt;
- &lt;property name=&quot;use_underline&quot;&gt;True&lt;/property&gt;
- &lt;/object&gt;
- &lt;packing&gt;
- &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
- &lt;property name=&quot;fill&quot;&gt;False&lt;/property&gt;
- &lt;property name=&quot;position&quot;&gt;1&lt;/property&gt;
- &lt;/packing&gt;
- &lt;/child&gt;
- &lt;/object&gt;
- &lt;/child&gt;
- &lt;/object&gt;
- &lt;/child&gt;
+ &lt;property name=&quot;width_chars&quot;&gt;20&lt;/property&gt;
+ &lt;accelerator key=&quot;d&quot; signal=&quot;grab-focus&quot; modifiers=&quot;GDK_MOD1_MASK&quot;/&gt;
+ &lt;signal name=&quot;changed&quot; handler=&quot;dest_file_changed_cb&quot;/&gt;
+ &lt;signal name=&quot;grab_focus&quot; handler=&quot;destination_grab_cb&quot; after=&quot;yes&quot;/&gt;
&lt;/object&gt;
&lt;packing&gt;
- &lt;property name=&quot;expand&quot;&gt;False&lt;/property&gt;
- &lt;property name=&quot;fill&quot;&gt;False&lt;/property&gt;
&lt;property name=&quot;position&quot;&gt;2&lt;/property&gt;
&lt;/packing&gt;
&lt;/child&gt;
+
+
+
+
+
+
+
&lt;/object&gt;
&lt;/child&gt;
&lt;child&gt;
@@ -5196,6 +5171,10 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A
</array>
<key>autoscale</key>
<false />
+ <key>dest_dir</key>
+ <string></string>
+ <key>dest_file</key>
+ <string>new_video.mp4</string>
<key>end_chapter</key>
<integer>100</integer>
<key>folder</key>
diff --git a/gtk/src/settings.c b/gtk/src/settings.c
index 0b5c90283..03d65c766 100644
--- a/gtk/src/settings.c
+++ b/gtk/src/settings.c
@@ -321,6 +321,12 @@ ghb_widget_value(GtkWidget *widget)
str = gtk_label_get_text (GTK_LABEL(widget));
value = ghb_string_value_new(str);
}
+ else if (type == GTK_TYPE_FILE_CHOOSER_BUTTON)
+ {
+ const gchar *str;
+ str = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(widget));
+ value = ghb_string_value_new(str);
+ }
else
{
g_debug("Attempt to set unknown widget type: %s\n", name);
@@ -569,6 +575,20 @@ update_widget(GtkWidget *widget, const GValue *value)
{
gtk_label_set_text (GTK_LABEL(widget), str);
}
+ else if (type == GTK_TYPE_FILE_CHOOSER_BUTTON)
+ {
+ GtkFileChooserAction act;
+ act = gtk_file_chooser_get_action(GTK_FILE_CHOOSER(widget));
+ if (act == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER ||
+ act == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+ {
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(widget), str);
+ }
+ else
+ {
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(widget), str);
+ }
+ }
else
{
g_debug("Attempt to set unknown widget type");