<child>
<placeholder/>
</child>
+ <child>
+ <object class="GtkLabel" id="activity_location">
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
<child>
<object class="GtkScrolledWindow" id="activity_scroll">
<property name="visible">True</property>
</child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
{
GIOChannel *channel;
gint pfd[2];
+ gchar *config, *path;
// I'm opening a pipe and attaching the writer end to stderr
// The reader end will be polled by main event loop and I'll get
}
// Open activity log.
// TODO: Put this in the same directory as the encode destination
- ud->activity_log = g_io_channel_new_file ("Activity.log", "w", NULL);
+ config = ghb_get_user_config_dir();
+ path = g_strdup_printf("%s/%s", config, "Activity.log");
+ ud->activity_log = g_io_channel_new_file (path, "w", NULL);
+ ghb_ui_update(ud, "activity_location", ghb_string_value(path));
+ g_free(path);
+ g_free(config);
// Set encoding to raw.
g_io_channel_set_encoding (ud->activity_log, NULL, NULL);
stderr->_fileno = pfd[1];
ud->current_job = NULL;
ud->current_dvd_device = NULL;
ud->dont_clear_presets = FALSE;
- // Redirect stderr to the activity window
- IoRedirect(ud);
// Enable events that alert us to media change events
watch_volumes (ud);
ud->builder = create_builder_or_die (BUILDER_NAME);
+ // Redirect stderr to the activity window
+ IoRedirect(ud);
ghb_init_dep_map();
// Need to connect x264_options textview buffer to the changed signal
}
}
-static void
-store_plist(GValue *plist, const gchar *name)
+gchar*
+ghb_get_user_config_dir()
{
const gchar *dir;
gchar *config;
- FILE *file;
dir = g_get_user_config_dir();
- config = g_strdup_printf ("%s/ghb", dir);
- if (!g_file_test(config, G_FILE_TEST_IS_DIR))
+ if (!g_file_test(dir, G_FILE_TEST_IS_DIR))
{
- g_mkdir (config, 0755);
+ dir = g_get_home_dir();
+ config = g_strdup_printf ("%s/.ghb", dir);
+ if (!g_file_test(config, G_FILE_TEST_IS_DIR))
+ g_mkdir (config, 0755);
}
+ else
+ {
+ config = g_strdup_printf ("%s/ghb", dir);
+ if (!g_file_test(config, G_FILE_TEST_IS_DIR))
+ g_mkdir (config, 0755);
+ }
+ return config;
+}
+
+static void
+store_plist(GValue *plist, const gchar *name)
+{
+ gchar *config, *path;
+ FILE *file;
+
+ config = ghb_get_user_config_dir();
+ path = g_strdup_printf ("%s/%s", config, name);
+ file = g_fopen(path, "w");
g_free(config);
- config = g_strdup_printf ("%s/ghb/%s", dir, name);
- file = g_fopen(config, "w");
- g_free(config);
+ g_free(path);
ghb_plist_write(file, plist);
fclose(file);
}
static GValue*
load_plist(const gchar *name)
{
- const gchar *dir;
- gchar *config;
+ gchar *config, *path;
GValue *plist = NULL;
- dir = g_get_user_config_dir();
- config = g_strdup_printf ("%s/ghb/%s", dir, name);
- if (g_file_test(config, G_FILE_TEST_IS_REGULAR))
+ config = ghb_get_user_config_dir();
+ path = g_strdup_printf ("%s/%s", config, name);
+ if (g_file_test(path, G_FILE_TEST_IS_REGULAR))
{
- plist = ghb_plist_parse_file(config);
+ plist = ghb_plist_parse_file(path);
}
g_free(config);
+ g_free(path);
return plist;
}
static void
remove_plist(const gchar *name)
{
- const gchar *dir;
- gchar *config;
+ gchar *config, *path;
- dir = g_get_user_config_dir();
- config = g_strdup_printf ("%s/ghb/%s", dir, name);
- if (g_file_test(config, G_FILE_TEST_IS_REGULAR))
+ config = ghb_get_user_config_dir();
+ path = g_strdup_printf ("%s/%s", config, name);
+ if (g_file_test(path, G_FILE_TEST_IS_REGULAR))
{
- g_unlink(config);
+ g_unlink(path);
}
+ g_free(path);
g_free(config);
}
void ghb_save_queue(GValue *queue);
GValue* ghb_load_queue();
void ghb_remove_queue_file(void);;
+gchar* ghb_get_user_config_dir();
#endif // _GHB_PRESETS_H_
" <placeholder/>\n"
" </child>\n"
" <child>\n"
+" <object class="GtkLabel" id="activity_locat"
+"ion">\n"
+" <property name="justify">GTK_JUSTIFY_LEFT&l"
+"t;/property>\n"
+" <property name="visible">True</property&"
+"gt;\n"
+" </object>\n"
+" <packing>\n"
+" <property name="expand">False</property&"
+"gt;\n"
+" <property name="position">1</property>"
+";\n"
+" </packing>\n"
+" </child>\n"
+" <child>\n"
" <object class="GtkScrolledWindow" id="activ"
"ity_scroll">\n"
" <property name="visible">True</property&"
" </child>\n"
" </object>\n"
" <packing>\n"
-" <property name="position">1</property>"
+" <property name="position">2</property>"
";\n"
" </packing>\n"
" </child>\n"
<child>
<placeholder/>
</child>
+ <child>
+ <object class="GtkLabel" id="activity_location">
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="visible">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
<child>
<object class="GtkScrolledWindow" id="activity_scroll">
<property name="visible">True</property>
</child>
</object>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
GTK_TEXT_VIEW(widget));
gtk_text_buffer_set_text (buffer, str, -1);
}
+ else if (type == GTK_TYPE_LABEL)
+ {
+ gtk_label_set_text (GTK_LABEL(widget), str);
+ }
else
{
g_debug("Attempt to set unknown widget type");