summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-11-24 03:09:18 +0100
committerGitHub <noreply@github.com>2018-11-24 03:09:18 +0100
commitd57e00801d26bc47a2b20ff7e102da941bdb7f75 (patch)
tree4084075160df023cecf099a00586a666d98a3291
parentMerge pull request #1770 from DarkLordZach/applet-stub (diff)
parentyuzu/applets/software_keyboard: Override accept() and reject() instead of providing own differently named member functions (diff)
downloadyuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.tar
yuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.tar.gz
yuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.tar.bz2
yuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.tar.lz
yuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.tar.xz
yuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.tar.zst
yuzu-d57e00801d26bc47a2b20ff7e102da941bdb7f75.zip
-rw-r--r--src/yuzu/applets/software_keyboard.cpp16
-rw-r--r--src/yuzu/applets/software_keyboard.h7
2 files changed, 11 insertions, 12 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index efefb1f99..8a26fdff1 100644
--- a/src/yuzu/applets/software_keyboard.cpp
+++ b/src/yuzu/applets/software_keyboard.cpp
@@ -82,8 +82,8 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
: QString::fromStdU16String(parameters.submit_text),
QDialogButtonBox::AcceptRole);
- connect(buttons, &QDialogButtonBox::accepted, this, &QtSoftwareKeyboardDialog::Submit);
- connect(buttons, &QDialogButtonBox::rejected, this, &QtSoftwareKeyboardDialog::Reject);
+ connect(buttons, &QDialogButtonBox::accepted, this, &QtSoftwareKeyboardDialog::accept);
+ connect(buttons, &QDialogButtonBox::rejected, this, &QtSoftwareKeyboardDialog::reject);
layout->addWidget(header_label);
layout->addWidget(sub_label);
layout->addWidget(guide_label);
@@ -96,16 +96,16 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default;
-void QtSoftwareKeyboardDialog::Submit() {
+void QtSoftwareKeyboardDialog::accept() {
ok = true;
text = line_edit->text().toStdU16String();
- accept();
+ QDialog::accept();
}
-void QtSoftwareKeyboardDialog::Reject() {
+void QtSoftwareKeyboardDialog::reject() {
ok = false;
text.clear();
- accept();
+ QDialog::reject();
}
std::u16string QtSoftwareKeyboardDialog::GetText() const {
@@ -129,13 +129,13 @@ QtSoftwareKeyboard::~QtSoftwareKeyboard() = default;
void QtSoftwareKeyboard::RequestText(std::function<void(std::optional<std::u16string>)> out,
Core::Frontend::SoftwareKeyboardParameters parameters) const {
- text_output = out;
+ text_output = std::move(out);
emit MainWindowGetText(parameters);
}
void QtSoftwareKeyboard::SendTextCheckDialog(std::u16string error_message,
std::function<void()> finished_check) const {
- this->finished_check = finished_check;
+ this->finished_check = std::move(finished_check);
emit MainWindowTextCheckDialog(error_message);
}
diff --git a/src/yuzu/applets/software_keyboard.h b/src/yuzu/applets/software_keyboard.h
index 73f56714f..c63720ba4 100644
--- a/src/yuzu/applets/software_keyboard.h
+++ b/src/yuzu/applets/software_keyboard.h
@@ -33,8 +33,8 @@ public:
Core::Frontend::SoftwareKeyboardParameters parameters);
~QtSoftwareKeyboardDialog() override;
- void Submit();
- void Reject();
+ void accept() override;
+ void reject() override;
std::u16string GetText() const;
bool GetStatus() const;
@@ -70,11 +70,10 @@ signals:
void MainWindowGetText(Core::Frontend::SoftwareKeyboardParameters parameters) const;
void MainWindowTextCheckDialog(std::u16string error_message) const;
-public slots:
+private:
void MainWindowFinishedText(std::optional<std::u16string> text);
void MainWindowFinishedCheckDialog();
-private:
mutable std::function<void(std::optional<std::u16string>)> text_output;
mutable std::function<void()> finished_check;
};