aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-20 13:37:22 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-20 13:37:22 +0800
commit1d2599d6a894c46f47e9d4cc901ce8dfa41228c5 (patch)
tree758d299919f11b289b6d59161be462294714ac5f
parentc5c43717419bcf6a6a3a5d5958090631dc7a13c9 (diff)
downloadgsoc2013-evolution-1d2599d6a894c46f47e9d4cc901ce8dfa41228c5.tar.gz
gsoc2013-evolution-1d2599d6a894c46f47e9d4cc901ce8dfa41228c5.tar.zst
gsoc2013-evolution-1d2599d6a894c46f47e9d4cc901ce8dfa41228c5.zip
** See Bug #52817.
2004-01-20 Not Zed <NotZed@Ximian.com> ** See Bug #52817. * mail-session.c (request_password, do_get_pass, get_password): Fix for api changes to camel_session_get_password. (request_password): if we have a STATIC password, don't show any 'remember' checkbox. svn path=/trunk/; revision=24324
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/mail-session.c27
2 files changed, 23 insertions, 13 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 8df78b3d0e..180e80a1e6 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,14 @@
2004-01-20 Not Zed <NotZed@Ximian.com>
+ ** See Bug #52817.
+
+ * mail-session.c (request_password, do_get_pass, get_password):
+ Fix for api changes to camel_session_get_password.
+ (request_password): if we have a STATIC password, don't show any
+ 'remember' checkbox.
+
+2004-01-20 Not Zed <NotZed@Ximian.com>
+
* em-folder-view.c (EMFolderView): Make displayed_uid public.
* em-folder-browser.c (em_folder_browser_show_preview): use
diff --git a/mail/mail-session.c b/mail/mail-session.c
index 02294201ea..2b3a757f1b 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -85,7 +85,7 @@ typedef struct _MailSessionClass {
static CamelSessionClass *ms_parent_class;
-static char *get_password(CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret, CamelService *service, const char *item, CamelException *ex);
+static char *get_password(CamelSession *session, const char *prompt, guint32 flags, CamelService *service, const char *item, CamelException *ex);
static void forget_password(CamelSession *session, CamelService *service, const char *item, CamelException *ex);
static gboolean alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel);
static CamelFilterDriver *get_filter_driver(CamelSession *session, const char *type, CamelException *ex);
@@ -174,8 +174,7 @@ struct _pass_msg {
CamelSession *session;
const char *prompt;
- gboolean reprompt;
- gboolean secret;
+ guint32 flags;
CamelService *service;
const char *item;
CamelException *ex;
@@ -283,20 +282,23 @@ request_password (struct _pass_msg *m)
gtk_container_set_border_width ((GtkContainer *) password_dialog, 6);
m->entry = gtk_entry_new ();
- gtk_entry_set_visibility ((GtkEntry *) m->entry, !m->secret);
+ gtk_entry_set_visibility ((GtkEntry *) m->entry, (m->flags & CAMEL_SESSION_PASSWORD_SECRET) != 0);
g_signal_connect (m->entry, "activate", G_CALLBACK (pass_activate), password_dialog);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), m->entry, TRUE, FALSE, 3);
gtk_widget_show (m->entry);
- if (m->reprompt && m->result) {
+ if ((m->flags & CAMEL_SESSION_PASSWORD_REPROMPT) && m->result) {
gtk_entry_set_text ((GtkEntry *) m->entry, m->result);
g_free (m->result);
m->result = NULL;
}
-
- if (m->service_url == NULL || m->service != NULL) {
- m->check = gtk_check_button_new_with_mnemonic (m->service_url ? _("_Remember this password") :
- _("_Remember this password for the remainder of this session"));
+
+ /* static password, shouldn't be remembered between sessions,
+ but will be remembered within the session beyond our control */
+ if ((m->service_url == NULL || m->service != NULL)
+ && (m->flags & CAMEL_SESSION_PASSWORD_STATIC) == 0) {
+ m->check = gtk_check_button_new_with_mnemonic (m->service_url ? _("_Remember this password")
+ : _("_Remember this password for the remainder of this session"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (m->check),
m->config_service ? m->config_service->save_passwd : FALSE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (password_dialog)->vbox), m->check, TRUE, FALSE, 3);
@@ -326,7 +328,7 @@ do_get_pass(struct _mail_msg *mm)
m->result = g_strdup(account->source->url);
} else if (m->key) {
m->result = e_passwords_get_password ("Mail", m->key);
- if (m->result == NULL || m->reprompt) {
+ if (m->result == NULL || (m->flags & CAMEL_SESSION_PASSWORD_REPROMPT)) {
if (mail_session->interactive) {
request_password(m);
return;
@@ -354,7 +356,7 @@ static struct _mail_msg_op get_pass_op = {
};
static char *
-get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboolean secret,
+get_password (CamelSession *session, const char *prompt, guint32 flags,
CamelService *service, const char *item, CamelException *ex)
{
struct _pass_msg *m, *r;
@@ -369,8 +371,7 @@ get_password (CamelSession *session, const char *prompt, gboolean reprompt, gboo
m->ismain = pthread_self() == mail_gui_thread;
m->session = session;
m->prompt = prompt;
- m->reprompt = reprompt;
- m->secret = secret;
+ m->flags = flags;
m->service = service;
m->item = item;
m->ex = ex;