diff --git a/src/core/MainWindow.cpp b/src/core/MainWindow.cpp index 7b012f7d..1fca03db 100644 --- a/src/core/MainWindow.cpp +++ b/src/core/MainWindow.cpp @@ -157,6 +157,8 @@ void MainWindow::initUI() widgetTypeToConstructorMap.insert(DisassemblyWidget::getWidgetType(), getNewInstance); widgetTypeToConstructorMap.insert(HexdumpWidget::getWidgetType(), getNewInstance); + widgetTypeToConstructorMap.insert(DecompilerWidget::getWidgetType(), + getNewInstance); initToolBar(); initDocks(); @@ -654,7 +656,12 @@ void MainWindow::finalizeOpen() auto disasmWidget = qobject_cast(dockWidget); if (disasmWidget && dockWidget->isVisibleToUser()) { disasmWidget->raiseMemoryWidget(); - // continue looping in case there is a graph wiget + // continue looping in case there is a graph widget + } + auto decompilerWidget = qobject_cast(dockWidget); + if (decompilerWidget && dockWidget->isVisibleToUser()) { + decompilerWidget->raiseMemoryWidget(); + // continue looping in case there is a graph widget } } } @@ -885,7 +892,8 @@ bool MainWindow::isExtraMemoryWidget(QDockWidget *dock) const { return qobject_cast(dock) || qobject_cast(dock) || - qobject_cast(dock); + qobject_cast(dock) || + qobject_cast(dock); } MemoryWidgetType MainWindow::getMemoryWidgetTypeToRestore() @@ -1341,7 +1349,8 @@ void MainWindow::setViewLayout(const CutterLayout &layout) docksToCreate = QStringList { DisassemblyWidget::getWidgetType(), GraphWidget::getWidgetType(), - HexdumpWidget::getWidgetType() + HexdumpWidget::getWidgetType(), + DecompilerWidget::getWidgetType() }; } else { docksToCreate = layout.viewProperties.keys(); diff --git a/src/widgets/DecompilerWidget.cpp b/src/widgets/DecompilerWidget.cpp index ba4ad758..a40d4f5e 100644 --- a/src/widgets/DecompilerWidget.cpp +++ b/src/widgets/DecompilerWidget.cpp @@ -34,8 +34,8 @@ DecompilerWidget::DecompilerWidget(MainWindow *main) : { ui->setupUi(this); setObjectName(main - ? main->getUniqueObjectName(tr("Decompiler")) - : tr("Decompiler")); + ? main->getUniqueObjectName(getWidgetType()) + : getWidgetType()); updateWindowTitle(); syntaxHighlighter = Config()->createSyntaxHighlighter(ui->textEdit->document()); @@ -108,6 +108,11 @@ DecompilerWidget::DecompilerWidget(MainWindow *main) : DecompilerWidget::~DecompilerWidget() = default; +QString DecompilerWidget::getWidgetType() +{ + return "Decompiler"; +} + Decompiler *DecompilerWidget::getCurrentDecompiler() { return Core()->getDecompilerById(ui->decompilerComboBox->currentData().toString()); diff --git a/src/widgets/DecompilerWidget.h b/src/widgets/DecompilerWidget.h index d1fbf1b4..6181dfd1 100644 --- a/src/widgets/DecompilerWidget.h +++ b/src/widgets/DecompilerWidget.h @@ -27,6 +27,7 @@ protected: public: explicit DecompilerWidget(MainWindow *main); ~DecompilerWidget(); + static QString getWidgetType(); public slots: void showDecompilerContextMenu(const QPoint &pt);