diff options
author | Milan Crha <mcrha@redhat.com> | 2009-09-24 18:25:35 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-09-24 18:25:35 +0800 |
commit | e73e6f1ea878dfea7344bd9bf2bca06da78b29c9 (patch) | |
tree | 6e775b93e828bafe1baf385524ead4c7ec6293a5 /addressbook/gui/contact-editor | |
parent | 0c1afa3941ef2663793d0b5e1fd9221423374d19 (diff) | |
download | gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.tar gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.tar.gz gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.tar.bz2 gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.tar.lz gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.tar.xz gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.tar.zst gsoc2013-evolution-e73e6f1ea878dfea7344bd9bf2bca06da78b29c9.zip |
Bug #593633 - Runtime warnings trying to create a recurrence event
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 23 |
1 files changed, 21 insertions, 2 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, |