From 013bdba902090e67db44c6278dd1752521f9afc8 Mon Sep 17 00:00:00 2001 From: sagcan Date: Fri, 28 Aug 2020 20:06:52 +0200 Subject: [PATCH] Center 'Rename Function' dialog for Disassembly and Decompiler view (#2408) Previously the 'Rename Function' dialog would pop-up in the top left corner if triggered inside the Disassembly or Decompiler view. This commit changes the behaviour so that the Dialog will now be pop-up in the center of the MainWindow by simply replacing the 'parent' pointer of the QInputDialog object with that of the mainWindow (this->mainWindow) --- src/menus/DecompilerContextMenu.cpp | 2 +- src/menus/DisassemblyContextMenu.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/menus/DecompilerContextMenu.cpp b/src/menus/DecompilerContextMenu.cpp index 4251e5b3..206ca4b2 100644 --- a/src/menus/DecompilerContextMenu.cpp +++ b/src/menus/DecompilerContextMenu.cpp @@ -404,7 +404,7 @@ void DecompilerContextMenu::actionRenameThingHereTriggered() Core()->createFunctionAt(func_addr, function_name); } } else { - QString newName = QInputDialog::getText(this, tr("Rename function %2").arg(currentName), + QString newName = QInputDialog::getText(this->mainWindow, tr("Rename function %2").arg(currentName), tr("Function name:"), QLineEdit::Normal, currentName, &ok); if (ok && !newName.isEmpty()) { Core()->renameFunction(func_addr, newName); diff --git a/src/menus/DisassemblyContextMenu.cpp b/src/menus/DisassemblyContextMenu.cpp index d9ea3e5d..f5fc4da3 100644 --- a/src/menus/DisassemblyContextMenu.cpp +++ b/src/menus/DisassemblyContextMenu.cpp @@ -819,7 +819,7 @@ void DisassemblyContextMenu::on_actionRename_triggered() if (fcn) { // Renaming a function - QString newName = QInputDialog::getText(this, tr("Rename function %2").arg(fcn->name), + QString newName = QInputDialog::getText(this->mainWindow, tr("Rename function %2").arg(fcn->name), tr("Function name:"), QLineEdit::Normal, fcn->name, &ok); if (ok && !newName.isEmpty()) { Core()->renameFunction(fcn->addr, newName);