aboutsummaryrefslogtreecommitdiffstats
path: root/smime/gui/component.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-03-20 01:01:22 +0800
committerChris Toshok <toshok@src.gnome.org>2004-03-20 01:01:22 +0800
commit9ae0f1424515b21f952125b130cf4c841dac29f2 (patch)
tree78ff81ace4c6af2209f26560d5aa3164675dac95 /smime/gui/component.c
parentf53bd65b2e5816e409144186bf397c526819efdb (diff)
downloadgsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.gz
gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.tar.zst
gsoc2013-evolution-9ae0f1424515b21f952125b130cf4c841dac29f2.zip
[ fixes bug #52829 ]
2004-03-19 Chris Toshok <toshok@ximian.com> [ fixes bug #52829 ] * lib/smime-marshal.list: add BOOL:POINTER,POINTER for pk11_change_passwd. * lib/e-cert-db.c (e_cert_db_class_init): initialize the pk11_change_passwd signal. (e_cert_db_login_to_slot): emit "pk11_change_passwd" with old_passwd == NULL to initialize the database. * lib/e-cert-db.h: add pk11_change_passwd signal slot. * gui/component.c (smime_pk11_change_passwd): implement the portion of this that gets called with old_passwd == NULL (the only part that needs implementing yet, since we don't have a UI for changing the password.) (smime_component_init): hook up to the pk11_change_passwd signal on ECertDB. svn path=/trunk/; revision=25131
Diffstat (limited to 'smime/gui/component.c')
-rw-r--r--smime/gui/component.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/smime/gui/component.c b/smime/gui/component.c
index 1b27f2d3d2..3c86b6e820 100644
--- a/smime/gui/component.c
+++ b/smime/gui/component.c
@@ -52,6 +52,31 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, char **passw
return TRUE;
}
+static gboolean
+smime_pk11_change_passwd (ECertDB *db, char **old_passwd, char **passwd, gpointer arg)
+{
+ char *prompt;
+
+ /* XXX need better strings here, just copy mozilla's? */
+
+ if (!old_passwd) {
+ /* we're setting the password initially */
+ prompt = _("Enter new password for certificate database");
+
+ *passwd = e_passwords_ask_password (_("Enter new password"), NULL, NULL,
+ prompt, TRUE,
+ E_PASSWORDS_DO_NOT_REMEMBER, NULL,
+ NULL);
+ }
+ else {
+ /* we're changing the password */
+ /* XXX implement this... */
+ }
+
+ /* this should return FALSE if they canceled. */
+ return TRUE;
+}
+
void
smime_component_init (void)
{
@@ -63,4 +88,8 @@ smime_component_init (void)
g_signal_connect (e_cert_db_peek (),
"pk11_passwd",
G_CALLBACK (smime_pk11_passwd), NULL);
+
+ g_signal_connect (e_cert_db_peek (),
+ "pk11_change_passwd",
+ G_CALLBACK (smime_pk11_change_passwd), NULL);
}