Finish the design OUT-607
authorThomas
Wed, 30 Oct 2019 09:39:30 +0100
branchOUT-607
changeset 2841d245223133eb
parent 2840 4318407e02ce
child 2842 8457deb2b11c
Finish the design
Properties/Resources.Designer.cs
Properties/Resources.de.resx
Properties/Resources.es.resx
Properties/Resources.resx
UI/FormControlOptions.xaml
UI/FormControlOptions.xaml.cs
UI/InputMessageBox.xaml
UI/InputMessageBox.xaml.cs
     1.1 --- a/Properties/Resources.Designer.cs	Tue Oct 29 16:25:05 2019 +0100
     1.2 +++ b/Properties/Resources.Designer.cs	Wed Oct 30 09:39:30 2019 +0100
     1.3 @@ -942,6 +942,15 @@
     1.4          }
     1.5          
     1.6          /// <summary>
     1.7 +        ///   Looks up a localized string similar to Please enter the fingerprint of the key you want to import:.
     1.8 +        /// </summary>
     1.9 +        public static string KeyImportPGP_IntroduceFingerprint {
    1.10 +            get {
    1.11 +                return ResourceManager.GetString("KeyImportPGP_IntroduceFingerprint", resourceCulture);
    1.12 +            }
    1.13 +        }
    1.14 +        
    1.15 +        /// <summary>
    1.16          ///   Looks up a localized string similar to Device Group.
    1.17          /// </summary>
    1.18          public static string KeySync_DeviceGroup {
     2.1 --- a/Properties/Resources.de.resx	Tue Oct 29 16:25:05 2019 +0100
     2.2 +++ b/Properties/Resources.de.resx	Wed Oct 30 09:39:30 2019 +0100
     2.3 @@ -932,4 +932,7 @@
     2.4    <data name="IntroTutorial_AcceptHandshake" xml:space="preserve">
     2.5      <value>Führen Sie einen Handshake mit Ihrem Kommunikationspartner durch. Der Handshake ist nur einmal pro Partner nötig und garantiert eine sichere und verifizierte Kommunikation.</value>
     2.6    </data>
     2.7 +  <data name="KeyImportPGP_IntroduceFingerprint" xml:space="preserve">
     2.8 +    <value>Bitte geben Sie den Fingerabdruck des Schlüssels ein, den Sie importieren möchten:</value>
     2.9 +  </data>
    2.10  </root>
    2.11 \ No newline at end of file
     3.1 --- a/Properties/Resources.es.resx	Tue Oct 29 16:25:05 2019 +0100
     3.2 +++ b/Properties/Resources.es.resx	Wed Oct 30 09:39:30 2019 +0100
     3.3 @@ -932,4 +932,7 @@
     3.4    <data name="IntroTutorial_AcceptHandshake" xml:space="preserve">
     3.5      <value>Al confirmar que tus Trustwords y las de tu interlocutor coincidan, tu comunicación será segura y verificada.</value>
     3.6    </data>
     3.7 +  <data name="KeyImportPGP_IntroduceFingerprint" xml:space="preserve">
     3.8 +    <value>Por favor, introduce la huella de la clave que quieres importar:</value>
     3.9 +  </data>
    3.10  </root>
    3.11 \ No newline at end of file
     4.1 --- a/Properties/Resources.resx	Tue Oct 29 16:25:05 2019 +0100
     4.2 +++ b/Properties/Resources.resx	Wed Oct 30 09:39:30 2019 +0100
     4.3 @@ -1062,4 +1062,7 @@
     4.4    <data name="IntroTutorial_AcceptHandshake" xml:space="preserve">
     4.5      <value>Complete a handshake with your communication partner. A handshake is needed only once per partner and will ensure Secure and Trusted communication.</value>
     4.6    </data>
     4.7 +  <data name="KeyImportPGP_IntroduceFingerprint" xml:space="preserve">
     4.8 +    <value>Please enter the fingerprint of the key you want to import:</value>
     4.9 +  </data>
    4.10  </root>
    4.11 \ No newline at end of file
     5.1 --- a/UI/FormControlOptions.xaml	Tue Oct 29 16:25:05 2019 +0100
     5.2 +++ b/UI/FormControlOptions.xaml	Wed Oct 30 09:39:30 2019 +0100
     5.3 @@ -571,11 +571,12 @@
     5.4                                     Margin="{StaticResource CheckBoxContentMarginWhenTop}" />
     5.5                      </CheckBox>
     5.6  
     5.7 +                    <!--Import key button-->
     5.8                      <Button Grid.Row="3"
     5.9 -                            Content="Import keys" 
    5.10 +                            Style="{StaticResource StyleButtonConfirm}"
    5.11 +                            Content="{x:Static p:Resources.StoreContextMenu_OpenPGPKeyImportWizard}" 
    5.12                              HorizontalAlignment="Left"
    5.13 -                            Margin="10,5"
    5.14 -                            Style="{StaticResource StyleButtonCancel}"
    5.15 +                            Margin="10"
    5.16                              Command="{Binding CommandImportKeys}"/>
    5.17  
    5.18                      <!-- Key blacklist title -->
     6.1 --- a/UI/FormControlOptions.xaml.cs	Tue Oct 29 16:25:05 2019 +0100
     6.2 +++ b/UI/FormControlOptions.xaml.cs	Wed Oct 30 09:39:30 2019 +0100
     6.3 @@ -1015,8 +1015,7 @@
     6.4              private void OpenDialogAndImportKeys()
     6.5              {
     6.6                  // Open a message box to introduce the fingerprint
     6.7 -                string fingerprint = null;
     6.8 -                if (InputMessageBox.Show(ref fingerprint) == true)
     6.9 +                if (InputMessageBox.ShowDialog(out string fingerprint) == true)
    6.10                  {
    6.11                      try
    6.12                      {
    6.13 @@ -1037,7 +1036,7 @@
    6.14                  // If the fingerprint is empty, return
    6.15                  if (string.IsNullOrEmpty(fingerprint))
    6.16                  {
    6.17 -                    Log.Verbose("OpenDialogAndImportKeys: Fingerprint is null. Abort.");
    6.18 +                    Log.Verbose("OpenDialogAndImportKeys: Fingerprint is null. Nothing done.");
    6.19                      return;
    6.20                  }
    6.21                  
    6.22 @@ -1050,7 +1049,7 @@
    6.23                      Multiselect = false
    6.24                  };
    6.25  
    6.26 -                // If files are selected, import all of them
    6.27 +                // Import the key file and set the key as default
    6.28                  if (openFileDialog.ShowDialog() == true)
    6.29                  {
    6.30                      bool success = false;
     7.1 --- a/UI/InputMessageBox.xaml	Tue Oct 29 16:25:05 2019 +0100
     7.2 +++ b/UI/InputMessageBox.xaml	Wed Oct 30 09:39:30 2019 +0100
     7.3 @@ -5,8 +5,13 @@
     7.4          xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     7.5          xmlns:p="clr-namespace:pEp.Properties"
     7.6          x:ClassModifier="internal"
     7.7 +        Icon="pack://application:,,,/pEp;component/Resources/ImageLogoIcon.png"
     7.8          mc:Ignorable="d"
     7.9 -        Width="480">
    7.10 +        Width="480"
    7.11 +        WindowStartupLocation="CenterScreen"
    7.12 +        SizeToContent="Height"
    7.13 +        Background="WhiteSmoke"
    7.14 +        Title="{x:Static p:Resources.StoreContextMenu_OpenPGPKeyImportWizard}">
    7.15      <Window.Resources>
    7.16          <ResourceDictionary>
    7.17              <!-- Dictionary -->
    7.18 @@ -19,12 +24,13 @@
    7.19      <StackPanel Margin="10">
    7.20  
    7.21          <!-- Explanation -->
    7.22 -        <TextBlock Text="{x:Static p:Resources.Handshake_FingerprintText}"
    7.23 +        <TextBlock Text="{x:Static p:Resources.KeyImportPGP_IntroduceFingerprint}"
    7.24                     TextWrapping="Wrap"
    7.25                     Margin="5,5,5,15"/>
    7.26  
    7.27          <!--Input field-->
    7.28 -        <TextBox Text="{Binding Input}"/>
    7.29 +        <TextBox Text="{Binding Input}"
    7.30 +                 Padding="2"/>
    7.31  
    7.32          <!--Buttons-->
    7.33          <StackPanel Orientation="Horizontal"
     8.1 --- a/UI/InputMessageBox.xaml.cs	Tue Oct 29 16:25:05 2019 +0100
     8.2 +++ b/UI/InputMessageBox.xaml.cs	Wed Oct 30 09:39:30 2019 +0100
     8.3 @@ -15,13 +15,18 @@
     8.4  
     8.5          public event PropertyChangedEventHandler PropertyChanged;
     8.6  
     8.7 -
     8.8 +        /// <summary>
     8.9 +        /// Primary constructor
    8.10 +        /// </summary>
    8.11          public InputMessageBox()
    8.12          {
    8.13              InitializeComponent();
    8.14              this.DataContext = this;
    8.15          }
    8.16  
    8.17 +        /// <summary>
    8.18 +        /// The command to execute when the Cancel button is clicked.
    8.19 +        /// </summary>
    8.20          public RelayCommand CommandButtonCancel
    8.21          {
    8.22              get
    8.23 @@ -39,6 +44,9 @@
    8.24              }
    8.25          }
    8.26  
    8.27 +        /// <summary>
    8.28 +        /// The command to execute when the Next button is clicked.
    8.29 +        /// </summary>
    8.30          public RelayCommand CommandButtonConfirm
    8.31          {
    8.32              get
    8.33 @@ -56,6 +64,9 @@
    8.34              }
    8.35          }
    8.36  
    8.37 +        /// <summary>
    8.38 +        /// Gets or sets the text in the input field.
    8.39 +        /// </summary>
    8.40          public string Input
    8.41          {
    8.42              get => this._Input;
    8.43 @@ -66,14 +77,26 @@
    8.44              }
    8.45          }
    8.46  
    8.47 +        /// <summary>
    8.48 +        /// Gets or sets the result of this message box.
    8.49 +        /// </summary>
    8.50          public bool? Result { get; private set; }
    8.51  
    8.52 +        /// <summary>
    8.53 +        /// 
    8.54 +        /// </summary>
    8.55 +        /// <param name="propertyName"></param>
    8.56          protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    8.57          {
    8.58              this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    8.59          }
    8.60  
    8.61 -        public static bool? Show(ref string fingerprint)
    8.62 +        /// <summary>
    8.63 +        /// Shows the message box as dialog.
    8.64 +        /// </summary>
    8.65 +        /// <param name="fingerprint">The fingerprint</param>
    8.66 +        /// <returns></returns>
    8.67 +        public static bool? ShowDialog(out string fingerprint)
    8.68          {
    8.69              fingerprint = null;
    8.70              InputMessageBox msgBox = new InputMessageBox();