diff --git a/src/KeePassLib2Android/Resources/Resource.designer.cs b/src/KeePassLib2Android/Resources/Resource.designer.cs index 367aacf9..e83a1334 100644 --- a/src/KeePassLib2Android/Resources/Resource.designer.cs +++ b/src/KeePassLib2Android/Resources/Resource.designer.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.18046 +// Laufzeitversion:4.0.30319.18051 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. diff --git a/src/Kp2aBusinessLogic/IKp2aApp.cs b/src/Kp2aBusinessLogic/IKp2aApp.cs index 1951a686..7e6085fc 100644 --- a/src/Kp2aBusinessLogic/IKp2aApp.cs +++ b/src/Kp2aBusinessLogic/IKp2aApp.cs @@ -50,6 +50,16 @@ namespace keepass2android EventHandler yesHandler, EventHandler noHandler, EventHandler cancelHandler, + Context ctx); + + /// + /// Asks the user the question "messageKey" with the options Yes/No/Cancel, but the yes/no strings can be selected freely, calls the handler corresponding to the answer. + /// + void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, + UiStringKey yesString, UiStringKey noString, + EventHandler yesHandler, + EventHandler noHandler, + EventHandler cancelHandler, Context ctx); /// diff --git a/src/Kp2aBusinessLogic/UiStringKey.cs b/src/Kp2aBusinessLogic/UiStringKey.cs index aa026a82..4011f22c 100644 --- a/src/Kp2aBusinessLogic/UiStringKey.cs +++ b/src/Kp2aBusinessLogic/UiStringKey.cs @@ -30,6 +30,10 @@ namespace keepass2android CheckingTargetFileForChanges, TitleSyncQuestion, MessageSyncQuestion, - SynchronizingDatabase + SynchronizingDatabase, + yes, + no, + YesSynchronize, + NoOverwrite } } \ No newline at end of file diff --git a/src/Kp2aBusinessLogic/database/edit/SaveDB.cs b/src/Kp2aBusinessLogic/database/edit/SaveDB.cs index 5798190a..f7d9fb7b 100644 --- a/src/Kp2aBusinessLogic/database/edit/SaveDB.cs +++ b/src/Kp2aBusinessLogic/database/edit/SaveDB.cs @@ -78,7 +78,9 @@ namespace keepass2android { //ask user... - _app.AskYesNoCancel(UiStringKey.TitleSyncQuestion, UiStringKey.MessageSyncQuestion, + _app.AskYesNoCancel(UiStringKey.TitleSyncQuestion, UiStringKey.MessageSyncQuestion, + UiStringKey.YesSynchronize, + UiStringKey.NoOverwrite, //yes = sync (sender, args) => { diff --git a/src/Kp2aUnitTests/Resources/Resource.Designer.cs b/src/Kp2aUnitTests/Resources/Resource.Designer.cs index 4c9de774..39c76447 100644 --- a/src/Kp2aUnitTests/Resources/Resource.Designer.cs +++ b/src/Kp2aUnitTests/Resources/Resource.Designer.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.18046 +// Laufzeitversion:4.0.30319.18051 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. diff --git a/src/Kp2aUnitTests/TestKp2aApp.cs b/src/Kp2aUnitTests/TestKp2aApp.cs index 365a9355..1b1caaaa 100644 --- a/src/Kp2aUnitTests/TestKp2aApp.cs +++ b/src/Kp2aUnitTests/TestKp2aApp.cs @@ -59,8 +59,23 @@ namespace Kp2aUnitTests public UiStringKey? LastYesNoCancelQuestionTitle { get; set; } - public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, EventHandler yesHandler, EventHandler noHandler, - EventHandler cancelHandler, Context ctx) + + public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, + EventHandler yesHandler, + EventHandler noHandler, + EventHandler cancelHandler, + Context ctx) + { + AskYesNoCancel(titleKey, messageKey, UiStringKey.yes, UiStringKey.no, + yesHandler, noHandler, cancelHandler, ctx); + } + + public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, + UiStringKey yesString, UiStringKey noString, + EventHandler yesHandler, + EventHandler noHandler, + EventHandler cancelHandler, + Context ctx) { LastYesNoCancelQuestionTitle = titleKey; switch (_yesNoCancelResult) diff --git a/src/keepass2android/Resources/Resource.designer.cs b/src/keepass2android/Resources/Resource.designer.cs index 9b3b0fdb..03a1535a 100644 --- a/src/keepass2android/Resources/Resource.designer.cs +++ b/src/keepass2android/Resources/Resource.designer.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.18046 +// Laufzeitversion:4.0.30319.18051 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. @@ -1296,32 +1296,32 @@ namespace keepass2android // aapt resource value: 0x7f0800f7 public const int BinaryDirectory_title = 2131230967; - // aapt resource value: 0x7f080138 - public const int ChangeLog = 2131231032; + // aapt resource value: 0x7f08013a + public const int ChangeLog = 2131231034; + + // aapt resource value: 0x7f080139 + public const int ChangeLog_0_7 = 2131231033; // aapt resource value: 0x7f080137 - public const int ChangeLog_0_7 = 2131231031; - - // aapt resource value: 0x7f080135 - public const int ChangeLog_0_8 = 2131231029; - - // aapt resource value: 0x7f080134 - public const int ChangeLog_0_8_1 = 2131231028; - - // aapt resource value: 0x7f080133 - public const int ChangeLog_0_8_2 = 2131231027; - - // aapt resource value: 0x7f080132 - public const int ChangeLog_0_8_3 = 2131231026; - - // aapt resource value: 0x7f080131 - public const int ChangeLog_0_8_4 = 2131231025; + public const int ChangeLog_0_8 = 2131231031; // aapt resource value: 0x7f080136 - public const int ChangeLog_keptDonate = 2131231030; + public const int ChangeLog_0_8_1 = 2131231030; - // aapt resource value: 0x7f080130 - public const int ChangeLog_title = 2131231024; + // aapt resource value: 0x7f080135 + public const int ChangeLog_0_8_2 = 2131231029; + + // aapt resource value: 0x7f080134 + public const int ChangeLog_0_8_3 = 2131231028; + + // aapt resource value: 0x7f080133 + public const int ChangeLog_0_8_4 = 2131231027; + + // aapt resource value: 0x7f080138 + public const int ChangeLog_keptDonate = 2131231032; + + // aapt resource value: 0x7f080132 + public const int ChangeLog_title = 2131231026; // aapt resource value: 0x7f080029 public const int CheckForFileChangesOnSave_key = 2131230761; @@ -1371,6 +1371,9 @@ namespace keepass2android // aapt resource value: 0x7f08012e public const int MessageSyncQuestion = 2131231022; + // aapt resource value: 0x7f080131 + public const int NoOverwrite = 2131231025; + // aapt resource value: 0x7f08002f public const int OpenKp2aKeyboardAutomatically_key = 2131230767; @@ -1503,6 +1506,9 @@ namespace keepass2android // aapt resource value: 0x7f08002e public const int UseKp2aKeyboard_key = 2131230766; + // aapt resource value: 0x7f080130 + public const int YesSynchronize = 2131231024; + // aapt resource value: 0x7f080032 public const int about_feedback = 2131230770; diff --git a/src/keepass2android/Resources/values/strings.xml b/src/keepass2android/Resources/values/strings.xml index 0d99abb6..ecc668e2 100644 --- a/src/keepass2android/Resources/values/strings.xml +++ b/src/keepass2android/Resources/values/strings.xml @@ -258,6 +258,8 @@ Merge changes? The database file was modified externally. Do you want to load and merge the changes before saving? Select No if you want to overwrite the external changes. Merging changes… + Yes, merge + No, overwrite Change log diff --git a/src/keepass2android/app/App.cs b/src/keepass2android/app/App.cs index d4fe0ff0..6b21c57a 100644 --- a/src/keepass2android/app/App.cs +++ b/src/keepass2android/app/App.cs @@ -159,8 +159,19 @@ namespace keepass2android return Application.Context.GetString((int)field.GetValue(null)); } + public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, + EventHandler yesHandler, + EventHandler noHandler, + EventHandler cancelHandler, + Context ctx) + { + AskYesNoCancel(titleKey, messageKey, UiStringKey.yes, UiStringKey.no, + yesHandler, noHandler, cancelHandler, ctx); + } + public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, - EventHandler yesHandler, + UiStringKey yesString, UiStringKey noString, + EventHandler yesHandler, EventHandler noHandler, EventHandler cancelHandler, Context ctx) @@ -173,9 +184,9 @@ namespace keepass2android builder.SetMessage(GetResourceString(messageKey)); - builder.SetPositiveButton(Resource.String.yes, yesHandler); + builder.SetPositiveButton(GetResourceString(yesString), yesHandler); - builder.SetNegativeButton(Resource.String.no, noHandler); + builder.SetNegativeButton(GetResourceString(noString), noHandler); builder.SetNeutralButton(ctx.GetString(Android.Resource.String.Cancel), cancelHandler);