summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-08-11 16:22:09 +0000
committerjstebbins <[email protected]>2015-08-11 16:22:09 +0000
commit17c78e117ef89fa4d44b9e4b34a0e8eb3f2e434d (patch)
tree3a89e2f456f4476dbfdb9f63a6dffba8ba084932
parent3cfc47653a4617b1f9774ef6f7cdff6050d37267 (diff)
LinGui: Change dest filename behavior when auto-naming is disabled
If auto-naming is disabled, don't set the destination filename to the default "new_video". Instead, leave it set to it's current value. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7399 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--gtk/src/callbacks.c16
-rw-r--r--gtk/src/internal_defaults.json1
2 files changed, 15 insertions, 2 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 72bd33a6f..6e7a41db1 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -566,12 +566,26 @@ check_name_template(signal_user_data_t *ud, const char *str)
static void
set_destination_settings(signal_user_data_t *ud, GhbValue *settings)
{
- const gchar *extension;
+ const gchar *extension, *dest_file;
gchar *filename;
extension = get_extension(ud, settings);
g_debug("set_destination_settings");
+ dest_file = ghb_dict_get_string(ud->settings, "dest_file");
+ if (dest_file == NULL)
+ {
+ // Initialize destination filename if it has no value yet.
+ // If auto-naming is disabled, this will be the default filename.
+ GString *str = g_string_new("");
+ const gchar *vol_name;
+ vol_name = ghb_dict_get_string(settings, "volume_label");
+ g_string_append_printf(str, "%s", vol_name);
+ g_string_append_printf(str, ".%s", extension);
+ filename = g_string_free(str, FALSE);
+ ghb_dict_set_string(settings, "dest_file", filename);
+ g_free(filename);
+ }
if (ghb_dict_get_bool(ud->prefs, "auto_name"))
{
GString *str = g_string_new("");
diff --git a/gtk/src/internal_defaults.json b/gtk/src/internal_defaults.json
index 285d982b0..6bf22e128 100644
--- a/gtk/src/internal_defaults.json
+++ b/gtk/src/internal_defaults.json
@@ -30,7 +30,6 @@
"angle": 1,
"autoscale": true,
"dest_dir": "",
- "dest_file": "new_video.mp4",
"end_point": 100.0,
"MetaName": "",
"MetaArtist": "",