summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-05-24 18:15:40 +0000
committerjstebbins <[email protected]>2010-05-24 18:15:40 +0000
commitb1d5e7b5af2cbc601253d254389a4ef8df709639 (patch)
tree0baeb0af4fd534eabfa7f25d3456f2aa452e52a6
parenteef8301f8f1c858961395ea8f1a9e6a58400e36d (diff)
LinGui: add option to completely disable update checking
configure --disable-gtk-update-checks removes the code that does update checks including the webkit library used for displaying the appcast. this is useful when packaging for a repository that has it's own update mechanism. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3323 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--gtk/configure.ac27
-rw-r--r--gtk/module.defs6
-rw-r--r--gtk/src/callbacks.c8
-rw-r--r--gtk/src/ghb.ui2
-rw-r--r--gtk/src/main.c5
-rw-r--r--gtk/src/marshalers.c4
-rw-r--r--make/configure.py3
7 files changed, 42 insertions, 13 deletions
diff --git a/gtk/configure.ac b/gtk/configure.ac
index 423923bf4..63a8a75ba 100644
--- a/gtk/configure.ac
+++ b/gtk/configure.ac
@@ -53,6 +53,10 @@ AC_ARG_ENABLE(gst,
AS_HELP_STRING([--enable-gst], [enable gstreamer on Win32]),
w32_gst=yes, w32_gst=no)
+AC_ARG_ENABLE(update-checks,
+ AS_HELP_STRING([--disable-update-checks], [disable update checks]),
+ update_checks=no, update_checks=yes)
+
# overwrite global variable (used for Makefile generation)
AC_SUBST(GLOBALCXXFLAGS, $CXXFLAGS )
AC_SUBST(GLOBALLDFLAGS, $LDFLAGS )
@@ -90,17 +94,22 @@ if test "x$w32_gst" = "xyes" -o "x$mingw_flag" != "xyes" ; then
CFLAGS="$CFLAGS -D_ENABLE_GST"
fi
-PKG_CHECK_MODULES(OldWebKitGtk, WebKitGtk, old_webkit=yes, old_webkit=no)
-if test "x$old_webkit" = "xyes" ; then
- if test "x$mingw_flag" = "xno" ; then
- GHB_PACKAGES="$GHB_PACKAGES WebKitGtk"
- CXXFLAGS="$CXXFLAGS -D_OLD_WEBKIT"
- CFLAGS="$CFLAGS -D_OLD_WEBKIT"
+PKG_PROG_PKG_CONFIG
+if test "x$update_checks" = "xyes" ; then
+ PKG_CHECK_MODULES(OldWebKitGtk, WebKitGtk, old_webkit=yes, old_webkit=no)
+ if test "x$old_webkit" = "xyes" ; then
+ if test "x$mingw_flag" = "xno" ; then
+ GHB_PACKAGES="$GHB_PACKAGES WebKitGtk"
+ CXXFLAGS="$CXXFLAGS -D_OLD_WEBKIT"
+ CFLAGS="$CFLAGS -D_OLD_WEBKIT"
+ fi
+ else
+ if test "x$mingw_flag" = "xno" ; then
+ GHB_PACKAGES="$GHB_PACKAGES webkit-1.0"
+ fi
fi
else
- if test "x$mingw_flag" = "xno" ; then
- GHB_PACKAGES="$GHB_PACKAGES webkit-1.0"
- fi
+ CFLAGS="$CFLAGS -D_NO_UPDATE_CHECK"
fi
AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])
diff --git a/gtk/module.defs b/gtk/module.defs
index 6801d61aa..9881a9000 100644
--- a/gtk/module.defs
+++ b/gtk/module.defs
@@ -22,9 +22,13 @@ BUILD.out += $(GTK.out)
###############################################################################
ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system))
- GTK.GCC.D += PTW32_STATIC_LIB
+ GTK.GCC.D += PTW32_STATIC_LIB
+ GTK.CONFIGURE.extra = --host=$(BUILD.spec)
endif
+ifeq (0,$(FEATURE.gtk.update.checks))
+ GTK.CONFIGURE.extra += --disable-update-checks
+endif
###############################################################################
###############################################################################
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 0b4cd5b94..ec29ff6c0 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -29,11 +29,15 @@
#include <netinet/in.h>
#include <netdb.h>
+
+#if !defined(_NO_UPDATE_CHECK)
#if defined(_OLD_WEBKIT)
#include <webkit.h>
#else
#include <webkit/webkit.h>
#endif
+#endif
+
#include <libnotify/notify.h>
#include <gdk/gdkx.h>
#else
@@ -2972,6 +2976,7 @@ ghb_timer_cb(gpointer data)
update_preview = FALSE;
}
+#if !defined(_NO_UPDATE_CHECK)
if (!appcast_busy)
{
gchar *updates;
@@ -3002,6 +3007,7 @@ ghb_timer_cb(gpointer data)
}
}
}
+#endif
return TRUE;
}
@@ -4664,6 +4670,7 @@ process_appcast(signal_user_data_t *ud)
gtk_label_set_text(GTK_LABEL(label), msg);
#if !defined(_WIN32)
+#if !defined(_NO_UPDATE_CHECK)
if (html == NULL)
{
html = webkit_web_view_new();
@@ -4675,6 +4682,7 @@ process_appcast(signal_user_data_t *ud)
}
webkit_web_view_open(WEBKIT_WEB_VIEW(html), description);
#endif
+#endif
dialog = GHB_WIDGET(ud->builder, "update_dialog");
response = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_hide(dialog);
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 3d7d9a53b..9f9df58ae 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -3806,7 +3806,7 @@ Requires subme >= 6 and trellis >= 1.</property>
<property name="orientation">vertical</property>
<property name="visible">True</property>
<child>
- <object class="GtkAlignment" id="alignment60">
+ <object class="GtkAlignment" id="check_updates_box">
<property name="visible">True</property>
<property name="left_padding">12</property>
<property name="top_padding">6</property>
diff --git a/gtk/src/main.c b/gtk/src/main.c
index c26966db2..6d0d81441 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -827,6 +827,11 @@ main (int argc, char *argv[])
// Since GtkBuilder no longer assigns object ids to widget names
// Assign a few that are necessary for style overrides to work
GtkWidget *widget;
+#if defined(_NO_UPDATE_CHECK)
+ widget = GHB_WIDGET(ud->builder, "check_updates_box");
+ gtk_widget_hide(widget);
+#endif
+
widget = GHB_WIDGET(ud->builder, "preview_hud");
gtk_widget_set_name(widget, "preview_hud");
widget = GHB_WIDGET(ud->builder, "preview_window");
diff --git a/gtk/src/marshalers.c b/gtk/src/marshalers.c
index 0f234ec3d..a87615269 100644
--- a/gtk/src/marshalers.c
+++ b/gtk/src/marshalers.c
@@ -47,7 +47,7 @@
#endif /* !G_ENABLE_DEBUG */
-/* VOID:STRING,STRING (marshalers.list:1) */
+/* VOID:STRING,STRING (/home/jstebbins/Source/HandBrake.update-checks/build.debug/../gtk/src/marshalers.list:1) */
void
ghb_marshal_VOID__STRING_STRING (GClosure *closure,
GValue *return_value G_GNUC_UNUSED,
@@ -84,7 +84,7 @@ ghb_marshal_VOID__STRING_STRING (GClosure *closure,
data2);
}
-/* BOOLEAN:BOXED (marshalers.list:2) */
+/* BOOLEAN:BOXED (/home/jstebbins/Source/HandBrake.update-checks/build.debug/../gtk/src/marshalers.list:2) */
void
ghb_marshal_BOOLEAN__BOXED (GClosure *closure,
GValue *return_value G_GNUC_UNUSED,
diff --git a/make/configure.py b/make/configure.py
index dcd798cf4..6702ee28d 100644
--- a/make/configure.py
+++ b/make/configure.py
@@ -1055,6 +1055,8 @@ def createCLI():
h = IfHost( 'disable GTK GUI', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
grp.add_option( '--disable-gtk', default=False, action='store_true', help=h )
+ h = IfHost( 'disable GTK GUI update checks', '*-*-linux*', none=optparse.SUPPRESS_HELP ).value
+ grp.add_option( '--disable-gtk-update-checks', default=False, action='store_true', help=h )
h = IfHost( 'enable GTK GUI (mingw)', '*-*-mingw*', none=optparse.SUPPRESS_HELP ).value
grp.add_option( '--enable-gtk-mingw', default=False, action='store_true', help=h )
@@ -1451,6 +1453,7 @@ int main ()
doc.addBlank()
doc.add( 'FEATURE.asm', 'disabled' )
doc.add( 'FEATURE.gtk', int( not options.disable_gtk ))
+ doc.add( 'FEATURE.gtk.update.checks', int( not options.disable_gtk_update_checks ))
doc.add( 'FEATURE.gtk.mingw', int( options.enable_gtk_mingw ))
doc.add( 'FEATURE.xcode', int( not (Tools.xcodebuild.fail or options.disable_xcode or options.cross) ))