mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-18 06:16:30 +03:00
add Lock button, change labels, reorder buttons
This commit is contained in:
@@ -89,6 +89,13 @@ public partial class RepositoryWindowViewModel : ViewModelBase
|
||||
LockTimerDisplay = string.Empty;
|
||||
}
|
||||
|
||||
public void Lock()
|
||||
{
|
||||
StopLockTimer();
|
||||
passStore.Lock();
|
||||
UpdateLockStatus();
|
||||
}
|
||||
|
||||
private void OnLockTimerTick(object? sender, EventArgs e)
|
||||
{
|
||||
var elapsed = DateTime.UtcNow - _timerStart;
|
||||
@@ -96,9 +103,7 @@ public partial class RepositoryWindowViewModel : ViewModelBase
|
||||
|
||||
if (remaining <= TimeSpan.Zero)
|
||||
{
|
||||
StopLockTimer();
|
||||
passStore.Lock();
|
||||
UpdateLockStatus();
|
||||
Lock();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,30 +84,14 @@
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
|
||||
<!-- Save Passwords -->
|
||||
<Button Content="Save"
|
||||
<!-- New Entry -->
|
||||
<Button Content="New Password"
|
||||
Classes="accentSidebarButton"
|
||||
Click="SaveButton_Click"
|
||||
Click="AddEntryButton_Click"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
|
||||
<!-- New Entry -->
|
||||
<Button Content="New Password"
|
||||
Classes="accentSidebarButton"
|
||||
Click="AddEntryButton_Click"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
|
||||
<!-- Edit Selected Entry -->
|
||||
<Button Content="Edit Selected Password"
|
||||
Classes="accentSidebarButton"
|
||||
Click="EditEntryButton_Click"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
|
||||
<!-- New Group -->
|
||||
<Button Content="New Group"
|
||||
Classes="accentSidebarButton"
|
||||
@@ -115,6 +99,30 @@
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
|
||||
<!-- Edit Selected Entry -->
|
||||
<Button Content="Edit Selected Password"
|
||||
Classes="accentSidebarButton"
|
||||
Click="EditEntryButton_Click"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
|
||||
<!-- Save Passwords -->
|
||||
<Button Content="Save Vault"
|
||||
Classes="accentSidebarButton"
|
||||
Click="SaveButton_Click"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
|
||||
<!-- Lock -->
|
||||
<Button Content="Lock Vault"
|
||||
Classes="accentSidebarButton"
|
||||
Click="LockButton_Click"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
|
||||
@@ -206,6 +206,14 @@ public partial class RepositoryWindow : Window
|
||||
}
|
||||
}
|
||||
|
||||
private void LockButton_Click(object sender, RoutedEventArgs args)
|
||||
{
|
||||
if (DataContext is RepositoryWindowViewModel vm)
|
||||
{
|
||||
vm.Lock();
|
||||
}
|
||||
}
|
||||
|
||||
private void Entry_DoubleTapped(object sender, TappedEventArgs args)
|
||||
{
|
||||
if (args.Source is StyledElement s && s.DataContext is PassStoreEntry ent)
|
||||
|
||||
Reference in New Issue
Block a user