summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-10-30 18:58:16 +0000
committerjstebbins <[email protected]>2008-10-30 18:58:16 +0000
commit9834623a06e533d557ec8919e4238e207886f9a7 (patch)
tree8d88b3e4e0347fd8b4a1e7a81ddc5e0519c09588 /gtk/src
parent39a4d09c458ecef7007890aaf9872842e041410f (diff)
LinGui: add handbrake version and preset used to activity log
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1882 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/callbacks.c42
-rw-r--r--gtk/src/callbacks.h1
-rw-r--r--gtk/src/main.c2
-rw-r--r--gtk/src/presets.c25
-rw-r--r--gtk/src/presets.h1
-rw-r--r--gtk/src/queuehandler.c2
6 files changed, 55 insertions, 18 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index df8d82996..7e22de3ce 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1401,9 +1401,20 @@ static void
submit_job(GValue *settings)
{
static gint unique_id = 1;
+ gchar *type, *modified, *preset;
+ GValue *path;
+ gboolean preset_modified;
g_debug("submit_job");
if (settings == NULL) return;
+ preset_modified = ghb_settings_get_boolean(settings, "preset_modified");
+ path = ghb_settings_get_value(settings, "preset");
+ preset = ghb_preset_path_string(path);
+ type = ghb_preset_is_custom() ? "Custom " : "";
+ modified = preset_modified ? "Modified " : "";
+ ghb_log("%s%sPreset: %s", modified, type, preset);
+ g_free(preset);
+
ghb_settings_set_int(settings, "job_unique_id", unique_id);
ghb_settings_set_int(settings, "job_status", GHB_QUEUE_RUNNING);
ghb_add_job (settings, unique_id);
@@ -1880,6 +1891,30 @@ ghb_log_cb(GIOChannel *source, GIOCondition cond, gpointer data)
}
void
+show_activity_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
+{
+ GtkWidget *widget = GHB_WIDGET (ud->builder, "activity_window");
+ gtk_widget_show (widget);
+}
+
+void
+ghb_log(gchar *log, ...)
+{
+ va_list args;
+ time_t _now;
+ struct tm *now;
+ gchar fmt[362];
+
+ _now = time(NULL);
+ now = localtime( &_now );
+ snprintf(fmt, 362, "[%02d:%02d:%02d] lingui: %s\n",
+ now->tm_hour, now->tm_min, now->tm_sec, log);
+ va_start(args, log);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
+void
about_activate_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "hb_about");
@@ -1924,13 +1959,6 @@ hb_about_response_cb(GtkWidget *widget, gint response, signal_user_data_t *ud)
}
void
-show_activity_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
-{
- GtkWidget *widget = GHB_WIDGET (ud->builder, "activity_window");
- gtk_widget_show (widget);
-}
-
-void
show_queue_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "queue_window");
diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h
index c2727f543..26c76861c 100644
--- a/gtk/src/callbacks.h
+++ b/gtk/src/callbacks.h
@@ -45,6 +45,7 @@ gboolean ghb_cancel_encode(const gchar *extra_msg);
GValue* ghb_start_next_job(signal_user_data_t *ud, gboolean find_first);
void ghb_check_dependency(signal_user_data_t *ud, GtkWidget *widget);
void ghb_do_scan(signal_user_data_t *ud, const gchar *filename, gboolean force);
+void ghb_log(gchar *log, ...);
#endif // _CALLBACKS_H_
diff --git a/gtk/src/main.c b/gtk/src/main.c
index c9021c587..d1a002a11 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -35,6 +35,7 @@
#include <gtk/gtk.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
+#include "hbversion.h"
#include "renderer_button.h"
#include "hb-backend.h"
#include "ghb-dvd.h"
@@ -527,6 +528,7 @@ main (int argc, char *argv[])
ud->builder = create_builder_or_die (BUILDER_NAME);
// Redirect stderr to the activity window
IoRedirect(ud);
+ ghb_log("Handbrake Version: %s (%d)", HB_VERSION, HB_BUILD);
ghb_init_dep_map();
// Need to connect x264_options textview buffer to the changed signal
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index 90bbe5511..cad74d74d 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -323,8 +323,7 @@ ghb_presets_remove(
presets_remove_nth(folder, indices[len-1]);
else
{
- g_warning("ghb_presets_remove ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_remove (): internal preset lookup error");
return FALSE;
}
return TRUE;
@@ -344,8 +343,7 @@ ghb_presets_replace(
ghb_array_replace(folder, indices[len-1], dict);
else
{
- g_warning("ghb_presets_replace ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_replace (): internal preset lookup error");
}
}
@@ -363,8 +361,7 @@ ghb_presets_insert(
ghb_array_insert(folder, indices[len-1], dict);
else
{
- g_warning("ghb_presets_insert ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_insert (): internal preset lookup error");
}
}
@@ -637,8 +634,7 @@ ghb_presets_get_type(
}
else
{
- g_warning("ghb_presets_get_type ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_get_type (): internal preset lookup error");
}
return type;
}
@@ -659,8 +655,7 @@ ghb_presets_get_folder(
}
else
{
- g_warning("ghb_presets_get_folder ()");
- g_warning("internal preset lookup error");
+ g_warning("ghb_presets_get_folder (): internal preset lookup error");
}
return folder;
}
@@ -891,6 +886,16 @@ ghb_settings_to_ui(signal_user_data_t *ud, GValue *dict)
static GValue *current_preset = NULL;
+gboolean
+ghb_preset_is_custom()
+{
+ const GValue *val;
+
+ if (current_preset == NULL) return FALSE;
+ val = preset_dict_get_value(current_preset, "Type");
+ return (ghb_value_int(val) == 1);
+}
+
void
ghb_set_preset_from_indices(signal_user_data_t *ud, gint *indices, gint len)
{
diff --git a/gtk/src/presets.h b/gtk/src/presets.h
index 2c34f30b2..156523806 100644
--- a/gtk/src/presets.h
+++ b/gtk/src/presets.h
@@ -37,5 +37,6 @@ void ghb_select_default_preset(GtkBuilder *builder);
void ghb_presets_list_init(signal_user_data_t *ud, gint *indices, gint len);
GValue* ghb_parse_preset_path(const gchar *path);
gchar* ghb_preset_path_string(const GValue *path);
+gboolean ghb_preset_is_custom(void);
#endif // _GHB_PRESETS_H_
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 6f79d4def..5f9b36b2e 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -139,7 +139,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
if (preset_modified)
g_string_append_printf(str,
- "<b>Customized Preset Based On:</b> <small>%s</small>\n",
+ "<b>Modified Preset Based On:</b> <small>%s</small>\n",
preset);
else
g_string_append_printf(str,