From 8a2d7e75773c27f079a5a39e9ff03cd02bc2ef69 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 1 Sep 2009 10:28:19 -0500 Subject: Apparently the DBus interface will put a bad string in messages in some cases. We don't really need it, so let's not risk it. --- src/indicator-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indicator-session.c b/src/indicator-session.c index 43c568f..8a4e298 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -367,7 +367,7 @@ build_users_menu (gpointer userdata) } if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_USERS_DBUS_NAME, 0, &returnval, &error)) { - g_error("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" ); + g_error("Unable to send message to DBus to start service"); g_error_free(error); return FALSE; } -- cgit v1.2.3 From 1f0874253406566587d4e42a9ee2f4617a5c66d9 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Wed, 2 Sep 2009 16:17:44 +0200 Subject: These patches introduce a gconf key whether the logout/restart/shutdown confirmations should be shown or not. Also the menu items should be suffixed by '...' accordingly. However this only works after a restart. Bugs which get fixed are: https://bugs.launchpad.net/indicator-session/+bug/422025 https://bugs.launchpad.net/ubuntu/+source/indicator-session/+bug/421693 https://bugs.launchpad.net/ubuntu/+source/indicator-session/+bug/419472 --- configure.ac | 13 +++++++++++++ data/Makefile.am | 32 ++++++++++++++++++++++++++++++-- src/Makefile.am | 6 +++--- src/gtk-dialog/Makefile.am | 6 ++++-- src/gtk-dialog/gtk-logout-helper.c | 4 +++- src/session-service.c | 20 +++++++++++++++++--- 6 files changed, 70 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 28b2c8b..5c5fbe1 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,8 @@ AM_INIT_AUTOMAKE(indicator-session, 0.1) AM_MAINTAINER_MODE +IT_PROG_INTLTOOL([0.35.0]) + AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_C_O @@ -56,6 +58,16 @@ PKG_CHECK_MODULES(GTKLOGOUTHELPER, gtk+-2.0 >= $GTK_REQUIRED_VERSION AC_SUBST(GTKLOGOUTHELPER_CFLAGS) AC_SUBST(GTKLOGOUTHELPER_LIBS) +AC_PATH_PROG(GCONFTOOL, gconftool-2) +dnl Specify the gconf configuration source, +dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults + +AM_GCONF_SOURCE_2 + +PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.0) +AC_SUBST(GCONF_CFLAGS) +AC_SUBST(GCONF_LIBS) + ########################### # Check to see if we're local ########################### @@ -115,6 +127,7 @@ data/icons/48x48/status/Makefile data/icons/scalable/Makefile data/icons/scalable/status/Makefile data/icons/scalable/actions/Makefile +po/Makefile.in ]) ########################### diff --git a/data/Makefile.am b/data/Makefile.am index 434e7d6..9ba0d97 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -9,9 +9,37 @@ dbus_services_DATA = $(service_in_files:.service.in=.service) %.service: %.service.in sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ +############################## +# GConf Schema +############################## + +schemadir = \ + $(GCONF_SCHEMA_FILE_DIR) + +schema_in_files = \ + indicator-session.schemas.in + +schema_DATA = \ + $(schema_in_files:.schemas.in=.schemas) + +@INTLTOOL_SCHEMAS_RULE@ + + #$(dbus_services_DATA): $(service_in_files) Makefile # sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ -EXTRA_DIST = $(service_in_files) +EXTRA_DIST = \ + $(service_in_files) \ + $(schema_in_files) + +CLEANFILES = \ + $(dbus_services_DATA) \ + $(schema_DATA) -CLEANFILES = $(dbus_services_DATA) +if GCONF_SCHEMAS_INSTALL +install-data-local: + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ + gconftool-2 --makefile-install-rule $(schema_DATA) +else +install-data-local: +endif diff --git a/src/Makefile.am b/src/Makefile.am index 599b70a..e2f0008 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -84,9 +84,9 @@ indicator_users_service_LDADD = $(USERSSERVICE_LIBS) # Session Stuff ################# -indicator_session_service_SOURCES = session-service.c -indicator_session_service_CFLAGS = $(SESSIONSERVICE_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror -indicator_session_service_LDADD = $(SESSIONSERVICE_LIBS) +indicator_session_service_SOURCES = session-service.c gtk-dialog/gconf-helper.c +indicator_session_service_CFLAGS = $(SESSIONSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall -Werror +indicator_session_service_LDADD = $(SESSIONSERVICE_LIBS) $(GCONF_LIBS) ############### # Other Stuff diff --git a/src/gtk-dialog/Makefile.am b/src/gtk-dialog/Makefile.am index 9aa0097..90a6209 100644 --- a/src/gtk-dialog/Makefile.am +++ b/src/gtk-dialog/Makefile.am @@ -5,9 +5,11 @@ gtk_logout_helper_SOURCES = \ gtk-logout-helper.c \ ck-pk-helper.c \ ck-pk-helper.h \ + gconf-helper.c \ + gconf-helper.h \ logout-dialog.c \ logout-dialog.h -gtk_logout_helper_CFLAGS = $(GTKLOGOUTHELPER_CFLAGS) -Wall -Werror -gtk_logout_helper_LDADD = $(GTKLOGOUTHELPER_LIBS) +gtk_logout_helper_CFLAGS = $(GTKLOGOUTHELPER_CFLAGS) $(GCONF_CFLAGS) -Wall -Werror +gtk_logout_helper_LDADD = $(GTKLOGOUTHELPER_LIBS) $(GCONF_LIBS) diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c index 5d87148..13991ca 100644 --- a/src/gtk-dialog/gtk-logout-helper.c +++ b/src/gtk-dialog/gtk-logout-helper.c @@ -6,6 +6,7 @@ Copyright 2009 Canonical Ltd. Authors: Ted Gould + Christoph Korn This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3, as published @@ -26,6 +27,7 @@ with this program. If not, see . #include #include "logout-dialog.h" #include "ck-pk-helper.h" +#include "gconf-helper.h" static void session_action (LogoutDialogAction action) @@ -132,7 +134,7 @@ main (int argc, char * argv[]) } GtkWidget * dialog = NULL; - if (!pk_require_auth(type)) { + if (!pk_require_auth(type) && !supress_confirmations()) { dialog = logout_dialog_new(type); } diff --git a/src/session-service.c b/src/session-service.c index ad160e9..0e89fed 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -31,6 +31,8 @@ with this program. If not, see . #include "dbus-shared-names.h" +#include "gtk-dialog/gconf-helper.h" + #define DKP_ADDRESS "org.freedesktop.DeviceKit.Power" #define DKP_OBJECT "/org/freedesktop/DeviceKit/Power" #define DKP_INTERFACE "org.freedesktop.DeviceKit.Power" @@ -223,7 +225,11 @@ create_items (DbusmenuMenuitem * root) { DbusmenuMenuitem * mi = NULL; mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _("Log Out")); + if (supress_confirmations()) { + dbusmenu_menuitem_property_set(mi, "label", _("Log Out")); + } else { + dbusmenu_menuitem_property_set(mi, "label", _("Log Out ...")); + } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "logout"); @@ -240,12 +246,20 @@ create_items (DbusmenuMenuitem * root) { g_signal_connect(G_OBJECT(hibernate_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(sleep), "Hibernate"); mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _("Restart")); + if (supress_confirmations()) { + dbusmenu_menuitem_property_set(mi, "label", _("Restart")); + } else { + dbusmenu_menuitem_property_set(mi, "label", _("Restart ...")); + } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart"); mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(mi, "label", _("Shutdown")); + if (supress_confirmations()) { + dbusmenu_menuitem_property_set(mi, "label", _("Shutdown")); + } else { + dbusmenu_menuitem_property_set(mi, "label", _("Shutdown ...")); + } dbusmenu_menuitem_child_append(root, mi); g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); -- cgit v1.2.3 From 1f47c9e8827165634149f6e21a4588fe577479d8 Mon Sep 17 00:00:00 2001 From: Christoph Korn Date: Wed, 2 Sep 2009 17:10:20 +0200 Subject: Added files which were missing in the previous commit. --- data/indicator-session.schemas.in | 17 +++++++++++++++++ src/gtk-dialog/gconf-helper.c | 32 ++++++++++++++++++++++++++++++++ src/gtk-dialog/gconf-helper.h | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 data/indicator-session.schemas.in create mode 100644 src/gtk-dialog/gconf-helper.c create mode 100644 src/gtk-dialog/gconf-helper.h diff --git a/data/indicator-session.schemas.in b/data/indicator-session.schemas.in new file mode 100644 index 0000000..1db9226 --- /dev/null +++ b/data/indicator-session.schemas.in @@ -0,0 +1,17 @@ + + + + + /schemas/apps/indicator-session/suppress_logout_restart_shutdown + /apps/indicator-session/suppress_logout_restart_shutdown + indicator-session + bool + FALSE + + Suppress the dialog to confirm logout, restart and shutdown action + Whether or not to show confirmation dialogs for logout, + restart and shutdown actions. + + + + diff --git a/src/gtk-dialog/gconf-helper.c b/src/gtk-dialog/gconf-helper.c new file mode 100644 index 0000000..0bd21ad --- /dev/null +++ b/src/gtk-dialog/gconf-helper.c @@ -0,0 +1,32 @@ +/* +A small wrapper utility to load indicators and put them as menu items +into the gnome-panel using it's applet interface. + +Copyright 2009 Canonical Ltd. + +Authors: + Christoph Korn + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see . +*/ + + +#include + +#include "gconf-helper.h" + +gboolean +supress_confirmations (void) { + GConfClient *client = gconf_client_get_default (); + return gconf_client_get_bool (client, SUPPRESS_KEY, NULL) ; +} diff --git a/src/gtk-dialog/gconf-helper.h b/src/gtk-dialog/gconf-helper.h new file mode 100644 index 0000000..1d78fd8 --- /dev/null +++ b/src/gtk-dialog/gconf-helper.h @@ -0,0 +1,33 @@ +/* +A small wrapper utility to load indicators and put them as menu items +into the gnome-panel using it's applet interface. + +Copyright 2009 Canonical Ltd. + +Authors: + Christoph Korn + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, 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, see . +*/ + + +#ifndef __GCONF_HELPER_H__ +#define __GCONF_HELPER_H__ 1 + +#include + +#define SUPPRESS_KEY "/apps/indicator-session/suppress_logout_restart_shutdown" + +gboolean supress_confirmations (void); + +#endif /* __GCONF_HELPER__ */ -- cgit v1.2.3 From 44ecddced2e977719ac661a8ed06969d1df0400b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 4 Sep 2009 13:44:50 -0500 Subject: releasing version 0.1.1-0ubuntu2~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1088ace..3fae4bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-session (0.1.1-0ubuntu2~ppa1) UNRELEASED; urgency=low +indicator-session (0.1.1-0ubuntu2~ppa1) karmic; urgency=low * Removing printing DBus error message as it sometimes isn't valid. (LP: #420238) - -- Ted Gould Fri, 04 Sep 2009 13:28:07 -0500 + -- Ted Gould Fri, 04 Sep 2009 13:44:45 -0500 indicator-session (0.1.1-0ubuntu1) karmic; urgency=low -- cgit v1.2.3 From 300caf97182bf232d538caadfffb6adce0a03194 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Sep 2009 10:19:00 -0500 Subject: releasing version 0.1.1-0ubuntu2~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0074a22..0905e1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-session (0.1.1-0ubuntu2~ppa2) UNRELEASED; urgency=low +indicator-session (0.1.1-0ubuntu2~ppa2) karmic; urgency=low * Merging in c_korn's branch. - -- Ted Gould Tue, 08 Sep 2009 10:14:04 -0500 + -- Ted Gould Tue, 08 Sep 2009 10:18:56 -0500 indicator-session (0.1.1-0ubuntu2~ppa1) karmic; urgency=low -- cgit v1.2.3 From 3211a5e810fbbe830a237127092d221018f4f6a2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Sep 2009 10:45:57 -0500 Subject: Turning into 0.1.2 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1d42cb0..957a471 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.1.1) +AM_INIT_AUTOMAKE(indicator-session, 0.1.2) AM_MAINTAINER_MODE -- cgit v1.2.3 From 5553f55cf3c4071dfaac02f7b85d7c821921ce60 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Sep 2009 10:52:06 -0500 Subject: releasing version 0.1.2-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index c470f75..a99d120 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-session (0.1.2-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-session (0.1.2-0ubuntu1~ppa1) karmic; urgency=low * Upstream version 0.1.2 fixes LP: #425598, LP: #418769, LP: #421693 and LP: #422025. - -- Ted Gould Tue, 08 Sep 2009 10:49:53 -0500 + -- Ted Gould Tue, 08 Sep 2009 10:51:59 -0500 indicator-session (0.1.1-0ubuntu2~ppa2) karmic; urgency=low -- cgit v1.2.3 From a937e1ff0501e9b28eca4cda1449d197471724a9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Sep 2009 11:11:38 -0500 Subject: * Upstream version 0.1.2 * Adds translation setup. (fixes LP: #425598) * Packaging fix to use upstream tarball. (fixes LP: #418769) * Shows elipsis when dialogs are enabled (fixes LP: #421693) * Adds GConf key for configure whether dialogs on shutdown and logout are shown. (fixes LP: #422025) --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index a99d120..cc47ab4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +indicator-session (0.1.2-0ubuntu1~ppa2) UNRELEASED; urgency=low + + * Upstream version 0.1.2 + * Adds translation setup. (fixes LP: #425598) + * Packaging fix to use upstream tarball. (fixes LP: #418769) + * Shows elipsis when dialogs are enabled (fixes LP: #421693) + * Adds GConf key for configure whether dialogs on shutdown and + logout are shown. (fixes LP: #422025) + + -- Ted Gould Tue, 08 Sep 2009 11:08:19 -0500 + indicator-session (0.1.2-0ubuntu1~ppa1) karmic; urgency=low * Upstream version 0.1.2 fixes LP: #425598, LP: #418769, LP: #421693 -- cgit v1.2.3 From 5360fce331660e7b94a274bffa125ba8233fbeab Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 8 Sep 2009 11:12:17 -0500 Subject: releasing version 0.1.2-0ubuntu1~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cc47ab4..f58837c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-session (0.1.2-0ubuntu1~ppa2) UNRELEASED; urgency=low +indicator-session (0.1.2-0ubuntu1~ppa2) karmic; urgency=low * Upstream version 0.1.2 * Adds translation setup. (fixes LP: #425598) @@ -7,7 +7,7 @@ indicator-session (0.1.2-0ubuntu1~ppa2) UNRELEASED; urgency=low * Adds GConf key for configure whether dialogs on shutdown and logout are shown. (fixes LP: #422025) - -- Ted Gould Tue, 08 Sep 2009 11:08:19 -0500 + -- Ted Gould Tue, 08 Sep 2009 11:12:12 -0500 indicator-session (0.1.2-0ubuntu1~ppa1) karmic; urgency=low -- cgit v1.2.3