mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Updated Settings page
Added new settings (history and clipboard) Renamed and moved Settings Vms
This commit is contained in:
@@ -108,6 +108,7 @@
|
||||
<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\SetMaxHistorySize\SetMaxHistorySizeCommand.cs" />
|
||||
<Compile Include="Parameters\Commands\SetRecycleBin\SetRecycleBinCommand.cs" />
|
||||
<Compile Include="Parameters\Models\CipherVm.cs" />
|
||||
<Compile Include="Parameters\Models\KeyDerivationVm.cs" />
|
||||
|
@@ -23,6 +23,7 @@ namespace ModernKeePass.Application.Common.Interfaces
|
||||
int Size { get; set; }
|
||||
bool IsDirty { get; set; }
|
||||
int MaxHistoryCount { get; set; }
|
||||
long MaxHistorySize { get; set; }
|
||||
|
||||
Task Open(byte[] file, Credentials credentials);
|
||||
Task ReOpen(byte[] file);
|
||||
|
@@ -64,17 +64,17 @@ namespace ModernKeePass.Application.Database.Commands.CreateDatabase
|
||||
_database.UpdateGroup(internetGroup);
|
||||
|
||||
var sample1 = _database.CreateEntry(_database.RootGroupId);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Title, "Sample Entry", true);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.UserName, "Username", true);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Title, "Sample Entry", false);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.UserName, "Username", false);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Password, "Password", true);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Url, "https://keepass.info/", true);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Notes, "You may safely delete this sample", true);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Url, "https://keepass.info/", false);
|
||||
_database.UpdateEntry(sample1.Id, EntryFieldName.Notes, "You may safely delete this sample", false);
|
||||
|
||||
var sample2 = _database.CreateEntry(_database.RootGroupId);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.Title, "Sample Entry #2", true);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.UserName, "Michael321", true);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.Title, "Sample Entry #2", false);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.UserName, "Michael321", false);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.Password, "12345", true);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.Url, "https://keepass.info/help/kb/testform.html", true);
|
||||
_database.UpdateEntry(sample2.Id, EntryFieldName.Url, "https://keepass.info/help/kb/testform.html", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -13,5 +13,6 @@
|
||||
public int Size { get; internal set; }
|
||||
public bool IsDirty { get; internal set; }
|
||||
public int MaxHistoryCount { get; set; }
|
||||
public long MaxHistorySize { get; set; }
|
||||
}
|
||||
}
|
@@ -34,6 +34,7 @@ namespace ModernKeePass.Application.Database.Queries.GetDatabase
|
||||
database.Size = _databaseProxy.Size;
|
||||
database.IsDirty = _databaseProxy.IsDirty;
|
||||
database.MaxHistoryCount = _databaseProxy.MaxHistoryCount;
|
||||
database.MaxHistorySize = _databaseProxy.MaxHistorySize;
|
||||
}
|
||||
return database;
|
||||
}
|
||||
|
@@ -0,0 +1,28 @@
|
||||
using MediatR;
|
||||
using ModernKeePass.Application.Common.Interfaces;
|
||||
using ModernKeePass.Domain.Exceptions;
|
||||
|
||||
namespace ModernKeePass.Application.Parameters.Commands.SetMaxHistorySize
|
||||
{
|
||||
public class SetMaxHistorySizeCommand : IRequest
|
||||
{
|
||||
public long MaxHistorySize { get; set; }
|
||||
|
||||
public class SetMaxHistorySizeCommandHandler : IRequestHandler<SetMaxHistorySizeCommand>
|
||||
{
|
||||
private readonly IDatabaseProxy _database;
|
||||
|
||||
public SetMaxHistorySizeCommandHandler(IDatabaseProxy database)
|
||||
{
|
||||
_database = database;
|
||||
}
|
||||
|
||||
public void Handle(SetMaxHistorySizeCommand message)
|
||||
{
|
||||
if (_database.IsOpen) _database.MaxHistorySize = message.MaxHistorySize;
|
||||
else throw new DatabaseClosedException();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user