Make "OK" and "Cancel" in PromptScreen translatable, and shorten some keys.

This commit is contained in:
wuspring 2013-09-03 18:42:12 +08:00 committed by wuspring
parent 361a6eaf63
commit 5655ddc835
3 changed files with 14 additions and 11 deletions

View File

@ -226,22 +226,22 @@ bool LoadFile(std::string &filename, std::string *error_string) {
case FILETYPE_ARCHIVE_RAR:
#ifdef WIN32
*error_string = "File is compressed (RAR).\nPlease decompress first (try WinRAR)";
*error_string = "RAR file detected (Require WINRAR)";
#else
*error_string = "File is compressed (RAR).\nPlease decompress first (try UnRAR)";
*error_string = "RAR file detected (Require UnRAR)";
#endif
break;
case FILETYPE_ARCHIVE_ZIP:
#ifdef WIN32
*error_string = "File is compressed (ZIP).\nPlease decompress first (try WinRAR)";
*error_string = "ZIP file detected (Require WINRAR)";
#else
*error_string = "File is compressed (ZIP).\nPlease decompress first (try UnRAR)";
*error_string = "ZIP file detected (Require UnRAR)";
#endif
break;
case FILETYPE_ISO_MODE2:
*error_string = "File is a MODE2 image. Are you trying to open a PSX game?";
*error_string = "PSX game image deteced.";
break;
case FILETYPE_NORMAL_DIRECTORY:

View File

@ -139,6 +139,13 @@ void UIDialogScreenWithBackground::DrawBackground(UIContext &dc) {
dc.Flush();
}
PromptScreen::PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText, std::function<void(bool)> callback)
: message_(message), callback_(callback) {
I18NCategory *d = GetI18NCategory("Dialog");
yesButtonText_ = d->T(yesButtonText.c_str());
noButtonText_ = d->T(noButtonText.c_str());
}
void PromptScreen::CreateViews() {
// Information in the top left.
// Back button to the bottom left.

View File

@ -43,12 +43,8 @@ protected:
class PromptScreen : public UIDialogScreenWithBackground {
public:
PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText)
: message_(message), yesButtonText_(yesButtonText), noButtonText_(noButtonText) {
callback_ = &NoOpVoidBool;
}
PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText, std::function<void(bool)> callback)
: message_(message), yesButtonText_(yesButtonText), noButtonText_(noButtonText), callback_(callback) {}
PromptScreen(std::string message, std::string yesButtonText, std::string noButtonText,
std::function<void(bool)> callback = &NoOpVoidBool);
virtual void CreateViews();