summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/callbacks.c8
-rw-r--r--gtk/src/callbacks.h3
-rw-r--r--gtk/src/hb-backend.c7
-rw-r--r--gtk/src/main.c6
-rw-r--r--gtk/src/presets.c2
-rw-r--r--gtk/src/queuehandler.c2
-rw-r--r--gtk/src/queuehandler.h1
7 files changed, 18 insertions, 11 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 00229f132..541d8863f 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -291,9 +291,10 @@ on_quit1_activate(GtkMenuItem *quit, signal_user_data_t *ud)
}
gboolean
-uppers_and_unders(const gchar *str)
+uppers_and_unders(gchar *str)
{
if (str == NULL) return FALSE;
+ str = g_strchomp(g_strchug(str));
while (*str)
{
if (*str == ' ')
@@ -709,7 +710,7 @@ source_dialog_extra_widgets(
gtk_combo_box_append_text (combo, "Not Selected");
while (link != NULL)
{
- gchar *name = get_dvd_volume_name(link->data);
+ gchar *name = get_dvd_device_name(link->data);
gtk_combo_box_append_text(combo, name);
g_free(name);
g_object_unref(link->data);
@@ -2775,7 +2776,7 @@ hbfd_feature_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
gtk_action_set_visible(action, hbfd);
}
-void
+gboolean
ghb_file_menu_add_dvd(signal_user_data_t *ud)
{
GList *link, *drives;
@@ -2833,6 +2834,7 @@ ghb_file_menu_add_dvd(signal_user_data_t *ud)
}
g_list_free(drives);
}
+ return FALSE;
}
gboolean ghb_is_cd(GDrive *gd);
diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h
index f438ba534..5b2816cdf 100644
--- a/gtk/src/callbacks.h
+++ b/gtk/src/callbacks.h
@@ -40,13 +40,12 @@ void warn_log_handler(
void debug_log_handler(
const gchar *domain, GLogLevelFlags flags, const gchar *msg, gpointer ud);
void ghb_hbfd(signal_user_data_t *ud, gboolean hbfd);
-void ghb_file_menu_add_dvd(signal_user_data_t *ud);
+gboolean ghb_file_menu_add_dvd(signal_user_data_t *ud);
void ghb_hal_init(void);
gboolean ghb_message_dialog(
GtkMessageType type, const gchar *message,
const gchar *no, const gchar *yes);
void ghb_init_dep_map(void);
-gboolean ghb_reload_queue(signal_user_data_t *ud);
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);
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 10a563074..05a0aeaa4 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -4138,10 +4138,11 @@ ghb_dvd_volname(const gchar *device)
{
gchar *name;
name = hb_dvd_name((gchar*)device);
- if (name != NULL)
+ if (name != NULL && name[0] != 0)
{
+ name = g_strdup(name);
sanitize_volname(name);
- return g_strdup(name);
+ return name;
}
- return name;
+ return NULL;
}
diff --git a/gtk/src/main.c b/gtk/src/main.c
index d4a1e87cb..505142be5 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -54,6 +54,7 @@
#include "values.h"
#include "icons.h"
#include "callbacks.h"
+#include "queuehandler.h"
#include "x264handler.h"
#include "settings.h"
#include "resources.h"
@@ -641,7 +642,6 @@ main (int argc, char *argv[])
buffer = gtk_text_view_get_buffer (textview);
g_signal_connect(buffer, "changed", (GCallback)x264_entry_changed_cb, ud);
- ghb_file_menu_add_dvd(ud);
ghb_combo_init(ud->builder);
g_debug("ud %p\n", ud);
@@ -712,6 +712,10 @@ main (int argc, char *argv[])
}
// Start timer for monitoring libhb status, 500ms
g_timeout_add (500, ghb_timer_cb, (gpointer)ud);
+
+ // Add dvd devices to File menu
+ g_idle_add((GSourceFunc)ghb_file_menu_add_dvd, ud);
+
// Everything should be go-to-go. Lets rock!
gtk_main ();
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index aef862f2c..25a5e96ce 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -3074,7 +3074,7 @@ presets_drag_motion_cb(
GtkWidget *widget;
widget = gtk_drag_get_source_widget(ctx);
- if (widget == NULL || widget != tv)
+ if (widget == NULL || widget != GTK_WIDGET(tv))
return TRUE;
// Get the type of the object being dragged
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index a6c9f466b..1ac36ca89 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -781,7 +781,7 @@ queue_drag_motion_cb(
GtkWidget *widget;
widget = gtk_drag_get_source_widget(ctx);
- if (widget == NULL || widget != tv)
+ if (widget == NULL || widget != GTK_WIDGET(tv))
return TRUE;
// This bit checks to see if the source is allowed to be
diff --git a/gtk/src/queuehandler.h b/gtk/src/queuehandler.h
index c817331eb..bf1677baf 100644
--- a/gtk/src/queuehandler.h
+++ b/gtk/src/queuehandler.h
@@ -29,5 +29,6 @@
#include "settings.h"
void ghb_queue_buttons_grey(signal_user_data_t *ud, gboolean working);
+gboolean ghb_reload_queue(signal_user_data_t *ud);
#endif // _QUEUEHANDLER_H_