minor tweaks to remove hooks

This commit is contained in:
Akash Mozumdar 2019-06-10 22:47:58 -04:00
parent 64eee8f049
commit fefa08c519
2 changed files with 5 additions and 2 deletions

View File

@ -40,6 +40,7 @@ extern const char* HOOK_SEARCH_FILTER;
extern const char* START_HOOK_SEARCH; extern const char* START_HOOK_SEARCH;
extern const char* SAVE_SEARCH_RESULTS; extern const char* SAVE_SEARCH_RESULTS;
extern const char* TEXT_FILES; extern const char* TEXT_FILES;
extern const char* DOUBLE_CLICK_TO_REMOVE_HOOK;
extern const char* SAVE_SETTINGS; extern const char* SAVE_SETTINGS;
extern const char* USE_JP_LOCALE; extern const char* USE_JP_LOCALE;
extern const char* FILTER_REPETITION; extern const char* FILTER_REPETITION;
@ -323,8 +324,9 @@ void MainWindow::RemoveHooks()
if (tp.processId == GetSelectedProcessId()) hooks[tp.addr] = Host::GetHookParam(tp); if (tp.processId == GetSelectedProcessId()) hooks[tp.addr] = Host::GetHookParam(tp);
} }
auto hookList = new QListWidget(this); auto hookList = new QListWidget(this);
hookList->setWindowFlag(Qt::Window, true); hookList->setWindowFlags(Qt::Window | Qt::WindowCloseButtonHint);
hookList->setWindowTitle(REMOVE_HOOKS); hookList->setMinimumSize({ 300, 50 });
hookList->setWindowTitle(DOUBLE_CLICK_TO_REMOVE_HOOK);
for (auto[address, hp] : hooks) for (auto[address, hp] : hooks)
new QListWidgetItem(QString(hp.name) + "@" + QString::number(address, 16), hookList); new QListWidgetItem(QString(hp.name) + "@" + QString::number(address, 16), hookList);
connect(hookList, &QListWidget::itemDoubleClicked, [processId, hookList](QListWidgetItem* item) connect(hookList, &QListWidget::itemDoubleClicked, [processId, hookList](QListWidgetItem* item)

View File

@ -61,6 +61,7 @@ const char* HOOK_SEARCH_FILTER = u8"Results must match this regex";
const char* START_HOOK_SEARCH = u8"Start hook search"; const char* START_HOOK_SEARCH = u8"Start hook search";
const char* SAVE_SEARCH_RESULTS = u8"Save search results"; const char* SAVE_SEARCH_RESULTS = u8"Save search results";
const char* TEXT_FILES = u8"Text (*.txt)"; const char* TEXT_FILES = u8"Text (*.txt)";
const char* DOUBLE_CLICK_TO_REMOVE_HOOK = u8"Double click a hook to remove it";
const char* FILTER_REPETITION = u8"Repetition Filter"; const char* FILTER_REPETITION = u8"Repetition Filter";
const char* DEFAULT_CODEPAGE = u8"Default Codepage"; const char* DEFAULT_CODEPAGE = u8"Default Codepage";
const char* FLUSH_DELAY = u8"Flush Delay"; const char* FLUSH_DELAY = u8"Flush Delay";