empathy r2665 - trunk/src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2665 - trunk/src
- Date: Tue, 10 Mar 2009 11:20:01 +0000 (UTC)
Author: xclaesse
Date: Tue Mar 10 11:20:01 2009
New Revision: 2665
URL: http://svn.gnome.org/viewvc/empathy?rev=2665&view=rev
Log:
Make the "Import Accounts" button insensitive if there's nothing to import.
Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
Modified:
trunk/src/empathy-accounts-dialog.c
trunk/src/empathy-import-dialog.c
trunk/src/empathy-import-dialog.h
trunk/src/empathy-import-pidgin.c
trunk/src/empathy-import-pidgin.h
Modified: trunk/src/empathy-accounts-dialog.c
==============================================================================
--- trunk/src/empathy-accounts-dialog.c (original)
+++ trunk/src/empathy-accounts-dialog.c Tue Mar 10 11:20:01 2009
@@ -1153,11 +1153,17 @@
empathy_conf_get_bool (empathy_conf_get (),
EMPATHY_PREFS_IMPORT_ASKED, &import_asked);
- if (!import_asked) {
- empathy_conf_set_bool (empathy_conf_get (),
- EMPATHY_PREFS_IMPORT_ASKED, TRUE);
- empathy_import_dialog_show (GTK_WINDOW (dialog->window),
- FALSE);
+
+ if (empathy_import_dialog_accounts_to_import ()) {
+
+ if (!import_asked) {
+ empathy_conf_set_bool (empathy_conf_get (),
+ EMPATHY_PREFS_IMPORT_ASKED, TRUE);
+ empathy_import_dialog_show (GTK_WINDOW (dialog->window),
+ FALSE);
+ }
+ } else {
+ gtk_widget_set_sensitive (dialog->button_import, FALSE);
}
return dialog->window;
Modified: trunk/src/empathy-import-dialog.c
==============================================================================
--- trunk/src/empathy-import-dialog.c (original)
+++ trunk/src/empathy-import-dialog.c Tue Mar 10 11:20:01 2009
@@ -347,6 +347,12 @@
g_slice_free (EmpathyImportDialog, dialog);
}
+gboolean
+empathy_import_dialog_accounts_to_import (void)
+{
+ return empathy_import_pidgin_accounts_to_import ();
+}
+
void
empathy_import_dialog_show (GtkWindow *parent,
gboolean warning)
Modified: trunk/src/empathy-import-dialog.h
==============================================================================
--- trunk/src/empathy-import-dialog.h (original)
+++ trunk/src/empathy-import-dialog.h Tue Mar 10 11:20:01 2009
@@ -38,6 +38,7 @@
EmpathyImportAccountData *empathy_import_account_data_new (const gchar *source);
void empathy_import_account_data_free (EmpathyImportAccountData *data);
+gboolean empathy_import_dialog_accounts_to_import (void);
void empathy_import_dialog_show (GtkWindow *parent, gboolean warning);
G_END_DECLS
Modified: trunk/src/empathy-import-pidgin.c
==============================================================================
--- trunk/src/empathy-import-pidgin.c (original)
+++ trunk/src/empathy-import-pidgin.c Tue Mar 10 11:20:01 2009
@@ -303,3 +303,19 @@
return accounts;
}
+gboolean
+empathy_import_pidgin_accounts_to_import (void)
+{
+ gchar *filename;
+ gboolean out;
+ GFile *file;
+
+ filename = g_build_filename (g_get_home_dir (), ".purple", "accounts.xml", NULL);
+ file = g_file_new_for_path (filename);
+ out = g_file_query_exists (file, NULL);
+
+ g_free (filename);
+ g_object_unref (file);
+
+ return out;
+}
Modified: trunk/src/empathy-import-pidgin.h
==============================================================================
--- trunk/src/empathy-import-pidgin.h (original)
+++ trunk/src/empathy-import-pidgin.h Tue Mar 10 11:20:01 2009
@@ -27,6 +27,7 @@
G_BEGIN_DECLS
GList *empathy_import_pidgin_load (void);
+gboolean empathy_import_pidgin_accounts_to_import (void);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]