diff --git a/ModernKeePass/App.xaml.cs b/ModernKeePass/App.xaml.cs index e16261d..ff9141f 100644 --- a/ModernKeePass/App.xaml.cs +++ b/ModernKeePass/App.xaml.cs @@ -32,9 +32,11 @@ namespace ModernKeePass AppCenter.Start("79d23520-a486-4f63-af81-8d90bf4e1bea", typeof(Analytics), typeof(Push)); InitializeComponent(); Suspending += OnSuspending; + Resuming += OnResuming; UnhandledException += OnUnhandledException; } + #region Event Handlers private void OnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) @@ -98,7 +100,10 @@ namespace ModernKeePass if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { - //TODO: Load state from previously suspended application + //TODO: Load state from previously terminated application +#if DEBUG + MessageDialogHelper.ShowNotificationDialog("App terminated", "Windows or an error made the app terminate"); +#endif } // Place the frame in the current Window @@ -133,6 +138,31 @@ namespace ModernKeePass Window.Current.Activate(); } + private async void OnResuming(object sender, object e) + { + var currentFrame = Window.Current.Content as Frame; + var database = DatabaseService.Instance; + if (database.DatabaseFile == null) + { +#if DEBUG + ToastNotificationHelper.ShowGenericToast("App suspended", "Nothing to do, no previous database opened"); +#endif + return; + } + try + { + if (database.CompositeKey != null) await database.ReOpen(); + } + catch (Exception ex) + { + currentFrame?.Navigate(typeof(MainPage)); +#if DEBUG + MessageDialogHelper.ShowErrorDialog(ex); +#endif + ToastNotificationHelper.ShowGenericToast("App suspended", "Database was closed (changes were saved)"); + } + } + /// /// Invoked when Navigation to a certain page fails /// @@ -155,8 +185,8 @@ namespace ModernKeePass var deferral = e.SuspendingOperation.GetDeferral(); UnhandledException -= OnUnhandledException; var database = DatabaseService.Instance; - database.Save(); - await database.Close(); + if (SettingsService.Instance.GetSetting("SaveSuspend", true)) database.Save(); + await database.Close(false); deferral.Complete(); } diff --git a/ModernKeePass/Common/MessageDialogHelper.cs b/ModernKeePass/Common/MessageDialogHelper.cs index f530c76..3bf8d03 100644 --- a/ModernKeePass/Common/MessageDialogHelper.cs +++ b/ModernKeePass/Common/MessageDialogHelper.cs @@ -55,7 +55,7 @@ namespace ModernKeePass.Common { if (exception == null) return; // Create the message dialog and set its content - var messageDialog = CreateBasicDialog("Error occured", exception.Message, "OK"); + var messageDialog = CreateBasicDialog(exception.Message, exception.StackTrace, "OK"); // Show the message dialog await messageDialog.ShowAsync(); diff --git a/ModernKeePass/Common/ToastNotificationHelper.cs b/ModernKeePass/Common/ToastNotificationHelper.cs index 8cd25a9..46f8f0c 100644 --- a/ModernKeePass/Common/ToastNotificationHelper.cs +++ b/ModernKeePass/Common/ToastNotificationHelper.cs @@ -45,5 +45,10 @@ namespace ModernKeePass.Common }; ToastNotificationManager.CreateToastNotifier().Show(toast); } + + public static void ShowErrorToast(Exception exception) + { + ShowGenericToast(exception.Source, exception.Message); + } } } diff --git a/ModernKeePass/Interfaces/IDatabaseService.cs b/ModernKeePass/Interfaces/IDatabaseService.cs index 5b9a16c..d634e2b 100644 --- a/ModernKeePass/Interfaces/IDatabaseService.cs +++ b/ModernKeePass/Interfaces/IDatabaseService.cs @@ -15,6 +15,7 @@ namespace ModernKeePass.Interfaces GroupVm RootGroup { get; set; } GroupVm RecycleBin { get; set; } StorageFile DatabaseFile { get; set; } + CompositeKey CompositeKey { get; } PwUuid DataCipher { get; set; } PwCompressionAlgorithm CompressionAlgorithm { get; set; } KdfParameters KeyDerivation { get; set; } @@ -23,12 +24,13 @@ namespace ModernKeePass.Interfaces bool IsClosed { get; } bool HasChanged { get; set; } - Task Open(CompositeKey key, bool createNew); + Task Open(CompositeKey key, bool createNew = false); + Task ReOpen(); void UpdateCompositeKey(CompositeKey key); void Save(); void Save(StorageFile file); void CreateRecycleBin(); void AddDeletedItem(PwUuid id); - Task Close(); + Task Close(bool releaseFile = true); } } \ No newline at end of file diff --git a/ModernKeePass/Interfaces/ISettingsService.cs b/ModernKeePass/Interfaces/ISettingsService.cs index e5411a9..5b6b147 100644 --- a/ModernKeePass/Interfaces/ISettingsService.cs +++ b/ModernKeePass/Interfaces/ISettingsService.cs @@ -2,7 +2,7 @@ { public interface ISettingsService { - T GetSetting(string property); + T GetSetting(string property, T defaultValue = default(T)); void PutSetting(string property, T value); } } \ No newline at end of file diff --git a/ModernKeePass/ModernKeePassApp.csproj b/ModernKeePass/ModernKeePassApp.csproj index 1a49a4e..b4057fe 100644 --- a/ModernKeePass/ModernKeePassApp.csproj +++ b/ModernKeePass/ModernKeePassApp.csproj @@ -124,6 +124,7 @@ + DonatePage.xaml @@ -155,6 +156,9 @@ SettingsNewDatabasePage.xaml + + SettingsSavePage.xaml + SettingsSecurityPage.xaml @@ -245,6 +249,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -357,7 +365,7 @@ True - ..\packages\ModernKeePassLib.2.37.8000\lib\netstandard1.2\ModernKeePassLib.dll + ..\packages\ModernKeePassLib.2.38.1\lib\netstandard1.2\ModernKeePassLib.dll True diff --git a/ModernKeePass/Services/DatabaseService.cs b/ModernKeePass/Services/DatabaseService.cs index e12b0f4..8f8ffe5 100644 --- a/ModernKeePass/Services/DatabaseService.cs +++ b/ModernKeePass/Services/DatabaseService.cs @@ -22,6 +22,7 @@ namespace ModernKeePass.Services private StorageFile _realDatabaseFile; private StorageFile _databaseFile; private GroupVm _recycleBin; + private CompositeKey _compositeKey; public GroupVm RootGroup { get; set; } @@ -56,6 +57,8 @@ namespace ModernKeePass.Services } } + public CompositeKey CompositeKey => _compositeKey; + public PwUuid DataCipher { get { return _pwDatabase.DataCipherUuid; } @@ -87,7 +90,7 @@ namespace ModernKeePass.Services { _settings = settings; } - + /// /// Open a KeePass database @@ -104,6 +107,8 @@ namespace ModernKeePass.Services { throw new ArgumentNullException(nameof(key)); } + + _compositeKey = key; var ioConnection = IOConnectionInfo.FromFile(DatabaseFile); if (createNew) { @@ -142,12 +147,17 @@ namespace ModernKeePass.Services } } + public async Task ReOpen() + { + await Open(_compositeKey); + } + /// /// Commit the changes to the currently opened database to file /// public void Save() { - if (!_pwDatabase.IsOpen) return; + if (!IsOpen) return; try { _pwDatabase.Save(new NullStatusLogger()); @@ -186,18 +196,18 @@ namespace ModernKeePass.Services /// /// Close the currently opened database /// - public async Task Close() + public async Task Close(bool releaseFile = true) { _pwDatabase?.Close(); // Restore the backup DB to the original one if (_settings.GetSetting("AntiCorruption")) { - if (_pwDatabase.Modified) + if (_pwDatabase != null && _pwDatabase.Modified) Save(_realDatabaseFile); await DatabaseFile.DeleteAsync(); } - DatabaseFile = null; + if (releaseFile) DatabaseFile = null; } public void AddDeletedItem(PwUuid id) diff --git a/ModernKeePass/Services/SettingsService.cs b/ModernKeePass/Services/SettingsService.cs index d13c9d8..817bcbd 100644 --- a/ModernKeePass/Services/SettingsService.cs +++ b/ModernKeePass/Services/SettingsService.cs @@ -9,7 +9,7 @@ namespace ModernKeePass.Services { private readonly IPropertySet _values = ApplicationData.Current.LocalSettings.Values; - public T GetSetting(string property) + public T GetSetting(string property, T defaultValue = default(T)) { try { @@ -17,7 +17,7 @@ namespace ModernKeePass.Services } catch (InvalidCastException) { - return default(T); + return defaultValue; } } diff --git a/ModernKeePass/Strings/en-US/CodeBehind.resw b/ModernKeePass/Strings/en-US/CodeBehind.resw index 93ab783..d13af0e 100644 --- a/ModernKeePass/Strings/en-US/CodeBehind.resw +++ b/ModernKeePass/Strings/en-US/CodeBehind.resw @@ -273,4 +273,7 @@ user account + + Saving + \ No newline at end of file diff --git a/ModernKeePass/Strings/en-US/Resources.resw b/ModernKeePass/Strings/en-US/Resources.resw index c7e4303..18c9411 100644 --- a/ModernKeePass/Strings/en-US/Resources.resw +++ b/ModernKeePass/Strings/en-US/Resources.resw @@ -333,6 +333,18 @@ Yes + + Don't save + + + Save + + + This settings is generally recommended. If you enable it, database will automatically be saved on application suspension and closing. However, if your database is huge, saving may be deemed too long by Windows, which will then forcibly kill the app. + + + Auto-save on suspend? + Here, you may change your database password, key file, or both. Just click on on diff --git a/ModernKeePass/Strings/fr-FR/CodeBehind.resw b/ModernKeePass/Strings/fr-FR/CodeBehind.resw index c69f9c2..ac33305 100644 --- a/ModernKeePass/Strings/fr-FR/CodeBehind.resw +++ b/ModernKeePass/Strings/fr-FR/CodeBehind.resw @@ -274,4 +274,7 @@ compte utilisateur + + Sauvegardes + \ No newline at end of file diff --git a/ModernKeePass/Strings/fr-FR/Resources.resw b/ModernKeePass/Strings/fr-FR/Resources.resw index 13be3e5..399f457 100644 --- a/ModernKeePass/Strings/fr-FR/Resources.resw +++ b/ModernKeePass/Strings/fr-FR/Resources.resw @@ -333,6 +333,18 @@ Oui + + Ne pas sauvegarder + + + Sauvegarder + + + Ce paramètre est généralement recommandé. Si vous l'activez, la base de données sera sauvegardée automatiquement lors de la suspension et de la fermeture. Cependant, si votre base de données est très volumineuse, il se peut que Windows estime que cela prend trop de temps et tue l'application. + + + Sauvegarder automatiquement lors de la suspension ? + Ici, vous pouvez changer le mot de passe maître, le fichier de clé, ou les deux. Cliquez simplement sur diff --git a/ModernKeePass/ViewModels/CompositeKeyVm.cs b/ModernKeePass/ViewModels/CompositeKeyVm.cs index e9f442f..dc8bdf1 100644 --- a/ModernKeePass/ViewModels/CompositeKeyVm.cs +++ b/ModernKeePass/ViewModels/CompositeKeyVm.cs @@ -137,7 +137,7 @@ namespace ModernKeePass.ViewModels if (HasPassword) errorMessage.Append(_resource.GetResourceValue("CompositeKeyErrorUserPassword")); if (HasPassword && HasKeyFile) errorMessage.Append(_resource.GetResourceValue("CompositeKeyErrorUserOr")); if (HasKeyFile) errorMessage.Append(_resource.GetResourceValue("CompositeKeyErrorUserKeyFile")); - if (HasKeyFile) errorMessage.Append(_resource.GetResourceValue("CompositeKeyErrorUserAccount")); + if (HasUserAccount) errorMessage.Append(_resource.GetResourceValue("CompositeKeyErrorUserAccount")); UpdateStatus(errorMessage.ToString(), StatusTypes.Error); } catch (Exception e) diff --git a/ModernKeePass/ViewModels/Items/SettingsNewVm.cs b/ModernKeePass/ViewModels/Items/SettingsNewVm.cs index 54dc044..a9a050d 100644 --- a/ModernKeePass/ViewModels/Items/SettingsNewVm.cs +++ b/ModernKeePass/ViewModels/Items/SettingsNewVm.cs @@ -6,7 +6,7 @@ namespace ModernKeePass.ViewModels { public class SettingsNewVm { - private ISettingsService _settings; + private readonly ISettingsService _settings; public SettingsNewVm() : this(SettingsService.Instance) { } diff --git a/ModernKeePass/ViewModels/Items/SettingsSaveVm.cs b/ModernKeePass/ViewModels/Items/SettingsSaveVm.cs new file mode 100644 index 0000000..a306d42 --- /dev/null +++ b/ModernKeePass/ViewModels/Items/SettingsSaveVm.cs @@ -0,0 +1,24 @@ +using ModernKeePass.Interfaces; +using ModernKeePass.Services; + +namespace ModernKeePass.ViewModels +{ + public class SettingsSaveVm + { + private readonly ISettingsService _settings; + + public SettingsSaveVm() : this(SettingsService.Instance) + { } + + public SettingsSaveVm(ISettingsService settings) + { + _settings = settings; + } + + public bool IsSaveSuspend + { + get { return _settings.GetSetting("SaveSuspend", true); } + set { _settings.PutSetting("SaveSuspend", value); } + } + } +} \ No newline at end of file diff --git a/ModernKeePass/ViewModels/SettingsVm.cs b/ModernKeePass/ViewModels/SettingsVm.cs index 9bbf52a..98e092b 100644 --- a/ModernKeePass/ViewModels/SettingsVm.cs +++ b/ModernKeePass/ViewModels/SettingsVm.cs @@ -55,6 +55,13 @@ namespace ModernKeePass.ViewModels IsSelected = true }, new ListMenuItemVm + { + Title = resource.GetResourceValue("SettingsMenuItemSave"), + Group = resource.GetResourceValue("SettingsMenuGroupApplication"), + SymbolIcon = Symbol.Save, + PageType = typeof(SettingsSavePage) + }, + new ListMenuItemVm { Title = resource.GetResourceValue("SettingsMenuItemGeneral"), Group = resource.GetResourceValue("SettingsMenuGroupDatabase"), diff --git a/ModernKeePass/Views/SettingsPageFrames/SettingsSavePage.xaml b/ModernKeePass/Views/SettingsPageFrames/SettingsSavePage.xaml new file mode 100644 index 0000000..0babd8e --- /dev/null +++ b/ModernKeePass/Views/SettingsPageFrames/SettingsSavePage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/ModernKeePass/Views/SettingsPageFrames/SettingsSavePage.xaml.cs b/ModernKeePass/Views/SettingsPageFrames/SettingsSavePage.xaml.cs new file mode 100644 index 0000000..444c34b --- /dev/null +++ b/ModernKeePass/Views/SettingsPageFrames/SettingsSavePage.xaml.cs @@ -0,0 +1,15 @@ +// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ModernKeePass.Views +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class SettingsSavePage + { + public SettingsSavePage() + { + InitializeComponent(); + } + } +} diff --git a/ModernKeePass/Views/SettingsPageFrames/SettingsSecurityPage.xaml b/ModernKeePass/Views/SettingsPageFrames/SettingsSecurityPage.xaml index 0a6bef6..5180f0d 100644 --- a/ModernKeePass/Views/SettingsPageFrames/SettingsSecurityPage.xaml +++ b/ModernKeePass/Views/SettingsPageFrames/SettingsSecurityPage.xaml @@ -2,7 +2,6 @@ x:Class="ModernKeePass.Views.SettingsSecurityPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:local="using:ModernKeePass.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:userControls="using:ModernKeePass.Views.UserControls" diff --git a/ModernKeePass/appMetadata/en-us/baselisting/releaseNotes.txt b/ModernKeePass/appMetadata/en-us/baselisting/releaseNotes.txt index 1e13c6b..9ef8331 100644 --- a/ModernKeePass/appMetadata/en-us/baselisting/releaseNotes.txt +++ b/ModernKeePass/appMetadata/en-us/baselisting/releaseNotes.txt @@ -1,2 +1,4 @@ -New inline menu on Entries to quickly copy login, password, and navigate to URL -Design changes \ No newline at end of file +Application now correctly resumes from suspend +Code enhancements +Return of the Donate page, with Paypal +KeePassLib version bump to 2.38 \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/description.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/description.txt index c893cfa..5b46729 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/description.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/description.txt @@ -1,6 +1,6 @@ -En avez-vous assez d'essayer de retenir des quantités de mots de passe ? Etes-vous soucieux que le fait d'utiliser le même mot de passe partout vous rend vulnérable ? -ModernKeePass est un gestionnaire de mots de passe gratuit, libre, facile à utiliser mais néanmoins sûr, basé sur la technologie certifiée et répandue KeePass 2.x et compatible avec celui-ci. -Vous pouvez stocker ou générer vos mots de passe dans une base de données chiffrée, qui peut être placée n'importe où (ordinateur personnel/tablette, cloud, clé USB...) +En avez-vous assez d'essayer de retenir des quantites de mots de passe ? Etes-vous soucieux que le fait d'utiliser le meme mot de passe partout vous rend vulnerable ? +ModernKeePass est un gestionnaire de mots de passe gratuit, libre, facile a utiliser mais neanmoins sur, base sur la technologie certifiee et repandue KeePass 2.x et compatible avec celui-ci. +Vous pouvez stocker ou generer vos mots de passe dans une base de donnees chiffree, qui peut etre placee n'importe ou (ordinateur personnel/tablette, cloud, cle USB...) -Bien que la sécurité informatique soit très importante, cette application essaie de rester simple à utiliser et à comprendre. Vos suggestions sont les bienvenues ! +Bien que la securite informatique soit tres importante, cette application essaie de rester simple a utiliser et a comprendre. Vos suggestions sont les bienvenues ! Fonctionne sur Windows 10, 8.1 et RT. \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Entry.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Entry.txt index 5f9b373..ba48db9 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Entry.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Entry.txt @@ -1 +1 @@ -Page d'entrée avec générateur de mot de passe \ No newline at end of file +Page d'entree avec generateur de mot de passe \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Filter.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Filter.txt index 1e0e721..55d879a 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Filter.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Filter.txt @@ -1 +1 @@ -Filtrez vos entrées pour rapidement trouver celle qui vous intéresse \ No newline at end of file +Filtrez vos entrees pour rapidement trouver celle qui vous interesse \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Group.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Group.txt index f70f2bc..0e33b6e 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Group.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Group.txt @@ -1 +1 @@ -Vue d'un groupe, avec ses sous-groupes et ses entrées \ No newline at end of file +Vue d'un groupe, avec ses sous-groupes et ses entrees \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.New.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.New.txt index 840976e..d9bd329 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.New.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.New.txt @@ -1 +1 @@ -Créez de nouvelles bases de données, en définissant un mot de passe et/ou un fichier de clé existant ou nouveau \ No newline at end of file +Creez de nouvelles bases de donnees, en definissant un mot de passe et/ou un fichier de cle existant ou nouveau \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Open.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Open.txt index a660814..895fe2b 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Open.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Open.txt @@ -1 +1 @@ -Ouvrez une base de données avec mot de passe et/ou fichier de clé \ No newline at end of file +Ouvrez une base de donnees avec mot de passe et/ou fichier de cle \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Recent.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Recent.txt index 8efe05e..42c90e1 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Recent.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Recent.txt @@ -1 +1 @@ -Ouvrez les fichiers récents \ No newline at end of file +Ouvrez les fichiers recents \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Semantic.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Semantic.txt index 9f620a2..7405ca7 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Semantic.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Semantic.txt @@ -1 +1 @@ -Vue d'ensemble avec le zoom sémantique \ No newline at end of file +Vue d'ensemble avec le zoom semantique \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Settings.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Settings.txt index 3b463d1..93f8444 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Settings.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/images/Screenshot/description.Settings.txt @@ -1 +1 @@ -Paramètres de l'application \ No newline at end of file +Parametres de l'application \ No newline at end of file diff --git a/ModernKeePass/appMetadata/fr-fr/baselisting/releaseNotes.txt b/ModernKeePass/appMetadata/fr-fr/baselisting/releaseNotes.txt index 11e5b15..4a76727 100644 --- a/ModernKeePass/appMetadata/fr-fr/baselisting/releaseNotes.txt +++ b/ModernKeePass/appMetadata/fr-fr/baselisting/releaseNotes.txt @@ -1,2 +1,4 @@ -Ajout d'un menu intégré à la liste d'entrées afin de copier rapidement le login, mot de passe et de naviguer vers l'URL -Quelques changements de design \ No newline at end of file +L'application recupere correctement d'une suspension +Ameliorations de code +Retour de la page de donation, avec Paypal +Version de la KeePassLib montee a 2.38 \ No newline at end of file diff --git a/ModernKeePass/packages.config b/ModernKeePass/packages.config index 6cc0bad..62995e7 100644 --- a/ModernKeePass/packages.config +++ b/ModernKeePass/packages.config @@ -7,7 +7,7 @@ - + diff --git a/ModernKeePassApp.Test/Mock/DatabaseServiceMock.cs b/ModernKeePassApp.Test/Mock/DatabaseServiceMock.cs index 3f6611a..24ff962 100644 --- a/ModernKeePassApp.Test/Mock/DatabaseServiceMock.cs +++ b/ModernKeePassApp.Test/Mock/DatabaseServiceMock.cs @@ -13,11 +13,14 @@ namespace ModernKeePassApp.Test.Mock { private bool _isOpen; private bool _isClosed; + private CompositeKey _compositeKey; public PwCompressionAlgorithm CompressionAlgorithm { get; set; } public StorageFile DatabaseFile { get; set; } + public CompositeKey CompositeKey => _compositeKey; + public PwUuid DataCipher { get; set; } public KdfParameters KeyDerivation { get; set; } @@ -43,7 +46,7 @@ namespace ModernKeePassApp.Test.Mock throw new NotImplementedException(); } - public Task Close() + public Task Close(bool releaseFile = true) { return Task.Run(() => { @@ -57,8 +60,9 @@ namespace ModernKeePassApp.Test.Mock throw new NotImplementedException(); } - public Task Open(CompositeKey key, bool createNew) + public Task Open(CompositeKey key, bool createNew = false) { + _compositeKey = key; return Task.Run(() => { _isOpen = true; @@ -66,6 +70,11 @@ namespace ModernKeePassApp.Test.Mock }); } + public async Task ReOpen() + { + await Open(_compositeKey); + } + public void Save() { // Do Nothing diff --git a/ModernKeePassApp.Test/Mock/SettingsServiceMock.cs b/ModernKeePassApp.Test/Mock/SettingsServiceMock.cs index 58ce523..fddf379 100644 --- a/ModernKeePassApp.Test/Mock/SettingsServiceMock.cs +++ b/ModernKeePassApp.Test/Mock/SettingsServiceMock.cs @@ -5,9 +5,9 @@ namespace ModernKeePassApp.Test.Mock { public class SettingsServiceMock : ISettingsService { - public T GetSetting(string property) + public T GetSetting(string property, T defaultValue = default(T)) { - return default(T); + return defaultValue; } public void PutSetting(string property, T value) diff --git a/ModernKeePassApp.Test/ViewModelsTests.cs b/ModernKeePassApp.Test/ViewModelsTests.cs index 60624a2..94f2e1b 100644 --- a/ModernKeePassApp.Test/ViewModelsTests.cs +++ b/ModernKeePassApp.Test/ViewModelsTests.cs @@ -13,8 +13,8 @@ namespace ModernKeePassApp.Test [TestClass] public class ViewModelsTests { - private RecentServiceMock _recent = new RecentServiceMock(); - private ResourceServiceMock _resource = new ResourceServiceMock(); + private readonly RecentServiceMock _recent = new RecentServiceMock(); + private readonly ResourceServiceMock _resource = new ResourceServiceMock(); [TestMethod] public void TestAboutVm() @@ -108,7 +108,7 @@ namespace ModernKeePassApp.Test Assert.AreEqual(1, settingsVm.MenuItems.Count()); var firstGroup = settingsVm.MenuItems.FirstOrDefault(); // All groups have an empty title, so all settings are put inside the empty group - Assert.AreEqual(3, firstGroup.Count()); + Assert.AreEqual(4, firstGroup.Count()); Assert.IsNotNull(settingsVm.SelectedItem); var selectedItem = (ListMenuItemVm) settingsVm.SelectedItem; Assert.AreEqual(typeof(SettingsNewDatabasePage), selectedItem.PageType);