2012-11-18 [colin] 3.9.0cvs6-stable
[claws.git] / src / gtk / inputdialog.c
index d3724c36528aee925763245dcd46a2b0249c9469..119718959f4cec4914dd1203882510d7f1da2552 100644 (file)
@@ -19,6 +19,7 @@
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include <glib.h>
@@ -302,7 +303,6 @@ gchar *input_dialog_query_password_keep(const gchar *server, const gchar *user,
 static void input_dialog_create(gboolean is_password)
 {
        static PangoFontDescription *font_desc;
-       GtkWidget *w_hbox;
        GtkWidget *hbox;
        GtkWidget *vbox;
        GtkWidget *cancel_button;
@@ -329,8 +329,6 @@ static void input_dialog_create(gboolean is_password)
                            FALSE, FALSE, 0);
 
        /* for title label */
-       w_hbox = gtk_hbox_new(FALSE, 0);
-       
        icon_q = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,
                                GTK_ICON_SIZE_DIALOG); 
        gtk_misc_set_alignment (GTK_MISC (icon_q), 0.5, 0.0);
@@ -432,7 +430,7 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
                gtk_button_set_label(GTK_BUTTON(remember_checkbtn), _("Remember this"));
 
        input_dialog_set(title, message, default_string);
-       gtk_widget_show(dialog);
+       gtk_window_present(GTK_WINDOW(dialog));
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn),
                                     default_checkbtn_state);
@@ -450,7 +448,6 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
                gtk_main_iteration();
 
        manage_window_focus_out(dialog, NULL, NULL);
-       gtk_widget_hide(dialog);
 
        if (ack) {
                GtkEditable *editable;
@@ -473,6 +470,10 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
        if (remember) {
                *remember = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remember_checkbtn));
        }
+
+       gtk_widget_destroy(dialog);
+       dialog = NULL;
+
        if (is_pass)
                debug_print("return string = %s\n", str ? "********": ("none"));
        else