mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-18 22:36: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;
|
LockTimerDisplay = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Lock()
|
||||||
|
{
|
||||||
|
StopLockTimer();
|
||||||
|
passStore.Lock();
|
||||||
|
UpdateLockStatus();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnLockTimerTick(object? sender, EventArgs e)
|
private void OnLockTimerTick(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var elapsed = DateTime.UtcNow - _timerStart;
|
var elapsed = DateTime.UtcNow - _timerStart;
|
||||||
@@ -96,9 +103,7 @@ public partial class RepositoryWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
if (remaining <= TimeSpan.Zero)
|
if (remaining <= TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
StopLockTimer();
|
Lock();
|
||||||
passStore.Lock();
|
|
||||||
UpdateLockStatus();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,30 +84,14 @@
|
|||||||
</TreeView.ItemTemplate>
|
</TreeView.ItemTemplate>
|
||||||
</TreeView>
|
</TreeView>
|
||||||
|
|
||||||
<!-- Save Passwords -->
|
<!-- New Entry -->
|
||||||
<Button Content="Save"
|
<Button Content="New Password"
|
||||||
Classes="accentSidebarButton"
|
Classes="accentSidebarButton"
|
||||||
Click="SaveButton_Click"
|
Click="AddEntryButton_Click"
|
||||||
Height="30"
|
Height="30"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,20,0,0"/>
|
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 -->
|
<!-- New Group -->
|
||||||
<Button Content="New Group"
|
<Button Content="New Group"
|
||||||
Classes="accentSidebarButton"
|
Classes="accentSidebarButton"
|
||||||
@@ -115,6 +99,30 @@
|
|||||||
Height="30"
|
Height="30"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,20,0,0"/>
|
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>
|
</StackPanel>
|
||||||
</Border>
|
</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)
|
private void Entry_DoubleTapped(object sender, TappedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Source is StyledElement s && s.DataContext is PassStoreEntry ent)
|
if (args.Source is StyledElement s && s.DataContext is PassStoreEntry ent)
|
||||||
|
|||||||
Reference in New Issue
Block a user