From 7cf1665ab87b3791549a2530687638da9a0d1135 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 22 Feb 2001 23:09:16 +0000 Subject: Construct the PGP Path GnomeFileEntry widget. (pgp_path_changed): Try to 2001-02-22 Jeffrey Stedfast * 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 --- mail/ChangeLog | 7 +++++++ mail/mail-accounts.c | 29 ++++++++++++++++++++++++++ mail/mail-accounts.h | 3 ++- mail/mail-config.glade | 56 +++++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 93 insertions(+), 2 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 69bddff9d7..08b4a4be9b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2001-02-22 Jeffrey Stedfast + + * 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). + 2001-02-23 Not Zed * mail-ops.c (create_folder_get): Make op cancellable/report 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 #include #include +#include static void mail_accounts_dialog_class_init (MailAccountsDialogClass *class); static void mail_accounts_dialog_init (MailAccountsDialog *dialog); @@ -348,6 +349,27 @@ timeout_changed (GtkEntry *entry, gpointer data) mail_config_set_mark_as_seen_timeout (val); } +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) { @@ -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 (); diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h index e2f355cd3d..dcee0528c6 100644 --- a/mail/mail-accounts.h +++ b/mail/mail-accounts.h @@ -63,9 +63,10 @@ struct _MailAccountsDialog { GtkButton *news_edit; GtkButton *news_delete; - /* temporary widgets */ + /* "Other" widgets */ GtkCheckButton *send_html; GtkSpinButton *timeout; + GnomeFileEntry *pgp_path; }; typedef struct _MailAccountsDialog MailAccountsDialog; diff --git a/mail/mail-config.glade b/mail/mail-config.glade index da0f2fc57b..5c7753cfb9 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -3116,7 +3116,7 @@ SMTP GtkVBox vbox38 False - 0 + 4 GtkCheckButton @@ -3200,6 +3200,60 @@ SMTP + + + GtkHBox + hbox41 + False + 0 + + 0 + False + True + + + + GtkLabel + lblPgpPath + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 4 + 0 + + 0 + False + False + + + + + GnomeFileEntry + filePgpPath + 10 + Select PGP binary + False + True + + 4 + True + True + + + + GtkEntry + GnomeEntry:entry + combo-entry1 + True + True + True + 0 + + + + -- cgit v1.2.3