mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 08:37:26 +00:00
Fix initial objectName for Memory Widgets
This commit is contained in:
parent
0c3b7e7f07
commit
ede98df6ac
@ -312,7 +312,7 @@ void MainWindow::initDocks()
|
|||||||
vTablesDock = new VTablesWidget(this, ui->actionVTables);
|
vTablesDock = new VTablesWidget(this, ui->actionVTables);
|
||||||
|
|
||||||
QSettings s;
|
QSettings s;
|
||||||
QStringList docks = s.value("docks").toStringList();
|
QStringList docks = s.value("docks", QStringList { GraphWidget::getWidgetType() }).toStringList();
|
||||||
|
|
||||||
// Restore all extra widgets
|
// Restore all extra widgets
|
||||||
QString className;
|
QString className;
|
||||||
@ -373,21 +373,18 @@ void MainWindow::updateTasksIndicator()
|
|||||||
void MainWindow::addExtraGraph()
|
void MainWindow::addExtraGraph()
|
||||||
{
|
{
|
||||||
auto *extraDock = new GraphWidget(this, ui->actionGraph);
|
auto *extraDock = new GraphWidget(this, ui->actionGraph);
|
||||||
extraDock->setObjectName(getUniqueObjectName(extraDock->getWidgetType()));
|
|
||||||
addExtraWidget(extraDock);
|
addExtraWidget(extraDock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addExtraHexdump()
|
void MainWindow::addExtraHexdump()
|
||||||
{
|
{
|
||||||
auto *extraDock = new HexdumpWidget(this, ui->actionHexdump);
|
auto *extraDock = new HexdumpWidget(this, ui->actionHexdump);
|
||||||
extraDock->setObjectName(getUniqueObjectName(extraDock->getWidgetType()));
|
|
||||||
addExtraWidget(extraDock);
|
addExtraWidget(extraDock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addExtraDisassembly()
|
void MainWindow::addExtraDisassembly()
|
||||||
{
|
{
|
||||||
auto *extraDock = new DisassemblyWidget(this, ui->actionDisassembly);
|
auto *extraDock = new DisassemblyWidget(this, ui->actionDisassembly);
|
||||||
extraDock->setObjectName(getUniqueObjectName(extraDock->getWidgetType()));
|
|
||||||
addExtraWidget(extraDock);
|
addExtraWidget(extraDock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -857,14 +854,14 @@ void MainWindow::updateDockActionsChecked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MainWindow::getUniqueObjectName(const QString& widgetType) const
|
QString MainWindow::getUniqueObjectName(const QString &widgetType) const
|
||||||
{
|
{
|
||||||
QStringList docks;
|
QStringList docks;
|
||||||
docks.reserve(dockWidgets.size());
|
docks.reserve(dockWidgets.size());
|
||||||
QString name;
|
QString name;
|
||||||
for (const auto &it : dockWidgets) {
|
for (const auto &it : dockWidgets) {
|
||||||
name = it->objectName();
|
name = it->objectName();
|
||||||
if (name.split(';').at(0) == widgetType && name != "Graph Overview") {
|
if (name.split(';').at(0) == widgetType) {
|
||||||
docks.push_back(name);
|
docks.push_back(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,8 @@ public:
|
|||||||
}
|
}
|
||||||
void messageBoxWarning(QString title, QString message);
|
void messageBoxWarning(QString title, QString message);
|
||||||
|
|
||||||
|
QString getUniqueObjectName(const QString &widgetType) const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void finalizeOpen();
|
void finalizeOpen();
|
||||||
|
|
||||||
@ -276,8 +278,6 @@ private:
|
|||||||
* pointer to class constructor and action that passed to this constructor.
|
* pointer to class constructor and action that passed to this constructor.
|
||||||
*/
|
*/
|
||||||
QMap<QString, std::pair<std::function<CutterDockWidget*(MainWindow*, QAction*)>, QAction*>> classNameToConstructorAndActionMap;
|
QMap<QString, std::pair<std::function<CutterDockWidget*(MainWindow*, QAction*)>, QAction*>> classNameToConstructorAndActionMap;
|
||||||
|
|
||||||
QString getUniqueObjectName(const QString &widgetType) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "common/Configuration.h"
|
#include "common/Configuration.h"
|
||||||
#include "common/Helpers.h"
|
#include "common/Helpers.h"
|
||||||
#include "common/TempConfig.h"
|
#include "common/TempConfig.h"
|
||||||
|
#include "core/MainWindow.h"
|
||||||
|
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
@ -39,7 +40,7 @@ DisassemblyWidget::DisassemblyWidget(MainWindow *main, QAction *action)
|
|||||||
, mDisasScrollArea(new DisassemblyScrollArea(this))
|
, mDisasScrollArea(new DisassemblyScrollArea(this))
|
||||||
, mDisasTextEdit(new DisassemblyTextEdit(this))
|
, mDisasTextEdit(new DisassemblyTextEdit(this))
|
||||||
{
|
{
|
||||||
setObjectName(getWidgetType());
|
setObjectName(main->getUniqueObjectName(getWidgetType()));
|
||||||
|
|
||||||
topOffset = bottomOffset = RVA_INVALID;
|
topOffset = bottomOffset = RVA_INVALID;
|
||||||
cursorLineOffset = 0;
|
cursorLineOffset = 0;
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
GraphWidget::GraphWidget(MainWindow *main, QAction *action) :
|
GraphWidget::GraphWidget(MainWindow *main, QAction *action) :
|
||||||
MemoryDockWidget(CutterCore::MemoryWidgetType::Graph, main, action)
|
MemoryDockWidget(CutterCore::MemoryWidgetType::Graph, main, action)
|
||||||
{
|
{
|
||||||
setObjectName(getWidgetType());
|
setObjectName(main->getUniqueObjectName(getWidgetType()));
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
graphView = new DisassemblerGraphView(this, seekable);
|
graphView = new DisassemblerGraphView(this, seekable);
|
||||||
setWidget(graphView);
|
setWidget(graphView);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "common/Helpers.h"
|
#include "common/Helpers.h"
|
||||||
#include "common/Configuration.h"
|
#include "common/Configuration.h"
|
||||||
#include "common/TempConfig.h"
|
#include "common/TempConfig.h"
|
||||||
|
#include "core/MainWindow.h"
|
||||||
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
@ -21,7 +22,7 @@ HexdumpWidget::HexdumpWidget(MainWindow *main, QAction *action) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setObjectName(getWidgetType());
|
setObjectName(main->getUniqueObjectName(getWidgetType()));
|
||||||
|
|
||||||
ui->copyMD5->setIcon(QIcon(":/img/icons/copy.svg"));
|
ui->copyMD5->setIcon(QIcon(":/img/icons/copy.svg"));
|
||||||
ui->copySHA1->setIcon(QIcon(":/img/icons/copy.svg"));
|
ui->copySHA1->setIcon(QIcon(":/img/icons/copy.svg"));
|
||||||
|
Loading…
Reference in New Issue
Block a user