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) public void UpdateCompositeKey(CompositeKey newCompositeKey)
{ {
if (newCompositeKey != null) _compositeKey = newCompositeKey; if (newCompositeKey == null) return;
_compositeKey = newCompositeKey;
_pwDatabase.MasterKey = newCompositeKey;
} }
private void CreateSampleData() private void CreateSampleData()

View File

@@ -456,4 +456,10 @@
<data name="TopMenuSortGroupsFlyout.Text" xml:space="preserve"> <data name="TopMenuSortGroupsFlyout.Text" xml:space="preserve">
<value>Sort groups</value> <value>Sort groups</value>
</data> </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> </root>

View File

@@ -456,4 +456,10 @@
<data name="TopMenuSortGroupsFlyout.Text" xml:space="preserve"> <data name="TopMenuSortGroupsFlyout.Text" xml:space="preserve">
<value>Trier les groupes</value> <value>Trier les groupes</value>
</data> </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> </root>

View File

@@ -5,6 +5,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:userControls="using:ModernKeePass.Views.UserControls" 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"> mc:Ignorable="d">
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -14,6 +17,12 @@
<Run x:Uid="SettingsSecurityDesc2" FontWeight="SemiBold" /> <Run x:Uid="SettingsSecurityDesc2" FontWeight="SemiBold" />
<Run x:Uid="SettingsSecurityDesc3" /> <Run x:Uid="SettingsSecurityDesc3" />
</TextBlock> </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> </StackPanel>
</Page> </Page>

View File

@@ -1,8 +1,5 @@
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
using ModernKeePass.Common;
using ModernKeePass.Events;
namespace ModernKeePass.Views namespace ModernKeePass.Views
{ {
/// <summary> /// <summary>
@@ -14,10 +11,5 @@ namespace ModernKeePass.Views
{ {
InitializeComponent(); 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"> mc:Ignorable="d">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Visibility="{Binding OverflowButtonsVisibility, ElementName=UserControl}"> <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"> <SymbolIcon Symbol="Undo">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuRestoreButton" /> <ToolTip x:Uid="TopMenuRestoreButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
</SymbolIcon> </SymbolIcon>
</Button> </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"> <SymbolIcon Symbol="Save">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuSaveButton" /> <ToolTip x:Uid="TopMenuSaveButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
</SymbolIcon> </SymbolIcon>
</Button> </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"> <SymbolIcon Symbol="Sort">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuSortButton" /> <ToolTip x:Uid="TopMenuSortButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
</SymbolIcon> </SymbolIcon>
<Button.Flyout> <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"> <ToggleButton Command="{Binding EditCommand, ElementName=UserControl}" IsChecked="{Binding IsEditButtonChecked, ElementName=UserControl, Mode=TwoWay}" Click="EditButton_Click" Style="{StaticResource NoBorderToggleButtonStyle}" Height="50">
<SymbolIcon Symbol="Edit"> <SymbolIcon Symbol="Edit">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuEditButton" /> <ToolTip x:Uid="TopMenuEditButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
</SymbolIcon> </SymbolIcon>
</ToggleButton> </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"> <SymbolIcon Symbol="Delete">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip x:Uid="TopMenuDeleteButton" /> <ToolTip x:Uid="TopMenuDeleteButton" RequestedTheme="Dark" />
</ToolTipService.ToolTip> </ToolTipService.ToolTip>
</SymbolIcon> </SymbolIcon>
</Button> </Button>
</StackPanel> </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" /> <SymbolIcon Symbol="More" />
<Button.Flyout> <Button.Flyout>
<MenuFlyout Opening="OverflowFlyout_OnOpening"> <MenuFlyout Opening="OverflowFlyout_OnOpening">

View File

@@ -2,6 +2,7 @@ Entry history feature added
App now uses Windows theme color as its base color App now uses Windows theme color as its base color
You can now change entries background and foreground colors You can now change entries background and foreground colors
You can now change groups and entries icons You can now change groups and entries icons
Menu has moved from the App Bar to an always visible menu
Design improvements Design improvements
Bug corrections Bug corrections
KeePassLib version bump to 2.39.1 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 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 la couleur de fond et de texte des entrees
Il est desormais possible de changer l'icone des groupes et 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 Ameliorations de design
Corrections de bugs Corrections de bugs
Version de la KeePassLib passe a 2.39.1 Version de la KeePassLib passe a 2.39.1