Updating master key now works again

Security settings page now also uses Toast Action
This commit is contained in:
BONNEVILLE Geoffroy
2018-07-12 12:30:58 +02:00
parent a91f8b6c5c
commit 2abab27d5c
8 changed files with 38 additions and 21 deletions

View File

@@ -186,7 +186,9 @@ namespace ModernKeePass.Services
public void UpdateCompositeKey(CompositeKey newCompositeKey)
{
if (newCompositeKey != null) _compositeKey = newCompositeKey;
if (newCompositeKey == null) return;
_compositeKey = newCompositeKey;
_pwDatabase.MasterKey = newCompositeKey;
}
private void CreateSampleData()

View File

@@ -456,4 +456,10 @@
<data name="TopMenuSortGroupsFlyout.Text" xml:space="preserve">
<value>Sort groups</value>
</data>
<data name="ToastUpdateDatabase.Message" xml:space="preserve">
<value>Database successfully updated</value>
</data>
<data name="ToastUpdateDatabase.Title" xml:space="preserve">
<value>Composite Key</value>
</data>
</root>

View File

@@ -391,7 +391,7 @@
<value>Login copié avec succès !</value>
</data>
<data name="ToastCopyPassword.Message" xml:space="preserve">
<value>Mot de passe copié avec succès !</value>
<value>Mot de passe copié avec succès !</value>
</data>
<data name="ToastCopyUrl.Message" xml:space="preserve">
<value>URL copié avec succès !</value>
@@ -456,4 +456,10 @@
<data name="TopMenuSortGroupsFlyout.Text" xml:space="preserve">
<value>Trier les groupes</value>
</data>
<data name="ToastUpdateDatabase.Message" xml:space="preserve">
<value>Base de données mise à jour</value>
</data>
<data name="ToastUpdateDatabase.Title" xml:space="preserve">
<value>Clé maître</value>
</data>
</root>

View File

@@ -5,6 +5,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userControls="using:ModernKeePass.Views.UserControls"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:actions="using:ModernKeePass.Actions"
mc:Ignorable="d">
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -14,6 +17,12 @@
<Run x:Uid="SettingsSecurityDesc2" FontWeight="SemiBold" />
<Run x:Uid="SettingsSecurityDesc3" />
</TextBlock>
<userControls:CompositeKeyUserControl Margin="0,20,0,0" UpdateKey="True" x:Uid="SettingsSecurityUpdateButton" ValidationChecked="CompositeKeyUserControl_OnValidationChecked" />
<userControls:CompositeKeyUserControl Margin="0,20,0,0" UpdateKey="True" x:Uid="SettingsSecurityUpdateButton">
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="ValidationChecked">
<actions:ToastAction x:Uid="ToastUpdateDatabase" />
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</userControls:CompositeKeyUserControl>
</StackPanel>
</Page>

View File

@@ -1,8 +1,5 @@
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
using ModernKeePass.Common;
using ModernKeePass.Events;
namespace ModernKeePass.Views
{
/// <summary>
@@ -14,10 +11,5 @@ namespace ModernKeePass.Views
{
InitializeComponent();
}
private void CompositeKeyUserControl_OnValidationChecked(object sender, PasswordEventArgs e)
{
ToastNotificationHelper.ShowGenericToast("Composite key", "Database successfully updated.");
}
}
}

View File

@@ -7,24 +7,24 @@
mc:Ignorable="d">
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Visibility="{Binding OverflowButtonsVisibility, ElementName=UserControl}">
<Button Command="{Binding RestoreCommand, ElementName=UserControl}" Visibility="{Binding RestoreButtonVisibility, ElementName=UserControl}" IsEnabled="{Binding IsRestoreButtonEnabled,ElementName=UserControl}" Click="RestoreButton_Click" Style="{StaticResource NoBorderButtonStyle}" Height="50">
<Button Command="{Binding RestoreCommand, ElementName=UserControl}" Visibility="{Binding RestoreButtonVisibility, ElementName=UserControl}" IsEnabled="{Binding IsRestoreButtonEnabled,ElementName=UserControl}" Click="RestoreButton_Click" Style="{StaticResource NoBorderButtonStyle}" Background="{ThemeResource ToggleButtonBackgroundThemeBrush}" Height="50">
<SymbolIcon Symbol="Undo">
<ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuRestoreButton" />
<ToolTip x:Uid="TopMenuRestoreButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip>
</SymbolIcon>
</Button>
<Button Command="{Binding SaveCommand, ElementName=UserControl}" Style="{StaticResource NoBorderButtonStyle}" Height="50">
<Button Command="{Binding SaveCommand, ElementName=UserControl}" Style="{StaticResource NoBorderButtonStyle}" Background="{ThemeResource ToggleButtonBackgroundThemeBrush}" Height="50">
<SymbolIcon Symbol="Save">
<ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuSaveButton" />
<ToolTip x:Uid="TopMenuSaveButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip>
</SymbolIcon>
</Button>
<Button Visibility="{Binding SortButtonVisibility, ElementName=UserControl}" Style="{StaticResource NoBorderButtonStyle}" Height="50">
<Button Visibility="{Binding SortButtonVisibility, ElementName=UserControl}" Style="{StaticResource NoBorderButtonStyle}" Background="{ThemeResource ToggleButtonBackgroundThemeBrush}" Height="50">
<SymbolIcon Symbol="Sort">
<ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuSortButton" />
<ToolTip x:Uid="TopMenuSortButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip>
</SymbolIcon>
<Button.Flyout>
@@ -37,19 +37,19 @@
<ToggleButton Command="{Binding EditCommand, ElementName=UserControl}" IsChecked="{Binding IsEditButtonChecked, ElementName=UserControl, Mode=TwoWay}" Click="EditButton_Click" Style="{StaticResource NoBorderToggleButtonStyle}" Height="50">
<SymbolIcon Symbol="Edit">
<ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuEditButton" />
<ToolTip x:Uid="TopMenuEditButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip>
</SymbolIcon>
</ToggleButton>
<Button Command="{Binding DeleteCommand, ElementName=UserControl}" IsEnabled="{Binding IsDeleteButtonEnabled, ElementName=UserControl}" Visibility="{Binding DeleteButtonVisibility, ElementName=UserControl}" Click="DeleteButton_Click" Style="{StaticResource NoBorderButtonStyle}" Height="50">
<Button Command="{Binding DeleteCommand, ElementName=UserControl}" IsEnabled="{Binding IsDeleteButtonEnabled, ElementName=UserControl}" Visibility="{Binding DeleteButtonVisibility, ElementName=UserControl}" Click="DeleteButton_Click" Style="{StaticResource NoBorderButtonStyle}" Background="{ThemeResource ToggleButtonBackgroundThemeBrush}" Height="50">
<SymbolIcon Symbol="Delete">
<ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuDeleteButton" />
<ToolTip x:Uid="TopMenuDeleteButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip>
</SymbolIcon>
</Button>
</StackPanel>
<Button Visibility="{Binding MoreButtonVisibility, ElementName=UserControl}" Style="{StaticResource NoBorderButtonStyle}" Height="50">
<Button Visibility="{Binding MoreButtonVisibility, ElementName=UserControl}" Style="{StaticResource NoBorderButtonStyle}" Background="{ThemeResource ToggleButtonBackgroundThemeBrush}" Height="50">
<SymbolIcon Symbol="More" />
<Button.Flyout>
<MenuFlyout Opening="OverflowFlyout_OnOpening">

View File

@@ -2,6 +2,7 @@ Entry history feature added
App now uses Windows theme color as its base color
You can now change entries background and foreground colors
You can now change groups and entries icons
Menu has moved from the App Bar to an always visible menu
Design improvements
Bug corrections
KeePassLib version bump to 2.39.1

View File

@@ -2,6 +2,7 @@ Ajout de la fonctionnalite d'historique des entrees
L'application utilise la couleur de theme de Windows en tant que couleur principale
Il est desormais possible de changer la couleur de fond et de texte des entrees
Il est desormais possible de changer l'icone des groupes et des entrees
Le menu est desormais visible au lieu d'etre dans l'App Bar
Ameliorations de design
Corrections de bugs
Version de la KeePassLib passe a 2.39.1