Clarified Yes/No buttons in Merge question dialog

This commit is contained in:
Philipp Crocoll 2013-07-17 16:26:12 +02:00
parent ed7a85dde7
commit 5699216c00
9 changed files with 81 additions and 31 deletions

View File

@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.

View File

@ -50,6 +50,16 @@ namespace keepass2android
EventHandler<DialogClickEventArgs> yesHandler,
EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> cancelHandler,
Context ctx);
/// <summary>
/// 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.
/// </summary>
void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey,
UiStringKey yesString, UiStringKey noString,
EventHandler<DialogClickEventArgs> yesHandler,
EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> cancelHandler,
Context ctx);
/// <summary>

View File

@ -30,6 +30,10 @@ namespace keepass2android
CheckingTargetFileForChanges,
TitleSyncQuestion,
MessageSyncQuestion,
SynchronizingDatabase
SynchronizingDatabase,
yes,
no,
YesSynchronize,
NoOverwrite
}
}

View File

@ -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) =>
{

View File

@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.

View File

@ -59,8 +59,23 @@ namespace Kp2aUnitTests
public UiStringKey? LastYesNoCancelQuestionTitle { get; set; }
public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey, EventHandler<DialogClickEventArgs> yesHandler, EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> cancelHandler, Context ctx)
public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey,
EventHandler<DialogClickEventArgs> yesHandler,
EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> 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<DialogClickEventArgs> yesHandler,
EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> cancelHandler,
Context ctx)
{
LastYesNoCancelQuestionTitle = titleKey;
switch (_yesNoCancelResult)

View File

@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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;

View File

@ -258,6 +258,8 @@
<string name="TitleSyncQuestion">Merge changes?</string>
<string name="MessageSyncQuestion">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.</string>
<string name="SynchronizingDatabase">Merging changes…</string>
<string name="YesSynchronize">Yes, merge</string>
<string name="NoOverwrite">No, overwrite</string>
<string name="ChangeLog_title">Change log</string>
<string name="ChangeLog_0_8_4">

View File

@ -159,8 +159,19 @@ namespace keepass2android
return Application.Context.GetString((int)field.GetValue(null));
}
public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey,
EventHandler<DialogClickEventArgs> yesHandler,
EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> cancelHandler,
Context ctx)
{
AskYesNoCancel(titleKey, messageKey, UiStringKey.yes, UiStringKey.no,
yesHandler, noHandler, cancelHandler, ctx);
}
public void AskYesNoCancel(UiStringKey titleKey, UiStringKey messageKey,
EventHandler<DialogClickEventArgs> yesHandler,
UiStringKey yesString, UiStringKey noString,
EventHandler<DialogClickEventArgs> yesHandler,
EventHandler<DialogClickEventArgs> noHandler,
EventHandler<DialogClickEventArgs> 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);