[gnome-online-accounts/gnome-3-6] Ensure that all dialogs have consistent and meaningful strings
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts/gnome-3-6] Ensure that all dialogs have consistent and meaningful strings
- Date: Fri, 14 Sep 2012 22:11:27 +0000 (UTC)
commit 4c396c1b8fea4c548edde22e3da0922c32b668d3
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Sep 14 15:24:33 2012 +0200
Ensure that all dialogs have consistent and meaningful strings
Now that modal dialogs have titles, we don't need an extra label. Also
ensure that the strings used for Google, Facebook and Windows Live are
consistent with the ones used for Exchange and Kerberos.
Therefore, all modal dialogs now have "FOO account" as the title.
This has the nice side-effect that we don't use "Refresh", which
does not sound right, in the UI anymore.
Fixes: https://bugzilla.gnome.org/683692
src/goabackend/goaexchangeprovider.c | 25 +++++++++----------------
src/goabackend/goakerberosprovider.c | 19 ++++---------------
src/goabackend/goaoauth2provider.c | 6 +-----
src/goabackend/goaoauthprovider.c | 6 +-----
src/goabackend/goautils.c | 22 +++++++---------------
src/goabackend/goautils.h | 2 +-
6 files changed, 23 insertions(+), 57 deletions(-)
---
diff --git a/src/goabackend/goaexchangeprovider.c b/src/goabackend/goaexchangeprovider.c
index 219997c..1f2c06c 100644
--- a/src/goabackend/goaexchangeprovider.c
+++ b/src/goabackend/goaexchangeprovider.c
@@ -436,16 +436,20 @@ on_email_address_or_password_changed (GtkEditable *editable, gpointer user_data)
}
static void
-create_account_details_ui (GtkBox *vbox, gboolean new_account, AddAccountData *data)
+create_account_details_ui (GoaProvider *provider,
+ GtkDialog *dialog,
+ GtkBox *vbox,
+ gboolean new_account,
+ AddAccountData *data)
{
GtkWidget *header_grid;
GtkWidget *grid1;
GtkWidget *grid2;
GtkWidget *hbox;
- GtkWidget *label;
- gchar *markup;
gint width;
+ goa_utils_set_dialog_title (provider, dialog, new_account);
+
data->cluebar = gtk_info_bar_new ();
gtk_info_bar_set_message_type (GTK_INFO_BAR (data->cluebar), GTK_MESSAGE_ERROR);
gtk_widget_set_no_show_all (data->cluebar, TRUE);
@@ -460,17 +464,6 @@ create_account_details_ui (GtkBox *vbox, gboolean new_account, AddAccountData *d
gtk_orientable_set_orientation (GTK_ORIENTABLE (header_grid), GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (vbox, header_grid, FALSE, FALSE, 0);
- label = gtk_label_new (NULL);
- gtk_widget_set_hexpand (label, TRUE);
- markup = g_strconcat ("<b>",
- (new_account) ? _("New Microsoft Exchange Account") : _("Microsoft Exchange Account"),
- "</b>",
- NULL);
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_container_add (GTK_CONTAINER (header_grid), label);
-
data->spinner = gtk_spinner_new ();
gtk_widget_set_no_show_all (data->spinner, TRUE);
gtk_container_add (GTK_CONTAINER (header_grid), data->spinner);
@@ -585,7 +578,7 @@ add_account (GoaProvider *provider,
data.dialog = dialog;
data.error = NULL;
- create_account_details_ui (vbox, TRUE, &data);
+ create_account_details_ui (provider, dialog, vbox, TRUE, &data);
gtk_widget_show_all (GTK_WIDGET (vbox));
ews_client = goa_ews_client_new ();
@@ -748,7 +741,7 @@ refresh_account (GoaProvider *provider,
data.dialog = GTK_DIALOG (dialog);
data.error = NULL;
- create_account_details_ui (GTK_BOX (vbox), FALSE, &data);
+ create_account_details_ui (provider, GTK_DIALOG (dialog), GTK_BOX (vbox), FALSE, &data);
account = goa_object_peek_account (object);
email_address = goa_account_get_presentation_identity (account);
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index 99a1a5b..a2b73d5 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -967,6 +967,7 @@ on_object_manager_ensured_for_getting_realms (GoaKerberosProvider *self,
static void
create_account_details_ui (GoaKerberosProvider *self,
+ GtkDialog *dialog,
GtkWidget *vbox,
gboolean new_account,
SignInRequest *request)
@@ -975,26 +976,14 @@ create_account_details_ui (GoaKerberosProvider *self,
GtkWidget *grid1;
GtkWidget *grid2;
GtkWidget *hbox;
- GtkWidget *label;
- gchar *markup;
gint width;
+ goa_utils_set_dialog_title (GOA_PROVIDER (self), dialog, new_account);
+
header_grid = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (header_grid), GTK_ORIENTATION_HORIZONTAL);
gtk_box_pack_start (GTK_BOX (vbox), header_grid, FALSE, FALSE, 0);
- label = gtk_label_new (NULL);
- gtk_widget_set_hexpand (label, TRUE);
- markup = g_strconcat ("<b>",
- (new_account) ? _("New Enterprise Login (Kerberos)") : _("Enterprise Login (Kerberos)"),
- "</b>",
- NULL);
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_misc_set_padding (GTK_MISC (label), 0.0, 12);
- gtk_container_add (GTK_CONTAINER (header_grid), label);
-
request->spinner = gtk_spinner_new ();
gtk_widget_set_no_show_all (request->spinner, TRUE);
gtk_container_add (GTK_CONTAINER (header_grid), request->spinner);
@@ -1332,7 +1321,7 @@ add_account (GoaProvider *provider,
request.dialog = dialog;
request.error = NULL;
- create_account_details_ui (self, GTK_WIDGET (vbox), TRUE, &request);
+ create_account_details_ui (self, dialog, GTK_WIDGET (vbox), TRUE, &request);
gtk_widget_show_all (GTK_WIDGET (vbox));
start_over:
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index fd2a636..fb0578f 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -833,7 +833,6 @@ get_tokens_and_identity (GoaOAuth2Provider *provider,
gboolean ret;
gchar *url;
IdentifyData data;
- GtkWidget *label;
gchar *escaped_redirect_uri;
gchar *escaped_client_id;
gchar *escaped_scope;
@@ -865,10 +864,7 @@ get_tokens_and_identity (GoaOAuth2Provider *provider,
escaped_client_id,
escaped_scope);
- label = goa_utils_create_add_refresh_label (GOA_PROVIDER (provider), add_account);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
+ goa_utils_set_dialog_title (GOA_PROVIDER (provider), dialog, add_account);
if (goa_oauth2_provider_get_use_external_browser (provider))
{
diff --git a/src/goabackend/goaoauthprovider.c b/src/goabackend/goaoauthprovider.c
index 6a85dba..e63d8fe 100644
--- a/src/goabackend/goaoauthprovider.c
+++ b/src/goabackend/goaoauthprovider.c
@@ -766,7 +766,6 @@ get_tokens_and_identity (GoaOAuthProvider *provider,
RestProxy *proxy;
RestProxyCall *call;
GHashTable *f;
- GtkWidget *label;
GtkWidget *spinner;
gboolean use_external_browser;
gchar **request_params;
@@ -816,10 +815,7 @@ get_tokens_and_identity (GoaOAuthProvider *provider,
goto out;
}
- label = goa_utils_create_add_refresh_label (GOA_PROVIDER (provider), add_account);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- gtk_widget_show (label);
+ goa_utils_set_dialog_title (GOA_PROVIDER (provider), dialog, add_account);
spinner = gtk_spinner_new ();
gtk_widget_set_size_request (GTK_WIDGET (spinner), 24, 24);
diff --git a/src/goabackend/goautils.c b/src/goabackend/goautils.c
index c599945..50c337c 100644
--- a/src/goabackend/goautils.c
+++ b/src/goabackend/goautils.c
@@ -95,26 +95,18 @@ goa_utils_check_duplicate (GoaClient *client,
return ret;
}
-GtkWidget *
-goa_utils_create_add_refresh_label (GoaProvider *provider, gboolean add_account)
+void
+goa_utils_set_dialog_title (GoaProvider *provider, GtkDialog *dialog, gboolean add_account)
{
- GtkWidget *label;
- gchar *markup;
gchar *provider_name;
- gchar *template;
-
- label = gtk_label_new (NULL);
+ gchar *title;
+ provider_name = goa_provider_get_provider_name (GOA_PROVIDER (provider), NULL);
/* Translators: the %s is the name of the provider. eg., Google. */
- template = g_strconcat ("<b>", (add_account) ? _("Add %s") : _("Refresh %s"), "</b>", NULL);
- provider_name = goa_provider_get_provider_name (provider, NULL);
- markup = g_strdup_printf (template, provider_name);
- gtk_label_set_markup (GTK_LABEL (label), markup);
- g_free (markup);
+ title = g_strdup_printf (_("%s account"), provider_name);
+ gtk_window_set_title (GTK_WINDOW (dialog), title);
+ g_free (title);
g_free (provider_name);
- g_free (template);
-
- return label;
}
gboolean
diff --git a/src/goabackend/goautils.h b/src/goabackend/goautils.h
index 0418fb7..70d2fee 100644
--- a/src/goabackend/goautils.h
+++ b/src/goabackend/goautils.h
@@ -41,7 +41,7 @@ gboolean goa_utils_check_duplicate (GoaClient *client,
GoaPeekInterfaceFunc func,
GError **error);
-GtkWidget *goa_utils_create_add_refresh_label (GoaProvider *provider, gboolean add_account);
+void goa_utils_set_dialog_title (GoaProvider *provider, GtkDialog *dialog, gboolean add_account);
gboolean goa_utils_delete_credentials_sync (GoaProvider *provider,
GoaAccount *account,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]