diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/applets/error.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/applets/software_keyboard.cpp | 21 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/yuzu/applets/error.cpp b/src/yuzu/applets/error.cpp index 97435592e..08ed57355 100644 --- a/src/yuzu/applets/error.cpp +++ b/src/yuzu/applets/error.cpp | |||
| @@ -29,12 +29,13 @@ void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) | |||
| 29 | void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, | 29 | void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, |
| 30 | std::function<void()> finished) const { | 30 | std::function<void()> finished) const { |
| 31 | this->callback = std::move(finished); | 31 | this->callback = std::move(finished); |
| 32 | |||
| 33 | const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count()); | ||
| 32 | emit MainWindowDisplayError( | 34 | emit MainWindowDisplayError( |
| 33 | tr("An error occured on %1 at %2.\nPlease try again or contact the " | 35 | tr("An error occured on %1 at %2.\nPlease try again or contact the " |
| 34 | "developer of the software.\n\nError Code: %3-%4 (0x%5)") | 36 | "developer of the software.\n\nError Code: %3-%4 (0x%5)") |
| 35 | .arg(QDateTime::fromSecsSinceEpoch(time.count()) | 37 | .arg(date_time.toString(QStringLiteral("dddd, MMMM d, yyyy"))) |
| 36 | .toString(QStringLiteral("dddd, MMMM d, yyyy"))) | 38 | .arg(date_time.toString(QStringLiteral("h:mm:ss A"))) |
| 37 | .arg(QDateTime::fromSecsSinceEpoch(time.count()).toString(QStringLiteral("h:mm:ss A"))) | ||
| 38 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) | 39 | .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) |
| 39 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) | 40 | .arg(error.description, 4, 10, QChar::fromLatin1('0')) |
| 40 | .arg(error.raw, 8, 16, QChar::fromLatin1('0'))); | 41 | .arg(error.raw, 8, 16, QChar::fromLatin1('0'))); |
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp index f3eb29b25..4f13e1d75 100644 --- a/src/yuzu/applets/software_keyboard.cpp +++ b/src/yuzu/applets/software_keyboard.cpp | |||
| @@ -18,23 +18,30 @@ QtSoftwareKeyboardValidator::QtSoftwareKeyboardValidator( | |||
| 18 | : parameters(std::move(parameters)) {} | 18 | : parameters(std::move(parameters)) {} |
| 19 | 19 | ||
| 20 | QValidator::State QtSoftwareKeyboardValidator::validate(QString& input, int& pos) const { | 20 | QValidator::State QtSoftwareKeyboardValidator::validate(QString& input, int& pos) const { |
| 21 | if (input.size() > parameters.max_length) | 21 | if (input.size() > parameters.max_length) { |
| 22 | return Invalid; | 22 | return Invalid; |
| 23 | if (parameters.disable_space && input.contains(' ')) | 23 | } |
| 24 | if (parameters.disable_space && input.contains(QLatin1Char{' '})) { | ||
| 24 | return Invalid; | 25 | return Invalid; |
| 25 | if (parameters.disable_address && input.contains('@')) | 26 | } |
| 27 | if (parameters.disable_address && input.contains(QLatin1Char{'@'})) { | ||
| 26 | return Invalid; | 28 | return Invalid; |
| 27 | if (parameters.disable_percent && input.contains('%')) | 29 | } |
| 30 | if (parameters.disable_percent && input.contains(QLatin1Char{'%'})) { | ||
| 28 | return Invalid; | 31 | return Invalid; |
| 29 | if (parameters.disable_slash && (input.contains('/') || input.contains('\\'))) | 32 | } |
| 33 | if (parameters.disable_slash && | ||
| 34 | (input.contains(QLatin1Char{'/'}) || input.contains(QLatin1Char{'\\'}))) { | ||
| 30 | return Invalid; | 35 | return Invalid; |
| 36 | } | ||
| 31 | if (parameters.disable_number && | 37 | if (parameters.disable_number && |
| 32 | std::any_of(input.begin(), input.end(), [](QChar c) { return c.isDigit(); })) { | 38 | std::any_of(input.begin(), input.end(), [](QChar c) { return c.isDigit(); })) { |
| 33 | return Invalid; | 39 | return Invalid; |
| 34 | } | 40 | } |
| 35 | 41 | ||
| 36 | if (parameters.disable_download_code && | 42 | if (parameters.disable_download_code && std::any_of(input.begin(), input.end(), [](QChar c) { |
| 37 | std::any_of(input.begin(), input.end(), [](QChar c) { return c == 'O' || c == 'I'; })) { | 43 | return c == QLatin1Char{'O'} || c == QLatin1Char{'I'}; |
| 44 | })) { | ||
| 38 | return Invalid; | 45 | return Invalid; |
| 39 | } | 46 | } |
| 40 | 47 | ||