Added Yes/No dialog box, and used it for the 'allow STK to connect

to internet' question.
This commit is contained in:
hiker 2014-10-22 09:15:42 +11:00
parent c012e98f9b
commit 69c155063a
3 changed files with 10 additions and 2 deletions

View File

@ -1156,7 +1156,7 @@ void askForInternetPermission()
"at a later time, go to options, select tab " "at a later time, go to options, select tab "
"'User Interface', and edit \"Allow STK to connect to the " "'User Interface', and edit \"Allow STK to connect to the "
"Internet\" and \"Allow STK to send anonymous HW statistics\")."), "Internet\" and \"Allow STK to send anonymous HW statistics\")."),
MessageDialog::MESSAGE_DIALOG_CONFIRM, MessageDialog::MESSAGE_DIALOG_YESNO,
new ConfirmServer(), true); new ConfirmServer(), true);
} }

View File

@ -95,6 +95,14 @@ void MessageDialog::doInit(MessageDialogType type,
cancelbtn->setText(_("OK")); cancelbtn->setText(_("OK"));
cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER); cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
} }
else if (type == MessageDialog::MESSAGE_DIALOG_YESNO)
{
ButtonWidget* yesbtn = getWidget<ButtonWidget>("confirm");
ButtonWidget* cancelbtn = getWidget<ButtonWidget>("cancel");
cancelbtn->setText(_("No"));
}
else if (type == MessageDialog::MESSAGE_DIALOG_OK_CANCEL) else if (type == MessageDialog::MESSAGE_DIALOG_OK_CANCEL)
{ {
// In case of a OK_CANCEL dialog, change the text from 'Yes' to 'Ok' // In case of a OK_CANCEL dialog, change the text from 'Yes' to 'Ok'

View File

@ -62,7 +62,7 @@ public:
}; };
enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM, enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM,
MESSAGE_DIALOG_OK_CANCEL }; MESSAGE_DIALOG_OK_CANCEL, MESSAGE_DIALOG_YESNO };
private: private: