diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-10-17 20:47:38 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-10-17 20:47:38 +0800 |
commit | b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc (patch) | |
tree | 80485ad4d9e8e1cc04be5729597f284e74e99926 | |
parent | c913dcdf12336156d154b117b0ffb1d208bbe8e3 (diff) | |
download | gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.tar gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.tar.gz gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.tar.bz2 gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.tar.lz gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.tar.xz gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.tar.zst gsoc2013-empathy-b35f4db08c5cc2e944dcc4fd4f9ab9507d9730fc.zip |
Only display the importing result if there was a failure. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1627
-rw-r--r-- | src/empathy-import-dialog.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c index 2387e507c..4a08bcee9 100644 --- a/src/empathy-import-dialog.c +++ b/src/empathy-import-dialog.c @@ -101,10 +101,7 @@ typedef struct GtkWidget *treeview; GtkWidget *button_ok; GtkWidget *button_cancel; - - guint no_imported; - guint no_not_imported; - guint no_ignored; + gboolean not_imported; } EmpathyImportDialog; #define PIDGIN_ACCOUNT_TAG_NAME "name" @@ -450,17 +447,12 @@ import_dialog_tree_model_foreach (GtkTreeModel *model, -1); if (!to_import) - { - dialog->no_ignored++; return FALSE; - } data = g_value_get_pointer (value); - if (import_dialog_add_account (data)) - dialog->no_imported++; - else - dialog->no_not_imported++; + if (!import_dialog_add_account (data)) + dialog->not_imported = TRUE; return FALSE; } @@ -478,22 +470,25 @@ import_dialog_button_ok_clicked_cb (GtkButton *button, { GtkTreeModel *model; GtkWidget *message; + GtkWindow *window; model = gtk_tree_view_get_model (GTK_TREE_VIEW (dialog->treeview)); gtk_tree_model_foreach (model, import_dialog_tree_model_foreach, dialog); - message = gtk_message_dialog_new (GTK_WINDOW (dialog->window), - GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, - _("%u accounts imported successfully.\n" - "%u accounts failed to import.\n" - "%u accounts were ignored."), - dialog->no_imported, dialog->no_not_imported, dialog->no_ignored); + window = gtk_window_get_transient_for (GTK_WINDOW (dialog->window)); + + import_dialog_free (dialog); + + if (!dialog->not_imported) + return; + + message = gtk_message_dialog_new (window, + GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, + _("One or more accounts failed to import.")); gtk_dialog_run (GTK_DIALOG (message)); gtk_widget_destroy (message); - - import_dialog_free (dialog); } static void |