mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-22 12:28:51 +00:00
e5d7bd660a
* Add generic r2 graph. * Add Callgraph widgets * Add more graphviz layouts. * Fix some edge cases in graphGridLayout that were more likely to appear in callgraphs * Refactor the code moving some of the logic out of disassemblyGraphWidget making it more reusable
39 lines
879 B
C++
39 lines
879 B
C++
#include "MemoryDockWidget.h"
|
|
#include "common/CutterSeekable.h"
|
|
#include "MainWindow.h"
|
|
#include <QAction>
|
|
#include <QEvent>
|
|
#include <QMenu>
|
|
#include <QContextMenuEvent>
|
|
|
|
MemoryDockWidget::MemoryDockWidget(MemoryWidgetType type, MainWindow *parent)
|
|
: AddressableDockWidget(parent)
|
|
, mType(type)
|
|
{
|
|
if (parent) {
|
|
parent->addMemoryDockWidget(this);
|
|
}
|
|
}
|
|
|
|
bool MemoryDockWidget::tryRaiseMemoryWidget()
|
|
{
|
|
if (!seekable->isSynchronized()) {
|
|
return false;
|
|
}
|
|
|
|
if (mType == MemoryWidgetType::Graph && Core()->isGraphEmpty()) {
|
|
return false;
|
|
}
|
|
raiseMemoryWidget();
|
|
|
|
return true;
|
|
}
|
|
|
|
bool MemoryDockWidget::eventFilter(QObject *object, QEvent *event)
|
|
{
|
|
if (mainWindow && event->type() == QEvent::FocusIn) {
|
|
mainWindow->setCurrentMemoryWidget(this);
|
|
}
|
|
return CutterDockWidget::eventFilter(object, event);
|
|
}
|