options
authorVolker Birk <vb@pep-project.org>
Mon, 25 May 2015 21:28:25 +0200
changeset 43a687873d7489
parent 42 1c7a1c3cf550
child 44 b823b8170ce8
options
CryptableMailItem.cs
Options.Designer.cs
Options.cs
Options.resx
Properties/Settings.Designer.cs
Properties/Settings.settings
RibbonpEp.Designer.cs
RibbonpEp.cs
RibbonpEp.resx
Settings.cs
ThisAddIn.cs
app.config
pEp.csproj
     1.1 --- a/CryptableMailItem.cs	Sun May 24 11:05:19 2015 +0200
     1.2 +++ b/CryptableMailItem.cs	Mon May 25 21:28:25 2015 +0200
     1.3 @@ -174,7 +174,10 @@
     1.4              }
     1.5              catch
     1.6              {
     1.7 -                fld.value = "";
     1.8 +                if (fld.name.ToLower() == "x-pep-version")
     1.9 +                    fld.value = ThisAddIn.PEP_VERSION;
    1.10 +                else
    1.11 +                    fld.value = "";
    1.12              }
    1.13  
    1.14              return fld;
    1.15 @@ -269,8 +272,14 @@
    1.16  
    1.17                      if (_mailItem.Categories != null)
    1.18                      {
    1.19 -                        string delim = Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("International").GetValue("sList").ToString();
    1.20 -                        _msg.keywords = _mailItem.Categories.Split(delim.ToCharArray());
    1.21 +                        using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey("Control Panel"))
    1.22 +                        {
    1.23 +                            using (RegistryKey key2 = key1.OpenSubKey("International"))
    1.24 +                            {
    1.25 +                                string delim = key2.GetValue("sList").ToString();
    1.26 +                                _msg.keywords = _mailItem.Categories.Split(delim.ToCharArray());
    1.27 +                            }
    1.28 +                        }
    1.29                      }
    1.30  
    1.31                      System.Array opt_fields = System.Array.CreateInstance(typeof(opt_field), 3);
    1.32 @@ -338,10 +347,13 @@
    1.33                          Directory.Delete(temp_dir, true);
    1.34                      }
    1.35  
    1.36 -                    foreach (object e in value.opt_fields)
    1.37 +                    if (value.opt_fields != null)
    1.38                      {
    1.39 -                        opt_field fld = (opt_field)e;
    1.40 -                        _mailItem.PropertyAccessor.SetProperty(ThisAddIn.PR_OPT_FIELD + fld.name, fld.value);
    1.41 +                        foreach (object e in value.opt_fields)
    1.42 +                        {
    1.43 +                            opt_field fld = (opt_field)e;
    1.44 +                            _mailItem.PropertyAccessor.SetProperty(ThisAddIn.PR_OPT_FIELD + fld.name, fld.value);
    1.45 +                        }
    1.46                      }
    1.47                  }
    1.48              }
    1.49 @@ -451,7 +463,8 @@
    1.50  
    1.51          public void save()
    1.52          {
    1.53 -            this._mailItem.Save();
    1.54 +            _mailItem = _mailItem.Copy();
    1.55 +            _mailItem.Save();
    1.56          }
    1.57  
    1.58          public void decrypt()
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Options.Designer.cs	Mon May 25 21:28:25 2015 +0200
     2.3 @@ -0,0 +1,93 @@
     2.4 +namespace pEp
     2.5 +{
     2.6 +    partial class frmOptions
     2.7 +    {
     2.8 +        /// <summary>
     2.9 +        /// Required designer variable.
    2.10 +        /// </summary>
    2.11 +        private System.ComponentModel.IContainer components = null;
    2.12 +
    2.13 +        /// <summary>
    2.14 +        /// Clean up any resources being used.
    2.15 +        /// </summary>
    2.16 +        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    2.17 +        protected override void Dispose(bool disposing)
    2.18 +        {
    2.19 +            if (disposing && (components != null))
    2.20 +            {
    2.21 +                components.Dispose();
    2.22 +            }
    2.23 +            base.Dispose(disposing);
    2.24 +        }
    2.25 +
    2.26 +        #region Windows Form Designer generated code
    2.27 +
    2.28 +        /// <summary>
    2.29 +        /// Required method for Designer support - do not modify
    2.30 +        /// the contents of this method with the code editor.
    2.31 +        /// </summary>
    2.32 +        private void InitializeComponent()
    2.33 +        {
    2.34 +            this.cbEncryptAll = new System.Windows.Forms.CheckBox();
    2.35 +            this.btnOK = new System.Windows.Forms.Button();
    2.36 +            this.button1 = new System.Windows.Forms.Button();
    2.37 +            this.SuspendLayout();
    2.38 +            // 
    2.39 +            // cbEncryptAll
    2.40 +            // 
    2.41 +            this.cbEncryptAll.AutoSize = true;
    2.42 +            this.cbEncryptAll.Location = new System.Drawing.Point(13, 13);
    2.43 +            this.cbEncryptAll.Name = "cbEncryptAll";
    2.44 +            this.cbEncryptAll.Size = new System.Drawing.Size(155, 17);
    2.45 +            this.cbEncryptAll.TabIndex = 0;
    2.46 +            this.cbEncryptAll.Text = "&Encrypt all Data on Servers";
    2.47 +            this.cbEncryptAll.UseVisualStyleBackColor = true;
    2.48 +            // 
    2.49 +            // btnOK
    2.50 +            // 
    2.51 +            this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
    2.52 +            this.btnOK.Location = new System.Drawing.Point(12, 36);
    2.53 +            this.btnOK.Name = "btnOK";
    2.54 +            this.btnOK.Size = new System.Drawing.Size(75, 23);
    2.55 +            this.btnOK.TabIndex = 1;
    2.56 +            this.btnOK.Text = "OK";
    2.57 +            this.btnOK.UseVisualStyleBackColor = true;
    2.58 +            // 
    2.59 +            // button1
    2.60 +            // 
    2.61 +            this.button1.CausesValidation = false;
    2.62 +            this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    2.63 +            this.button1.Location = new System.Drawing.Point(93, 36);
    2.64 +            this.button1.Name = "button1";
    2.65 +            this.button1.Size = new System.Drawing.Size(75, 23);
    2.66 +            this.button1.TabIndex = 2;
    2.67 +            this.button1.Text = "Cancel";
    2.68 +            this.button1.UseVisualStyleBackColor = true;
    2.69 +            // 
    2.70 +            // frmOptions
    2.71 +            // 
    2.72 +            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    2.73 +            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    2.74 +            this.ClientSize = new System.Drawing.Size(181, 70);
    2.75 +            this.Controls.Add(this.button1);
    2.76 +            this.Controls.Add(this.btnOK);
    2.77 +            this.Controls.Add(this.cbEncryptAll);
    2.78 +            this.MaximizeBox = false;
    2.79 +            this.MinimizeBox = false;
    2.80 +            this.Name = "frmOptions";
    2.81 +            this.ShowIcon = false;
    2.82 +            this.ShowInTaskbar = false;
    2.83 +            this.Text = "p≡p Options";
    2.84 +            this.Load += new System.EventHandler(this.frmOptions_Load);
    2.85 +            this.ResumeLayout(false);
    2.86 +            this.PerformLayout();
    2.87 +
    2.88 +        }
    2.89 +
    2.90 +        #endregion
    2.91 +
    2.92 +        private System.Windows.Forms.CheckBox cbEncryptAll;
    2.93 +        private System.Windows.Forms.Button btnOK;
    2.94 +        private System.Windows.Forms.Button button1;
    2.95 +    }
    2.96 +}
    2.97 \ No newline at end of file
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/Options.cs	Mon May 25 21:28:25 2015 +0200
     3.3 @@ -0,0 +1,40 @@
     3.4 +using System;
     3.5 +using System.Collections.Generic;
     3.6 +using System.ComponentModel;
     3.7 +using System.Data;
     3.8 +using System.Drawing;
     3.9 +using System.Linq;
    3.10 +using System.Text;
    3.11 +using System.Windows.Forms;
    3.12 +
    3.13 +using Microsoft.Win32;
    3.14 +
    3.15 +namespace pEp
    3.16 +{
    3.17 +    public partial class frmOptions : Form
    3.18 +    {
    3.19 +        public frmOptions()
    3.20 +        {
    3.21 +            InitializeComponent();
    3.22 +        }
    3.23 +
    3.24 +        private void frmOptions_Load(object sender, EventArgs e)
    3.25 +        {
    3.26 +            using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey("Software"))
    3.27 +            {
    3.28 +                using (RegistryKey key2 = key1.OpenSubKey("pEp"))
    3.29 +                {
    3.30 +                    if (key2 != null)
    3.31 +                    {
    3.32 +                        string sde = key2.GetValue("StoreDataEncrypted", "True").ToString();
    3.33 +                        cbEncryptAll.CheckState = sde == "True" ? CheckState.Checked : CheckState.Unchecked;
    3.34 +                    }
    3.35 +                    else
    3.36 +                    {
    3.37 +                        cbEncryptAll.CheckState = CheckState.Checked;
    3.38 +                    }
    3.39 +                }
    3.40 +            }
    3.41 +        }
    3.42 +    }
    3.43 +}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/Options.resx	Mon May 25 21:28:25 2015 +0200
     4.3 @@ -0,0 +1,120 @@
     4.4 +<?xml version="1.0" encoding="utf-8"?>
     4.5 +<root>
     4.6 +  <!-- 
     4.7 +    Microsoft ResX Schema 
     4.8 +    
     4.9 +    Version 2.0
    4.10 +    
    4.11 +    The primary goals of this format is to allow a simple XML format 
    4.12 +    that is mostly human readable. The generation and parsing of the 
    4.13 +    various data types are done through the TypeConverter classes 
    4.14 +    associated with the data types.
    4.15 +    
    4.16 +    Example:
    4.17 +    
    4.18 +    ... ado.net/XML headers & schema ...
    4.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
    4.20 +    <resheader name="version">2.0</resheader>
    4.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    4.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    4.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    4.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    4.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
    4.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
    4.27 +    </data>
    4.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    4.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
    4.30 +        <comment>This is a comment</comment>
    4.31 +    </data>
    4.32 +                
    4.33 +    There are any number of "resheader" rows that contain simple 
    4.34 +    name/value pairs.
    4.35 +    
    4.36 +    Each data row contains a name, and value. The row also contains a 
    4.37 +    type or mimetype. Type corresponds to a .NET class that support 
    4.38 +    text/value conversion through the TypeConverter architecture. 
    4.39 +    Classes that don't support this are serialized and stored with the 
    4.40 +    mimetype set.
    4.41 +    
    4.42 +    The mimetype is used for serialized objects, and tells the 
    4.43 +    ResXResourceReader how to depersist the object. This is currently not 
    4.44 +    extensible. For a given mimetype the value must be set accordingly:
    4.45 +    
    4.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
    4.47 +    that the ResXResourceWriter will generate, however the reader can 
    4.48 +    read any of the formats listed below.
    4.49 +    
    4.50 +    mimetype: application/x-microsoft.net.object.binary.base64
    4.51 +    value   : The object must be serialized with 
    4.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    4.53 +            : and then encoded with base64 encoding.
    4.54 +    
    4.55 +    mimetype: application/x-microsoft.net.object.soap.base64
    4.56 +    value   : The object must be serialized with 
    4.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
    4.58 +            : and then encoded with base64 encoding.
    4.59 +
    4.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
    4.61 +    value   : The object must be serialized into a byte array 
    4.62 +            : using a System.ComponentModel.TypeConverter
    4.63 +            : and then encoded with base64 encoding.
    4.64 +    -->
    4.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    4.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    4.67 +    <xsd:element name="root" msdata:IsDataSet="true">
    4.68 +      <xsd:complexType>
    4.69 +        <xsd:choice maxOccurs="unbounded">
    4.70 +          <xsd:element name="metadata">
    4.71 +            <xsd:complexType>
    4.72 +              <xsd:sequence>
    4.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
    4.74 +              </xsd:sequence>
    4.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
    4.76 +              <xsd:attribute name="type" type="xsd:string" />
    4.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
    4.78 +              <xsd:attribute ref="xml:space" />
    4.79 +            </xsd:complexType>
    4.80 +          </xsd:element>
    4.81 +          <xsd:element name="assembly">
    4.82 +            <xsd:complexType>
    4.83 +              <xsd:attribute name="alias" type="xsd:string" />
    4.84 +              <xsd:attribute name="name" type="xsd:string" />
    4.85 +            </xsd:complexType>
    4.86 +          </xsd:element>
    4.87 +          <xsd:element name="data">
    4.88 +            <xsd:complexType>
    4.89 +              <xsd:sequence>
    4.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    4.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
    4.92 +              </xsd:sequence>
    4.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    4.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    4.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
    4.96 +              <xsd:attribute ref="xml:space" />
    4.97 +            </xsd:complexType>
    4.98 +          </xsd:element>
    4.99 +          <xsd:element name="resheader">
   4.100 +            <xsd:complexType>
   4.101 +              <xsd:sequence>
   4.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   4.103 +              </xsd:sequence>
   4.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
   4.105 +            </xsd:complexType>
   4.106 +          </xsd:element>
   4.107 +        </xsd:choice>
   4.108 +      </xsd:complexType>
   4.109 +    </xsd:element>
   4.110 +  </xsd:schema>
   4.111 +  <resheader name="resmimetype">
   4.112 +    <value>text/microsoft-resx</value>
   4.113 +  </resheader>
   4.114 +  <resheader name="version">
   4.115 +    <value>2.0</value>
   4.116 +  </resheader>
   4.117 +  <resheader name="reader">
   4.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   4.119 +  </resheader>
   4.120 +  <resheader name="writer">
   4.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   4.122 +  </resheader>
   4.123 +</root>
   4.124 \ No newline at end of file
     5.1 --- a/Properties/Settings.Designer.cs	Sun May 24 11:05:19 2015 +0200
     5.2 +++ b/Properties/Settings.Designer.cs	Mon May 25 21:28:25 2015 +0200
     5.3 @@ -1,7 +1,7 @@
     5.4  //------------------------------------------------------------------------------
     5.5  // <auto-generated>
     5.6  //     This code was generated by a tool.
     5.7 -//     Runtime Version:4.0.30319.34014
     5.8 +//     Runtime Version:4.0.30319.34209
     5.9  //
    5.10  //     Changes to this file may cause incorrect behavior and will be lost if
    5.11  //     the code is regenerated.
     6.1 --- a/Properties/Settings.settings	Sun May 24 11:05:19 2015 +0200
     6.2 +++ b/Properties/Settings.settings	Mon May 25 21:28:25 2015 +0200
     6.3 @@ -1,7 +1,5 @@
     6.4  <?xml version='1.0' encoding='utf-8'?>
     6.5  <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
     6.6 -  <Profiles>
     6.7 -    <Profile Name="(Default)" />
     6.8 -  </Profiles>
     6.9 +  <Profiles />
    6.10    <Settings />
    6.11 -</SettingsFile>
    6.12 +</SettingsFile>
    6.13 \ No newline at end of file
     7.1 --- a/RibbonpEp.Designer.cs	Sun May 24 11:05:19 2015 +0200
     7.2 +++ b/RibbonpEp.Designer.cs	Mon May 25 21:28:25 2015 +0200
     7.3 @@ -37,8 +37,9 @@
     7.4              System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RibbonpEp));
     7.5              this.tabpEp = this.Factory.CreateRibbonTab();
     7.6              this.grpOptions = this.Factory.CreateRibbonGroup();
     7.7 +            this.btnOptions = this.Factory.CreateRibbonButton();
     7.8 +            this.btnGPA = this.Factory.CreateRibbonButton();
     7.9              this.btnAbout = this.Factory.CreateRibbonButton();
    7.10 -            this.btnGPA = this.Factory.CreateRibbonButton();
    7.11              this.tabpEp.SuspendLayout();
    7.12              this.grpOptions.SuspendLayout();
    7.13              // 
    7.14 @@ -50,11 +51,31 @@
    7.15              // 
    7.16              // grpOptions
    7.17              // 
    7.18 +            this.grpOptions.Items.Add(this.btnOptions);
    7.19              this.grpOptions.Items.Add(this.btnGPA);
    7.20              this.grpOptions.Items.Add(this.btnAbout);
    7.21              this.grpOptions.Label = "Options";
    7.22              this.grpOptions.Name = "grpOptions";
    7.23              // 
    7.24 +            // btnOptions
    7.25 +            // 
    7.26 +            this.btnOptions.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
    7.27 +            this.btnOptions.Label = "Options...";
    7.28 +            this.btnOptions.Name = "btnOptions";
    7.29 +            this.btnOptions.ScreenTip = "Settings of p≡p";
    7.30 +            this.btnOptions.ShowImage = true;
    7.31 +            this.btnOptions.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnOptions_Click);
    7.32 +            // 
    7.33 +            // btnGPA
    7.34 +            // 
    7.35 +            this.btnGPA.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
    7.36 +            this.btnGPA.Image = ((System.Drawing.Image)(resources.GetObject("btnGPA.Image")));
    7.37 +            this.btnGPA.Label = "Keys";
    7.38 +            this.btnGPA.Name = "btnGPA";
    7.39 +            this.btnGPA.ScreenTip = "Start the Gnu Privacy Assistant";
    7.40 +            this.btnGPA.ShowImage = true;
    7.41 +            this.btnGPA.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnGPA_Click);
    7.42 +            // 
    7.43              // btnAbout
    7.44              // 
    7.45              this.btnAbout.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
    7.46 @@ -65,16 +86,6 @@
    7.47              this.btnAbout.ShowImage = true;
    7.48              this.btnAbout.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnAbout_Click_1);
    7.49              // 
    7.50 -            // btnGPA
    7.51 -            // 
    7.52 -            this.btnGPA.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge;
    7.53 -            this.btnGPA.Image = ((System.Drawing.Image)(resources.GetObject("btnGPA.Image")));
    7.54 -            this.btnGPA.Label = "Keys";
    7.55 -            this.btnGPA.Name = "btnGPA";
    7.56 -            this.btnGPA.ScreenTip = "Start the Gnu Privacy Assistant";
    7.57 -            this.btnGPA.ShowImage = true;
    7.58 -            this.btnGPA.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.btnGPA_Click);
    7.59 -            // 
    7.60              // RibbonpEp
    7.61              // 
    7.62              this.Name = "RibbonpEp";
    7.63 @@ -94,6 +105,7 @@
    7.64          internal Microsoft.Office.Tools.Ribbon.RibbonGroup grpOptions;
    7.65          internal Microsoft.Office.Tools.Ribbon.RibbonButton btnAbout;
    7.66          internal Microsoft.Office.Tools.Ribbon.RibbonButton btnGPA;
    7.67 +        internal Microsoft.Office.Tools.Ribbon.RibbonButton btnOptions;
    7.68  
    7.69  
    7.70      }
     8.1 --- a/RibbonpEp.cs	Sun May 24 11:05:19 2015 +0200
     8.2 +++ b/RibbonpEp.cs	Mon May 25 21:28:25 2015 +0200
     8.3 @@ -6,9 +6,9 @@
     8.4  using System.Reflection;
     8.5  using System.Diagnostics;
     8.6  using System.IO;
     8.7 +using System.Drawing;
     8.8  
     8.9  using Microsoft.Win32;
    8.10 -
    8.11  using Microsoft.Office.Tools.Ribbon;
    8.12  
    8.13  namespace pEp
    8.14 @@ -19,20 +19,24 @@
    8.15  
    8.16          private void RibbonpEp_Load(object sender, RibbonUIEventArgs e)
    8.17          {
    8.18 +            btnOptions.OfficeImageId = "MessageOptions";
    8.19 +
    8.20              try
    8.21              {
    8.22 -                RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\GNU\\GnuPG");
    8.23 -                string gpg_path = (string)rk.GetValue("Install Directory");
    8.24 -                if (gpg_path != null)
    8.25 +                using (RegistryKey rk = Registry.LocalMachine.OpenSubKey("SOFTWARE\\GNU\\GnuPG"))
    8.26                  {
    8.27 -                    gpa_exe = gpg_path + "\\gpa.exe";
    8.28 -                    if (File.Exists(gpa_exe))
    8.29 -                        btnGPA.Enabled = true;
    8.30 +                    string gpg_path = (string)rk.GetValue("Install Directory");
    8.31 +                    if (gpg_path != null)
    8.32 +                    {
    8.33 +                        gpa_exe = gpg_path + "\\gpa.exe";
    8.34 +                        if (File.Exists(gpa_exe))
    8.35 +                            btnGPA.Enabled = true;
    8.36 +                        else
    8.37 +                            btnGPA.Enabled = false;
    8.38 +                    }
    8.39                      else
    8.40                          btnGPA.Enabled = false;
    8.41                  }
    8.42 -                else
    8.43 -                    btnGPA.Enabled = false;
    8.44              }
    8.45              catch
    8.46              {
    8.47 @@ -43,7 +47,7 @@
    8.48          private void btnAbout_Click_1(object sender, RibbonControlEventArgs e)
    8.49          {
    8.50              string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
    8.51 -            string text = "p≡p for Outlook Version " + version + "\n\nCopyright 2014, p≡p Security SA, Luxembourg";
    8.52 +            string text = "p≡p for Outlook Version " + version + "\n\nCopyright 2014, 2015 p≡p Security SA, Luxembourg";
    8.53              string title = "About p≡p for Outlook";
    8.54              MessageBox.Show(text, title);
    8.55          }
    8.56 @@ -57,5 +61,23 @@
    8.57              catch
    8.58              { }
    8.59          }
    8.60 +
    8.61 +        private void btnOptions_Click(object sender, RibbonControlEventArgs e)
    8.62 +        {
    8.63 +            frmOptions frm = new frmOptions();
    8.64 +
    8.65 +            DialogResult res = frm.ShowDialog();
    8.66 +            if (res == DialogResult.OK)
    8.67 +            {
    8.68 +                using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey("Software", true))
    8.69 +                {
    8.70 +                    using (RegistryKey key2 = key1.CreateSubKey("pEp"))
    8.71 +                    {
    8.72 +                        string sde = ((CheckBox)frm.Controls.Find("cbEncryptAll", true)[0]).Checked.ToString();
    8.73 +                        key2.SetValue("StoreDataEncrypted", sde);
    8.74 +                    }
    8.75 +                }
    8.76 +            }
    8.77 +        }
    8.78      }
    8.79  }
     9.1 --- a/RibbonpEp.resx	Sun May 24 11:05:19 2015 +0200
     9.2 +++ b/RibbonpEp.resx	Mon May 25 21:28:25 2015 +0200
     9.3 @@ -120,48 +120,46 @@
     9.4    <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     9.5    <data name="btnGPA.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     9.6      <value>
     9.7 -        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
     9.8 -        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAbbSURBVFhHvZd5UNRlGMc3hNBMUVxlvCCo1FLkctllWfZ0
     9.9 -        D5Zd7nMRERRQy9SsKaHUckzH1JIOK49sMitrtMlpVBDwAjywyK7psNLp8KjUsGOmP749319uY0YqWD0z
    9.10 -        n/kd+3vf532+7/s+z7uq/9p8hrT+llFxx1NGxJwoGeeKu/D6/zOv0QqTVosFzgpkxKa8Kq96XOA6/v6f
    9.11 -        WH6C7SGvbTwmFBVgx47t2LmzHjZzCraULYH8HClECH2F64V/1yzRmjNZDhfWP79Ocd7QsBO7djVh3ZrV
    9.12 -        mJpbjJx4U518phWGCX3Y5pptki41Os+ZBqvRgO3bt6Gubgeamhqxe/cutDQ348D+/Th08CCa9+7F5plL
    9.13 -        kDxqTIc00wlU49osPUbfmmN3Yf6DNYpzyt3Y2IB94ozODx44oDhvazuEt98+jHnl01GcZH1FmtqFGKWT
    9.14 -        rlq5wWNzafRwmUzYuvVNRWo6pdTN+/ahtaVFcUoOH27Du+3tSDWbMDkrB4EBAXcEBwbPkG6KhFSlw66a
    9.15 -        SPij2ZCE1za9ivr6OmWe9+7dozj3y33o0B/On3qiFk6bBd543dEZjgy9NK8UKoQSIUO4vJWVlizM9Lph
    9.16 -        txhh1OvOFTjdJzdOqsEDE6uweNHCP6X2R+yXOj87ExX5hZg+Pm2OdEOnfseThUlCpmAWOreZM6tu4jXN
    9.17 -        ZZcIzLAZDaeTtZqOFF0ipuYVoeXux5Up2N/a+pd5rpPpmFRSDKdW91OlNXWFdHGpc0aeL6QI0ULnxk6I
    9.18 -        3AYKPYUBU8zu+d6EJGR73cdK3d72taWzsPGlDYrU1ffdiyyXExNTrPUBAQHT5PuLnZYJBQIlTxLGCGqh
    9.19 -        t9C53X/vHPgK8pm5bhT48Yhyo2N1w+zFmGxywm414Z35TyjXpYsfQWVOLgr1xjb57uKIpwiMmM7HC3TO
    9.20 -        rRcmMCgG93ebXVU11JyS/L3c8qMRQqJgFLh3x1an5Q71FeShKCPjW5/B1DbN7n5a3l8qtU/IEuiUUtNp
    9.21 -        iBAkBAiXtR7G5KSzcmX0LCAmgdnrdiFcGFk6wYf8nExmNUZJp/6IKTej9ggcdJRA570EOr98DShPD9lX
    9.22 -        U94HixY+jFyPCY5xQ3+Q11www9Vq9WC59oyKihpk1GvPBQcH2+S5WOCq5jVP8EvNRcypY76/YsSKzS2M
    9.23 -        DNu5Mgjnm1RId0gFm/cA3pw3BqmJwxGptWKYOQsJVtcvNpMBxYV5L0sTSkuZCwVGbBG4wDjPLDacwqur
    9.24 -        evmmiCP1S6IU5z/Wq3Dy9T6Y6xuOJXdY8GGtBiMiw0HHQaveh6r2XaiTPUdC02YPlaZWgVFzrfgX15Wl
    9.25 -        vtTS9eHHDz8dgZ/3qHBuhwonNoWi9bFb8MkzGnywUgOP04rUzGyEPPshVE+9h6D7NkGtd78nTTkAzjWn
    9.26 -        h2uGcne91lvjh3Sc2tIPHQ0qnHlLha83DsOX66Px0ZMaHFmmQapFA81LRzH6hU8x8LmPoFrZjn5ZdzFP
    9.27 -        cG8zow0SuNC6ZyWOIa11y3sr8v+wVYWvNkTii3WxivztSzXImzodyS9/jtgXP8NNaz+G6skjuLF0IQfA
    9.28 -        +XcL/kNG90461UVh3tmFfXF2mwqn3wjEsRdux9HVCWh6KA4bZoxF5htfw/7aMUUFDqL3ihaEaWwnpGm5
    9.29 -        wB2gEXjI4HGr6+bWq7+j/C2rAnFqcy/UPTIKjYti4NGGo3zOPSh66wS8m7+CbuNRZRDhsbrz0oyJh3t/
    9.30 -        osBKx9XfeXa7ktk1/Tua1wRhT20gGpcNoLSlAjuvdFRVJ45OMp311NYhOncq4uZtwM3uCVv5m0AFmPUS
    9.31 -        BO6K7inw+qJgOJNC4bP3hyc5jNIyuXAAZHJK2T2zjBU1GKk1YWSyHVE662l5zwFwoNnCSGGAcHVJ52Kb
    9.32 -        6Bi8XztG/Vu5N4SRjxWcAlMqo2Pp9Ap2y/SaCM8ze3BrzLhfe6qHcesx/bLQMCMy6wULXbM70yMeXT4t
    9.33 -        DC6JvjKjb728opRc1YxsguAQWISY4WLjXXm4NToOo4tm+dXJFTgYFpquz785fvB5p059xmMI/U4ehwg8
    9.34 -        LLLTdIFFiMUnVGCGuyHOnvVZku9O3GZ0I764msmH37FaMgl1ff69+sHflHkU6Tl/TKfskEWFzhk1I6O0
    9.35 -        nNse+rwpW9IWrEVcTgWisytWyTsmIirEAXRvB4ixIasXO2Jx4WmVz/2ESxdVkKGgctOoWA2i7dkfyDPX
    9.36 -        CKeJmZAqdcs4AGYySsnOWE65qDrrkAPqFWtJO57omzFX7v2VcLjwz0esKxg7ZbTMZBzIQIGD+qe0yu8Z
    9.37 -        MaeIp1vuEh48mIq7ZXTEaNkB55xF5XI5nb/xWw6W1ZDbkPdd/K+nUv0OTcTRP5k8oHMAAAAASUVORK5C
    9.38 -        YII=
    9.39 +        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
    9.40 +        wwAADsMBx2+oZAAABttJREFUWEe9l3lQ1GUYxzeE0ExRXGW8IKjUUuRy2WVZ9nQPll3ucxERFFDL1Kwp
    9.41 +        odRyTMfUkg4rj2wyK2u0yWlUEPACPLDIrumw0unwqNSwY6Y/vj3fX25jRipYPTOf+R37e9/nfb7v+z7P
    9.42 +        u6r/2nyGtP6WUXHHU0bEnCgZ54q78Pr/M6/RCpNWiwXOCmTEprwqr3pc4Dr+/p9YfoLtIa9tPCYUFWDH
    9.43 +        ju3YubMeNnMKtpQtgfwcKUQIfYXrhX/XLNGaM1kOF9Y/v05x3tCwE7t2NWHdmtWYmluMnHhTnXymFYYJ
    9.44 +        fdjmmm2SLjU6z5kGq9GA7du3oa5uB5qaGrF79y60NDfjwP79OHTwIJr37sXmmUuQPGpMhzTTCVTj2iw9
    9.45 +        Rt+aY3dh/oM1inPK3djYgH3ijM4PHjigOG9rO4S33z6MeeXTUZxkfUWa2oUYpZOuWrnBY3Np9HCZTNi6
    9.46 +        9U1Fajql1M379qG1pUVxSg4fbsO77e1INZswOSsHgQEBdwQHBs+QboqEVKXDrppI+KPZkITXNr2K+vo6
    9.47 +        ZZ737t2jOPfLfejQH86feqIWTpsF3njd0RmODL00rxQqhBIhQ7i8lZWWLMz0umG3GGHU684VON0nN06q
    9.48 +        wQMTq7B40cI/pfZH7Jc6PzsTFfmFmD4+bY50Q6d+x5OFSUKmYBY6t5kzq27iNc1llwjMsBkNp5O1mo4U
    9.49 +        XSKm5hWh5e7HlSnY39r6l3muk+mYVFIMp1b3U6U1dYV0calzRp4vpAjRQufGTojcBgo9hQFTzO753oQk
    9.50 +        ZHvdx0rd3va1pbOw8aUNitTV992LLJcTE1Os9QEBAdPk+4udlgkFAiVPEsYIaqG30Lndf+8c+Arymblu
    9.51 +        FPjxiHKjY3XD7MWYbHLCbjXhnflPKNelix9BZU4uCvXGNvnu4oinCIyYzscLdM6tFyYwKAb3d5tdVTXU
    9.52 +        nJL8vdzyoxFComAUuHfHVqflDvUV5KEoI+Nbn8HUNs3uflreXyq1T8gS6JRS02mIECQECJe1HsbkpLNy
    9.53 +        ZfQsICaB2et2IVwYWTrBh/ycTGY1Rkmn/ogpN6P2CBx0lEDnvQQ6v3wNKE8P2VdT3geLFj6MXI8JjnFD
    9.54 +        f5DXXDDD1Wr1YLn2jIqKGmTUa88FBwfb5LlY4KrmNU/wS81FzKljvr9ixIrNLYwM27kyCOebVEh3SAWb
    9.55 +        9wDenDcGqYnDEam1Ypg5CwlW1y82kwHFhXkvSxNKS5kLBUZsEbjAOM8sNpzCq6t6+aaII/VLohTnP9ar
    9.56 +        cPL1PpjrG44ld1jwYa0GIyLDQcdBq96HqvZdqJM9R0LTZg+VplaBUXOt+BfXlaW+1NL14ccPPx2Bn/eo
    9.57 +        cG6HCic2haL1sVvwyTMafLBSA4/TitTMbIQ8+yFUT72HoPs2Qa13vydNOQDONaeHa4Zyd73WW+OHdJza
    9.58 +        0g8dDSqceUuFrzcOw5fro/HRkxocWaZBqkUDzUtHMfqFTzHwuY+gWtmOfll3MU9wbzOjDRK40LpnJY4h
    9.59 +        rXXLeyvy/7BVha82ROKLdbGK/O1LNcibOh3JL3+O2Bc/w01rP4bqySO4sXQhB8D5dwv+Q0b3TjrVRWHe
    9.60 +        2YV9cXabCqffCMSxF27H0dUJaHooDhtmjEXmG1/D/toxRQUOoveKFoRpbCekabnAHaAReMjgcavr5tar
    9.61 +        v6P8LasCcWpzL9Q9MgqNi2Lg0YajfM49KHrrBLybv4Ju41FlEOGxuvPSjImHe3+iwErH1d95druS2TX9
    9.62 +        O5rXBGFPbSAalw2gtKUCO690VFUnjk4ynfXU1iE6dyri5m3Aze4JW/mbQAWY9RIE7oruKfD6omA4k0Lh
    9.63 +        s/eHJzmM0jK5cABkckrZPbOMFTUYqTVhZLIdUTrraXnPAXCg2cJIYYBwdUnnYpvoGLxfO0b9W7k3hJGP
    9.64 +        FZwCUyqjY+n0CnbL9JoIzzN7cGvMuF97qodx6zH9stAwIzLrBQtdszvTIx5dPi0MLom+MqNvvbyilFzV
    9.65 +        jGyC4BBYhJjhYuNdebg1Og6ji2b51ckVOBgWmq7Pvzl+8HmnTn3GYwj9Th6HCDwsstN0gUWIxSdUYIa7
    9.66 +        Ic6e9VmS707cZnQjvriayYffsVoyCXV9/r36wd+UeRTpOX9Mp+yQRYXOGTUjo7Sc2x76vClb0hasRVxO
    9.67 +        BaKzK1bJOyYiKsQBdG8HiLEhqxc7YnHhaZXP/YRLF1WQoaBy06hYDaLt2R/IM9cIp4mZkCp1yzgAZjJK
    9.68 +        yc5YTrmoOuuQA+oVa0k7nuibMVfu/ZVwuPDPR6wrGDtltMxkHMhAgYP6p7TK7xkxp4inW+4SHjyYirtl
    9.69 +        dMRo2QHnnEXlcjmdv/FbDpbVkNuQ9138r6dS/Q5NxNE/mTygcwAAAABJRU5ErkJggg==
    9.70  </value>
    9.71    </data>
    9.72    <data name="btnAbout.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    9.73      <value>
    9.74 -        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    9.75 -        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADJSURBVFhHzZMxDsMwDMT8vf7/QS0SRAdVZmVnuZQAB4WS
    9.76 -        t4z/4DXejygoOhQUHQqKDgVFh4Kiw8QxPKGg6FBQRDtof6GYYjwY1N4Z+0HtSTHFIM+5dwZ5zj0ppliP
    9.77 -        Yu6ou7/m5AX8IudRM3fW3TpLAbEe1bmz7tZZCohBnvN3YnU7KSDGUVB7Z+wHtUsBsT1cuH0rIG4/Am7f
    9.78 -        Jo7hy/MR+L7jjVtB0aGg6FBQdCgoOhQUHV7QL+JQUHQoKDoUFB0Kig4FRYfPM8YHFzDOIbu5zZwAAAAA
    9.79 -        SUVORK5CYII=
    9.80 +        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
    9.81 +        wwAADsMBx2+oZAAAAMlJREFUWEfNkzEOwzAMxPy9/v9BLRJEB1VmZWe5lAAHhZK3jP/gNd6PKCg6FBQd
    9.82 +        CooOBUWHgqLDxDE8oaDoUFBEO2h/oZhiPBjU3hn7Qe1JMcUgz7l3BnnOPSmmWI9i7qi7v+bkBfwi51Ez
    9.83 +        d9bdOksBsR7VubPu1lkKiEGe83didTspIMZRUHtn7Ae1SwGxPVy4fSsgbj8Cbt8mjuHL8xH4vuONW0HR
    9.84 +        oaDoUFB0KCg6FBQdXtAv4lBQdCgoOhQUHQqKDgVFh88zxgcXMM4hu7nNnAAAAABJRU5ErkJggg==
    9.85  </value>
    9.86    </data>
    9.87  </root>
    9.88 \ No newline at end of file
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/Settings.cs	Mon May 25 21:28:25 2015 +0200
    10.3 @@ -0,0 +1,28 @@
    10.4 +namespace pEp.Properties {
    10.5 +    
    10.6 +    
    10.7 +    // This class allows you to handle specific events on the settings class:
    10.8 +    //  The SettingChanging event is raised before a setting's value is changed.
    10.9 +    //  The PropertyChanged event is raised after a setting's value is changed.
   10.10 +    //  The SettingsLoaded event is raised after the setting values are loaded.
   10.11 +    //  The SettingsSaving event is raised before the setting values are saved.
   10.12 +    internal sealed partial class Settings {
   10.13 +        
   10.14 +        public Settings() {
   10.15 +            // // To add event handlers for saving and changing settings, uncomment the lines below:
   10.16 +            //
   10.17 +            // this.SettingChanging += this.SettingChangingEventHandler;
   10.18 +            //
   10.19 +            // this.SettingsSaving += this.SettingsSavingEventHandler;
   10.20 +            //
   10.21 +        }
   10.22 +        
   10.23 +        private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
   10.24 +            // Add code to handle the SettingChangingEvent event here.
   10.25 +        }
   10.26 +        
   10.27 +        private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
   10.28 +            // Add code to handle the SettingsSaving event here.
   10.29 +        }
   10.30 +    }
   10.31 +}
    11.1 --- a/ThisAddIn.cs	Sun May 24 11:05:19 2015 +0200
    11.2 +++ b/ThisAddIn.cs	Mon May 25 21:28:25 2015 +0200
    11.3 @@ -30,6 +30,8 @@
    11.4          public const string PR_SMTP_ADDRESS = "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"; 
    11.5          public const string disclaimer = "This mail was encrypted using p≡p.\n\nYou need p≡p or a software for decrypting OpenPGP messages to read it.";
    11.6  
    11.7 +        public const string PEP_VERSION = "1.0";
    11.8 +
    11.9          static void StopHere(string reason)
   11.10          {
   11.11  #if DEBUG
   11.12 @@ -174,7 +176,7 @@
   11.13                  return;
   11.14              }
   11.15  
   11.16 -            _mailItem.PropertyAccessor.SetProperty(PR_X_PEP_VERSION, "1.0");
   11.17 +            _mailItem.PropertyAccessor.SetProperty(PR_X_PEP_VERSION, PEP_VERSION);
   11.18  
   11.19              CryptableMailItem mailItem = CryptableMailItem.createMailItem(_mailItem);
   11.20  
    12.1 --- a/app.config	Sun May 24 11:05:19 2015 +0200
    12.2 +++ b/app.config	Mon May 25 21:28:25 2015 +0200
    12.3 @@ -1,3 +1,5 @@
    12.4  <?xml version="1.0" encoding="utf-8" ?>
    12.5  <configuration>
    12.6 +    <configSections>
    12.7 +    </configSections>
    12.8  </configuration>
    12.9 \ No newline at end of file
    13.1 --- a/pEp.csproj	Sun May 24 11:05:19 2015 +0200
    13.2 +++ b/pEp.csproj	Mon May 25 21:28:25 2015 +0200
    13.3 @@ -234,6 +234,12 @@
    13.4        <DependentUpon>Handshake.cs</DependentUpon>
    13.5      </Compile>
    13.6      <Compile Include="CryptableMailItem.cs" />
    13.7 +    <Compile Include="Options.cs">
    13.8 +      <SubType>Form</SubType>
    13.9 +    </Compile>
   13.10 +    <Compile Include="Options.Designer.cs">
   13.11 +      <DependentUpon>Options.cs</DependentUpon>
   13.12 +    </Compile>
   13.13      <Compile Include="Properties\AssemblyInfo.cs">
   13.14        <SubType>Code</SubType>
   13.15      </Compile>
   13.16 @@ -243,6 +249,9 @@
   13.17      <EmbeddedResource Include="Handshake.resx">
   13.18        <DependentUpon>Handshake.cs</DependentUpon>
   13.19      </EmbeddedResource>
   13.20 +    <EmbeddedResource Include="Options.resx">
   13.21 +      <DependentUpon>Options.cs</DependentUpon>
   13.22 +    </EmbeddedResource>
   13.23      <EmbeddedResource Include="Properties\Resources.resx">
   13.24        <Generator>ResXFileCodeGenerator</Generator>
   13.25        <SubType>Designer</SubType>
   13.26 @@ -275,6 +284,7 @@
   13.27      <Compile Include="RibbonpEp.Designer.cs">
   13.28        <DependentUpon>RibbonpEp.cs</DependentUpon>
   13.29      </Compile>
   13.30 +    <Compile Include="Settings.cs" />
   13.31      <Compile Include="ThisAddIn.cs">
   13.32        <SubType>Code</SubType>
   13.33      </Compile>