From 43a0bac59f141df84b60748ca07ad2c6b6ba2faa Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 4 Nov 2018 04:31:49 -0500 Subject: [PATCH] remove whats this button on dialogs --- GUI/mainwindow.cpp | 6 +++--- extensions/bingtranslate/bingtranslate.cpp | 9 ++++++++- extensions/googletranslate/googletranslate.cpp | 9 ++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 6376e86..7fc777d 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -179,7 +179,7 @@ void MainWindow::on_attachButton_clicked() QStringList processList(allProcesses.uniqueKeys()); processList.sort(Qt::CaseInsensitive); bool ok; - QString process = QInputDialog::getItem(this, SELECT_PROCESS, INJECT_INFO, processList, 0, true, &ok); + QString process = QInputDialog::getItem(this, SELECT_PROCESS, INJECT_INFO, processList, 0, true, &ok, Qt::WindowCloseButtonHint); if (!ok) return; if (process.toInt(nullptr, 0)) Host::InjectProcess(process.toInt(nullptr, 0)); else for (auto processId : allProcesses.values(process)) Host::InjectProcess(processId); @@ -193,7 +193,7 @@ void MainWindow::on_detachButton_clicked() void MainWindow::on_hookButton_clicked() { bool ok; - QString hookCode = QInputDialog::getText(this, ADD_HOOK, CODE_INFODUMP, QLineEdit::Normal, "", &ok); + QString hookCode = QInputDialog::getText(this, ADD_HOOK, CODE_INFODUMP, QLineEdit::Normal, "", &ok, Qt::WindowCloseButtonHint); if (!ok) return; if (auto hp = ParseCode(hookCode)) Host::InsertHook(GetSelectedProcessId(), hp.value()); else Host::AddConsoleOutput(INVALID_CODE); @@ -211,7 +211,7 @@ void MainWindow::on_unhookButton_clicked() GenerateCode(hook, GetSelectedProcessId()) ); bool ok; - QString hook = QInputDialog::getItem(this, UNHOOK, REMOVE_HOOK, hookList, 0, false, &ok); + QString hook = QInputDialog::getItem(this, UNHOOK, REMOVE_HOOK, hookList, 0, false, &ok, Qt::WindowCloseButtonHint); if (ok) Host::RemoveHook(GetSelectedProcessId(), hooks.at(hookList.indexOf(hook)).insertion_address); } diff --git a/extensions/bingtranslate/bingtranslate.cpp b/extensions/bingtranslate/bingtranslate.cpp index 6135444..fd7d5c7 100644 --- a/extensions/bingtranslate/bingtranslate.cpp +++ b/extensions/bingtranslate/bingtranslate.cpp @@ -66,7 +66,14 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved { QTimer::singleShot(0, [] { - translateTo = QInputDialog::getItem(nullptr, "Select Language", "What language should Bing translate to?", languages, 0, false).split(" ")[1].toStdWString(); + translateTo = QInputDialog::getItem( + nullptr, + "Select Language", + "What language should Bing translate to?", + languages, + 0, false, nullptr, + Qt::WindowCloseButtonHint + ).split(" ")[1].toStdWString(); }); } break; diff --git a/extensions/googletranslate/googletranslate.cpp b/extensions/googletranslate/googletranslate.cpp index 4ac05e5..563d8c5 100644 --- a/extensions/googletranslate/googletranslate.cpp +++ b/extensions/googletranslate/googletranslate.cpp @@ -82,7 +82,14 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved { QTimer::singleShot(0, [] { - translateTo = QInputDialog::getItem(nullptr, "Select Language", "What language should Google translate to?", languages, 0, false).split(" ")[1].toStdWString(); + translateTo = QInputDialog::getItem( + nullptr, + "Select Language", + "What language should Google translate to?", + languages, + 0, false, nullptr, + Qt::WindowCloseButtonHint + ).split(" ")[1].toStdWString(); }); } break;