aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorChristoph Korn <c_korn@gmx.de>2009-09-08 10:09:45 -0500
committerTed Gould <ted@canonical.com>2009-09-08 10:09:45 -0500
commit85799abbe897e0f1e08b8d594716ab34b543d9fd (patch)
tree193e939ef6385ec5bdf59ba578e1ffd3c7b83375 /src/session-service.c
parenta5b8008742a719b77a7f3a13f81c2af02f6e4550 (diff)
parent1f47c9e8827165634149f6e21a4588fe577479d8 (diff)
downloadayatana-indicator-session-85799abbe897e0f1e08b8d594716ab34b543d9fd.tar.gz
ayatana-indicator-session-85799abbe897e0f1e08b8d594716ab34b543d9fd.tar.bz2
ayatana-indicator-session-85799abbe897e0f1e08b8d594716ab34b543d9fd.zip
Adding a GConf key to suppress confirmation dialogs
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/session-service.c b/src/session-service.c
index bea26ba..9e5cbb2 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -31,6 +31,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#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, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out"));
+ if (supress_confirmations()) {
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out"));
+ } else {
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_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, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart"));
+ if (supress_confirmations()) {
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart"));
+ } else {
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_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, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown"));
+ if (supress_confirmations()) {
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown"));
+ } else {
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown ..."));
+ }
dbusmenu_menuitem_child_append(root, mi);
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown");