@@ -31,11 +31,11 @@ public bool IsAlreadyUsedTeachingTipOpened
31
31
set => SetProperty ( ref _IsAlreadyUsedTeachingTipOpened , value ) ;
32
32
}
33
33
34
- private bool _ShowAddNewShortcutGrid ;
35
- public bool ShowAddNewShortcutGrid
34
+ private bool _ShowAddNewHotKeySection ;
35
+ public bool ShowAddNewHotKeySection
36
36
{
37
- get => _ShowAddNewShortcutGrid ;
38
- set => SetProperty ( ref _ShowAddNewShortcutGrid , value ) ;
37
+ get => _ShowAddNewHotKeySection ;
38
+ set => SetProperty ( ref _ShowAddNewHotKeySection , value ) ;
39
39
}
40
40
41
41
private ModifiableCommandHotKeyItem ? _SelectedNewShortcutItem ;
@@ -48,22 +48,22 @@ public ModifiableCommandHotKeyItem? SelectedNewShortcutItem
48
48
// Commands
49
49
50
50
public ICommand LoadCommandsCommand { get ; set ; }
51
- public ICommand ShowResetAllConfirmationCommand { get ; set ; }
52
- public ICommand ShowAddNewShortcutGridCommand { get ; set ; }
53
- public ICommand HideAddNewShortcutGridCommand { get ; set ; }
54
- public ICommand AddNewShortcutCommand { get ; set ; }
55
- public ICommand ResetAllCommand { get ; set ; }
51
+ public ICommand ShowAddNewHotKeySectionCommand { get ; set ; }
52
+ public ICommand HideAddNewHotKeySectionCommand { get ; set ; }
53
+ public ICommand AddNewHotKeyCommand { get ; set ; }
54
+ public ICommand ShowRestoreDefaultsConfirmationCommand { get ; set ; }
55
+ public ICommand RestoreDefaultsCommand { get ; set ; }
56
56
57
57
// Constructor
58
58
59
59
public ActionsViewModel ( )
60
60
{
61
61
LoadCommandsCommand = new AsyncRelayCommand ( ExecuteLoadCommandsCommand ) ;
62
- ShowResetAllConfirmationCommand = new RelayCommand ( ExecuteShowResetAllConfirmationCommand ) ;
63
- ShowAddNewShortcutGridCommand = new RelayCommand ( ExecuteShowAddNewShortcutGridCommand ) ;
64
- HideAddNewShortcutGridCommand = new RelayCommand ( ExecuteHideAddNewShortcutGridCommand ) ;
65
- AddNewShortcutCommand = new RelayCommand ( ExecuteAddNewShortcutCommand ) ;
66
- ResetAllCommand = new RelayCommand ( ExecuteResetAllCommand ) ;
62
+ ShowAddNewHotKeySectionCommand = new RelayCommand ( ExecuteShowAddNewHotKeySectionCommand ) ;
63
+ HideAddNewHotKeySectionCommand = new RelayCommand ( ExecuteHideAddNewHotKeySectionCommand ) ;
64
+ AddNewHotKeyCommand = new RelayCommand ( ExecuteAddNewHotKeyCommand ) ;
65
+ ShowRestoreDefaultsConfirmationCommand = new RelayCommand ( ExecuteShowRestoreDefaultsConfirmationCommand ) ;
66
+ RestoreDefaultsCommand = new RelayCommand ( ExecuteRestoreDefaultsCommand ) ;
67
67
}
68
68
69
69
// Command methods
@@ -110,26 +110,21 @@ await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(() =>
110
110
} ) ;
111
111
}
112
112
113
- private void ExecuteShowResetAllConfirmationCommand ( )
113
+ private void ExecuteShowAddNewHotKeySectionCommand ( )
114
114
{
115
- IsResetAllConfirmationTeachingTipOpened = true ;
116
- }
117
-
118
- private void ExecuteShowAddNewShortcutGridCommand ( )
119
- {
120
- ShowAddNewShortcutGrid = true ;
115
+ ShowAddNewHotKeySection = true ;
121
116
122
- // Reset edit mode for each item
117
+ // Reset edit mode of every item
123
118
foreach ( var hotkey in ValidKeyboardShortcuts )
124
119
{
125
120
hotkey . IsEditMode = false ;
126
121
hotkey . HotKeyText = hotkey . HotKey . LocalizedLabel ;
127
122
}
128
123
}
129
124
130
- private void ExecuteHideAddNewShortcutGridCommand ( )
125
+ private void ExecuteHideAddNewHotKeySectionCommand ( )
131
126
{
132
- ShowAddNewShortcutGrid = false ;
127
+ ShowAddNewHotKeySection = false ;
133
128
134
129
if ( SelectedNewShortcutItem is null )
135
130
return ;
@@ -138,7 +133,7 @@ private void ExecuteHideAddNewShortcutGridCommand()
138
133
SelectedNewShortcutItem = null ;
139
134
}
140
135
141
- private void ExecuteAddNewShortcutCommand ( )
136
+ private void ExecuteAddNewHotKeyCommand ( )
142
137
{
143
138
if ( SelectedNewShortcutItem is null )
144
139
return ;
@@ -202,8 +197,8 @@ GeneralSettingsService.Actions is not null
202
197
PreviousHotKey = HotKey . Parse ( SelectedNewShortcutItem . PreviousHotKey . RawLabel ) ,
203
198
} ;
204
199
205
- // Hide the grid
206
- ShowAddNewShortcutGrid = false ;
200
+ // Hide the section
201
+ ShowAddNewHotKeySection = false ;
207
202
208
203
// Remove from excluded list and set null
209
204
SelectedNewShortcutItem . HotKeyText = "" ;
@@ -213,7 +208,12 @@ GeneralSettingsService.Actions is not null
213
208
ValidKeyboardShortcuts . Insert ( 0 , selectedNewItem ) ;
214
209
}
215
210
216
- private void ExecuteResetAllCommand ( )
211
+ private void ExecuteShowRestoreDefaultsConfirmationCommand ( )
212
+ {
213
+ IsResetAllConfirmationTeachingTipOpened = true ;
214
+ }
215
+
216
+ private void ExecuteRestoreDefaultsCommand ( )
217
217
{
218
218
GeneralSettingsService . Actions = null ;
219
219
IsResetAllConfirmationTeachingTipOpened = false ;
0 commit comments