summaryrefslogtreecommitdiff
path: root/src/contacts-setup-window.vala
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2022-09-03 09:54:43 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2022-09-03 09:54:43 +0200
commit59ac39fa7e0d62130303e7bf3d38dfdda2321187 (patch)
treecb580cc14a09b6bfc909547ad515d1eec512003b /src/contacts-setup-window.vala
parent437deaf68fa19939f628a9c491aee236ef4fcff2 (diff)
downloadgnome-contacts-59ac39fa7e0d62130303e7bf3d38dfdda2321187.tar.gz
Emit a log message if no address books are found
On a well configured system, this shouldn't happen since we expect something like E-D-S to be running. Of course, distro bugs can happen, and people can always screw up their system, so at least put a log message asking them if something like E-D-S is running. Related: https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/179
Diffstat (limited to 'src/contacts-setup-window.vala')
-rw-r--r--src/contacts-setup-window.vala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/contacts-setup-window.vala b/src/contacts-setup-window.vala
index 365f94c..7a560d2 100644
--- a/src/contacts-setup-window.vala
+++ b/src/contacts-setup-window.vala
@@ -41,6 +41,7 @@ public class Contacts.SetupWindow : Adw.ApplicationWindow {
public SetupWindow (App app, Store store) {
Object (application: app, icon_name: Config.APP_ID);
+ // Setup the list of address books
this.accounts_list = new AccountsList (store);
this.clamp.set_child (this.accounts_list);
@@ -48,6 +49,17 @@ public class Contacts.SetupWindow : Adw.ApplicationWindow {
this.setup_done_button.sensitive = (this.accounts_list.selected_store != null);
});
+ // In case of a badly configured system, there will be 0 address books and
+ // as a user there's no way to know why that might happen, so at least put
+ // a warning log message. Make sure we do give Backends some time to come
+ // up
+ Timeout.add_seconds (5, () => {
+ if (store.address_books.get_n_items () == 0)
+ warning ("No address books were found on the system. Are you sure evolution-data-server is running?");
+ return Source.REMOVE;
+ });
+
+ // Make sure we emit a signal when setup is complete
this.setup_done_button.clicked.connect (() => {
setup_done ((Edsf.PersonaStore) this.accounts_list.selected_store);
});