aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-10-17 20:47:35 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-10-17 20:47:35 +0800
commit9443aba35805c6c91d6c7d51246be6d311df3798 (patch)
tree417d1180ebf4434cf2aa685645bb34936b3ef1dd /src
parenta1e7795ec6e8c0459d9f3fe9158dcca20cd4cda3 (diff)
downloadgsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.tar
gsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.tar.gz
gsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.tar.bz2
gsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.tar.lz
gsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.tar.xz
gsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.tar.zst
gsoc2013-empathy-9443aba35805c6c91d6c7d51246be6d311df3798.zip
Ask whether to import if there are accounts to import on loading the account editor, but only once. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1626 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'src')
-rw-r--r--src/empathy-accounts-dialog.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index d3d0ff86c..344a34d17 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -44,6 +44,7 @@
#include <libempathy-gtk/empathy-account-widget.h>
#include <libempathy-gtk/empathy-account-widget-irc.h>
#include <libempathy-gtk/empathy-account-widget-sip.h>
+#include <libempathy-gtk/empathy-conf.h>
#include "empathy-accounts-dialog.h"
#include "empathy-import-dialog.h"
@@ -1020,6 +1021,36 @@ accounts_dialog_response_cb (GtkWidget *widget,
}
static void
+accounts_dialog_accounts_to_import (EmpathyAccountsDialog *dialog)
+{
+ GtkWidget *message;
+ gint response;
+ gboolean ask;
+
+ empathy_conf_get_bool (empathy_conf_get (),
+ EMPATHY_PREFS_IMPORT_ASKED, &ask);
+
+ if (ask)
+ return;
+
+ empathy_conf_set_bool (empathy_conf_get (),
+ EMPATHY_PREFS_IMPORT_ASKED, TRUE);
+
+ message = gtk_message_dialog_new (GTK_WINDOW (dialog->window),
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ _("Do you want to import accounts"
+ " from Pidgin?"));
+
+ response = gtk_dialog_run (GTK_DIALOG (message));
+ gtk_widget_destroy (message);
+
+ if (response == GTK_RESPONSE_YES)
+ empathy_import_dialog_show (GTK_WINDOW (dialog->window));
+}
+
+static void
accounts_dialog_destroy_cb (GtkWidget *widget,
EmpathyAccountsDialog *dialog)
{
@@ -1177,6 +1208,9 @@ empathy_accounts_dialog_show (GtkWindow *parent,
gtk_widget_show (dialog->window);
+ if (empathy_import_dialog_accounts_to_import ())
+ accounts_dialog_accounts_to_import (dialog);
+
return dialog->window;
}