aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-25 01:22:12 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-25 01:22:12 +0800
commit0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa (patch)
tree321d35a22258b0f74f6dd7d5e3e0f069e80696a6 /mail/mail-display.c
parent64342afba2c9e747549746548a20b0f29e813189 (diff)
downloadgsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.tar
gsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.tar.gz
gsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.tar.bz2
gsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.tar.lz
gsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.tar.xz
gsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.tar.zst
gsoc2013-evolution-0b9b384a2bbd6257dae54ed1b5ee08f100fa32aa.zip
Fix GDK_THREADS_entering and leaving, hopefully once and for all. Genericify the recursive-store-loading. Load stores when they're added to the config page.
svn path=/trunk/; revision=5005
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 760c45c92e..ab42452cf3 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -35,15 +35,6 @@ static void redisplay (MailDisplay *md);
* Callbacks
*----------------------------------------------------------------------*/
-static void
-save_data_eexist_cb (int reply, gpointer user_data)
-{
- gboolean *ok = user_data;
-
- *ok = reply == 0;
- gtk_main_quit ();
-}
-
static gboolean
write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
{
@@ -56,16 +47,26 @@ write_data_to_file (CamelMimePart *part, const char *name, gboolean unique)
fd = open (name, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
if (fd == -1 && errno == EEXIST && !unique) {
- gboolean ok = FALSE;
-
- gnome_ok_cancel_dialog_modal (
- "A file by that name already exists.\nOverwrite it?",
- save_data_eexist_cb, &ok);
- GDK_THREADS_ENTER();
- gtk_main ();
- GDK_THREADS_LEAVE();
- if (!ok)
+ GtkWidget *dlg;
+ GtkWidget *text;
+
+ dlg = gnome_dialog_new (_("Overwrite file?"),
+ GNOME_STOCK_BUTTON_YES,
+ GNOME_STOCK_BUTTON_NO,
+ NULL);
+ text = gtk_label_new (_("A file by that name already exists.\nOverwrite it?"));
+ gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dlg)->vbox), text, TRUE, TRUE, 4);
+ gtk_widget_show (text);
+
+ /* This should be mail_dialog_run_and_close, but for some reason this
+ * particular dialog will deadlock as it tries to GDK_THREADS_ENTER
+ * (gtk_main_level is indeed 1). I think it has to do with being in
+ * the file selection window. God this sucks.
+ */
+ if (gnome_dialog_run_and_close (GNOME_DIALOG (dlg)) != 0) /* !!! */
return FALSE;
+ gtk_widget_destroy (dlg);
+
fd = open (name, O_WRONLY | O_TRUNC);
}