Implement UI changes OUT-640
authorThomas
Thu, 21 Nov 2019 17:25:36 +0100
branchOUT-640
changeset 287768bd0540f1b8
parent 2876 ddf5f79fd0ac
child 2880 fef4fae188c4
Implement UI changes
Extensions/AccountExtensions.cs
PEPSettings.cs
Properties/Resources.Designer.cs
Properties/Resources.de.resx
Properties/Resources.es.resx
Properties/Resources.resx
ThisAddIn.cs
UI/FormControlOptions.xaml
UI/FormControlOptions.xaml.cs
     1.1 --- a/Extensions/AccountExtensions.cs	Thu Nov 21 13:56:03 2019 +0100
     1.2 +++ b/Extensions/AccountExtensions.cs	Thu Nov 21 17:25:36 2019 +0100
     1.3 @@ -62,7 +62,7 @@
     1.4                  else
     1.5                  {
     1.6                      // Use global sync setting as default
     1.7 -                    acctSettings.IsSyncEnabled = Globals.ThisAddIn.Settings.IsSyncEnabledForAllAccounts;
     1.8 +                    acctSettings.IsSyncEnabled = Globals.ThisAddIn.Settings.IsSyncEnabled;
     1.9                  }
    1.10  
    1.11                  // Signal sync settings to engine
     2.1 --- a/PEPSettings.cs	Thu Nov 21 13:56:03 2019 +0100
     2.2 +++ b/PEPSettings.cs	Thu Nov 21 17:25:36 2019 +0100
     2.3 @@ -73,7 +73,6 @@
     2.4          public const string REG_NAME_IS_SECURITY_LOSS_WARNING_ENABLED           = "IsSecurityLossWarningEnabled";
     2.5          public const string REG_NAME_IS_SENSITIVE_DATA_LOGGING_ENABLED          = "IsSensitiveDataLoggingEnabled";
     2.6          public const string REG_NAME_IS_SYNC_ENABLED                            = "IsSyncEnabled";
     2.7 -        public const string REG_NAME_IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS           = "IsSyncEnabledForAllAccounts";
     2.8          public const string REG_NAME_IS_TNEF_DISABLED                           = "DisableTNEF"; // Name defined by Microsoft
     2.9          public const string REG_NAME_IS_UNENCRYPTED_SUBJECT_ENABLED             = "IsUnencryptedSubjectEnabled";
    2.10          public const string REG_NAME_IS_UX_IMPROVEMENT_ENABLED                  = "IsUXImprovementEnabled";
    2.11 @@ -114,7 +113,6 @@
    2.12  #endif
    2.13          public const bool                  IS_SENSITIVE_DATA_LOGGING_ENABLED_DEFAULT          = false;
    2.14          public const bool                  IS_SYNC_ENABLED_DEFAULT                            = true;
    2.15 -        public const bool                  IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS_DEFAULT           = true;
    2.16          public const bool                  IS_TNEF_DISABLED_DEFAULT                           = false;
    2.17          public const bool                  IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT             = false;
    2.18          public const bool                  IS_UX_IMPROVEMENT_ENABLED_DEFAULT                  = true;
    2.19 @@ -140,7 +138,6 @@
    2.20          private bool                                     _IsSecurityLossWarningEnabled;
    2.21          private bool                                     _IsSensitiveDataLoggingEnabled;
    2.22          private bool                                     _IsSyncEnabled;
    2.23 -        private bool                                     _IsSyncEnabledForAllAccounts;
    2.24          private bool                                     _IsTNEFDisabled;
    2.25          private bool                                     _IsUnencryptedSubjectEnabled;
    2.26          private bool                                     _IsUXImprovementEnabled;
    2.27 @@ -461,24 +458,6 @@
    2.28          }
    2.29  
    2.30          /// <summary>
    2.31 -        /// Gets or sets whether key sync is enabled for all accounts.
    2.32 -        /// </summary>
    2.33 -        public bool IsSyncEnabledForAllAccounts
    2.34 -        {
    2.35 -            get { return (this._IsSyncEnabledForAllAccounts); }
    2.36 -            set
    2.37 -            {
    2.38 -                if (object.Equals(this._IsSyncEnabledForAllAccounts, value) == false)
    2.39 -                {
    2.40 -                    this._IsSyncEnabledForAllAccounts = value;
    2.41 -                    this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabledForAllAccounts));
    2.42 -
    2.43 -                    Globals.ThisAddIn.SyncWithSettings();
    2.44 -                }
    2.45 -            }
    2.46 -        }
    2.47 -
    2.48 -        /// <summary>
    2.49          /// Gets or sets whether TNEF/RTF format is forcefully disabled in the registry.
    2.50          /// Can only be set from the registry.
    2.51          /// </summary>
    2.52 @@ -609,7 +588,6 @@
    2.53              this._IsSecurityLossWarningEnabled = PEPSettings.IS_SECURITY_LOSS_WARNING_ENABLED_DEFAULT;
    2.54              this._IsSensitiveDataLoggingEnabled = PEPSettings.IS_SENSITIVE_DATA_LOGGING_ENABLED_DEFAULT;
    2.55              this._IsSyncEnabled = PEPSettings.IS_SYNC_ENABLED_DEFAULT;
    2.56 -            this._IsSyncEnabledForAllAccounts = PEPSettings.IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS_DEFAULT;
    2.57              this._IsTNEFDisabled = PEPSettings.IS_TNEF_DISABLED_DEFAULT;
    2.58              this._IsUnencryptedSubjectEnabled = PEPSettings.IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT;
    2.59              this._IsUXImprovementEnabled = PEPSettings.IS_UX_IMPROVEMENT_ENABLED_DEFAULT;
    2.60 @@ -641,7 +619,6 @@
    2.61              this.RaisePropertyChangedEvent(nameof(this.IsSecurityLossWarningEnabled));
    2.62              this.RaisePropertyChangedEvent(nameof(this.IsSensitiveDataLoggingEnabled));
    2.63              this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabled));
    2.64 -            this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabledForAllAccounts));
    2.65              this.RaisePropertyChangedEvent(nameof(this.IsTNEFDisabled));
    2.66              this.RaisePropertyChangedEvent(nameof(this.IsUnencryptedSubjectEnabled));
    2.67              this.RaisePropertyChangedEvent(nameof(this.IsUXImprovementEnabled));
    2.68 @@ -769,7 +746,6 @@
    2.69                  Comparisons.Equals(this.IsReaderSplashEnabled, obj.IsReaderSplashEnabled) &&
    2.70                  Comparisons.Equals(this.IsSecurityLossWarningEnabled, obj.IsSecurityLossWarningEnabled) &&
    2.71                  Comparisons.Equals(this.IsSensitiveDataLoggingEnabled, obj.IsSensitiveDataLoggingEnabled) &&
    2.72 -                Comparisons.Equals(this.IsSyncEnabledForAllAccounts, obj.IsSyncEnabledForAllAccounts) &&
    2.73                  Comparisons.Equals(this.IsSyncEnabled, obj.IsSyncEnabled) &&
    2.74                  Comparisons.Equals(this.IsTNEFDisabled, obj.IsTNEFDisabled) &&
    2.75                  Comparisons.Equals(this.IsUnencryptedSubjectEnabled, obj.IsUnencryptedSubjectEnabled) &&
    2.76 @@ -930,8 +906,7 @@
    2.77                          pEpKey.SetValue(PEPSettings.REG_NAME_IS_PRIVACY_STATUS_BAR_ENABLED, this._IsPrivacyStatusBarEnabled.ToString(), RegistryValueKind.String);
    2.78                          pEpKey.SetValue(PEPSettings.REG_NAME_IS_READER_SPLASH_ENABLED, this._IsReaderSplashEnabled.ToString(), RegistryValueKind.String);
    2.79                          pEpKey.SetValue(PEPSettings.REG_NAME_IS_SECURITY_LOSS_WARNING_ENABLED, this._IsSecurityLossWarningEnabled.ToString(), RegistryValueKind.String);
    2.80 -                        pEpKey.SetValue(PEPSettings.REG_NAME_IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS, this._IsSyncEnabledForAllAccounts.ToString(), RegistryValueKind.String);
    2.81 -                        pEpKey.SetValue(PEPSettings.REG_NAME_IS_SYNC_ENABLED, AdapterExtensions.GetIsSyncEnabled().ToString(), RegistryValueKind.String);
    2.82 +                        pEpKey.SetValue(PEPSettings.REG_NAME_IS_SYNC_ENABLED, this._IsSyncEnabled.ToString(), RegistryValueKind.String);
    2.83                          pEpKey.SetValue(PEPSettings.REG_NAME_IS_UNENCRYPTED_SUBJECT_ENABLED, this._IsUnencryptedSubjectEnabled.ToString(), RegistryValueKind.String);
    2.84                          pEpKey.SetValue(PEPSettings.REG_NAME_IS_VERBOSE_LOGGING_ENABLED, this._IsVerboseLoggingEnabled.ToString(), RegistryValueKind.String);
    2.85                          pEpKey.SetValue(PEPSettings.REG_NAME_TRUSTWORDS_CULTURE, (this._TrustwordsCulture?.TwoLetterISOLanguageName ?? string.Empty), RegistryValueKind.String);
    2.86 @@ -1824,33 +1799,6 @@
    2.87                              this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabled));
    2.88                          }
    2.89  
    2.90 -                        // Attempt to get IsSyncEnabledForAllAccounts value
    2.91 -                        isPropertySet = false;
    2.92 -                        try
    2.93 -                        {
    2.94 -                            keyValue = pEpKey.GetValue(PEPSettings.REG_NAME_IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS, PEPSettings.IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS_DEFAULT).ToString();
    2.95 -                            isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
    2.96 -
    2.97 -                            if (isSuccessful)
    2.98 -                            {
    2.99 -                                this._IsSyncEnabledForAllAccounts = parsedBoolValue;
   2.100 -                                isPropertySet = true;
   2.101 -                            }
   2.102 -                        }
   2.103 -                        catch
   2.104 -                        {
   2.105 -                            Log.Warning("LoadFromRegistry: Unable to read IsSyncEnabledForAllAccounts");
   2.106 -                        }
   2.107 -                        finally
   2.108 -                        {
   2.109 -                            if (isPropertySet == false)
   2.110 -                            {
   2.111 -                                this._IsSyncEnabledForAllAccounts = PEPSettings.IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS_DEFAULT;
   2.112 -                            }
   2.113 -
   2.114 -                            this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabledForAllAccounts));
   2.115 -                        }
   2.116 -
   2.117                          // Attempt to get IsUnencryptedSubjectEnabled value
   2.118                          isPropertySet = false;
   2.119                          try
     3.1 --- a/Properties/Resources.Designer.cs	Thu Nov 21 13:56:03 2019 +0100
     3.2 +++ b/Properties/Resources.Designer.cs	Thu Nov 21 17:25:36 2019 +0100
     3.3 @@ -1894,6 +1894,15 @@
     3.4          }
     3.5          
     3.6          /// <summary>
     3.7 +        ///   Looks up a localized string similar to Enable p≡p Sync.
     3.8 +        /// </summary>
     3.9 +        public static string Options_IsSyncEnabled {
    3.10 +            get {
    3.11 +                return ResourceManager.GetString("Options_IsSyncEnabled", resourceCulture);
    3.12 +            }
    3.13 +        }
    3.14 +        
    3.15 +        /// <summary>
    3.16          ///   Looks up a localized string similar to Enable p≡p sync for all accounts.
    3.17          /// </summary>
    3.18          public static string Options_IsSyncEnabledForAllAccountsText {
     4.1 --- a/Properties/Resources.de.resx	Thu Nov 21 13:56:03 2019 +0100
     4.2 +++ b/Properties/Resources.de.resx	Thu Nov 21 17:25:36 2019 +0100
     4.3 @@ -941,4 +941,7 @@
     4.4    <data name="SyncWizard_RejectButton" xml:space="preserve">
     4.5      <value>Ablehnen</value>
     4.6    </data>
     4.7 +  <data name="Options_IsSyncEnabled" xml:space="preserve">
     4.8 +    <value>p≡p Sync aktivieren</value>
     4.9 +  </data>
    4.10  </root>
    4.11 \ No newline at end of file
     5.1 --- a/Properties/Resources.es.resx	Thu Nov 21 13:56:03 2019 +0100
     5.2 +++ b/Properties/Resources.es.resx	Thu Nov 21 17:25:36 2019 +0100
     5.3 @@ -941,4 +941,7 @@
     5.4    <data name="SyncWizard_RejectButton" xml:space="preserve">
     5.5      <value>Rechazar</value>
     5.6    </data>
     5.7 +  <data name="Options_IsSyncEnabled" xml:space="preserve">
     5.8 +    <value>Activate p≡p Sync</value>
     5.9 +  </data>
    5.10  </root>
    5.11 \ No newline at end of file
     6.1 --- a/Properties/Resources.resx	Thu Nov 21 13:56:03 2019 +0100
     6.2 +++ b/Properties/Resources.resx	Thu Nov 21 17:25:36 2019 +0100
     6.3 @@ -1071,4 +1071,7 @@
     6.4    <data name="SyncWizard_RejectButton" xml:space="preserve">
     6.5      <value>Decline</value>
     6.6    </data>
     6.7 +  <data name="Options_IsSyncEnabled" xml:space="preserve">
     6.8 +    <value>Enable p≡p Sync</value>
     6.9 +  </data>
    6.10  </root>
    6.11 \ No newline at end of file
     7.1 --- a/ThisAddIn.cs	Thu Nov 21 13:56:03 2019 +0100
     7.2 +++ b/ThisAddIn.cs	Thu Nov 21 17:25:36 2019 +0100
     7.3 @@ -555,7 +555,7 @@
     7.4              {
     7.5                  if (this._Settings != null)
     7.6                  {
     7.7 -                    // Update the Outlook accounts list with the one maintained in pEp settings if needed.
     7.8 +                    // Update the Outlook accounts list with the one maintained in pEp settings if needed
     7.9                      if (syncAccountsList)
    7.10                      {
    7.11                          this.SyncAccountsList();
    7.12 @@ -567,6 +567,26 @@
    7.13                          accountSettings?.SignalSyncSettingsToEngine();
    7.14                      });
    7.15  
    7.16 +                    // Enable/disable Sync if needed
    7.17 +                    bool isSyncRunning =  ThisAddIn.PEPEngine.GetIsSyncRunning();
    7.18 +                    if ((this._Settings.IsSyncEnabled) &&
    7.19 +                        (isSyncRunning == false))
    7.20 +                    {
    7.21 +                        ThisAddIn.PEPEngine.Startup();
    7.22 +                    }
    7.23 +                    else if ((this.Settings.IsSyncEnabled == false) &&
    7.24 +                            (isSyncRunning))
    7.25 +                    {
    7.26 +                        if (this.Settings.IsGrouped)
    7.27 +                        {
    7.28 +                            ThisAddIn.PEPEngine.LeaveDeviceGroup();
    7.29 +                        }
    7.30 +                        else
    7.31 +                        {
    7.32 +                            ThisAddIn.PEPEngine.ShutDownSync();
    7.33 +                        }
    7.34 +                    }
    7.35 +
    7.36                      // Sync IsPassiveModeEnabled with engine
    7.37                      ThisAddIn.PEPEngine.PassiveMode(this._Settings.IsPassiveModeEnabled);
    7.38  
    7.39 @@ -724,7 +744,7 @@
    7.40                  };
    7.41  
    7.42                  // Set not for sync flag if necessary
    7.43 -                if ((Globals.ThisAddIn.Settings.IsSyncEnabledForAllAccounts == false) &&
    7.44 +                if ((this._Settings.IsSyncEnabled == false) ||
    7.45                       (acctSettings.IsSyncEnabled == false))
    7.46                  {
    7.47                      ownIdentity.Flags = pEpIdentityFlags.pEpIdfNotForSync;
    7.48 @@ -1128,20 +1148,6 @@
    7.49  
    7.50              if (state != null)
    7.51              {
    7.52 -                // Enable Sync if needed
    7.53 -                if (state.IsSyncEnabled &&
    7.54 -                    AdapterExtensions.GetIsSyncEnabled() == false)
    7.55 -                {
    7.56 -                    try
    7.57 -                    {
    7.58 -                        ThisAddIn.PEPEngine.Startup();
    7.59 -                    }
    7.60 -                    catch (Exception ex)
    7.61 -                    {
    7.62 -                        Log.Error("SetOptionsState: Error enabling Sync. " + ex.ToString());
    7.63 -                    }
    7.64 -                }
    7.65 -
    7.66                  // Get the blacklist
    7.67                  try
    7.68                  {
    7.69 @@ -1256,7 +1262,6 @@
    7.70                  this._Settings.IsPrivacyStatusBarEnabled = state.IsPrivacyStatusBarEnabled;
    7.71                  this._Settings.IsSecurityLossWarningEnabled = state.IsSecurityLossWarningEnabled;
    7.72                  this._Settings.IsSyncEnabled = state.IsSyncEnabled;
    7.73 -                this._Settings.IsSyncEnabledForAllAccounts = state.IsSyncEnabledForAllAccounts;
    7.74                  this._Settings.IsUnencryptedSubjectEnabled = state.IsUnencryptedSubjectEnabled;
    7.75                  this._Settings.IsVerboseLoggingEnabled = state.IsVerboseLoggingEnabled;
    7.76                  this._Settings.TrustwordsCulture = ((state.TrustwordsCulture != null) ? new CultureInfo(state.TrustwordsCulture.LCID) : null);
    7.77 @@ -1431,7 +1436,7 @@
    7.78              state.IsPEPFolderVisible = (isDefaultStore ? true : this._Settings.IsPEPFolderVisible);
    7.79              state.IsPrivacyStatusBarEnabled = this._Settings.IsPrivacyStatusBarEnabled;
    7.80              state.IsSecurityLossWarningEnabled = this._Settings.IsSecurityLossWarningEnabled;
    7.81 -            state.IsSyncEnabledForAllAccounts = this._Settings.IsSyncEnabledForAllAccounts;
    7.82 +            state.IsSyncEnabled = this._Settings.IsSyncEnabled;
    7.83              state.IsTNEFDisabled = this._Settings.IsTNEFDisabled;
    7.84              state.IsUnencryptedSubjectEnabled = this._Settings.IsUnencryptedSubjectEnabled;
    7.85              state.IsVerboseLoggingEnabled = this._Settings.IsVerboseLoggingEnabled;
     8.1 --- a/UI/FormControlOptions.xaml	Thu Nov 21 13:56:03 2019 +0100
     8.2 +++ b/UI/FormControlOptions.xaml	Thu Nov 21 17:25:36 2019 +0100
     8.3 @@ -203,7 +203,7 @@
     8.4                          <CheckBox Grid.Row="2"
     8.5                                    VerticalContentAlignment="Top"
     8.6                                    IsThreeState="False"
     8.7 -                                  IsChecked="{Binding Path=IsSyncEnabledForAllAccounts, Mode=TwoWay}"
     8.8 +                                  IsChecked="{Binding Path=IsSyncEnabled, Mode=TwoWay}"
     8.9                                    Visibility="{Binding Path=IsAdvancedEnabled, Mode=OneWay, Converter={StaticResource BoolToVisibility}}">
    8.10                              <CheckBox.Margin>
    8.11                                  <Thickness Bottom="0"
    8.12 @@ -211,7 +211,7 @@
    8.13                                             Right="0"
    8.14                                             Top="{StaticResource PageSubSectionSpacing}" />
    8.15                              </CheckBox.Margin>
    8.16 -                            <TextBlock Text="{x:Static p:Resources.Options_IsSyncEnabledForAllAccountsText}"
    8.17 +                            <TextBlock Text="{x:Static p:Resources.Options_IsSyncEnabled}"
    8.18                                         TextWrapping="Wrap"
    8.19                                         Margin="{StaticResource CheckBoxContentMarginWhenTop}" />
    8.20                          </CheckBox>
    8.21 @@ -233,7 +233,7 @@
    8.22                          <!-- Account list -->
    8.23                          <TextBlock  Grid.Row="0"
    8.24                                      Visibility="Collapsed" />
    8.25 -                        
    8.26 +
    8.27                          <!-- Can be used for a title -->
    8.28                          <ListBox  Name="accountSettingsListBox"
    8.29                                    Grid.Row="1"
    8.30 @@ -531,19 +531,12 @@
    8.31                                        Margin="5">
    8.32                              </ComboBox>
    8.33                          </StackPanel>
    8.34 -                        <StackPanel Grid.Row="7"
    8.35 -                                    Orientation="Horizontal">
    8.36 -                            <Button Style="{StaticResource StyleButtonGray}"
    8.37 -                                    Margin="0,0,10,0"
    8.38 -                                    HorizontalAlignment="Left"
    8.39 -                                    Content="{x:Static p:Resources.Options_ResetAllOwnKeys}"
    8.40 -                                    Click="ButtonResetAllOwnKeys_Click" />
    8.41 -                            <Button Style="{StaticResource StyleButtonGray}"
    8.42 -                                    HorizontalAlignment="Left"
    8.43 -                                    Content="{x:Static p:Resources.Options_LeaveDeviceGroupText}"
    8.44 -                                    Click="ButtonLeaveDeviceGroup_Click"
    8.45 -                                    Visibility="{Binding IsGrouped, Converter={StaticResource BoolToVisibility}}" />
    8.46 -                        </StackPanel>
    8.47 +                        <Button Grid.Row="7"
    8.48 +                                Style="{StaticResource StyleButtonGray}"
    8.49 +                                Margin="0,0,10,0"
    8.50 +                                HorizontalAlignment="Left"
    8.51 +                                Content="{x:Static p:Resources.Options_ResetAllOwnKeys}"
    8.52 +                                Click="ButtonResetAllOwnKeys_Click" />
    8.53                      </Grid>
    8.54  
    8.55                  </Grid>
     9.1 --- a/UI/FormControlOptions.xaml.cs	Thu Nov 21 13:56:03 2019 +0100
     9.2 +++ b/UI/FormControlOptions.xaml.cs	Thu Nov 21 17:25:36 2019 +0100
     9.3 @@ -9,6 +9,7 @@
     9.4  using System.Diagnostics;
     9.5  using System.Globalization;
     9.6  using System.IO;
     9.7 +using System.Linq;
     9.8  using System.Text;
     9.9  using System.Text.RegularExpressions;
    9.10  using System.Windows;
    9.11 @@ -257,29 +258,6 @@
    9.12          }
    9.13  
    9.14          /// <summary>
    9.15 -        /// Event handler for when the Leave Device Group button is clicked.
    9.16 -        /// </summary>
    9.17 -        private void ButtonLeaveDeviceGroup_Click(object sender, RoutedEventArgs e)
    9.18 -        {
    9.19 -            try
    9.20 -            {
    9.21 -                // Leave the device group
    9.22 -                ThisAddIn.PEPEngine.LeaveDeviceGroup();
    9.23 -
    9.24 -                // Calling LeaveDeviceGroup will shutdown sync, so we have to persist
    9.25 -                // this setting in the app to not start sync again.
    9.26 -                this.DisplayState.IsSyncEnabled = false;
    9.27 -
    9.28 -                // Show a success notification
    9.29 -                Notification.Show(Properties.Resources.KeySync_DeviceGroup, Properties.Resources.Notifications_DeviceGroupLeftText);
    9.30 -            }
    9.31 -            catch (Exception ex)
    9.32 -            {
    9.33 -                Log.Error("ButtonLeaveDeviceGroup_Click: Error leaving device group. " + ex.ToString());
    9.34 -            }
    9.35 -        }
    9.36 -
    9.37 -        /// <summary>
    9.38          /// Event handler for when the Reset All Own Keys button is clicked.
    9.39          /// </summary>
    9.40          private void ButtonResetAllOwnKeys_Click(object sender, RoutedEventArgs e)
    9.41 @@ -337,7 +315,6 @@
    9.42              private int                                             _BlacklistSelectedIndex;
    9.43              private RelayCommand                                    _CommandExportKeys;
    9.44              private RelayCommand                                    _CommandImportKeys;
    9.45 -            private RelayCommand                                    _CommandToggleSync;
    9.46              private bool                                            _HideInternalMessages;
    9.47              private bool                                            _IsAdvancedEnabled;
    9.48              private bool                                            _IsAutoUpdateEnabled;
    9.49 @@ -352,7 +329,6 @@
    9.50              private bool                                            _IsPrivacyStatusBarEnabled;
    9.51              private bool                                            _IsSecurityLossWarningEnabled;
    9.52              private bool                                            _IsSyncEnabled;
    9.53 -            private bool                                            _IsSyncEnabledForAllAccounts;
    9.54              private bool                                            _IsTNEFDisabled;
    9.55              private bool                                            _IsUnencryptedSubjectEnabled;
    9.56              private bool                                            _IsVerboseLoggingEnabled;
    9.57 @@ -364,7 +340,6 @@
    9.58              private Globals.ReleaseMode                             _ReleaseMode;
    9.59              private int                                             _SelectedPageIndex;
    9.60              private List<KVPair<string, string>>                    _SystemInfo;
    9.61 -            private string                                          _ToggleSyncButtonText;
    9.62              private CultureInfo                                     _TrustwordsCulture;
    9.63              private List<KeyValuePair<CultureInfo, string>>         _TrustwordsCultureList;
    9.64  
    9.65 @@ -494,22 +469,6 @@
    9.66              }
    9.67  
    9.68              /// <summary>
    9.69 -            /// Gets the command to execute when the Enable/Disable Sync button is clicked.
    9.70 -            /// </summary>
    9.71 -            public RelayCommand CommandToggleSync
    9.72 -            {
    9.73 -                get
    9.74 -                {
    9.75 -                    if (this._CommandToggleSync == null)
    9.76 -                    {
    9.77 -                        this._CommandToggleSync = new RelayCommand(p => this.ToggleSync());
    9.78 -                    }
    9.79 -
    9.80 -                    return this._CommandToggleSync;
    9.81 -                }
    9.82 -            }
    9.83 -
    9.84 -            /// <summary>
    9.85              /// Gets or sets whether to hide pEp internal messages.
    9.86              /// </summary>
    9.87              public bool HideInternalMessages
    9.88 @@ -698,7 +657,7 @@
    9.89              }
    9.90  
    9.91              /// <summary>
    9.92 -            /// Gets or sets whether to disable key sync for all accounts.
    9.93 +            /// Gets or sets whether sync is enabled or not.
    9.94              /// </summary>
    9.95              public bool IsSyncEnabled
    9.96              {
    9.97 @@ -713,21 +672,6 @@
    9.98              }
    9.99  
   9.100              /// <summary>
   9.101 -            /// Gets or sets whether to disable key sync for all accounts.
   9.102 -            /// </summary>
   9.103 -            public bool IsSyncEnabledForAllAccounts
   9.104 -            {
   9.105 -                get { return (this._IsSyncEnabledForAllAccounts); }
   9.106 -                set
   9.107 -                {
   9.108 -                    this._IsSyncEnabledForAllAccounts = value;
   9.109 -                    this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabledForAllAccounts));
   9.110 -
   9.111 -                    this.CalcDependentProperties();
   9.112 -                }
   9.113 -            }
   9.114 -
   9.115 -            /// <summary>
   9.116              /// Gets or sets whether TNEF/RTF format is forcefully disabled in the registry.
   9.117              /// </summary>
   9.118              public bool IsTNEFDisabled
   9.119 @@ -920,19 +864,6 @@
   9.120              }
   9.121  
   9.122              /// <summary>
   9.123 -            /// Gets or sets the text of the Enable/Disable Sync button text.
   9.124 -            /// </summary>
   9.125 -            public string ToggleSyncButtonText
   9.126 -            {
   9.127 -                get { return this._ToggleSyncButtonText; }
   9.128 -                set
   9.129 -                {
   9.130 -                    this._ToggleSyncButtonText = value;
   9.131 -                    this.RaisePropertyChangedEvent(nameof(this.ToggleSyncButtonText));
   9.132 -                }
   9.133 -            }
   9.134 -
   9.135 -            /// <summary>
   9.136              /// Gets or sets the current trustwords culture/language.
   9.137              /// Warning: This must correlate with TrustwordsCultureList.
   9.138              /// </summary>
   9.139 @@ -1179,7 +1110,6 @@
   9.140                  copy.IsPrivacyStatusBarEnabled = this._IsPrivacyStatusBarEnabled;
   9.141                  copy.IsSecurityLossWarningEnabled = this._IsSecurityLossWarningEnabled;
   9.142                  copy.IsSyncEnabled = this._IsSyncEnabled;
   9.143 -                copy.IsSyncEnabledForAllAccounts = this._IsSyncEnabledForAllAccounts;
   9.144                  copy.IsTNEFDisabled = this._IsTNEFDisabled;
   9.145                  copy.IsUnencryptedSubjectEnabled = this._IsUnencryptedSubjectEnabled;
   9.146                  copy.IsVerboseLoggingEnabled = this._IsVerboseLoggingEnabled;
   9.147 @@ -1189,7 +1119,6 @@
   9.148                  copy.PEPName = this._PEPName;
   9.149                  copy.SelectedPageIndex = this._SelectedPageIndex;
   9.150                  copy.SystemInfo = this._SystemInfo;
   9.151 -                copy.ToggleSyncButtonText = this._ToggleSyncButtonText;
   9.152                  copy.TrustwordsCulture = ((this._TrustwordsCulture != null) ? new CultureInfo(this._TrustwordsCulture.LCID) : null);
   9.153  
   9.154                  return copy;
   9.155 @@ -1235,7 +1164,6 @@
   9.156                  this._IsPrivacyStatusBarEnabled = PEPSettings.IS_PRIVACY_STATUS_BAR_ENABLED_DEFAULT;
   9.157                  this._IsSecurityLossWarningEnabled = PEPSettings.IS_SECURITY_LOSS_WARNING_ENABLED_DEFAULT;
   9.158                  this._IsSyncEnabled = PEPSettings.IS_SYNC_ENABLED_DEFAULT;
   9.159 -                this._IsSyncEnabledForAllAccounts = PEPSettings.IS_SYNC_ENABLED_FOR_ALL_ACCOUNTS_DEFAULT;
   9.160                  this._IsTNEFDisabled = PEPSettings.IS_TNEF_DISABLED_DEFAULT;
   9.161                  this._IsUnencryptedSubjectEnabled = PEPSettings.IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT;
   9.162                  this._IsVerboseLoggingEnabled = PEPSettings.IS_VERBOSE_LOGGING_ENABLED_DEFAULT;
   9.163 @@ -1247,7 +1175,6 @@
   9.164                  this._ReleaseMode = Globals.RELEASE_MODE;
   9.165                  this._SelectedPageIndex = (int)OptionPages.Accounts;
   9.166                  this._SystemInfo = null;
   9.167 -                this._ToggleSyncButtonText = Properties.Resources.Options_EnableSync;
   9.168                  this._TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
   9.169                  this._TrustwordsCultureList = Globals.ThisAddIn.LanguageList;
   9.170  
   9.171 @@ -1273,7 +1200,6 @@
   9.172                  this.RaisePropertyChangedEvent(nameof(this.IsPrivacyStatusBarEnabled));
   9.173                  this.RaisePropertyChangedEvent(nameof(this.IsSecurityLossWarningEnabled));
   9.174                  this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabled));
   9.175 -                this.RaisePropertyChangedEvent(nameof(this.IsSyncEnabledForAllAccounts));
   9.176                  this.RaisePropertyChangedEvent(nameof(this.IsTNEFDisabled));
   9.177                  this.RaisePropertyChangedEvent(nameof(this.IsUnencryptedSubjectEnabled));
   9.178                  this.RaisePropertyChangedEvent(nameof(this.IsVerboseLoggingEnabled));
   9.179 @@ -1408,11 +1334,11 @@
   9.180                                  entry.IsSyncEnabledOptionVisible = true;
   9.181                                  entry.IsSyncEnabledOverridden = true;
   9.182                              }
   9.183 -                            else if (this._IsSyncEnabledForAllAccounts)
   9.184 +                            else if (this._IsSyncEnabled == false)
   9.185                              {
   9.186 -                                /* If 'Disable pEp sync for all accounts' is checked, show sync disabled for each account. 
   9.187 +                                /* If Sync is disabled, show sync disabled for each account. 
   9.188                                   * This will still preserve whatever the past user setting was for the account.
   9.189 -                                 * This can be done because processing will use the 'IsSyncDisabledForAllAccounts' as an override.
   9.190 +                                 * This can be done because processing will use the 'IsSyncEnabled' as an override.
   9.191                                   * 
   9.192                                   * Do not modify the stored real value for IsSyncEnabled
   9.193                                   */
   9.194 @@ -1426,8 +1352,7 @@
   9.195                                  // Check if the value was previously overridden
   9.196                                  if (entry.IsSyncEnabledOverridden)
   9.197                                  {
   9.198 -                                    entry.IsSyncEnabled = false;
   9.199 -                                    entry.IsSyncEnabledOptionChecked = false;
   9.200 +                                    entry.IsSyncEnabledOptionChecked = entry.IsSyncEnabled;
   9.201                                  }
   9.202                                  else
   9.203                                  {
   9.204 @@ -1566,46 +1491,6 @@
   9.205                  return true;
   9.206              }
   9.207  
   9.208 -            private void ToggleSync()
   9.209 -            {
   9.210 -                if (this.IsGrouped)
   9.211 -                {
   9.212 -                    try
   9.213 -                    {
   9.214 -                        ThisAddIn.PEPEngine.LeaveDeviceGroup();
   9.215 -                        this.ToggleSyncButtonText = Properties.Resources.Options_EnableSync;
   9.216 -                    }
   9.217 -                    catch (Exception ex)
   9.218 -                    {
   9.219 -                        Log.Error("ToggleSync: Error leaving device group. " + ex.ToString());
   9.220 -                    }
   9.221 -                }
   9.222 -                else if (this.IsSyncEnabled)
   9.223 -                {
   9.224 -                    try
   9.225 -                    {
   9.226 -                        ThisAddIn.PEPEngine.ShutDownSync();
   9.227 -                        this.ToggleSyncButtonText = Properties.Resources.Options_EnableSync;
   9.228 -                    }
   9.229 -                    catch (Exception ex)
   9.230 -                    {
   9.231 -                        Log.Error("ToggleSync: Error disabling sync. " + ex.ToString());
   9.232 -                    }
   9.233 -                }
   9.234 -                else
   9.235 -                {
   9.236 -                    try
   9.237 -                    {
   9.238 -                        ThisAddIn.PEPEngine.Startup();
   9.239 -                        this.ToggleSyncButtonText = Properties.Resources.Options_DisableSync;
   9.240 -                    }
   9.241 -                    catch (Exception ex)
   9.242 -                    {
   9.243 -                        Log.Error("ToggleSync: Error enabling sync. " + ex.ToString());
   9.244 -                    }
   9.245 -                }
   9.246 -            }
   9.247 -
   9.248              /**************************************************************
   9.249               * 
   9.250               * Event Handling