r35785 - /desktop/unstable/gnome-session/debian/patches/04_fallback_warning_notify.patch
joss at users.alioth.debian.org
joss at users.alioth.debian.org
Sun Sep 23 07:43:25 UTC 2012
Author: joss
Date: Sun Sep 23 07:43:24 2012
New Revision: 35785
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=35785
Log:
Update 04_fallback_warning_notify.patch after upstream review.
Modified:
desktop/unstable/gnome-session/debian/patches/04_fallback_warning_notify.patch
Modified: desktop/unstable/gnome-session/debian/patches/04_fallback_warning_notify.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/gnome-session/debian/patches/04_fallback_warning_notify.patch?rev=35785&op=diff
==============================================================================
--- desktop/unstable/gnome-session/debian/patches/04_fallback_warning_notify.patch [utf-8] (original)
+++ desktop/unstable/gnome-session/debian/patches/04_fallback_warning_notify.patch [utf-8] Sun Sep 23 07:43:24 2012
@@ -1,95 +1,59 @@
-Index: gnome-session-3.4.2.1/configure.ac
-===================================================================
---- gnome-session-3.4.2.1.orig/configure.ac 2012-05-23 15:53:21.000000000 +0200
-+++ gnome-session-3.4.2.1/configure.ac 2012-09-11 21:07:30.154242183 +0200
-@@ -73,6 +73,40 @@ PKG_CHECK_MODULES(EGG_SMCLIENT, gtk+-3.0
- PKG_CHECK_MODULES(GL_TEST, xcomposite gl)
+From 64175236ff7b2b3a31d836c8804afe3b203ef319 Mon Sep 17 00:00:00 2001
+From: Josselin Mouette <joss at debian.org>
+Date: Sun, 23 Sep 2012 09:41:10 +0200
+Subject: [PATCH] Display fallback warning using libnotify
+
+This avoids annoying users, especially those using live systems, with a
+dialog they have to click on.
+---
+ configure.ac | 2 ++
+ gnome-session/gsm-manager.c | 62 +++++++++++++++++++------------------------
+ 2 files changed, 30 insertions(+), 34 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b75f269..60a7461 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -38,6 +38,7 @@ GTK3_REQUIRED=2.90.7
+ DBUS_GLIB_REQUIRED=0.76
+ UPOWER_REQUIRED=0.9.0
+ JSON_GLIB_REQUIRED=0.10
++LIBNOTIFY_REQUIRED=0.7
dnl ====================================================================
-+dnl Check for libnotify
-+dnl ====================================================================
-+AC_ARG_ENABLE([libnotify],
-+ AS_HELP_STRING([--enable-libnotify], [Use libnotify]),
-+ [enable_libnotify=$enableval],
-+ [enable_libnotify=auto])
-+
-+PKG_CHECK_MODULES(LIBNOTIFY,
-+ [libnotify >= 0.7],
-+ [have_libnotify=yes], [have_libnotify=no])
-+
-+AC_MSG_CHECKING([whether to use libnotify])
-+
-+if test x$enable_libnotify = xauto ; then
-+ if test x$have_libnotify = xno ; then
-+ enable_libnotify=no
-+ else
-+ enable_libnotify=yes
-+ fi
-+fi
-+
-+AC_MSG_RESULT($enable_libnotify)
-+
-+if test x$enable_libnotify = xyes; then
-+ if test x$have_libnotify = xno; then
-+ AC_MSG_ERROR([Libnotify support explicitly required, but headers not found])
-+ fi
-+ AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if libnotify is used instead of error dialogs])
-+fi
-+
-+AC_SUBST(LIBNOTIFY_CFLAGS)
-+AC_SUBST(LIBNOTIFY_LIBS)
-+
-+dnl ====================================================================
- dnl Check for systemd
- dnl ====================================================================
- AC_ARG_ENABLE([systemd],
-Index: gnome-session-3.4.2.1/gnome-session/Makefile.am
-===================================================================
---- gnome-session-3.4.2.1.orig/gnome-session/Makefile.am 2012-05-17 20:26:07.000000000 +0200
-+++ gnome-session-3.4.2.1/gnome-session/Makefile.am 2012-09-11 21:08:33.586552239 +0200
-@@ -73,6 +73,7 @@ gnome_session_CPPFLAGS = \
- $(ICE_CFLAGS) \
- $(XEXT_CFLAGS) \
- $(GCONF_CFLAGS) \
-+ $(LIBNOTIFY_CFLAGS) \
- $(SYSTEMD_CFLAGS) \
- -I$(top_srcdir)/egg \
- -DLOCALE_DIR=\""$(datadir)/locale"\" \
-@@ -92,6 +93,7 @@ gnome_session_LDADD = \
- $(XEXT_LIBS) \
- $(GNOME_SESSION_LIBS) \
- $(GCONF_LIBS) \
-+ $(LIBNOTIFY_LIBS) \
- $(SYSTEMD_LIBS) \
- $(EXECINFO_LIBS)
+ dnl Dependency Checks
+@@ -54,6 +55,7 @@ PKG_CHECK_MODULES(GNOME_SESSION,
+ dbus-glib-1 >= $DBUS_GLIB_REQUIRED
+ upower-glib >= $UPOWER_REQUIRED
+ json-glib-1.0 >= $JSON_GLIB_REQUIRED
++ libnotify >= $LIBNOTIFY_REQUIRED
+ )
-Index: gnome-session-3.4.2.1/gnome-session/gsm-manager.c
-===================================================================
---- gnome-session-3.4.2.1.orig/gnome-session/gsm-manager.c 2012-09-11 20:45:31.199794108 +0200
-+++ gnome-session-3.4.2.1/gnome-session/gsm-manager.c 2012-09-11 22:51:08.960644337 +0200
-@@ -42,6 +42,10 @@
+ PKG_CHECK_MODULES(SESSION_PROPERTIES,
+diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
+index 9f7cff5..c85b6b1 100644
+--- a/gnome-session/gsm-manager.c
++++ b/gnome-session/gsm-manager.c
+@@ -40,6 +40,8 @@
#include <gtk/gtk.h> /* for logout dialog */
-+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
-+#endif
+
#include "gsm-manager.h"
#include "gsm-manager-glue.h"
-@@ -1368,6 +1372,43 @@ end_session_or_show_shell_dialog (GsmMan
-
+@@ -1341,46 +1343,38 @@ end_session_or_show_shell_dialog (GsmManager *manager)
}
-+#ifdef HAVE_LIBNOTIFY
-+
-+static void
+ static void
+on_link_clicked (NotifyNotification *notif,
+ char *action,
+ gpointer data)
+{
-+ gtk_show_uri (NULL, (char *)data, GDK_CURRENT_TIME, NULL);
++ char *uri = data;
++ gtk_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
++ g_free (uri);
+}
+
+static gboolean
@@ -102,32 +66,56 @@
+}
+
+static void
-+show_fallback_dialog (const char *title,
-+ const char *description,
-+ const char *link_text,
-+ const char *uri)
-+{
+ show_fallback_dialog (const char *title,
+ const char *description,
+ const char *link_text,
+ const char *uri)
+ {
+- GtkWidget *dialog, *image, *link, *hbox;
+-
+- dialog = gtk_message_dialog_new (NULL, 0,
+- GTK_MESSAGE_WARNING,
+- GTK_BUTTONS_CLOSE,
+- "%s", title);
+-
+- gtk_window_set_icon_name (GTK_WINDOW (dialog), GSM_ICON_COMPUTER_FAIL);
+ NotifyNotification *notif;
-+
+
+- image = gtk_image_new_from_icon_name (GSM_ICON_COMPUTER_FAIL,
+- gsm_util_get_computer_fail_icon_size ());
+- gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image);
+-
+- if (description) {
+- gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
+- "%s", description);
+- }
+-
+- hbox = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (dialog));
+-
+- if (uri) {
+- if (link_text) {
+- link = gtk_link_button_new_with_label (uri, link_text);
+- } else {
+- link = gtk_link_button_new (uri);
+- }
+- gtk_box_pack_start (GTK_BOX (hbox), link, FALSE, FALSE, 0);
+- }
+-
+- gtk_widget_show_all (dialog);
+-
+- g_signal_connect (dialog,
+- "response",
+- G_CALLBACK (gtk_widget_destroy),
+- NULL);
+ notify_init ("GNOME");
+ notif = notify_notification_new (title, description, GSM_ICON_COMPUTER_FAIL);
+ notify_notification_set_timeout (notif, 15*1000);
-+ notify_notification_add_action (notif, "link-click", link_text, NOTIFY_ACTION_CALLBACK (on_link_clicked), (gpointer) uri, NULL);
++ notify_notification_add_action (notif, "link-click", link_text, NOTIFY_ACTION_CALLBACK (on_link_clicked), g_strdup (uri), NULL);
+ /* Give the notification daemon a chance to finish initialization */
+ g_timeout_add_seconds (2, (GSourceFunc) notification_show_timeout, (gpointer) notif);
-+}
-+
-+#else /* HAVE_LIBNOTIFY */
-+
- static void
- show_fallback_dialog (const char *title,
- const char *description,
-@@ -1411,6 +1452,8 @@ show_fallback_dialog (const char *title,
- NULL);
}
-+#endif /* HAVE_LIBNOTIFY */
-+
static void
- possibly_show_fallback_dialog (GsmManager *manager)
- {
+--
+1.7.10.4
+
More information about the pkg-gnome-commits
mailing list