@@ -314,8 +314,7 @@ void DisassemblyContextMenu::addDebugMenu()
314
314
QVector<DisassemblyContextMenu::ThingUsedHere> DisassemblyContextMenu::getThingUsedHere (RVA offset)
315
315
{
316
316
RzCoreLocked core (Core ());
317
- auto p = fromOwned (
318
- rz_core_analysis_name (core, offset), rz_core_analysis_name_free);
317
+ auto p = fromOwned (rz_core_analysis_name (core, offset), rz_core_analysis_name_free);
319
318
if (!p) {
320
319
return {};
321
320
}
@@ -799,7 +798,6 @@ void DisassemblyContextMenu::on_actionAddComment_triggered()
799
798
800
799
void DisassemblyContextMenu::on_actionAnalyzeFunction_triggered ()
801
800
{
802
- bool ok;
803
801
RVA flagOffset;
804
802
QString name = Core ()->nearestFlag (offset, &flagOffset);
805
803
if (name.isEmpty () || flagOffset != offset) {
@@ -812,12 +810,20 @@ void DisassemblyContextMenu::on_actionAnalyzeFunction_triggered()
812
810
}
813
811
814
812
// Create dialog
815
- QString functionName =
816
- QInputDialog::getText (this , tr (" New function at %1" ).arg (RzAddressString (offset)),
817
- tr (" Function name:" ), QLineEdit::Normal, name, &ok);
813
+ QInputDialog inputDialog (this ->mainWindow );
814
+ inputDialog.resize (500 , 100 );
815
+ inputDialog.setWindowTitle (tr (" New function at %1" ).arg (RzAddressString (offset)));
816
+ inputDialog.setLabelText (tr (" Function name:" ));
817
+ inputDialog.setTextValue (name);
818
+ inputDialog.setWindowFlags (Qt::Window | Qt::WindowMinimizeButtonHint);
819
+
820
+ if (inputDialog.exec () != QDialog::Accepted) {
821
+ return ;
822
+ }
823
+
824
+ QString functionName = inputDialog.textValue ().trimmed ();
818
825
819
- // If user accepted
820
- if (ok && !functionName.isEmpty ()) {
826
+ if (!functionName.isEmpty ()) {
821
827
Core ()->createFunctionAt (offset, functionName);
822
828
}
823
829
}
0 commit comments