Fix SDB Browser docking problem and rename the whole thing (#1188)

* Fix sdbBrowser docking and renaming

* Fix SdbBrowser docking and naming
This commit is contained in:
Itay Cohen 2019-02-13 06:38:47 +00:00 committed by GitHub
parent bc974e432f
commit b5a69357d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 31 deletions

View File

@ -156,7 +156,6 @@ SOURCES += \
widgets/ImportsWidget.cpp \
widgets/Omnibar.cpp \
widgets/RelocsWidget.cpp \
widgets/SdbDock.cpp \
widgets/SectionsWidget.cpp \
widgets/SegmentsWidget.cpp \
widgets/StringsWidget.cpp \
@ -228,7 +227,8 @@ SOURCES += \
dialogs/WelcomeDialog.cpp \
RunScriptTask.cpp \
dialogs/EditMethodDialog.cpp \
dialogs/LoadNewTypesDialog.cpp
dialogs/LoadNewTypesDialog.cpp \
widgets/SdbWidget.cpp
HEADERS += \
Cutter.h \
@ -262,7 +262,6 @@ HEADERS += \
widgets/ImportsWidget.h \
widgets/Omnibar.h \
widgets/RelocsWidget.h \
widgets/SdbDock.h \
widgets/SectionsWidget.h \
widgets/SegmentsWidget.h \
widgets/StringsWidget.h \
@ -339,7 +338,8 @@ HEADERS += \
RunScriptTask.h \
common/Json.h \
dialogs/EditMethodDialog.h \
dialogs/LoadNewTypesDialog.h
dialogs/LoadNewTypesDialog.h \
widgets/SdbWidget.h
FORMS += \
dialogs/AboutDialog.ui \
@ -361,7 +361,6 @@ FORMS += \
widgets/ExportsWidget.ui \
widgets/FunctionsWidget.ui \
widgets/ImportsWidget.ui \
widgets/SdbDock.ui \
widgets/RelocsWidget.ui \
widgets/StringsWidget.ui \
widgets/SymbolsWidget.ui \
@ -400,7 +399,8 @@ FORMS += \
dialogs/HexdumpRangeDialog.ui \
dialogs/WelcomeDialog.ui \
dialogs/EditMethodDialog.ui \
dialogs/LoadNewTypesDialog.ui
dialogs/LoadNewTypesDialog.ui \
widgets/SdbWidget.ui
RESOURCES += \
resources.qrc \

View File

@ -76,7 +76,7 @@
#include "widgets/FlagsWidget.h"
#include "widgets/VisualNavbar.h"
#include "widgets/Dashboard.h"
#include "widgets/SdbDock.h"
#include "widgets/SdbWidget.h"
#include "widgets/Omnibar.h"
#include "widgets/ConsoleWidget.h"
#include "widgets/EntrypointWidget.h"
@ -231,7 +231,7 @@ void MainWindow::initUI()
ui->actionJupyter->setVisible(false);
#endif
dashboardDock = new Dashboard(this, ui->actionDashboard);
sdbDock = new SdbDock(this, ui->actionSDBBrowser);
sdbDock = new SdbWidget(this, ui->actionSDBBrowser);
classesDock = new ClassesWidget(this, ui->actionClasses);
resourcesDock = new ResourcesWidget(this, ui->actionResources);
vTablesDock = new VTablesWidget(this, ui->actionVTables);
@ -612,6 +612,7 @@ void MainWindow::restoreDocks()
tabifyDockWidget(dashboardDock, classesDock);
tabifyDockWidget(dashboardDock, resourcesDock);
tabifyDockWidget(dashboardDock, vTablesDock);
tabifyDockWidget(dashboardDock, sdbDock);
// Add Stack, Registers and Backtrace vertically stacked
addDockWidget(Qt::TopDockWidgetArea, stackDock);

View File

@ -37,7 +37,7 @@ class StringsWidget;
class FlagsWidget;
class Dashboard;
class QLineEdit;
class SdbDock;
class SdbWidget;
class QAction;
class SectionsWidget;
class SegmentsWidget;
@ -218,7 +218,7 @@ private:
FlagsWidget *flagsDock = nullptr;
Dashboard *dashboardDock = nullptr;
QLineEdit *gotoEntry = nullptr;
SdbDock *sdbDock = nullptr;
SdbWidget *sdbDock = nullptr;
SectionsWidget *sectionsDock = nullptr;
SegmentsWidget *segmentsDock = nullptr;
ZignaturesWidget *zignaturesDock = nullptr;

View File

@ -1,5 +1,5 @@
#include "SdbDock.h"
#include "ui_SdbDock.h"
#include "SdbWidget.h"
#include "ui_SdbWidget.h"
#include "MainWindow.h"
#include "common/Helpers.h"
@ -8,9 +8,9 @@
#include <QTreeWidget>
SdbDock::SdbDock(MainWindow *main, QAction *action) :
SdbWidget::SdbWidget(MainWindow *main, QAction *action) :
CutterDockWidget(main, action),
ui(new Ui::SdbDock)
ui(new Ui::SdbWidget)
{
ui->setupUi(this);
@ -20,7 +20,7 @@ SdbDock::SdbDock(MainWindow *main, QAction *action) :
reload(nullptr);
}
void SdbDock::reload(QString _path)
void SdbWidget::reload(QString _path)
{
if (!_path.isNull()) {
path = _path;
@ -55,7 +55,7 @@ void SdbDock::reload(QString _path)
}
void SdbDock::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
void SdbWidget::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
{
if (column < 0)
return;
@ -84,9 +84,9 @@ void SdbDock::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
}
}
SdbDock::~SdbDock() {}
SdbWidget::~SdbWidget() {}
void SdbDock::on_lockButton_clicked()
void SdbWidget::on_lockButton_clicked()
{
if (ui->lockButton->isChecked()) {
this->setAllowedAreas(Qt::NoDockWidgetArea);
@ -97,7 +97,7 @@ void SdbDock::on_lockButton_clicked()
}
}
void SdbDock::on_treeWidget_itemChanged(QTreeWidgetItem *item, int column)
void SdbWidget::on_treeWidget_itemChanged(QTreeWidgetItem *item, int column)
{
Core()->sdbSet(path, item->text(0), item->text(column));
}

View File

@ -1,5 +1,5 @@
#ifndef SDBDOCK_H
#define SDBDOCK_H
#ifndef SDBWIDGET_H
#define SDBWIDGET_H
#include <memory>
@ -9,16 +9,16 @@ class MainWindow;
class QTreeWidgetItem;
namespace Ui {
class SdbDock;
class SdbWidget;
}
class SdbDock : public CutterDockWidget
class SdbWidget : public CutterDockWidget
{
Q_OBJECT
public:
explicit SdbDock(MainWindow *main, QAction *action = nullptr);
~SdbDock();
explicit SdbWidget(MainWindow *main, QAction *action = nullptr);
~SdbWidget();
private slots:
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
@ -28,9 +28,9 @@ private slots:
void reload(QString _path = nullptr);
private:
std::unique_ptr<Ui::SdbDock> ui;
std::unique_ptr<Ui::SdbWidget> ui;
QString path;
};
#endif // SDBDOCK_H
#endif // SDBWIDGET_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SdbDock</class>
<widget class="QDockWidget" name="SdbDock">
<class>SdbWidget</class>
<widget class="QDockWidget" name="SdbWidget">
<property name="geometry">
<rect>
<x>0</x>
@ -11,10 +11,10 @@
</rect>
</property>
<property name="floating">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="windowTitle">
<string notr="true">SDB Browser</string>
<string>SDB Browser</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout">