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 --- src/gtk-dialog/Makefile.am | 6 ++++-- src/gtk-dialog/gtk-logout-helper.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/gtk-dialog') 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); } -- 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. --- src/gtk-dialog/gconf-helper.c | 32 ++++++++++++++++++++++++++++++++ src/gtk-dialog/gconf-helper.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 src/gtk-dialog/gconf-helper.c create mode 100644 src/gtk-dialog/gconf-helper.h (limited to 'src/gtk-dialog') 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