GUI: resolved issue #125 (tabbed reference view)
This commit is contained in:
parent
13eaa8a7ae
commit
4ce848d21b
|
|
@ -20,7 +20,6 @@ ReferenceView::ReferenceView()
|
|||
// Setup signals
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceAddColumnAt(int, QString)), this, SLOT(addColumnAt(int, QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetRowCount(int_t)), this, SLOT(setRowCount(int_t)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceDeleteAllColumns()), this, SLOT(deleteAllColumns()));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetCellContent(int, int, QString)), this, SLOT(setCellContent(int, int, QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceReloadData()), this, SLOT(reloadData()));
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceSetSingleSelection(int, bool)), this, SLOT(setSingleSelection(int, bool)));
|
||||
|
|
@ -58,6 +57,17 @@ void ReferenceView::setupContextMenu()
|
|||
connect(Config(), SIGNAL(shortcutsUpdated()), this, SLOT(refreshShortcutsSlot()));
|
||||
}
|
||||
|
||||
void ReferenceView::disconnectBridge()
|
||||
{
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceAddColumnAt(int, QString)), this, SLOT(addColumnAt(int, QString)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetRowCount(int_t)), this, SLOT(setRowCount(int_t)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetCellContent(int, int, QString)), this, SLOT(setCellContent(int, int, QString)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceReloadData()), this, SLOT(reloadData()));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetSingleSelection(int, bool)), this, SLOT(setSingleSelection(int, bool)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetProgress(int)), mSearchProgress, SLOT(setValue(int)));
|
||||
disconnect(Bridge::getBridge(), SIGNAL(referenceSetSearchStartCol(int)), this, SLOT(setSearchStartCol(int)));
|
||||
}
|
||||
|
||||
void ReferenceView::refreshShortcutsSlot()
|
||||
{
|
||||
mToggleBreakpoint->setShortcut(ConfigShortcut("ActionToggleBreakpoint"));
|
||||
|
|
@ -87,21 +97,6 @@ void ReferenceView::setRowCount(int_t count)
|
|||
mList->setRowCount(count);
|
||||
}
|
||||
|
||||
void ReferenceView::deleteAllColumns()
|
||||
{
|
||||
mSearchBox->setText("");
|
||||
mList->setTableOffset(0);
|
||||
mList->setSingleSelection(0);
|
||||
mList->deleteAllColumns();
|
||||
mList->reloadData();
|
||||
mSearchList->setTableOffset(0);
|
||||
mSearchList->setSingleSelection(0);
|
||||
mSearchList->deleteAllColumns();
|
||||
mSearchList->reloadData();
|
||||
mSearchStartCol = 1;
|
||||
mFollowDumpDefault = false;
|
||||
}
|
||||
|
||||
void ReferenceView::setCellContent(int r, int c, QString s)
|
||||
{
|
||||
mSearchBox->setText("");
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ class ReferenceView : public SearchListView
|
|||
public:
|
||||
ReferenceView();
|
||||
void setupContextMenu();
|
||||
void disconnectBridge();
|
||||
|
||||
private slots:
|
||||
void addColumnAt(int width, QString title);
|
||||
void setRowCount(int_t count);
|
||||
void deleteAllColumns();
|
||||
void setCellContent(int r, int c, QString s);
|
||||
void reloadData();
|
||||
void setSingleSelection(int index, bool scroll);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Bridge::Bridge(QObject* parent) : QObject(parent)
|
|||
mBridgeMutex = new QMutex();
|
||||
winId = 0;
|
||||
scriptView = 0;
|
||||
referenceView = 0;
|
||||
referenceManager = 0;
|
||||
bridgeResult = 0;
|
||||
hasBridgeResult = false;
|
||||
}
|
||||
|
|
@ -173,11 +173,6 @@ void Bridge::emitReferenceSetRowCount(int_t count)
|
|||
emit referenceSetRowCount(count);
|
||||
}
|
||||
|
||||
void Bridge::emitReferenceDeleteAllColumns()
|
||||
{
|
||||
emit referenceDeleteAllColumns();
|
||||
}
|
||||
|
||||
void Bridge::emitReferenceSetCellContent(int r, int c, QString s)
|
||||
{
|
||||
emit referenceSetCellContent(r, c, s);
|
||||
|
|
@ -203,6 +198,16 @@ void Bridge::emitReferenceSetSearchStartCol(int col)
|
|||
emit referenceSetSearchStartCol(col);
|
||||
}
|
||||
|
||||
void Bridge::emitReferenceInitialize(QString name)
|
||||
{
|
||||
mBridgeMutex->lock();
|
||||
hasBridgeResult = false;
|
||||
emit referenceInitialize(name);
|
||||
while(!hasBridgeResult) //wait for thread completion
|
||||
Sleep(100);
|
||||
mBridgeMutex->unlock();
|
||||
}
|
||||
|
||||
void Bridge::emitStackDumpAt(uint_t va, uint_t csp)
|
||||
{
|
||||
emit stackDumpAt(va, csp);
|
||||
|
|
@ -558,13 +563,13 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa
|
|||
|
||||
case GUI_REF_GETROWCOUNT:
|
||||
{
|
||||
return (void*)Bridge::getBridge()->referenceView->mList->getRowCount();
|
||||
return (void*)(void*)Bridge::getBridge()->referenceManager->currentReferenceView()->mList->getRowCount();
|
||||
}
|
||||
break;
|
||||
|
||||
case GUI_REF_DELETEALLCOLUMNS:
|
||||
{
|
||||
Bridge::getBridge()->emitReferenceDeleteAllColumns();
|
||||
GuiReferenceInitialize("References");
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -577,7 +582,7 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa
|
|||
|
||||
case GUI_REF_GETCELLCONTENT:
|
||||
{
|
||||
return (void*)Bridge::getBridge()->referenceView->mList->getCellContent((int)(int_t)param1, (int)(int_t)param2).toUtf8().constData();
|
||||
return (void*)Bridge::getBridge()->referenceManager->currentReferenceView()->mList->getCellContent((int)(int_t)param1, (int)(int_t)param2).toUtf8().constData();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -605,6 +610,12 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa
|
|||
}
|
||||
break;
|
||||
|
||||
case GUI_REF_INITIALIZE:
|
||||
{
|
||||
Bridge::getBridge()->emitReferenceInitialize(QString(reinterpret_cast<const char*>(param1)));
|
||||
}
|
||||
break;
|
||||
|
||||
case GUI_STACK_DUMP_AT:
|
||||
{
|
||||
Bridge::getBridge()->emitStackDumpAt((uint_t)param1, (uint_t)param2);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include <QMutex>
|
||||
#include "Imports.h"
|
||||
#include "NewTypes.h"
|
||||
#include "SearchListView.h"
|
||||
#include "ReferenceManager.h"
|
||||
|
||||
class Bridge : public QObject
|
||||
{
|
||||
|
|
@ -48,12 +48,12 @@ public:
|
|||
void emitSetSymbolProgress(int progress);
|
||||
void emitReferenceAddColumnAt(int width, QString title);
|
||||
void emitReferenceSetRowCount(int_t count);
|
||||
void emitReferenceDeleteAllColumns();
|
||||
void emitReferenceSetCellContent(int r, int c, QString s);
|
||||
void emitReferenceReloadData();
|
||||
void emitReferenceSetSingleSelection(int index, bool scroll);
|
||||
void emitReferenceSetProgress(int progress);
|
||||
void emitReferenceSetSearchStartCol(int col);
|
||||
void emitReferenceInitialize(QString name);
|
||||
void emitStackDumpAt(uint_t va, uint_t csp);
|
||||
void emitUpdateDump();
|
||||
void emitUpdateThreads();
|
||||
|
|
@ -80,7 +80,7 @@ public:
|
|||
//Public variables
|
||||
void* winId;
|
||||
QWidget* scriptView;
|
||||
SearchListView* referenceView;
|
||||
ReferenceManager* referenceManager;
|
||||
|
||||
signals:
|
||||
void disassembleAt(int_t va, int_t eip);
|
||||
|
|
@ -107,12 +107,12 @@ signals:
|
|||
void setSymbolProgress(int progress);
|
||||
void referenceAddColumnAt(int width, QString title);
|
||||
void referenceSetRowCount(int_t count);
|
||||
void referenceDeleteAllColumns();
|
||||
void referenceSetCellContent(int r, int c, QString s);
|
||||
void referenceReloadData();
|
||||
void referenceSetSingleSelection(int index, bool scroll);
|
||||
void referenceSetProgress(int progress);
|
||||
void referenceSetSearchStartCol(int col);
|
||||
void referenceInitialize(QString name);
|
||||
void stackDumpAt(uint_t va, uint_t csp);
|
||||
void updateDump();
|
||||
void updateThreads();
|
||||
|
|
|
|||
|
|
@ -82,11 +82,11 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
mCpuWidget->setWindowTitle("CPU");
|
||||
mCpuWidget->setWindowIcon(QIcon(":/icons/images/processor-cpu.png"));
|
||||
|
||||
// Reference View
|
||||
mReferenceView = new ReferenceView();
|
||||
Bridge::getBridge()->referenceView = mReferenceView;
|
||||
mReferenceView->setWindowTitle("References");
|
||||
mReferenceView->setWindowIcon(QIcon(":/icons/images/search.png"));
|
||||
// Reference Manager
|
||||
mReferenceManager = new ReferenceManager();
|
||||
Bridge::getBridge()->referenceManager = mReferenceManager;
|
||||
mReferenceManager->setWindowTitle("References");
|
||||
mReferenceManager->setWindowIcon(QIcon(":/icons/images/search.png"));
|
||||
|
||||
// Thread View
|
||||
mThreadView = new ThreadView();
|
||||
|
|
@ -105,7 +105,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
mTabWidget->addTab(mCallStackView, mCallStackView->windowIcon(), mCallStackView->windowTitle());
|
||||
mTabWidget->addTab(mScriptView, mScriptView->windowIcon(), mScriptView->windowTitle());
|
||||
mTabWidget->addTab(mSymbolView, mSymbolView->windowIcon(), mSymbolView->windowTitle());
|
||||
mTabWidget->addTab(mReferenceView, mReferenceView->windowIcon(), mReferenceView->windowTitle());
|
||||
mTabWidget->addTab(mReferenceManager, mReferenceManager->windowIcon(), mReferenceManager->windowTitle());
|
||||
mTabWidget->addTab(mThreadView, mThreadView->windowIcon(), mThreadView->windowTitle());
|
||||
|
||||
setCentralWidget(mTabWidget);
|
||||
|
|
@ -152,7 +152,7 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
connect(ui->actionCpu, SIGNAL(triggered()), this, SLOT(displayCpuWidget()));
|
||||
connect(ui->actionSymbolInfo, SIGNAL(triggered()), this, SLOT(displaySymbolWidget()));
|
||||
connect(mSymbolView, SIGNAL(showCpu()), this, SLOT(displayCpuWidget()));
|
||||
connect(mReferenceView, SIGNAL(showCpu()), this, SLOT(displayCpuWidget()));
|
||||
connect(mReferenceManager, SIGNAL(showCpu()), this, SLOT(displayCpuWidget()));
|
||||
connect(ui->actionReferences, SIGNAL(triggered()), this, SLOT(displayReferencesWidget()));
|
||||
connect(ui->actionThreads, SIGNAL(triggered()), this, SLOT(displayThreadsWidget()));
|
||||
connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(openSettings()));
|
||||
|
|
@ -644,9 +644,9 @@ void MainWindow::displaySymbolWidget()
|
|||
|
||||
void MainWindow::displayReferencesWidget()
|
||||
{
|
||||
mReferenceView->show();
|
||||
mReferenceView->setFocus();
|
||||
setTab(mReferenceView);
|
||||
mReferenceManager->show();
|
||||
mReferenceManager->setFocus();
|
||||
setTab(mReferenceManager);
|
||||
}
|
||||
|
||||
void MainWindow::displayThreadsWidget()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "SymbolView.h"
|
||||
#include "BreakpointsView.h"
|
||||
#include "ScriptView.h"
|
||||
#include "ReferenceView.h"
|
||||
#include "ReferenceManager.h"
|
||||
#include "ThreadView.h"
|
||||
#include "PatchDialog.h"
|
||||
#include "CalculatorDialog.h"
|
||||
|
|
@ -104,7 +104,7 @@ private:
|
|||
SymbolView* mSymbolView;
|
||||
BreakpointsView* mBreakpointsView;
|
||||
ScriptView* mScriptView;
|
||||
ReferenceView* mReferenceView;
|
||||
ReferenceManager* mReferenceManager;
|
||||
ThreadView* mThreadView;
|
||||
PatchDialog* mPatchDialog;
|
||||
CalculatorDialog* mCalculatorDialog;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
#include "ReferenceManager.h"
|
||||
#include "Bridge.h"
|
||||
|
||||
ReferenceManager::ReferenceManager(QWidget* parent) : MHTabWidget(parent, false, true)
|
||||
{
|
||||
this->setMovable(true);
|
||||
mCurrentReferenceView = 0;
|
||||
connect(Bridge::getBridge(), SIGNAL(referenceInitialize(QString)), this, SLOT(newReferenceView(QString)));
|
||||
}
|
||||
|
||||
ReferenceView* ReferenceManager::currentReferenceView()
|
||||
{
|
||||
return mCurrentReferenceView;
|
||||
}
|
||||
|
||||
void ReferenceManager::newReferenceView(QString name)
|
||||
{
|
||||
if(mCurrentReferenceView) //disconnect previous reference view
|
||||
mCurrentReferenceView->disconnectBridge();
|
||||
mCurrentReferenceView = new ReferenceView();
|
||||
connect(mCurrentReferenceView, SIGNAL(showCpu()), this, SIGNAL(showCpu()));
|
||||
insertTab(0, mCurrentReferenceView, name);
|
||||
setCurrentIndex(0);
|
||||
Bridge::getBridge()->BridgeSetResult(1);
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef REFERENCEMANAGER_H
|
||||
#define REFERENCEMANAGER_H
|
||||
|
||||
#include "TabWidget.h"
|
||||
#include "ReferenceView.h"
|
||||
|
||||
class ReferenceManager : public MHTabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ReferenceManager(QWidget* parent = 0);
|
||||
ReferenceView* currentReferenceView();
|
||||
|
||||
public slots:
|
||||
void newReferenceView(QString name);
|
||||
|
||||
signals:
|
||||
void showCpu();
|
||||
|
||||
private:
|
||||
ReferenceView* mCurrentReferenceView;
|
||||
};
|
||||
|
||||
#endif // REFERENCEMANAGER_H
|
||||
|
|
@ -84,7 +84,8 @@ SOURCES += \
|
|||
Src/Gui/CalculatorDialog.cpp \
|
||||
Src/Gui/AttachDialog.cpp \
|
||||
Src/Gui/PageMemoryRights.cpp \
|
||||
Src/Gui/SelectFields.cpp
|
||||
Src/Gui/SelectFields.cpp \
|
||||
Src/Gui/ReferenceManager.cpp
|
||||
|
||||
|
||||
HEADERS += \
|
||||
|
|
@ -147,7 +148,8 @@ HEADERS += \
|
|||
Src/Gui/CalculatorDialog.h \
|
||||
Src/Gui/AttachDialog.h \
|
||||
Src/Gui/PageMemoryRights.h \
|
||||
Src/Gui/SelectFields.h
|
||||
Src/Gui/SelectFields.h \
|
||||
Src/Gui/ReferenceManager.h
|
||||
|
||||
|
||||
INCLUDEPATH += \
|
||||
|
|
|
|||
Loading…
Reference in New Issue