mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-23 05:16:11 +00:00
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:
parent
1955288058
commit
013bdba902
@ -404,7 +404,7 @@ void DecompilerContextMenu::actionRenameThingHereTriggered()
|
|||||||
Core()->createFunctionAt(func_addr, function_name);
|
Core()->createFunctionAt(func_addr, function_name);
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
tr("Function name:"), QLineEdit::Normal, currentName, &ok);
|
||||||
if (ok && !newName.isEmpty()) {
|
if (ok && !newName.isEmpty()) {
|
||||||
Core()->renameFunction(func_addr, newName);
|
Core()->renameFunction(func_addr, newName);
|
||||||
|
@ -819,7 +819,7 @@ void DisassemblyContextMenu::on_actionRename_triggered()
|
|||||||
|
|
||||||
if (fcn) {
|
if (fcn) {
|
||||||
// Renaming a function
|
// 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);
|
tr("Function name:"), QLineEdit::Normal, fcn->name, &ok);
|
||||||
if (ok && !newName.isEmpty()) {
|
if (ok && !newName.isEmpty()) {
|
||||||
Core()->renameFunction(fcn->addr, newName);
|
Core()->renameFunction(fcn->addr, newName);
|
||||||
|
Loading…
Reference in New Issue
Block a user