OBS User unknown 2008-10-22 15:58:32 +00:00 committed by Git OBS Bridge
parent 3db2d35eac
commit 959cabc9b8
3 changed files with 95 additions and 228 deletions

View File

@ -1,8 +1,8 @@
Index: gnome-session/gsm-manager.c
===================================================================
--- gnome-session/gsm-manager.c (révision 5027)
--- gnome-session/gsm-manager.c (révision 5137)
+++ gnome-session/gsm-manager.c (copie de travail)
@@ -2178,7 +2178,8 @@ logout_dialog_response (GsmLogoutDialog
@@ -2180,7 +2180,8 @@ logout_dialog_response (GsmLogoutDialog
{
g_debug ("GsmManager: Logout dialog response: %d", response_id);
@ -12,7 +12,7 @@ Index: gnome-session/gsm-manager.c
/* In case of dialog cancel, switch user, hibernate and
* suspend, we just perform the respective action and return,
@@ -2188,6 +2189,10 @@ logout_dialog_response (GsmLogoutDialog
@@ -2190,6 +2191,10 @@ logout_dialog_response (GsmLogoutDialog
case GTK_RESPONSE_NONE:
case GTK_RESPONSE_DELETE_EVENT:
break;
@ -25,7 +25,7 @@ Index: gnome-session/gsm-manager.c
break;
Index: gnome-session/gsm-util.c
===================================================================
--- gnome-session/gsm-util.c (révision 5027)
--- gnome-session/gsm-util.c (révision 5137)
+++ gnome-session/gsm-util.c (copie de travail)
@@ -21,6 +21,7 @@
#include <config.h>
@ -113,7 +113,7 @@ Index: gnome-session/gsm-util.c
+}
Index: gnome-session/gsm-util.h
===================================================================
--- gnome-session/gsm-util.h (révision 5027)
--- gnome-session/gsm-util.h (révision 5137)
+++ gnome-session/gsm-util.h (copie de travail)
@@ -21,6 +21,7 @@
#define __GSM_UTIL_H__
@ -133,141 +133,11 @@ Index: gnome-session/gsm-util.h
G_END_DECLS
#endif /* __GSM_UTIL_H__ */
Index: gnome-session/test-logout.c
===================================================================
--- gnome-session/test-logout.c (révision 0)
+++ gnome-session/test-logout.c (révision 0)
@@ -0,0 +1,117 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Novell, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+
+#include <gtk/gtk.h>
+
+#include "gsm-logout-dialog.h"
+
+static void
+logout_dialog_response (GsmLogoutDialog *logout_dialog,
+ guint response_id,
+ gpointer data)
+{
+ /* In case of dialog cancel, switch user, hibernate and
+ * suspend, we just perform the respective action and return,
+ * without shutting down the session. */
+ switch (response_id) {
+ case GTK_RESPONSE_CANCEL:
+ case GTK_RESPONSE_NONE:
+ case GTK_RESPONSE_DELETE_EVENT:
+ g_print ("Cancel\n");
+ break;
+ case GTK_RESPONSE_HELP:
+ g_print ("Help\n");
+ break;
+ case GSM_LOGOUT_RESPONSE_SWITCH_USER:
+ g_print ("Switch user\n");
+ break;
+ case GSM_LOGOUT_RESPONSE_HIBERNATE:
+ g_print ("Hibernate\n");
+ break;
+ case GSM_LOGOUT_RESPONSE_SLEEP:
+ g_print ("Suspend\n");
+ break;
+ case GSM_LOGOUT_RESPONSE_SHUTDOWN:
+ g_print ("Shutdown\n");
+ break;
+ case GSM_LOGOUT_RESPONSE_REBOOT:
+ g_print ("Reboot\n");
+ break;
+ case GSM_LOGOUT_RESPONSE_LOGOUT:
+ g_print ("Logout\n");
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+
+ gtk_main_quit ();
+}
+
+
+int
+main (int argc,
+ char *argv[])
+{
+ GtkWidget *dialog;
+ GError *error;
+
+ static gboolean logout;
+ static gboolean shutdown;
+
+ static GOptionEntry entries[] = {
+ { "logout", 'l', 0, G_OPTION_ARG_NONE, &logout, "Test logout dialog", NULL },
+ { "shutdown", 's', 0, G_OPTION_ARG_NONE, &shutdown, "Test shutdown dialog", NULL },
+ { NULL, 0, 0, 0, NULL, NULL, NULL }
+ };
+
+ logout = shutdown = FALSE;
+ error = NULL;
+
+ gtk_init_with_args (&argc, &argv,
+ (char *) " - test logout/shutdown dialogs",
+ entries, NULL,
+ &error);
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ exit (1);
+ }
+
+ if (!shutdown)
+ dialog = gsm_get_logout_dialog (gdk_screen_get_default (),
+ GDK_CURRENT_TIME);
+ else
+ dialog = gsm_get_shutdown_dialog (gdk_screen_get_default (),
+ GDK_CURRENT_TIME);
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (logout_dialog_response), NULL);
+ gtk_widget_show (dialog);
+
+ gtk_main ();
+
+ return 0;
+}
Index: gnome-session/Makefile.am
===================================================================
--- gnome-session/Makefile.am (révision 5027)
--- gnome-session/Makefile.am (révision 5137)
+++ gnome-session/Makefile.am (copie de travail)
@@ -7,6 +7,7 @@ noinst_LTLIBRARIES = libgsmutil.la
noinst_PROGRAMS = \
test-client-dbus \
test-inhibit \
+ test-logout \
$(NULL)
INCLUDES = \
@@ -21,6 +22,7 @@ INCLUDES = \
@@ -21,6 +21,7 @@ INCLUDES = \
-DDATA_DIR=\""$(datadir)/gnome-session"\" \
-DDBUS_LAUNCH=\"dbus-launch\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
@ -275,34 +145,9 @@ Index: gnome-session/Makefile.am
-DGLADEDIR=\""$(pkgdatadir)"\" \
-DGCONF_SANITY_CHECK=\""$(GCONF_SANITY_CHECK)"\" \
-DGCONFTOOL_CMD=\"$(GCONFTOOL)\"
@@ -42,6 +44,24 @@ test_client_dbus_LDADD = \
$(DBUS_GLIB_LIBS) \
$(NULL)
+test_logout_SOURCES = \
+ test-logout.c \
+ gdm.c \
+ gdm.h \
+ gsm-consolekit.c \
+ gsm-consolekit.h \
+ gsm-logout-dialog.c \
+ gsm-logout-dialog.h \
+ gsm-power-manager.c \
+ gsm-power-manager.h \
+ $(NULL)
+
+test_logout_LDADD = \
+ $(GNOME_SESSION_LIBS) \
+ $(DBUS_GLIB_LIBS) \
+ $(POLKIT_GNOME_LIBS) \
+ $(NULL)
+
gnome_session_LDADD = \
-lSM -lICE \
libgsmutil.la \
Index: gnome-session/gsm-logout-dialog.c
===================================================================
--- gnome-session/gsm-logout-dialog.c (révision 5027)
--- gnome-session/gsm-logout-dialog.c (révision 5137)
+++ gnome-session/gsm-logout-dialog.c (copie de travail)
@@ -37,8 +37,13 @@
@ -355,9 +200,7 @@ Index: gnome-session/gsm-logout-dialog.c
-};
-
-G_DEFINE_TYPE (GsmLogoutDialog, gsm_logout_dialog, GTK_TYPE_MESSAGE_DIALOG);
+static void gsm_logout_set_info_text (GsmLogoutDialog *logout_dialog,
+ int seconds);
-
-static void
-gsm_logout_dialog_set_property (GObject *object,
- guint prop_id,
@ -372,7 +215,9 @@ Index: gnome-session/gsm-logout-dialog.c
- break;
- }
-}
-
+static void gsm_logout_set_info_text (GsmLogoutDialog *logout_dialog,
+ int seconds);
-static void
-gsm_logout_dialog_get_property (GObject *object,
- guint prop_id,
@ -436,7 +281,7 @@ Index: gnome-session/gsm-logout-dialog.c
logout_dialog->priv->power_manager = gsm_get_power_manager ();
logout_dialog->priv->consolekit = gsm_get_consolekit ();
@@ -247,17 +221,76 @@ gsm_logout_supports_shutdown (GsmLogoutD
@@ -247,17 +221,82 @@ gsm_logout_supports_shutdown (GsmLogoutD
}
static void
@ -459,7 +304,7 @@ Index: gnome-session/gsm-logout-dialog.c
+ const char *info_text;
+ char *buf;
+ char *markup;
+ const char *name;
+ char *name;
+
+ switch (logout_dialog->priv->default_response) {
+ case GSM_LOGOUT_RESPONSE_LOGOUT:
@ -494,11 +339,15 @@ Index: gnome-session/gsm-logout-dialog.c
+ g_assert_not_reached ();
+ }
+
+ name = g_get_real_name ();
+ name = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL);
+
+ if (!name || name[0] == '\0') {
+ name = g_get_user_name ();
+ }
+ if (!name || name[0] == '\0' || strcmp (name, "Unknown") == 0) {
+ name = g_locale_to_utf8 (g_get_user_name (), -1 , NULL, NULL, NULL);
+ }
+
+ if (!name) {
+ name = g_strdup (g_get_user_name ());
+ }
+
+ buf = g_strdup_printf (info_text, name, seconds);
+ markup = g_markup_printf_escaped ("<i>%s</i>", buf);
@ -506,6 +355,8 @@ Index: gnome-session/gsm-logout-dialog.c
+ gtk_label_set_markup (GTK_LABEL (logout_dialog->priv->info_label),
+ markup);
+ g_free (markup);
+
+ g_free (name);
}
static gboolean
@ -513,11 +364,11 @@ Index: gnome-session/gsm-logout-dialog.c
{
GsmLogoutDialog *logout_dialog;
- char *secondary_text;
- const char *name;
- char *name;
int seconds_to_show;
logout_dialog = (GsmLogoutDialog *) data;
@@ -278,46 +311,7 @@ gsm_logout_dialog_timeout (gpointer data
@@ -278,73 +317,129 @@ gsm_logout_dialog_timeout (gpointer data
seconds_to_show += 10;
}
@ -533,7 +384,8 @@ Index: gnome-session/gsm-logout-dialog.c
- "out in %d seconds.",
- seconds_to_show);
- break;
-
+ gsm_logout_set_info_text (logout_dialog, seconds_to_show);
- case GSM_DIALOG_LOGOUT_TYPE_SHUTDOWN:
- secondary_text = ngettext ("You are currently logged in as "
- "\"%s\".\n"
@ -545,46 +397,35 @@ Index: gnome-session/gsm-logout-dialog.c
- "shut down in %d seconds.",
- seconds_to_show);
- break;
-
+ logout_dialog->priv->timeout--;
- default:
- g_assert_not_reached ();
- }
-
- name = g_get_real_name ();
-
- if (!name || name[0] == '\0') {
- name = g_get_user_name ();
- }
-
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (logout_dialog),
- secondary_text,
- name,
- seconds_to_show,
- NULL);
+ gsm_logout_set_info_text (logout_dialog, seconds_to_show);
+ return TRUE;
+}
logout_dialog->priv->timeout--;
@@ -325,12 +319,10 @@ gsm_logout_dialog_timeout (gpointer data
}
static void
-gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog)
- name = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL);
+static void
+gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog,
+ int seconds)
{
- logout_dialog->priv->timeout = AUTOMATIC_ACTION_TIMEOUT;
-
- /* Sets the secondary text */
- gsm_logout_dialog_timeout (logout_dialog);
+{
+ logout_dialog->priv->timeout = seconds;
if (logout_dialog->priv->timeout_id != 0) {
g_source_remove (logout_dialog->priv->timeout_id);
@@ -342,13 +334,118 @@ gsm_logout_dialog_set_timeout (GsmLogout
}
- if (!name || name[0] == '\0' || strcmp (name, "Unknown") == 0) {
- name = g_locale_to_utf8 (g_get_user_name (), -1 , NULL, NULL, NULL);
+ if (logout_dialog->priv->timeout_id != 0) {
+ g_source_remove (logout_dialog->priv->timeout_id);
}
static GtkWidget *
- if (!name) {
- name = g_strdup (g_get_user_name ());
+ logout_dialog->priv->timeout_id = g_timeout_add (1000,
+ gsm_logout_dialog_timeout,
+ logout_dialog);
+}
+
+static GtkWidget *
+gsm_logout_tile_new (const char *icon_name,
+ const char *title,
+ const char *description)
@ -612,19 +453,27 @@ Index: gnome-session/gsm-logout-dialog.c
+ image = gtk_image_new_from_icon_name (icon_name,
+ GTK_ICON_SIZE_DIALOG);
+ gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+ }
+
}
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (logout_dialog),
- secondary_text,
- name,
- seconds_to_show,
- NULL);
+ vbox = gtk_vbox_new (FALSE, 2);
+
- logout_dialog->priv->timeout--;
+ markup = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>",
+ title);
+ label = gtk_label_new (markup);
+ g_free (markup);
+
- g_free (name);
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_use_underline (GTK_LABEL (label), TRUE);
+
- return TRUE;
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+
+ if (description != NULL) {
@ -652,20 +501,27 @@ Index: gnome-session/gsm-logout-dialog.c
+ gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
+
+ return button;
+}
+
+static void
}
static void
-gsm_logout_dialog_set_timeout (GsmLogoutDialog *logout_dialog)
+gsm_logout_tile_clicked (GtkWidget *tile,
+ gpointer response_p)
+{
{
- logout_dialog->priv->timeout = AUTOMATIC_ACTION_TIMEOUT;
+ GtkWidget *dialog;
+
- /* Sets the secondary text */
- gsm_logout_dialog_timeout (logout_dialog);
+ dialog = gtk_widget_get_toplevel (tile);
+ g_assert (GTK_IS_DIALOG (dialog));
+ gtk_dialog_response (GTK_DIALOG (dialog),
+ GPOINTER_TO_UINT (response_p));
+}
+
- if (logout_dialog->priv->timeout_id != 0) {
- g_source_remove (logout_dialog->priv->timeout_id);
- }
+static GtkWidget *
+gsm_logout_append_tile (GtkWidget *vbox,
+ unsigned int response,
@ -683,13 +539,15 @@ Index: gnome-session/gsm-logout-dialog.c
+ "clicked",
+ G_CALLBACK (gsm_logout_tile_clicked),
+ GUINT_TO_POINTER (response));
+
- logout_dialog->priv->timeout_id = g_timeout_add (1000,
- gsm_logout_dialog_timeout,
- logout_dialog);
+ return tile;
+}
+
+static GtkWidget *
gsm_get_dialog (GsmDialogLogoutType type,
GdkScreen *screen,
}
static GtkWidget *
@@ -353,8 +448,10 @@ gsm_get_dialog (GsmDialogLogoutType type
guint32 activate_time)
{
GsmLogoutDialog *logout_dialog;
@ -701,7 +559,7 @@ Index: gnome-session/gsm-logout-dialog.c
if (current_dialog != NULL) {
gtk_widget_destroy (GTK_WIDGET (current_dialog));
@@ -358,82 +455,119 @@ gsm_get_dialog (GsmDialogLogoutType type
@@ -364,82 +461,119 @@ gsm_get_dialog (GsmDialogLogoutType type
current_dialog = logout_dialog;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 21 14:37:52 CEST 2008 - vuntz@novell.com
- Rebase gnome-session-bgo507101-tile-ui.patch.
Fix bnc#437090.
-------------------------------------------------------------------
Tue Oct 14 18:58:43 CEST 2008 - meissner@suse.de

View File

@ -38,7 +38,7 @@ BuildRequires: update-desktop-files
License: GPL v2 or later; LGPL v2.1 or later
Group: System/GUI/GNOME
Version: 2.24.0
Release: 2
Release: 3
Summary: Session Tools for the GNOME 2.x Desktop
Url: http://www.gnome.org
Source: %{name}-%{version}.tar.bz2
@ -56,7 +56,7 @@ Patch0: gnome-session-ice-auth-for-suid.patch
Patch1: gnome-session-kdm-support.patch
# PATCH-FIX-OPENSUSE gnome-session-wm-switch.patch bnc180506 danw@novell.com -- Fixes legacy sessions to use gnome-wm instead of metacity/compiz.
Patch2: gnome-session-wm-switch.patch
# PATCH-NEEDS-REBASE gnome-session-bgo507101-tile-ui.patch bgo507101 vuntz@novell.com -- Tile UI for logout dialog. Was: PATCH-FIX-UPSTREAM
# PATCH-FIX-UPSTREAM gnome-session-bgo507101-tile-ui.patch bgo507101 vuntz@novell.com -- Tile UI for logout dialog.
Patch3: gnome-session-bgo507101-tile-ui.patch
# PATCH-FEATURE-OPENSUSE gnome-session-gnome-wm-compiz-manager.patch vuntz@novell.com -- Launch compiz-manager when configured.
Patch4: gnome-session-gnome-wm-compiz-manager.patch
@ -124,7 +124,7 @@ Authors:
%patch0 -p1
%patch1 -p1
%patch2 -p1
# %patch3 -p0
%patch3 -p0
%patch4 -p1
%patch5 -p1
%patch6 -p0
@ -195,6 +195,9 @@ rm -rf $RPM_BUILD_ROOT
%files lang -f %{name}-2.0.lang
%changelog
* Tue Oct 21 2008 vuntz@novell.com
- Rebase gnome-session-bgo507101-tile-ui.patch.
Fix bnc#437090.
* Tue Oct 14 2008 meissner@suse.de
- added prototype
* Mon Oct 06 2008 sbrabec@suse.cz