OSDN Git Service

LinGui: update appcast checker to handle modified format
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 17 Jun 2009 16:46:04 +0000 (16:46 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 17 Jun 2009 16:46:04 +0000 (16:46 +0000)
exchange gtkhtml for webkitgtk in order to load html from the
link provided in the new appcast format.

git-svn-id: svn://localhost/HandBrake/trunk@2552 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/configure.ac
gtk/src/appcast.c
gtk/src/callbacks.c

index 566c789..3e7ae4a 100644 (file)
@@ -69,14 +69,14 @@ AM_PROG_LIBTOOL
 case $host in
   *-*-mingw*)
     if test "x$w32_gst" = "xyes" ; then
-               GHB_PACKAGES="gtk+-2.0 >= 2.8 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage libgtkhtml-3.14"
+               GHB_PACKAGES="gtk+-2.0 >= 2.8 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage webkit-1.0"
        else
         GHB_PACKAGES="gtk+-2.0 >= 2.8 gthread-2.0 gio-2.0"
        fi
        mingw_flag=yes
     ;;
   *)
-       GHB_PACKAGES="gtk+-2.0 >= 2.8 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage libgtkhtml-3.14 libnotify"
+       GHB_PACKAGES="gtk+-2.0 >= 2.8 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage webkit-1.0 libnotify"
        mingw_flag=no
     ;;
 esac
index 114b653..6e6f564 100644 (file)
@@ -35,7 +35,7 @@ typedef struct
 
 static tag_map_t tag_map[] =
 {
-       {"description", A_DESCRIPTION},
+       {"sparkle:releaseNotesLink", A_DESCRIPTION},
        {"enclosure", A_ENCLOSURE},
        {"item", A_ITEM},
 };
index aa5635f..487e89f 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <netinet/in.h>
 #include <netdb.h>
-#include <gtkhtml/gtkhtml.h>
+#include <webkit/webkit.h>
 #include <libnotify/notify.h>
 #else
 #define WINVER 0x0500
@@ -3420,14 +3420,6 @@ format_vquality_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud)
        return g_strdup_printf("QP: %.1f / %.1f%%", val, percent);
 }
 
-#if !defined(_WIN32)
-G_MODULE_EXPORT void
-html_link_cb(GtkHTML *html, const gchar *url, signal_user_data_t *ud)
-{
-       browse_url(url);
-}
-#endif
-
 static gpointer check_stable_update(signal_user_data_t *ud);
 static gboolean stable_update_lock = FALSE;
 
@@ -3436,7 +3428,8 @@ process_appcast(signal_user_data_t *ud)
 {
        gchar *description = NULL, *build = NULL, *version = NULL, *msg;
 #if !defined(_WIN32)
-       GtkWidget *html, *window;
+       GtkWidget *window;
+       static GtkWidget *html = NULL;
 #endif
        GtkWidget *dialog, *label;
        gint    response, ibuild = 0, skip;
@@ -3463,21 +3456,22 @@ process_appcast(signal_user_data_t *ud)
                        version, build, hb_get_version(NULL), hb_get_build(NULL));
        label = GHB_WIDGET(ud->builder, "update_message");
        gtk_label_set_text(GTK_LABEL(label), msg);
+
 #if !defined(_WIN32)
-       html = gtk_html_new_from_string(description, -1);
-       g_signal_connect(html, "link_clicked", G_CALLBACK(html_link_cb), ud);
-       window = GHB_WIDGET(ud->builder, "update_scroll");
-       gtk_container_add(GTK_CONTAINER(window), html);
-       // Show it
-       gtk_widget_set_size_request(html, 420, 240);
-       gtk_widget_show(html);
+       if (html == NULL)
+       {
+               html = webkit_web_view_new();
+               window = GHB_WIDGET(ud->builder, "update_scroll");
+               gtk_container_add(GTK_CONTAINER(window), html);
+               // Show it
+               gtk_widget_set_size_request(html, 420, 240);
+               gtk_widget_show(html);
+       }
 #endif
        dialog = GHB_WIDGET(ud->builder, "update_dialog");
+       webkit_web_view_load_uri(WEBKIT_WEB_VIEW(html), description);
        response = gtk_dialog_run(GTK_DIALOG(dialog));
        gtk_widget_hide(dialog);
-#if !defined(_WIN32)
-       gtk_widget_destroy(html);
-#endif
        if (response == GTK_RESPONSE_OK)
        {
                // Skip