aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-accounts.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-23 07:09:16 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-23 07:09:16 +0800
commit7cf1665ab87b3791549a2530687638da9a0d1135 (patch)
tree82cf134329d2d48414f572e4c186698a511f5c30 /mail/mail-accounts.c
parentc70f26c34bfaeb2a0737db371eeec5404abd3e84 (diff)
downloadgsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar.gz
gsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar.zst
gsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.zip
Construct the PGP Path GnomeFileEntry widget. (pgp_path_changed): Try to
2001-02-22 Jeffrey Stedfast <fejj@ximian.com> * mail-accounts.c (construct): Construct the PGP Path GnomeFileEntry widget. (pgp_path_changed): Try to auto-detect which PGP type the binary file is based on the basename (yuck). svn path=/trunk/; revision=8353
Diffstat (limited to 'mail/mail-accounts.c')
-rw-r--r--mail/mail-accounts.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c
index 29200a5c5a..03eb142cc4 100644
--- a/mail/mail-accounts.c
+++ b/mail/mail-accounts.c
@@ -30,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <camel/camel-url.h>
+#include <openpgp-utils.h>
static void mail_accounts_dialog_class_init (MailAccountsDialogClass *class);
static void mail_accounts_dialog_init (MailAccountsDialog *dialog);
@@ -349,6 +350,27 @@ timeout_changed (GtkEntry *entry, gpointer data)
}
static void
+pgp_path_changed (GtkEntry *entry, gpointer data)
+{
+ const char *path, *bin;
+ PgpType type = PGP_TYPE_NONE;
+
+ path = gtk_entry_get_text (entry);
+ bin = g_basename (path);
+
+ /* FIXME: This detection should be better */
+ if (!strcmp (bin, "pgp"))
+ type = PGP_TYPE_PGP2;
+ else if (!strcmp (bin, "pgpv") || !strcmp (bin, "pgpe") || !strcmp (bin, "pgpk") || !strcmp (bin, "pgps"))
+ type = PGP_TYPE_PGP5;
+ else if (!strcmp (bin, "gpg"))
+ type = PGP_TYPE_GPG;
+
+ mail_config_set_pgp_path (path && *path ? path : NULL);
+ mail_config_set_pgp_type (type);
+}
+
+static void
construct (MailAccountsDialog *dialog)
{
GladeXML *gui;
@@ -420,6 +442,13 @@ construct (MailAccountsDialog *dialog)
gtk_signal_connect (GTK_OBJECT (dialog->timeout), "changed",
GTK_SIGNAL_FUNC (timeout_changed), dialog);
+ dialog->pgp_path = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "filePgpPath"));
+ gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (dialog->pgp_path)),
+ mail_config_get_pgp_path ());
+ gnome_file_entry_set_default_path (dialog->pgp_path, mail_config_get_pgp_path ());
+ gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (dialog->pgp_path)),
+ "changed", GTK_SIGNAL_FUNC (pgp_path_changed), dialog);
+
/* now to fill in the clists */
dialog->accounts_row = -1;
dialog->accounts = mail_config_get_accounts ();