summaryrefslogtreecommitdiffstats
path: root/gtk/src/presets.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-10-31 18:03:24 +0000
committerjstebbins <[email protected]>2008-10-31 18:03:24 +0000
commit2ff0ad590ea9f4c559ecbcf24282d8d9559aa61d (patch)
tree7c819886d472bcf6a09b2b2cc0bf639ba3bdcf32 /gtk/src/presets.c
parent71d5ee949240506a1aab5cfe2c71dada1c17cb39 (diff)
LinGui: Activity Logs for individual encodes
- Individual activity logs are saved in the file format "YYYY-MM-DD HH-MM-SS mymoviename.log". - Default directory is <user config idr>/ghb/EncodeLogs (usually ~/.config/ghb/EncodeLogs) - Preference available to alternatively put them in the users output movie directory with the output movie (by default set to "off"). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1887 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/presets.c')
-rw-r--r--gtk/src/presets.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index cad74d74d..0e40e6dcc 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -1015,7 +1015,7 @@ ghb_select_default_preset(GtkBuilder *builder)
}
gchar*
-ghb_get_user_config_dir()
+ghb_get_user_config_dir(gchar *subdir)
{
const gchar *dir;
gchar *config;
@@ -1034,6 +1034,23 @@ ghb_get_user_config_dir()
if (!g_file_test(config, G_FILE_TEST_IS_DIR))
g_mkdir (config, 0755);
}
+ if (subdir)
+ {
+ gchar **split;
+ gint ii;
+
+ split = g_strsplit(subdir, "/", -1);
+ for (ii = 0; split[ii] != NULL; ii++)
+ {
+ gchar *tmp;
+
+ tmp = g_strdup_printf ("%s/%s", config, split[ii]);
+ g_free(config);
+ config = tmp;
+ if (!g_file_test(config, G_FILE_TEST_IS_DIR))
+ g_mkdir (config, 0755);
+ }
+ }
return config;
}
@@ -1043,7 +1060,7 @@ store_plist(GValue *plist, const gchar *name)
gchar *config, *path;
FILE *file;
- config = ghb_get_user_config_dir();
+ config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/%s", config, name);
file = g_fopen(path, "w");
g_free(config);
@@ -1058,7 +1075,7 @@ load_plist(const gchar *name)
gchar *config, *path;
GValue *plist = NULL;
- config = ghb_get_user_config_dir();
+ config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/%s", config, name);
if (g_file_test(path, G_FILE_TEST_IS_REGULAR))
{
@@ -1074,7 +1091,7 @@ remove_plist(const gchar *name)
{
gchar *config, *path;
- config = ghb_get_user_config_dir();
+ config = ghb_get_user_config_dir(NULL);
path = g_strdup_printf ("%s/%s", config, name);
if (g_file_test(path, G_FILE_TEST_IS_REGULAR))
{