From 871a58ea8aa324673075ceb24246faf7b56739c3 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Thu, 26 Jul 2001 19:47:05 +0000 Subject: Use magic to make the password remembering checkbutton come after the 2001-07-26 Peter Williams * mail-mt.c (do_get_pass): Use magic to make the password remembering checkbutton come after the entry, visually. svn path=/trunk/; revision=11432 --- mail/mail-mt.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'mail/mail-mt.c') diff --git a/mail/mail-mt.c b/mail/mail-mt.c index 9f330b217a..a4d7f91d9a 100644 --- a/mail/mail-mt.c +++ b/mail/mail-mt.c @@ -424,8 +424,9 @@ do_get_pass(struct _mail_msg *mm) struct _pass_msg *m = (struct _pass_msg *)mm; const MailConfigAccount *mca; GtkWidget *dialogue; - GtkWidget *tb; - + GtkWidget *tb, *entry; + GList *children, *iter; + /* this api is just awful ... hence the hacks */ dialogue = gnome_request_dialog(m->secret, m->prompt, NULL, 0, pass_got, m, NULL); @@ -435,8 +436,33 @@ do_get_pass(struct _mail_msg *mm) tb = gtk_check_button_new_with_label (_("Remember this password")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tb), mca->source->save_passwd); gtk_widget_show (tb); + + /* do some dirty stuff to put the checkbutton after the entry */ + entry = NULL; + children = gtk_container_children (GTK_CONTAINER (GNOME_DIALOG (dialogue)->vbox)); + + for (iter = children; iter; iter = iter->next) { + if (GTK_IS_ENTRY (iter->data)) { + entry = GTK_WIDGET (iter->data); + break; + } + } + + g_list_free (children); + + if (entry) { + gtk_object_ref (GTK_OBJECT (entry)); + gtk_container_remove (GTK_CONTAINER (GNOME_DIALOG (dialogue)->vbox), entry); + } + gtk_box_pack_end (GTK_BOX (GNOME_DIALOG (dialogue)->vbox), tb, TRUE, FALSE, 0); + + if (entry) { + gtk_box_pack_end (GTK_BOX (GNOME_DIALOG (dialogue)->vbox), entry, TRUE, FALSE, 0); + gtk_object_unref (GTK_OBJECT (entry)); + } + m->tb = tb; e_container_foreach_leaf((GtkContainer *)dialogue, focus_on_entry, NULL); -- cgit