2010-10-17 [colin] 3.7.6cvs56
[claws.git] / src / gtk / inputdialog.c
index e75cc5acbc5526ad5af2d7340e2a26cacdbc74e5..65e38e70bc4f0d59e7ef52a8ab6bc6b4cb733a3a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -85,7 +85,7 @@ static void combo_activated   (GtkEditable    *editable);
 gchar *input_dialog(const gchar *title, const gchar *message,
                    const gchar *default_string)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
@@ -111,7 +111,7 @@ gchar *input_dialog(const gchar *title, const gchar *message,
 gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
                                   const gchar *default_string)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(TRUE);
@@ -137,7 +137,7 @@ gchar *input_dialog_with_invisible_checkbtn(const gchar *title, const gchar *mes
                                   const gchar *default_string, const gchar *checkbtn_label,
                                   gboolean *checkbtn_state)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(TRUE);
@@ -164,7 +164,7 @@ gchar *input_dialog_with_invisible_checkbtn(const gchar *title, const gchar *mes
                HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
 #endif
 
-       return input_dialog_open(title, message, checkbtn_label, default_string, FALSE, checkbtn_state);
+       return input_dialog_open(title, message, checkbtn_label, default_string, (checkbtn_state? *checkbtn_state:FALSE), checkbtn_state);
 }
 
 gchar *input_dialog_combo(const gchar *title, const gchar *message,
@@ -178,7 +178,7 @@ gchar *input_dialog_combo_remember(const gchar *title, const gchar *message,
                          const gchar *default_string, GList *list,
                          gboolean *remember)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
@@ -209,7 +209,7 @@ gchar *input_dialog_with_checkbtn(const gchar       *title,
                                   const gchar  *checkbtn_label,
                                   gboolean *checkbtn_state)
 {
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);
@@ -274,12 +274,12 @@ gchar *input_dialog_query_password_keep(const gchar *server, const gchar *user,
                                  user);
        else
                message = g_strdup_printf(_("Input password:"));
-        if (keep && prefs_common.session_passwords) {
+        if (keep) {
                if (*keep != NULL) {
                        pass = g_strdup (*keep);
                }
                else {
-                       gboolean state = FALSE;
+                       gboolean state = prefs_common.session_passwords;
                        pass = input_dialog_with_invisible_checkbtn(_("Input password"), 
                                        message, NULL,
                                        _("Remember password for this session"), 
@@ -288,6 +288,7 @@ gchar *input_dialog_query_password_keep(const gchar *server, const gchar *user,
                                *keep = g_strdup (pass);
                                debug_print("keeping session password for account\n");
                        }
+                       prefs_common.session_passwords = state;
                }
        }
        else {
@@ -312,7 +313,6 @@ static void input_dialog_create(gboolean is_password)
        gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
        gtk_window_set_default_size(GTK_WINDOW(dialog), 375, 100);
        gtk_window_set_title(GTK_WINDOW(dialog), "");
-       gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
 
        g_signal_connect(G_OBJECT(dialog), "delete_event",
                         G_CALLBACK(delete_event), NULL);
@@ -420,7 +420,7 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
 {
        gchar *str;
 
-       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+       if (dialog && gtkut_widget_get_visible(dialog)) return NULL;
 
        if (!dialog)
                input_dialog_create(FALSE);