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)
This commit is contained in:
sagcan 2020-08-28 20:06:52 +02:00 committed by GitHub
parent 1955288058
commit 013bdba902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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);