yuzu/software_keyboard: Remove unnecessary GetStatus() member function
Like with the profile selection dialog, we can just use the result of QDialog's exec() function to determine whether or not a dialog was accepted.
This commit is contained in:
parent
802dd3cc95
commit
cfc9d92b38
|
@ -104,13 +104,11 @@ QtSoftwareKeyboardDialog::QtSoftwareKeyboardDialog(
|
||||||
QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default;
|
QtSoftwareKeyboardDialog::~QtSoftwareKeyboardDialog() = default;
|
||||||
|
|
||||||
void QtSoftwareKeyboardDialog::accept() {
|
void QtSoftwareKeyboardDialog::accept() {
|
||||||
ok = true;
|
|
||||||
text = line_edit->text().toStdU16String();
|
text = line_edit->text().toStdU16String();
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtSoftwareKeyboardDialog::reject() {
|
void QtSoftwareKeyboardDialog::reject() {
|
||||||
ok = false;
|
|
||||||
text.clear();
|
text.clear();
|
||||||
QDialog::reject();
|
QDialog::reject();
|
||||||
}
|
}
|
||||||
|
@ -119,10 +117,6 @@ std::u16string QtSoftwareKeyboardDialog::GetText() const {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtSoftwareKeyboardDialog::GetStatus() const {
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
QtSoftwareKeyboard::QtSoftwareKeyboard(GMainWindow& main_window) {
|
QtSoftwareKeyboard::QtSoftwareKeyboard(GMainWindow& main_window) {
|
||||||
connect(this, &QtSoftwareKeyboard::MainWindowGetText, &main_window,
|
connect(this, &QtSoftwareKeyboard::MainWindowGetText, &main_window,
|
||||||
&GMainWindow::SoftwareKeyboardGetText, Qt::QueuedConnection);
|
&GMainWindow::SoftwareKeyboardGetText, Qt::QueuedConnection);
|
||||||
|
|
|
@ -36,10 +36,8 @@ public:
|
||||||
void reject() override;
|
void reject() override;
|
||||||
|
|
||||||
std::u16string GetText() const;
|
std::u16string GetText() const;
|
||||||
bool GetStatus() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool ok = false;
|
|
||||||
std::u16string text;
|
std::u16string text;
|
||||||
|
|
||||||
QDialogButtonBox* buttons;
|
QDialogButtonBox* buttons;
|
||||||
|
|
|
@ -259,9 +259,8 @@ void GMainWindow::SoftwareKeyboardGetText(
|
||||||
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
|
dialog.setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint |
|
||||||
Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
|
Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint);
|
||||||
dialog.setWindowModality(Qt::WindowModal);
|
dialog.setWindowModality(Qt::WindowModal);
|
||||||
dialog.exec();
|
|
||||||
|
|
||||||
if (!dialog.GetStatus()) {
|
if (dialog.exec() == QDialog::Rejected) {
|
||||||
emit SoftwareKeyboardFinishedText(std::nullopt);
|
emit SoftwareKeyboardFinishedText(std::nullopt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue