mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Clipboard action now sets an expiration timer
WIP Max History count (back-end done, front-end todo)
This commit is contained in:
@@ -106,6 +106,7 @@
|
|||||||
<Compile Include="Parameters\Commands\SetCipher\SetCipherCommand.cs" />
|
<Compile Include="Parameters\Commands\SetCipher\SetCipherCommand.cs" />
|
||||||
<Compile Include="Parameters\Commands\SetCompression\SetCompressionCommand.cs" />
|
<Compile Include="Parameters\Commands\SetCompression\SetCompressionCommand.cs" />
|
||||||
<Compile Include="Parameters\Commands\SetHasRecycleBin\SetHasRecycleBinCommand.cs" />
|
<Compile Include="Parameters\Commands\SetHasRecycleBin\SetHasRecycleBinCommand.cs" />
|
||||||
|
<Compile Include="Parameters\Commands\SetMaxHistoryCount\SetHistoryCountCommand.cs" />
|
||||||
<Compile Include="Parameters\Commands\SetKeyDerivation\SetKeyDerivationCommand.cs" />
|
<Compile Include="Parameters\Commands\SetKeyDerivation\SetKeyDerivationCommand.cs" />
|
||||||
<Compile Include="Parameters\Commands\SetRecycleBin\SetRecycleBinCommand.cs" />
|
<Compile Include="Parameters\Commands\SetRecycleBin\SetRecycleBinCommand.cs" />
|
||||||
<Compile Include="Parameters\Models\CipherVm.cs" />
|
<Compile Include="Parameters\Models\CipherVm.cs" />
|
||||||
|
@@ -22,6 +22,7 @@ namespace ModernKeePass.Application.Common.Interfaces
|
|||||||
string FileAccessToken { get; set; }
|
string FileAccessToken { get; set; }
|
||||||
int Size { get; set; }
|
int Size { get; set; }
|
||||||
bool IsDirty { get; set; }
|
bool IsDirty { get; set; }
|
||||||
|
int MaxHistoryCount { get; set; }
|
||||||
|
|
||||||
Task Open(byte[] file, Credentials credentials);
|
Task Open(byte[] file, Credentials credentials);
|
||||||
Task ReOpen(byte[] file);
|
Task ReOpen(byte[] file);
|
||||||
|
@@ -12,5 +12,6 @@
|
|||||||
public string KeyDerivationId { get; set; }
|
public string KeyDerivationId { get; set; }
|
||||||
public int Size { get; internal set; }
|
public int Size { get; internal set; }
|
||||||
public bool IsDirty { get; internal set; }
|
public bool IsDirty { get; internal set; }
|
||||||
|
public int MaxHistoryCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -33,6 +33,7 @@ namespace ModernKeePass.Application.Database.Queries.GetDatabase
|
|||||||
database.KeyDerivationId = _databaseProxy.KeyDerivationId;
|
database.KeyDerivationId = _databaseProxy.KeyDerivationId;
|
||||||
database.Size = _databaseProxy.Size;
|
database.Size = _databaseProxy.Size;
|
||||||
database.IsDirty = _databaseProxy.IsDirty;
|
database.IsDirty = _databaseProxy.IsDirty;
|
||||||
|
database.MaxHistoryCount = _databaseProxy.MaxHistoryCount;
|
||||||
}
|
}
|
||||||
return database;
|
return database;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,27 @@
|
|||||||
|
using MediatR;
|
||||||
|
using ModernKeePass.Application.Common.Interfaces;
|
||||||
|
using ModernKeePass.Domain.Exceptions;
|
||||||
|
|
||||||
|
namespace ModernKeePass.Application.Parameters.Commands.SetMaxHistoryCount
|
||||||
|
{
|
||||||
|
public class SetMaxHistoryCountCommand : IRequest
|
||||||
|
{
|
||||||
|
public int MaxHistoryCount { get; set; }
|
||||||
|
|
||||||
|
public class SetMaxHistoryCountCommandHandler : IRequestHandler<SetMaxHistoryCountCommand>
|
||||||
|
{
|
||||||
|
private readonly IDatabaseProxy _database;
|
||||||
|
|
||||||
|
public SetMaxHistoryCountCommandHandler(IDatabaseProxy database)
|
||||||
|
{
|
||||||
|
_database = database;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(SetMaxHistoryCountCommand message)
|
||||||
|
{
|
||||||
|
if (_database.IsOpen) _database.MaxHistoryCount = message.MaxHistoryCount;
|
||||||
|
else throw new DatabaseClosedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -40,6 +40,12 @@ namespace ModernKeePass.Infrastructure.KeePass
|
|||||||
public int Size { get; set; }
|
public int Size { get; set; }
|
||||||
public bool IsDirty { get; set; }
|
public bool IsDirty { get; set; }
|
||||||
|
|
||||||
|
public int MaxHistoryCount
|
||||||
|
{
|
||||||
|
get { return _pwDatabase.HistoryMaxItems; }
|
||||||
|
set { _pwDatabase.HistoryMaxItems = value; }
|
||||||
|
}
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
public bool IsRecycleBinEnabled
|
public bool IsRecycleBinEnabled
|
||||||
{
|
{
|
||||||
|
@@ -166,14 +166,6 @@ namespace ModernKeePass
|
|||||||
#if DEBUG
|
#if DEBUG
|
||||||
_notification.Show("App resumed", "Nothing to do, no previous database opened");
|
_notification.Show("App resumed", "Nothing to do, no previous database opened");
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_hockey.TrackException(ex);
|
|
||||||
_hockey.Flush();
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
_navigation.NavigateTo(Constants.Navigation.MainPage);
|
_navigation.NavigateTo(Constants.Navigation.MainPage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
Support for additional fields
|
Support for additional fields
|
||||||
Support for attachments
|
Support for attachments
|
||||||
|
Add an expiration timer for clipboard data
|
||||||
Ability to manually reorder groups
|
Ability to manually reorder groups
|
||||||
|
Ability to set max history count
|
||||||
Design changes
|
Design changes
|
||||||
Update to KeePassLib version 2.45
|
Update to KeePassLib version 2.45
|
@@ -1,5 +1,7 @@
|
|||||||
Ajout des champs additionnels
|
Ajout des champs additionnels
|
||||||
Ajout des pi<70>ces-jointes
|
Ajout des pi<70>ces-jointes
|
||||||
|
Ajout d'une expiration du presse papier
|
||||||
Possibilite de reorganiser les groupes manuellement
|
Possibilite de reorganiser les groupes manuellement
|
||||||
|
Possibilite de parametrer le nombre max d'historique
|
||||||
Quelques changements de design
|
Quelques changements de design
|
||||||
Mise a jour de la KeePassLib version 2.45
|
Mise a jour de la KeePassLib version 2.45
|
@@ -1,11 +1,17 @@
|
|||||||
using Windows.ApplicationModel.DataTransfer;
|
using System;
|
||||||
|
using Windows.ApplicationModel.DataTransfer;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Xaml.Interactivity;
|
using Microsoft.Xaml.Interactivity;
|
||||||
|
using ModernKeePass.Application.Common.Interfaces;
|
||||||
|
using ModernKeePass.Common;
|
||||||
|
|
||||||
namespace ModernKeePass.Actions
|
namespace ModernKeePass.Actions
|
||||||
{
|
{
|
||||||
public class ClipboardAction : DependencyObject, IAction
|
public class ClipboardAction : DependencyObject, IAction
|
||||||
{
|
{
|
||||||
|
private DispatcherTimer _dispatcher;
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get { return (string)GetValue(TextProperty); }
|
get { return (string)GetValue(TextProperty); }
|
||||||
@@ -18,10 +24,24 @@ namespace ModernKeePass.Actions
|
|||||||
public object Execute(object sender, object parameter)
|
public object Execute(object sender, object parameter)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Text)) return null;
|
if (string.IsNullOrEmpty(Text)) return null;
|
||||||
|
|
||||||
|
var settings = App.Services.GetRequiredService<ISettingsProxy>();
|
||||||
|
|
||||||
|
_dispatcher = new DispatcherTimer {Interval = TimeSpan.FromSeconds(settings.GetSetting(Constants.Settings.ClipboardTimeout, 10))};
|
||||||
|
_dispatcher.Tick += Dispatcher_Tick;
|
||||||
|
|
||||||
var dataPackage = new DataPackage { RequestedOperation = DataPackageOperation.Copy };
|
var dataPackage = new DataPackage { RequestedOperation = DataPackageOperation.Copy };
|
||||||
dataPackage.SetText(Text);
|
dataPackage.SetText(Text);
|
||||||
Clipboard.SetContent(dataPackage);
|
Clipboard.SetContent(dataPackage);
|
||||||
|
_dispatcher.Start();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Dispatcher_Tick(object sender, object e)
|
||||||
|
{
|
||||||
|
Clipboard.SetContent(null);
|
||||||
|
_dispatcher.Stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
public static string SaveSuspend => nameof(SaveSuspend);
|
public static string SaveSuspend => nameof(SaveSuspend);
|
||||||
public static string Sample => nameof(Sample);
|
public static string Sample => nameof(Sample);
|
||||||
public static string DefaultFileFormat => nameof(DefaultFileFormat);
|
public static string DefaultFileFormat => nameof(DefaultFileFormat);
|
||||||
|
public static string ClipboardTimeout => nameof(ClipboardTimeout);
|
||||||
|
public static string HistoryMaxCount => nameof(HistoryMaxCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user