From a76563f00527498fd4121d2b824ef622bc062985 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 3 Mar 2010 16:38:44 -0600 Subject: Adding in different button strings if we need authentication. --- src/dialog.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/dialog.c b/src/dialog.c index 6dd7a90..dd681b3 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -27,6 +27,14 @@ static const gchar * button_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button", "Switch Off") }; +/* TRANSLATORS: These strings have an ellipsis so that the user knows + they are also going to get a password dialog to do the action. */ +static const gchar * button_auth_strings[LOGOUT_DIALOG_TYPE_CNT] = { + /* LOGOUT_DIALOG_LOGOUT, */ NC_("button auth", "Log Out"), + /* LOGOUT_DIALOG_RESTART, */ NC_("button auth", "Restart..."), + /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button auth", "Switch Off...") +}; + /* static const gchar * restart_updates = N_("Restart Instead"); static const gchar * restart_auth = N_("Restart..."); @@ -165,9 +173,16 @@ logout_dialog_new (LogoutDialogType type) restart_required = check_restart_required(); } + const gchar * button_text; + if (allowed) { + button_text = _(button_strings[type]); + } else { + button_text = _(button_auth_strings[type]); + } + gtk_dialog_add_buttons(GTK_DIALOG(dialog), _("Cancel"), GTK_RESPONSE_CANCEL, - _(button_strings[type]), GTK_RESPONSE_OK, + button_text, GTK_RESPONSE_OK, NULL); return dialog; -- cgit v1.2.3