mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-23 05:16:11 +00:00
27 lines
820 B
C++
27 lines
820 B
C++
|
#include "MemoryDockWidget.h"
|
||
|
|
||
|
#include <QAction>
|
||
|
|
||
|
MemoryDockWidget::MemoryDockWidget(CutterCore::MemoryWidgetType type, MainWindow *parent, QAction *action)
|
||
|
: CutterDockWidget(parent, action)
|
||
|
, mType(type)
|
||
|
{
|
||
|
connect(Core(), &CutterCore::raisePrioritizedMemoryWidget, this, &MemoryDockWidget::handleRaiseMemoryWidget);
|
||
|
}
|
||
|
|
||
|
void MemoryDockWidget::handleRaiseMemoryWidget(CutterCore::MemoryWidgetType raiseType)
|
||
|
{
|
||
|
bool raisingEmptyGraph = (raiseType == CutterCore::MemoryWidgetType::Graph && Core()->isGraphEmpty());
|
||
|
if (raisingEmptyGraph) {
|
||
|
raiseType = CutterCore::MemoryWidgetType::Disassembly;
|
||
|
}
|
||
|
|
||
|
if (raiseType == mType) {
|
||
|
getBoundAction()->setChecked(true);
|
||
|
|
||
|
show();
|
||
|
raise();
|
||
|
widgetToFocusOnRaise()->setFocus(Qt::FocusReason::TabFocusReason);
|
||
|
}
|
||
|
}
|