diff options
Diffstat (limited to 'addressbook/gui')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 23 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard-view.c | 4 |
2 files changed, 23 insertions, 4 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index bb40e9a79d..1e287d8516 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -35,6 +35,25 @@ #include "eab-contact-merging.h" #include "e-util/e-error.h" +static GtkWindow * +get_dlg_parent_window (void) +{ + GList *windows; + GtkWindow *parent = NULL; + EShell *shell = e_shell_get_default (); + + g_return_val_if_fail (shell != NULL, NULL); + + for (windows = e_shell_get_watched_windows (shell); windows && !parent; windows = windows->next) { + if (GTK_IS_WINDOW (windows->data)) + parent = windows->data; + } + + g_return_val_if_fail (parent != NULL, NULL); + + return parent; +} + typedef struct _QuickAdd QuickAdd; struct _QuickAdd { gchar *name; @@ -129,7 +148,7 @@ merge_cb (EBook *book, EBookStatus status, gpointer closure) if (e_book_is_writable (book)) eab_merging_book_add_contact (book, qa->contact, NULL, NULL); else - e_error_run (NULL, "addressbook:error-read-only", e_source_peek_name (e_book_get_source (book)), NULL); + e_error_run (get_dlg_parent_window (), "addressbook:error-read-only", e_source_peek_name (e_book_get_source (book)), NULL); if (qa->cb) qa->cb (qa->contact, qa->closure); @@ -326,7 +345,7 @@ build_quick_add_dialog (QuickAdd *qa) g_return_val_if_fail (qa != NULL, NULL); dialog = gtk_dialog_new_with_buttons (_("Contact Quick-Add"), - NULL, /* XXX */ + get_dlg_parent_window (), GTK_DIALOG_NO_SEPARATOR, _("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 80d7291113..5f16ac9a56 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -167,10 +167,10 @@ set_empty_message (EMinicardView *view) g_object_get (view->adapter, "editable", &editable, "model", &model, + "book", &book, NULL); - g_object_get (view->adapter, "book", &book, NULL); - if (!e_book_check_static_capability (book, "do-initial-query")) + if (book && !e_book_check_static_capability (book, "do-initial-query")) perform_initial_query = TRUE; searching = model && e_addressbook_model_can_stop (model); |