diff options
author | Christoph Korn <korn@ubuntu> | 2009-09-02 16:17:44 +0200 |
---|---|---|
committer | Christoph Korn <korn@ubuntu> | 2009-09-02 16:17:44 +0200 |
commit | 1f0874253406566587d4e42a9ee2f4617a5c66d9 (patch) | |
tree | cd8a07328b4a7fcdf836e6596c311a0640e2cf2d /src/session-service.c | |
parent | 41f1b3206ab13b008aed6670dc42636049c9590d (diff) | |
download | ayatana-indicator-session-1f0874253406566587d4e42a9ee2f4617a5c66d9.tar.gz ayatana-indicator-session-1f0874253406566587d4e42a9ee2f4617a5c66d9.tar.bz2 ayatana-indicator-session-1f0874253406566587d4e42a9ee2f4617a5c66d9.zip |
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
Diffstat (limited to 'src/session-service.c')
-rw-r--r-- | src/session-service.c | 20 |
1 files changed, 17 insertions, 3 deletions
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 <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, "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"); |