Wipe on Alt+W as well as put the boxes back
Alt+W only put the boxes back, so wiping needed Ctrl+W or the button. It now goes both ways, the way N1MM's Wipe button does: with something in the boxes it clears them, and pressed again on empty boxes it puts back what it cleared. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NZkFxHde1iifAQemFTHxf
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
</MenuItem>
|
||||
<MenuItem Header="_Edit">
|
||||
<MenuItem Header="Wipe Out Entry Fields" Click="OnWipe" InputGesture="Ctrl+W" />
|
||||
<MenuItem Header="Restore Wiped Entry Fields" Click="OnRestoreWiped" InputGesture="Alt+W" />
|
||||
<MenuItem Header="Wipe Out or Restore Entry Fields" Click="OnWipeOrRestore" InputGesture="Alt+W" />
|
||||
<Separator />
|
||||
<MenuItem Header="Edit Last Contact" Click="OnEditLastContact" InputGesture="Ctrl+Y" />
|
||||
<MenuItem Header="Add a Note to Last/Current Contact" Click="OnAddNote" InputGesture="Ctrl+N" />
|
||||
|
||||
@@ -390,7 +390,7 @@ public sealed partial class EntryWindow : Window
|
||||
break;
|
||||
case Key.W when e.KeyModifiers.HasFlag(KeyModifiers.Alt):
|
||||
e.Handled = true;
|
||||
OnRestoreWiped(this, new RoutedEventArgs());
|
||||
OnWipeOrRestore(this, new RoutedEventArgs());
|
||||
break;
|
||||
case Key.L when e.KeyModifiers.HasFlag(KeyModifiers.Control):
|
||||
e.Handled = true;
|
||||
@@ -686,20 +686,15 @@ public sealed partial class EntryWindow : Window
|
||||
Refresh();
|
||||
}
|
||||
|
||||
/// N1MM's Alt+W: the boxes the last wipe cleared are filled in again. With
|
||||
/// something typed in them there is nowhere to put it back, so the status
|
||||
/// line says so rather than throwing the typing away.
|
||||
private void OnRestoreWiped(object? sender, RoutedEventArgs e)
|
||||
/// N1MM's Alt+W: it wipes the boxes, and pressed again on empty boxes it
|
||||
/// puts back what it wiped.
|
||||
private void OnWipeOrRestore(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (Logging is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!Logging.RestoreWiped())
|
||||
{
|
||||
Status(Logging.Entry.IsEmpty ? "no wiped contact to put back" : "wipe the boxes first");
|
||||
return;
|
||||
}
|
||||
Logging.WipeOrRestore();
|
||||
ResetEsm();
|
||||
SyncBoxes();
|
||||
boxes[0].Focus();
|
||||
|
||||
Reference in New Issue
Block a user