diff --git a/Accounts/Properties/Resources.Designer.cs b/Accounts/Properties/Resources.Designer.cs index c586bdb..a912b08 100644 --- a/Accounts/Properties/Resources.Designer.cs +++ b/Accounts/Properties/Resources.Designer.cs @@ -198,7 +198,7 @@ public static string Application_Name { } /// - /// Looks up a localized string similar to New. + /// Looks up a localized string similar to _New. /// public static string Home_New { get { @@ -207,7 +207,16 @@ public static string Home_New { } /// - /// Looks up a localized string similar to Open. + /// Looks up a localized string similar to Create a new account (Ctrl+N). + /// + public static string Home_New_Description { + get { + return ResourceManager.GetString("Home_New_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to _Open. /// public static string Home_Open { get { @@ -216,7 +225,16 @@ public static string Home_Open { } /// - /// Looks up a localized string similar to Edit. + /// Looks up a localized string similar to Open an account file (Ctrl+O). + /// + public static string Home_Open_Description { + get { + return ResourceManager.GetString("Home_Open_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to _Edit. /// public static string Menu_Edit { get { @@ -225,7 +243,7 @@ public static string Menu_Edit { } /// - /// Looks up a localized string similar to Copy. + /// Looks up a localized string similar to _Copy. /// public static string Menu_Edit_Copy { get { @@ -243,7 +261,7 @@ public static string Menu_Edit_Cut { } /// - /// Looks up a localized string similar to Duplicate.... + /// Looks up a localized string similar to _Duplicate.... /// public static string Menu_Edit_Duplicate { get { @@ -270,7 +288,7 @@ public static string Menu_Edit_Paste { } /// - /// Looks up a localized string similar to File. + /// Looks up a localized string similar to _File. /// public static string Menu_File { get { @@ -279,7 +297,7 @@ public static string Menu_File { } /// - /// Looks up a localized string similar to Archive. + /// Looks up a localized string similar to A_rchive. /// public static string Menu_File_Archive { get { @@ -297,7 +315,7 @@ public static string Menu_File_Archive_Description { } /// - /// Looks up a localized string similar to Close. + /// Looks up a localized string similar to _Close. /// public static string Menu_File_Close { get { @@ -306,7 +324,7 @@ public static string Menu_File_Close { } /// - /// Looks up a localized string similar to Exit. + /// Looks up a localized string similar to _Exit. /// public static string Menu_File_Exit { get { @@ -315,7 +333,7 @@ public static string Menu_File_Exit { } /// - /// Looks up a localized string similar to New. + /// Looks up a localized string similar to _New. /// public static string Menu_File_New { get { @@ -324,7 +342,7 @@ public static string Menu_File_New { } /// - /// Looks up a localized string similar to Open. + /// Looks up a localized string similar to _Open. /// public static string Menu_File_Open { get { @@ -333,7 +351,7 @@ public static string Menu_File_Open { } /// - /// Looks up a localized string similar to Save. + /// Looks up a localized string similar to _Save. /// public static string Menu_File_Save { get { @@ -342,7 +360,7 @@ public static string Menu_File_Save { } /// - /// Looks up a localized string similar to Help. + /// Looks up a localized string similar to _Help. /// public static string Menu_Help { get { @@ -360,7 +378,7 @@ public static string Menu_Help_About { } /// - /// Looks up a localized string similar to Go to the current month. + /// Looks up a localized string similar to Go to the current month (Ctrl+M). /// public static string Navigation_Current { get { @@ -441,7 +459,7 @@ public static string Transaction_Date { } /// - /// Looks up a localized string similar to Add. + /// Looks up a localized string similar to _Add. /// public static string Transaction_Form_Add { get { @@ -450,7 +468,7 @@ public static string Transaction_Form_Add { } /// - /// Looks up a localized string similar to Add a transaction. + /// Looks up a localized string similar to Add a transaction (Ctrl+T). /// public static string Transaction_Form_Add_Description { get { @@ -459,7 +477,7 @@ public static string Transaction_Form_Add_Description { } /// - /// Looks up a localized string similar to Cancel. + /// Looks up a localized string similar to _Cancel. /// public static string Transaction_Form_Cancel { get { @@ -477,7 +495,7 @@ public static string Transaction_Form_Cancel_Description { } /// - /// Looks up a localized string similar to Delete. + /// Looks up a localized string similar to _Delete. /// public static string Transaction_Form_Delete { get { @@ -504,7 +522,7 @@ public static string Transaction_Form_Delete_Description { } /// - /// Looks up a localized string similar to Save. + /// Looks up a localized string similar to _Save. /// public static string Transaction_Form_Save { get { diff --git a/Accounts/Properties/Resources.fr.resx b/Accounts/Properties/Resources.fr.resx index 237a03a..83f4ebc 100644 --- a/Accounts/Properties/Resources.fr.resx +++ b/Accounts/Properties/Resources.fr.resx @@ -19,34 +19,34 @@ Comptes - Fichier + _Fichier - Nouveau + _Nouveau - Ouvrir + _Ouvrir - Enregistrer + _Enregistrer - Fermer + _Fermer - Quitter + _Quitter - Édition + _Édition - Dupliquer... + _Dupliquer... - Nouveau + _Nouveau - Ouvrir + _Ouvrir Opération @@ -79,16 +79,16 @@ Pointé - Enregistrer + _Enregistrer - Annuler + _Annuler - Supprimer + _Supprimer - Aller au mois actuel + Aller au mois actuel (Ctrl+M) Mois précédent (Ctrl+Shift+Tab) @@ -103,7 +103,7 @@ Année précédente - Copier + _Copier Couper @@ -127,10 +127,10 @@ Supprimer l'opération - Ajouter + _Ajouter - Ajouter une opération + Ajouter une opération (Ctrl+T) Crédit : @@ -202,7 +202,7 @@ Fichier de compte - Archiver + A_rchiver Créer une sauvegarde du fichier de compte @@ -233,4 +233,10 @@ https://github.com/GaelGirodon/accounts Le montant de l'opération est invalide + + Créer un nouveau compte (Ctrl+N) + + + Ouvrir un fichier de compte (Ctrl+O) + diff --git a/Accounts/Properties/Resources.resx b/Accounts/Properties/Resources.resx index 8ac2b16..f4bc01f 100644 --- a/Accounts/Properties/Resources.resx +++ b/Accounts/Properties/Resources.resx @@ -27,34 +27,34 @@ Accounts - File + _File - New + _New - Open + _Open - Save + _Save - Close + _Close - Exit + _Exit - Edit + _Edit - Duplicate... + _Duplicate... - New + _New - Open + _Open Transaction @@ -87,16 +87,16 @@ Checked - Save + _Save - Cancel + _Cancel - Delete + _Delete - Go to the current month + Go to the current month (Ctrl+M) Previous month (Ctrl+Shift+Tab) @@ -114,13 +114,13 @@ Cut - Copy + _Copy Paste - Help + _Help About @@ -135,10 +135,10 @@ Delete transaction - Add + _Add - Add a transaction + Add a transaction (Ctrl+T) Credit: @@ -210,7 +210,7 @@ Account file - Archive + A_rchive Create a backup of the account file @@ -241,4 +241,10 @@ https://github.com/GaelGirodon/accounts Transaction amount is invalid + + Create a new account (Ctrl+N) + + + Open an account file (Ctrl+O) + diff --git a/Accounts/Windows/MainWindow.xaml b/Accounts/Windows/MainWindow.xaml index 13eeb2c..3d77b57 100644 --- a/Accounts/Windows/MainWindow.xaml +++ b/Accounts/Windows/MainWindow.xaml @@ -28,6 +28,8 @@ CanExecute="CloseCommand_OnCanExecute" Executed="CloseCommand_OnExecuted" /> + + @@ -107,7 +111,7 @@ @@ -264,25 +268,25 @@ - - - @@ -290,11 +294,11 @@ @@ -305,17 +309,19 @@ Margin="0, 32" HorizontalAlignment="Center" Foreground="White" /> - - diff --git a/Accounts/Windows/MainWindow.xaml.cs b/Accounts/Windows/MainWindow.xaml.cs index 63d44bd..a28d25e 100644 --- a/Accounts/Windows/MainWindow.xaml.cs +++ b/Accounts/Windows/MainWindow.xaml.cs @@ -302,10 +302,15 @@ private void NextYearCommand_OnExecuted(object sender, ExecutedRoutedEventArgs e _vm.UpdateTransactionsView(); } + private void CurrentMonthCommand_OnCanExecute(object sender, CanExecuteRoutedEventArgs e) + { + e.CanExecute = _vm.HasAccount; + } + /// /// Navigate to the current month. /// - private void CurrentButton_OnClick(object sender, RoutedEventArgs e) + private void CurrentMonthCommand_OnExecuted(object sender, ExecutedRoutedEventArgs e) { _vm.DateFilter = DateTime.Today; _vm.UpdateTransactionsView(); @@ -363,10 +368,15 @@ private void TransactionsListView_OnSelectionChanged(object sender, SelectionCha _vm.IsChecked = _vm.Transaction.IsChecked; } + private void AddTransactionCommand_OnCanExecute(object sender, CanExecuteRoutedEventArgs e) + { + e.CanExecute = _vm.HasAccount && _vm.Transaction == null; + } + /// /// Initialize the form with default values for a new transaction. /// - private void AddButton_OnClick(object sender, RoutedEventArgs e) + private void AddTransactionCommand_OnExecuted(object sender, ExecutedRoutedEventArgs e) { _vm.Transaction = new Transaction(); _vm.Name = _vm.Transaction.Name; @@ -455,7 +465,11 @@ public static class MainWindowCommands public static readonly RoutedUICommand Archive = new( Resources.Menu_File_Archive, Resources.Menu_File_Archive, - typeof(MainWindowCommands)); + typeof(MainWindowCommands), + new InputGestureCollection + { + new KeyGesture(Key.B, ModifierKeys.Control) + }); /// /// Close the current account file. @@ -481,6 +495,18 @@ public static class MainWindowCommands new KeyGesture(Key.D, ModifierKeys.Control) }); + /// + /// Initialize the form with default values for a new transaction. + /// + public static readonly RoutedUICommand AddTransaction = new( + Resources.Transaction_Form_Add, + Resources.Transaction_Form_Add_Description, + typeof(MainWindowCommands), + new InputGestureCollection + { + new KeyGesture(Key.T, ModifierKeys.Control) + }); + /// /// Navigate to the previous year. /// @@ -520,5 +546,17 @@ public static class MainWindowCommands Resources.Navigation_Year_Next, Resources.Navigation_Year_Next, typeof(MainWindowCommands)); + + /// + /// Navigate to the current month. + /// + public static readonly RoutedUICommand CurrentMonth = new( + Resources.Navigation_Current, + Resources.Navigation_Current, + typeof(MainWindowCommands), + new InputGestureCollection + { + new KeyGesture(Key.M, ModifierKeys.Control) + }); } }