OUT-553: Adjust design of key sync notification sync
authorThomas
Tue, 14 May 2019 12:49:23 +0200
branchsync
changeset 26266092f345eaf9
parent 2625 d30e7f635ac7
child 2627 47eb50143f2a
OUT-553: Adjust design of key sync notification
AdapterCallbacks.cs
Properties/Resources.Designer.cs
Properties/Resources.de.resx
Properties/Resources.es.resx
Properties/Resources.resx
Resources/ImageIconDeviceGroup.png
UI/Notification.xaml
UI/Notification.xaml.cs
pEpForOutlook.csproj
     1.1 --- a/AdapterCallbacks.cs	Wed May 08 11:27:41 2019 +0200
     1.2 +++ b/AdapterCallbacks.cs	Tue May 14 12:49:23 2019 +0200
     1.3 @@ -94,9 +94,13 @@
     1.4                      }
     1.5                  // Signal to show notification that a sync process was successful
     1.6                  case SyncHandshakeSignal.SyncNotifyAcceptedDeviceAdded:
     1.7 +                    {
     1.8 +                        this.ShowNotification(Properties.Resources.KeySync_DeviceGroup, Properties.Resources.KeySync_NotifyAcceptedDeviceAdded);
     1.9 +                        break;
    1.10 +                    }
    1.11                  case SyncHandshakeSignal.SyncNotifyAcceptedGroupCreated:
    1.12                      {
    1.13 -                        // TODO: show notification
    1.14 +                        this.ShowNotification(Properties.Resources.KeySync_DeviceGroup, Properties.Resources.KeySync_NotifyAcceptedGroupCreated);
    1.15                          break;
    1.16                      }
    1.17                  // Signal to close the dialog (actually, it is already closed at this point)
     2.1 --- a/Properties/Resources.Designer.cs	Wed May 08 11:27:41 2019 +0200
     2.2 +++ b/Properties/Resources.Designer.cs	Tue May 14 12:49:23 2019 +0200
     2.3 @@ -493,6 +493,16 @@
     2.4          /// <summary>
     2.5          ///   Looks up a localized resource of type System.Drawing.Bitmap.
     2.6          /// </summary>
     2.7 +        public static System.Drawing.Bitmap ImageIconDeviceGroup {
     2.8 +            get {
     2.9 +                object obj = ResourceManager.GetObject("ImageIconDeviceGroup", resourceCulture);
    2.10 +                return ((System.Drawing.Bitmap)(obj));
    2.11 +            }
    2.12 +        }
    2.13 +        
    2.14 +        /// <summary>
    2.15 +        ///   Looks up a localized resource of type System.Drawing.Bitmap.
    2.16 +        /// </summary>
    2.17          public static System.Drawing.Bitmap ImageLogoBlack {
    2.18              get {
    2.19                  object obj = ResourceManager.GetObject("ImageLogoBlack", resourceCulture);
    2.20 @@ -801,6 +811,33 @@
    2.21          }
    2.22          
    2.23          /// <summary>
    2.24 +        ///   Looks up a localized string similar to Device Group.
    2.25 +        /// </summary>
    2.26 +        public static string KeySync_DeviceGroup {
    2.27 +            get {
    2.28 +                return ResourceManager.GetString("KeySync_DeviceGroup", resourceCulture);
    2.29 +            }
    2.30 +        }
    2.31 +        
    2.32 +        /// <summary>
    2.33 +        ///   Looks up a localized string similar to Your device is now member of your device group..
    2.34 +        /// </summary>
    2.35 +        public static string KeySync_NotifyAcceptedDeviceAdded {
    2.36 +            get {
    2.37 +                return ResourceManager.GetString("KeySync_NotifyAcceptedDeviceAdded", resourceCulture);
    2.38 +            }
    2.39 +        }
    2.40 +        
    2.41 +        /// <summary>
    2.42 +        ///   Looks up a localized string similar to Your device is now member of your device group..
    2.43 +        /// </summary>
    2.44 +        public static string KeySync_NotifyAcceptedGroupCreated {
    2.45 +            get {
    2.46 +                return ResourceManager.GetString("KeySync_NotifyAcceptedGroupCreated", resourceCulture);
    2.47 +            }
    2.48 +        }
    2.49 +        
    2.50 +        /// <summary>
    2.51          ///   Looks up a localized string similar to Back.
    2.52          /// </summary>
    2.53          public static string KeySyncWizard_BackButtonText {
     3.1 --- a/Properties/Resources.de.resx	Wed May 08 11:27:41 2019 +0200
     3.2 +++ b/Properties/Resources.de.resx	Tue May 14 12:49:23 2019 +0200
     3.3 @@ -834,4 +834,13 @@
     3.4    <data name="PrivacyStatus_ResetTrust" xml:space="preserve">
     3.5      <value>Status zurücksetzen</value>
     3.6    </data>
     3.7 +  <data name="KeySync_NotifyAcceptedDeviceAdded" xml:space="preserve">
     3.8 +    <value>Ihr Gerät ist nun Teil Ihrer Gerätegruppe.</value>
     3.9 +  </data>
    3.10 +  <data name="KeySync_NotifyAcceptedGroupCreated" xml:space="preserve">
    3.11 +    <value>Ihr Gerät ist nun Teil Ihrer Gerätegruppe.</value>
    3.12 +  </data>
    3.13 +  <data name="KeySync_DeviceGroup" xml:space="preserve">
    3.14 +    <value>Gerätegruppe</value>
    3.15 +  </data>
    3.16  </root>
    3.17 \ No newline at end of file
     4.1 --- a/Properties/Resources.es.resx	Wed May 08 11:27:41 2019 +0200
     4.2 +++ b/Properties/Resources.es.resx	Tue May 14 12:49:23 2019 +0200
     4.3 @@ -834,4 +834,13 @@
     4.4    <data name="PrivacyStatus_ResetTrust" xml:space="preserve">
     4.5      <value>Reestablecer estatus</value>
     4.6    </data>
     4.7 +  <data name="KeySync_NotifyAcceptedDeviceAdded" xml:space="preserve">
     4.8 +    <value>Tu dispositivo ahora forma parte de tu grupo de dispositivos.</value>
     4.9 +  </data>
    4.10 +  <data name="KeySync_NotifyAcceptedGroupCreated" xml:space="preserve">
    4.11 +    <value>Tu dispositivo ahora forma parte de tu grupo de dispositivos.</value>
    4.12 +  </data>
    4.13 +  <data name="KeySync_DeviceGroup" xml:space="preserve">
    4.14 +    <value>Grupo de dispositivos</value>
    4.15 +  </data>
    4.16  </root>
    4.17 \ No newline at end of file
     5.1 --- a/Properties/Resources.resx	Wed May 08 11:27:41 2019 +0200
     5.2 +++ b/Properties/Resources.resx	Tue May 14 12:49:23 2019 +0200
     5.3 @@ -952,4 +952,16 @@
     5.4    <data name="PrivacyStatus_ResetTrust" xml:space="preserve">
     5.5      <value>Reset Trust</value>
     5.6    </data>
     5.7 +  <data name="ImageIconDeviceGroup" type="System.Resources.ResXFileRef, System.Windows.Forms">
     5.8 +    <value>..\Resources\ImageIconDeviceGroup.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
     5.9 +  </data>
    5.10 +  <data name="KeySync_NotifyAcceptedDeviceAdded" xml:space="preserve">
    5.11 +    <value>Your device is now member of your device group.</value>
    5.12 +  </data>
    5.13 +  <data name="KeySync_NotifyAcceptedGroupCreated" xml:space="preserve">
    5.14 +    <value>Your device is now member of your device group.</value>
    5.15 +  </data>
    5.16 +  <data name="KeySync_DeviceGroup" xml:space="preserve">
    5.17 +    <value>Device Group</value>
    5.18 +  </data>
    5.19  </root>
    5.20 \ No newline at end of file
     6.1 Binary file Resources/ImageIconDeviceGroup.png has changed
     7.1 --- a/UI/Notification.xaml	Wed May 08 11:27:41 2019 +0200
     7.2 +++ b/UI/Notification.xaml	Tue May 14 12:49:23 2019 +0200
     7.3 @@ -12,7 +12,7 @@
     7.4          ShowInTaskbar="False"
     7.5          Topmost="True"
     7.6          Height="100" 
     7.7 -        Width="300">
     7.8 +        Width="350">
     7.9  
    7.10      <Grid RenderTransformOrigin="0,1">
    7.11  
    7.12 @@ -20,13 +20,26 @@
    7.13          <Border BorderThickness="1" 
    7.14                  Background="Black" 
    7.15                  BorderBrush="Black">
    7.16 -            <StackPanel Margin="5">
    7.17 +            <Grid Margin="10">
    7.18 +                <Grid.ColumnDefinitions>
    7.19 +                    <ColumnDefinition Width="Auto"/>
    7.20 +                    <ColumnDefinition Width="215"/>
    7.21 +                    <ColumnDefinition Width="*"/>
    7.22 +                </Grid.ColumnDefinitions>
    7.23 +                <Grid.RowDefinitions>
    7.24 +                    <RowDefinition Height="Auto"/>
    7.25 +                    <RowDefinition Height="*"/>
    7.26 +                </Grid.RowDefinitions>
    7.27 +
    7.28 +                <!--The X to close the notification-->
    7.29                  <TextBlock Foreground="White"
    7.30                             Text="&#10005;"
    7.31                             FontWeight="Light"
    7.32                             HorizontalAlignment="Right" 
    7.33 -                           MouseUp="TextBlock_MouseUp"
    7.34 -                           Padding="3">
    7.35 +                           MouseUp="TextBlockClose_MouseUp"
    7.36 +                           Padding="3"
    7.37 +                           Grid.Column="2"
    7.38 +                           Grid.Row="0">
    7.39                      <TextBlock.Style>
    7.40                          <Style>
    7.41                              <Style.Triggers>
    7.42 @@ -38,15 +51,34 @@
    7.43                          </Style>
    7.44                      </TextBlock.Style>
    7.45                  </TextBlock>
    7.46 -                <TextBlock Foreground="White" 
    7.47 -                           FontWeight="DemiBold" 
    7.48 +
    7.49 +                <!--The Device Group Logo-->
    7.50 +                <Image Grid.Column="0"
    7.51 +                       Grid.RowSpan="2"
    7.52 +                       Height="80"
    7.53 +                       Stretch="Uniform"
    7.54 +                       VerticalAlignment="Stretch"
    7.55 +                       HorizontalAlignment="Center"
    7.56 +                       Margin="0,0,15,0"
    7.57 +                       Source="pack://application:,,,/pEp;component/Resources/ImageIconDeviceGroup.png">
    7.58 +                </Image>
    7.59 +
    7.60 +                <!--The title text-->
    7.61 +                <TextBlock Grid.Column="1"
    7.62 +                           Grid.Row="0"                           
    7.63 +                           Foreground="White" 
    7.64 +                           FontWeight="Bold" 
    7.65                             Text="{Binding TitleText}" 
    7.66 -                           Margin="5,0,5,5"/>
    7.67 -                <TextBlock TextWrapping="Wrap" 
    7.68 -                           Foreground="White" 
    7.69 +                           Margin="5,7,5,5"/>
    7.70 +
    7.71 +                <!--The notification content-->
    7.72 +                <TextBlock Grid.Column="1"
    7.73 +                           Grid.Row="1"
    7.74 +                           TextWrapping="Wrap" 
    7.75 +                           Foreground="LightGray" 
    7.76                             Text="{Binding NotificationText}" 
    7.77                             Margin="5,5,0,5"/>
    7.78 -            </StackPanel>
    7.79 +            </Grid>
    7.80          </Border>
    7.81  
    7.82          <!-- Animation -->
     8.1 --- a/UI/Notification.xaml.cs	Wed May 08 11:27:41 2019 +0200
     8.2 +++ b/UI/Notification.xaml.cs	Tue May 14 12:49:23 2019 +0200
     8.3 @@ -27,6 +27,9 @@
     8.4          public double AnimationStartX { get; private set; }
     8.5          public double AnimationEndX { get; private set; }
     8.6  
     8.7 +        /// <summary>
     8.8 +        /// The primary constructor.
     8.9 +        /// </summary>
    8.10          public Notification()
    8.11          {
    8.12              InitializeComponent();
    8.13 @@ -38,18 +41,29 @@
    8.14              this.Top = desktopWorkingArea.Bottom - this.Height - Notification.offset;
    8.15          }
    8.16  
    8.17 +        /// <summary>
    8.18 +        /// Secondary constructor.
    8.19 +        /// </summary>
    8.20 +        /// <param name="title">The title of this notification.</param>
    8.21 +        /// <param name="text">The content of this notification.</param>
    8.22          public Notification(string title, string text) : this()
    8.23          {
    8.24              this.TitleText = title;
    8.25              this.NotificationText = text;
    8.26          }
    8.27  
    8.28 +        /// <summary>
    8.29 +        /// Event handler for when the notification's animation has finished.
    8.30 +        /// </summary>
    8.31          private void Storyboard_Completed(object sender, EventArgs e)
    8.32          {            
    8.33              this.Close();
    8.34          }
    8.35  
    8.36 -        private void TextBlock_MouseUp(object sender, MouseButtonEventArgs e)
    8.37 +        /// <summary>
    8.38 +        /// Event handler for when the Close button was clicked.
    8.39 +        /// </summary>
    8.40 +        private void TextBlockClose_MouseUp(object sender, MouseButtonEventArgs e)
    8.41          {
    8.42              this.Close();
    8.43          }
     9.1 --- a/pEpForOutlook.csproj	Wed May 08 11:27:41 2019 +0200
     9.2 +++ b/pEpForOutlook.csproj	Tue May 14 12:49:23 2019 +0200
     9.3 @@ -584,6 +584,7 @@
     9.4      <Resource Include="Resources\ImagePrivacyStatusGreenInvert.png" />
     9.5      <Resource Include="Resources\ImagePrivacyStatusNoColorInvert.png" />
     9.6      <Resource Include="Resources\ImagePrivacyStatusYellowInvert.png" />
     9.7 +    <Resource Include="Resources\ImageIconDeviceGroup.png" />
     9.8      <Content Include="Resources\ImageReaderSplash.png" />
     9.9      <Content Include="Resources\ImageUpgradePEP.png" />
    9.10      <Resource Include="Resources\ImageNeverUnsecureOff.png" />