diff options
author | jstebbins <[email protected]> | 2009-06-24 00:38:40 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-06-24 00:38:40 +0000 |
commit | a0031445c36cdbadf1135176e071318b892d280e (patch) | |
tree | f0b8510c7d20f9099aa8bee532ec4a996c9e4e7d /gtk | |
parent | 94a12232650e5f29a185d4f009308f297b49c3ae (diff) |
LinGui: make mingw gtk ui work again.
neglect caused it become broken
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2610 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/Makefile.am | 2 | ||||
-rw-r--r-- | gtk/src/callbacks.c | 59 | ||||
-rw-r--r-- | gtk/src/main.c | 1 | ||||
-rw-r--r-- | gtk/src/preview.c | 4 |
4 files changed, 40 insertions, 26 deletions
diff --git a/gtk/src/Makefile.am b/gtk/src/Makefile.am index 28d5c8e5a..b90e804e7 100644 --- a/gtk/src/Makefile.am +++ b/gtk/src/Makefile.am @@ -5,7 +5,7 @@ HB_LIBS= \ -lhb -la52 -lmkv -lavformat -lavcodec -lavutil -ldca -ldvdnav -ldvdread \ -lfaac -lmp3lame -lmpeg2 -lvorbis -lvorbisenc -logg -lsamplerate \ -lx264 -lmp4v2 -lswscale -ltheora -lfaad -lz \ - -lbz2 -liberty -lpthreadGC2 + -lbz2 -liberty -lpthread -ldl else HB_LIBS= \ -lhb -la52 -lmkv -lavformat -lavcodec -lavutil -ldca -ldvdnav -ldvdread \ diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index bf44181e6..b0ef9b592 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -405,36 +405,30 @@ get_direct_dvd_volume_name(const gchar *drive) return result; } #endif + static gchar* -get_dvd_volume_name(GDrive *gd) +get_dvd_volume_name(gpointer gd) { gchar *label = NULL; gchar *result; gchar *drive; drive = get_dvd_device_name(gd); - if (g_drive_has_media (gd)) + g_mutex_lock(volname_mutex); + label = g_strdup(g_hash_table_lookup(volname_hash, drive)); + g_mutex_unlock(volname_mutex); + if (label != NULL) { - g_mutex_lock(volname_mutex); - label = g_strdup(g_hash_table_lookup(volname_hash, drive)); - g_mutex_unlock(volname_mutex); - if (label != NULL) + if (uppers_and_unders(label)) { - if (uppers_and_unders(label)) - { - camel_convert(label); - } + camel_convert(label); + } #if defined(_WIN32) - result = g_strdup_printf("%s (%s)", label, drive); + result = g_strdup_printf("%s (%s)", label, drive); #else - result = g_strdup_printf("%s - %s", drive, label); + result = g_strdup_printf("%s - %s", drive, label); #endif - g_free(label); - } - else - { - result = g_strdup_printf("%s", drive); - } + g_free(label); } else { @@ -466,8 +460,19 @@ ghb_cache_volnames(signal_user_data_t *ud) g_hash_table_remove_all(volname_hash); while (link != NULL) { - gchar *drive = get_dvd_device_name(link->data); - gchar *name = get_direct_dvd_volume_name(drive); + gchar *name, *drive; + +#if !defined(_WIN32) + if (!g_drive_has_media (link->data)) + { + g_object_unref(link->data); + link = link->next; + continue; + } +#endif + drive = get_dvd_device_name(link->data); + name = get_direct_dvd_volume_name(drive); + if (drive != NULL && name != NULL) { g_hash_table_insert(volname_hash, drive, name); @@ -480,7 +485,11 @@ ghb_cache_volnames(signal_user_data_t *ud) g_free(name); } +#if defined(_WIN32) + g_free(link->data); +#else g_object_unref(link->data); +#endif link = link->next; } g_mutex_unlock(volname_mutex); @@ -3023,7 +3032,11 @@ ghb_file_menu_add_dvd(signal_user_data_t *ud) (GCallback)dvd_source_activate_cb, ud); g_free(name); g_free(drive); +#if defined(_WIN32) + g_free(link->data); +#else g_object_unref(link->data); +#endif link = link->next; } g_list_free(drives); @@ -3129,7 +3142,7 @@ handle_media_change(const gchar *device, gboolean insert, signal_user_data_t *ud ins_count++; if (ins_count == 2) { - ghb_file_menu_add_dvd(ud); + g_thread_create((GThreadFunc)ghb_cache_volnames, ud, FALSE, NULL); if (ud->current_dvd_device != NULL && strcmp(device, ud->current_dvd_device) == 0) { @@ -3150,7 +3163,7 @@ handle_media_change(const gchar *device, gboolean insert, signal_user_data_t *ud rem_count++; if (rem_count == 2) { - ghb_file_menu_add_dvd(ud); + g_thread_create((GThreadFunc)ghb_cache_volnames, ud, FALSE, NULL); if (ud->current_dvd_device != NULL && strcmp(device, ud->current_dvd_device) == 0) { @@ -3625,9 +3638,9 @@ process_appcast(signal_user_data_t *ud) gtk_widget_set_size_request(html, 420, 240); gtk_widget_show(html); } + webkit_web_view_open(WEBKIT_WEB_VIEW(html), description); #endif dialog = GHB_WIDGET(ud->builder, "update_dialog"); - webkit_web_view_open(WEBKIT_WEB_VIEW(html), description); response = gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_hide(dialog); if (response == GTK_RESPONSE_OK) diff --git a/gtk/src/main.c b/gtk/src/main.c index 2a3ee18f8..9058bd43c 100644 --- a/gtk/src/main.c +++ b/gtk/src/main.c @@ -816,6 +816,7 @@ main (int argc, char *argv[]) // Everything should be go-to-go. Lets rock! gtk_main (); + gtk_status_icon_set_visible(si, FALSE); ghb_backend_close(); if (ud->queue) ghb_value_free(ud->queue); diff --git a/gtk/src/preview.c b/gtk/src/preview.c index b440475cc..c6a379058 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -978,7 +978,7 @@ picture_settings_alt2_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) } } -void +G_MODULE_EXPORT void preview_frame_value_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { if (ud->preview->live_id >= 0) @@ -1001,7 +1001,7 @@ preview_window_delete_cb( return TRUE; } -gboolean +G_MODULE_EXPORT gboolean settings_window_delete_cb( GtkWidget *widget, GdkEvent *event, |