aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-10-13 22:24:10 +0800
committerMilan Crha <mcrha@redhat.com>2009-10-13 22:24:10 +0800
commite06b88c4fda627599d7c1a33ddec0a35a4374e4f (patch)
treea862b4d3909923719ab03936ec60dfc00f185ba8 /addressbook/gui
parentdc2953040b0fb9576411d2f145e7e6ff11dd989a (diff)
downloadgsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.gz
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.bz2
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.lz
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.xz
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.zst
gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.zip
Bug #594471 - Shouldn't call e_error_new/run with NULL 'parent'
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c2
-rw-r--r--addressbook/gui/contact-editor/e-contact-quick-add.c23
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c3
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-model.c3
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c2
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c3
6 files changed, 10 insertions, 26 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 007436e7da..6fab3cb75e 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -2769,7 +2769,7 @@ categories_clicked (GtkWidget *button, EContactEditor *editor)
g_free (categories);
return;
}else if (!(dialog = GTK_DIALOG (e_categories_dialog_new (categories)))) {
- e_error_run (NULL, "addressbook:edit-categories", NULL);
+ e_error_run (GTK_WINDOW (editor->app), "addressbook:edit-categories", NULL);
g_free (categories);
return;
}
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c
index 1e287d8516..5288ab009d 100644
--- a/addressbook/gui/contact-editor/e-contact-quick-add.c
+++ b/addressbook/gui/contact-editor/e-contact-quick-add.c
@@ -35,25 +35,6 @@
#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;
@@ -148,7 +129,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 (get_dlg_parent_window (), "addressbook:error-read-only", e_source_peek_name (e_book_get_source (book)), NULL);
+ e_error_run (e_shell_get_active_window (NULL), "addressbook:error-read-only", e_source_peek_name (e_book_get_source (book)), NULL);
if (qa->cb)
qa->cb (qa->contact, qa->closure);
@@ -345,7 +326,7 @@ build_quick_add_dialog (QuickAdd *qa)
g_return_val_if_fail (qa != NULL, NULL);
dialog = gtk_dialog_new_with_buttons (_("Contact Quick-Add"),
- get_dlg_parent_window (),
+ e_shell_get_active_window (NULL),
GTK_DIALOG_NO_SEPARATOR,
_("_Edit Full"), QUICK_ADD_RESPONSE_EDIT_FULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 77d91357c5..73b5dcd7cf 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -25,6 +25,7 @@
#include "e-contact-list-editor.h"
#include <e-util/e-util-private.h>
#include <e-util/e-error.h>
+#include "shell/e-shell.h"
#include <string.h>
@@ -259,7 +260,7 @@ contact_list_editor_contact_exists (EContactListModel *model,
if (!e_contact_list_model_has_email (model, email))
return FALSE;
- return (e_error_run (NULL, tag, email, NULL) != GTK_RESPONSE_YES);
+ return (e_error_run (e_shell_get_active_window (NULL), tag, email, NULL) != GTK_RESPONSE_YES);
}
static void
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-model.c b/addressbook/gui/contact-list-editor/e-contact-list-model.c
index d43e895570..a5fc9937ac 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-model.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-model.c
@@ -24,6 +24,7 @@
#include "e-contact-list-model.h"
#include "e-util/e-error.h"
+#include "shell/e-shell.h"
static gpointer parent_class;
@@ -152,7 +153,7 @@ e_contact_list_model_add_email (EContactListModel *model,
g_return_if_fail (email != NULL);
if (e_contact_list_model_has_email (model, email))
- if (e_error_run (NULL, tag, email, NULL) != GTK_RESPONSE_YES)
+ if (e_error_run (e_shell_get_active_window (NULL), tag, email, NULL) != GTK_RESPONSE_YES)
return;
destination = e_destination_new ();
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index c606530594..8d07a8007a 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1109,7 +1109,7 @@ delete_contacts_cb (EBook *book, EBookStatus status, gpointer closure)
case E_BOOK_ERROR_CANCELLED :
break;
case E_BOOK_ERROR_PERMISSION_DENIED :
- e_error_run (NULL, "addressbook:contact-delete-error-perm", NULL);
+ e_error_run (e_shell_get_active_window (NULL), "addressbook:contact-delete-error-perm", NULL);
break;
default :
/* Unknown error */
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index effea132c3..0aa63850a2 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -37,6 +37,7 @@
#include <libebook/e-destination.h>
#include "e-util/e-error.h"
#include "e-util/e-html-utils.h"
+#include "shell/e-shell.h"
#include "misc/e-image-chooser.h"
#include <e-util/e-icon-factory.h>
#include "eab-contact-merging.h"
@@ -85,7 +86,7 @@ eab_error_dialog (const gchar *msg, EBookStatus status)
status_str = status_to_string [status];
if (status_str)
- e_error_run (NULL, "addressbook:generic-error", msg, _(status_str), NULL);
+ e_error_run (e_shell_get_active_window (NULL), "addressbook:generic-error", msg, _(status_str), NULL);
}
void