aboutsummaryrefslogtreecommitdiffstats
path: root/mail
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
parentc70f26c34bfaeb2a0737db371eeec5404abd3e84 (diff)
downloadgsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar
gsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar.gz
gsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar.bz2
gsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar.lz
gsoc2013-evolution-7cf1665ab87b3791549a2530687638da9a0d1135.tar.xz
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')
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/mail-accounts.c29
-rw-r--r--mail/mail-accounts.h3
-rw-r--r--mail/mail-config.glade56
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 <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).
+
2001-02-23 Not Zed <NotZed@Ximian.com>
* 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 <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 ();
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
<class>GtkVBox</class>
<name>vbox38</name>
<homogeneous>False</homogeneous>
- <spacing>0</spacing>
+ <spacing>4</spacing>
<widget>
<class>GtkCheckButton</class>
@@ -3200,6 +3200,60 @@ SMTP
</child>
</widget>
</widget>
+
+ <widget>
+ <class>GtkHBox</class>
+ <name>hbox41</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkLabel</class>
+ <name>lblPgpPath</name>
+ <label>PGP binary path:</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>4</xpad>
+ <ypad>0</ypad>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+ </widget>
+
+ <widget>
+ <class>GnomeFileEntry</class>
+ <name>filePgpPath</name>
+ <max_saved>10</max_saved>
+ <title>Select PGP binary</title>
+ <directory>False</directory>
+ <modal>True</modal>
+ <child>
+ <padding>4</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkEntry</class>
+ <child_name>GnomeEntry:entry</child_name>
+ <name>combo-entry1</name>
+ <can_focus>True</can_focus>
+ <editable>True</editable>
+ <text_visible>True</text_visible>
+ <text_max_length>0</text_max_length>
+ <text></text>
+ </widget>
+ </widget>
+ </widget>
</widget>
<widget>