diff options
Diffstat (limited to 'src/gtk-dialog')
-rw-r--r-- | src/gtk-dialog/gconf-helper.c | 4 | ||||
-rw-r--r-- | src/gtk-dialog/gtk-logout-helper.c | 23 | ||||
-rw-r--r-- | src/gtk-dialog/logout-dialog.c | 8 |
3 files changed, 22 insertions, 13 deletions
diff --git a/src/gtk-dialog/gconf-helper.c b/src/gtk-dialog/gconf-helper.c index 213592e..9262b19 100644 --- a/src/gtk-dialog/gconf-helper.c +++ b/src/gtk-dialog/gconf-helper.c @@ -51,11 +51,11 @@ static void update_menu_entries_callback (GConfClient *client, guint cnxn_id, GC if (gconf_value_get_bool (value)) { dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out")); dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart")); - dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown")); + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch Off")); } else { dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->logout_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Log Out...")); dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->restart_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Restart...")); - dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shutdown...")); + dbusmenu_menuitem_property_set(restart_shutdown_logout_mi->shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Switch Off...")); } } } diff --git a/src/gtk-dialog/gtk-logout-helper.c b/src/gtk-dialog/gtk-logout-helper.c index 4c6614c..7453ce4 100644 --- a/src/gtk-dialog/gtk-logout-helper.c +++ b/src/gtk-dialog/gtk-logout-helper.c @@ -43,19 +43,23 @@ consolekit_fallback (LogoutDialogAction action) return; } + GError * error = NULL; + switch (action) { case LOGOUT_DIALOG_LOGOUT: g_warning("Unable to fallback to ConsoleKit for logout as it's a session issue. We need some sort of session handler."); break; case LOGOUT_DIALOG_SHUTDOWN: - dbus_g_proxy_call_no_reply(proxy, - "Stop", - G_TYPE_INVALID); + dbus_g_proxy_call(proxy, + "Stop", + &error, + G_TYPE_INVALID); break; case LOGOUT_DIALOG_RESTART: - dbus_g_proxy_call_no_reply(proxy, - "Restart", - G_TYPE_INVALID); + dbus_g_proxy_call(proxy, + "Restart", + &error, + G_TYPE_INVALID); break; default: g_warning("Unknown action"); @@ -64,6 +68,11 @@ consolekit_fallback (LogoutDialogAction action) g_object_unref(proxy); + if (error != NULL) { + g_error("Unable to signal ConsoleKit: %s", error->message); + g_error_free(error); + } + return; } @@ -150,7 +159,7 @@ option_restart (const gchar * arg, const gchar * value, gpointer data, GError * static GOptionEntry options[] = { {"logout", 'l', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_logout, "Log out of the current session", NULL}, - {"shutdown", 's', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_shutdown, "Shutdown the entire system", NULL}, + {"shutdown", 's', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_shutdown, "Switch off the entire system", NULL}, {"restart", 'r', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, option_restart, "Restart the system", NULL}, {NULL} diff --git a/src/gtk-dialog/logout-dialog.c b/src/gtk-dialog/logout-dialog.c index 98806ca..07fc6df 100644 --- a/src/gtk-dialog/logout-dialog.c +++ b/src/gtk-dialog/logout-dialog.c @@ -62,13 +62,13 @@ get_plural_string (LogoutDialog * dialog); static const gchar * title_strings[LOGOUT_DIALOG_ACTION_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ NC_("title", "Log Out"), /* LOGOUT_DIALOG_RESTART, */ NC_("title", "Restart"), - /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("title", "Shut Down") + /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("title", "Switch Off") }; static const gchar * button_strings[LOGOUT_DIALOG_ACTION_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ NC_("button", "Log Out"), /* LOGOUT_DIALOG_RESTART, */ NC_("button", "Restart"), - /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button", "Shut Down") + /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button", "Switch Off") }; static const gchar * restart_auth = N_("Restart..."); @@ -126,8 +126,8 @@ get_plural_string (LogoutDialog * dialog) dialog->timeout); break; case LOGOUT_DIALOG_SHUTDOWN: - plural_string = ngettext("The computer will be shut down in %d second.", - "The computer will be shut down in %d seconds.", + plural_string = ngettext("The computer will switch off in %d second.", + "The computer will switch off in %d seconds.", dialog->timeout); break; default: |