parent
90ec689131
commit
4b28e7d957
|
@ -30,18 +30,11 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
connect(Bridge::getBridge(), SIGNAL(updateArgumentView()), mArgumentWidget, SLOT(refreshData()));
|
||||
mDisas->setCodeFoldingManager(mSideBar->getCodeFoldingManager());
|
||||
|
||||
QSplitter* splitter = new QSplitter(this);
|
||||
splitter->addWidget(mSideBar);
|
||||
splitter->addWidget(mDisas);
|
||||
splitter->setChildrenCollapsible(false);
|
||||
splitter->setCollapsible(0, true); //allow collapsing of the SideBar
|
||||
splitter->setHandleWidth(1);
|
||||
ui->mTopLeftUpperLeftFrameLayout->addWidget(mSideBar);
|
||||
ui->mTopLeftUpperRightFrameLayout->addWidget(mDisas);
|
||||
|
||||
ui->mTopLeftVSplitter->setSizes(QList<int>() << 100 << 1);
|
||||
ui->mTopLeftVSplitter->setCollapsible(1, true); //allow collapsing of the InfoBox
|
||||
|
||||
ui->mTopLeftUpperFrameLayout->addWidget(splitter);
|
||||
|
||||
mInfo = new CPUInfoBox();
|
||||
ui->mTopLeftLowerFrameLayout->addWidget(mInfo);
|
||||
int height = mInfo->getHeight();
|
||||
|
@ -68,7 +61,6 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
connect(button_changeview, SIGNAL(clicked()), mGeneralRegs, SLOT(onChangeFPUViewAction()));
|
||||
mGeneralRegs->SetChangeButton(button_changeview);
|
||||
|
||||
ui->mTopRightVSplitter->setSizes(QList<int>() << 87 << 14);
|
||||
ui->mTopRightVSplitter->setCollapsible(1, true); //allow collapsing of the ArgumentWidget
|
||||
|
||||
ui->mTopRightUpperFrameLayout->addWidget(button_changeview);
|
||||
|
@ -84,39 +76,73 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
mStack->loadColumnFromConfig("CPUStack");
|
||||
}
|
||||
|
||||
inline void saveSplitter(QSplitter* splitter, QString name)
|
||||
{
|
||||
BridgeSettingSet("Main Window Settings", (name + "Geometry").toUtf8().constData(), splitter->saveGeometry().toBase64().data());
|
||||
BridgeSettingSet("Main Window Settings", (name + "State").toUtf8().constData(), splitter->saveState().toBase64().data());
|
||||
}
|
||||
|
||||
inline void loadSplitter(QSplitter* splitter, QString name)
|
||||
{
|
||||
char setting[MAX_SETTING_SIZE] = "";
|
||||
if(BridgeSettingGet("Main Window Settings", (name + "Geometry").toUtf8().constData(), setting))
|
||||
splitter->restoreGeometry(QByteArray::fromBase64(QByteArray(setting)));
|
||||
if(BridgeSettingGet("Main Window Settings", (name + "State").toUtf8().constData(), setting))
|
||||
splitter->restoreState(QByteArray::fromBase64(QByteArray(setting)));
|
||||
}
|
||||
|
||||
void CPUWidget::saveWindowSettings()
|
||||
{
|
||||
saveSplitter(ui->mVSplitter, "mVSplitter");
|
||||
saveSplitter(ui->mTopHSplitter, "mTopHSplitter");
|
||||
saveSplitter(ui->mTopLeftVSplitter, "mTopLeftVSplitter");
|
||||
saveSplitter(ui->mTopLeftUpperHSplitter, "mTopLeftUpperHSplitter");
|
||||
saveSplitter(ui->mTopRightVSplitter, "mTopRightVSplitter");
|
||||
saveSplitter(ui->mBotHSplitter, "mBotHSplitter");
|
||||
}
|
||||
|
||||
void CPUWidget::loadWindowSettings()
|
||||
{
|
||||
loadSplitter(ui->mVSplitter, "mVSplitter");
|
||||
loadSplitter(ui->mTopHSplitter, "mTopHSplitter");
|
||||
loadSplitter(ui->mTopLeftVSplitter, "mTopLeftVSplitter");
|
||||
loadSplitter(ui->mTopLeftUpperHSplitter, "mTopLeftUpperHSplitter");
|
||||
loadSplitter(ui->mTopRightVSplitter, "mTopRightVSplitter");
|
||||
loadSplitter(ui->mBotHSplitter, "mBotHSplitter");
|
||||
}
|
||||
|
||||
CPUWidget::~CPUWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CPUWidget::setDefaultDisposition(void)
|
||||
void CPUWidget::setDefaultDisposition()
|
||||
{
|
||||
QList<int> sizesList;
|
||||
int wTotalSize;
|
||||
// This is magic, don't touch it...
|
||||
|
||||
// Vertical Splitter
|
||||
wTotalSize = ui->mVSplitter->widget(0)->size().height() + ui->mVSplitter->widget(1)->size().height();
|
||||
|
||||
sizesList.append(wTotalSize * 70 / 100);
|
||||
sizesList.append(wTotalSize - wTotalSize * 70 / 100);
|
||||
|
||||
ui->mVSplitter->setSizes(sizesList);
|
||||
ui->mVSplitter->setStretchFactor(0, 48);
|
||||
ui->mVSplitter->setStretchFactor(1, 62);
|
||||
|
||||
// Top Horizontal Splitter
|
||||
wTotalSize = ui->mTopHSplitter->widget(0)->size().height() + ui->mTopHSplitter->widget(1)->size().height();
|
||||
|
||||
sizesList.append(wTotalSize * 70 / 100);
|
||||
sizesList.append(wTotalSize - wTotalSize * 70 / 100);
|
||||
|
||||
ui->mTopHSplitter->setSizes(sizesList);
|
||||
ui->mTopHSplitter->setStretchFactor(0, 77);
|
||||
ui->mTopHSplitter->setStretchFactor(1, 23);
|
||||
|
||||
// Bottom Horizontal Splitter
|
||||
wTotalSize = ui->mBotHSplitter->widget(0)->size().height() + ui->mBotHSplitter->widget(1)->size().height();
|
||||
ui->mBotHSplitter->setStretchFactor(0, 60);
|
||||
ui->mBotHSplitter->setStretchFactor(1, 40);
|
||||
|
||||
sizesList.append(wTotalSize * 70 / 100);
|
||||
sizesList.append(wTotalSize - wTotalSize * 70 / 100);
|
||||
// Top Right Vertical Splitter
|
||||
ui->mTopRightVSplitter->setStretchFactor(0, 87);
|
||||
ui->mTopRightVSplitter->setStretchFactor(1, 13);
|
||||
|
||||
ui->mBotHSplitter->setSizes(sizesList);
|
||||
// Top Left Vertical Splitter
|
||||
ui->mTopLeftVSplitter->setStretchFactor(0, 99);
|
||||
ui->mTopLeftVSplitter->setStretchFactor(1, 1);
|
||||
|
||||
// Top Left Upper Horizontal Splitter
|
||||
ui->mTopLeftUpperHSplitter->setStretchFactor(0, 36);
|
||||
ui->mTopLeftUpperHSplitter->setStretchFactor(1, 64);
|
||||
}
|
||||
|
||||
void CPUWidget::setDisasmFocus()
|
||||
|
@ -124,31 +150,6 @@ void CPUWidget::setDisasmFocus()
|
|||
mDisas->setFocus();
|
||||
}
|
||||
|
||||
QVBoxLayout* CPUWidget::getTopLeftUpperWidget()
|
||||
{
|
||||
return ui->mTopLeftUpperFrameLayout;
|
||||
}
|
||||
|
||||
QVBoxLayout* CPUWidget::getTopLeftLowerWidget()
|
||||
{
|
||||
return ui->mTopLeftLowerFrameLayout;
|
||||
}
|
||||
|
||||
QVBoxLayout* CPUWidget::getTopRightWidget()
|
||||
{
|
||||
return ui->mTopRightUpperFrameLayout;
|
||||
}
|
||||
|
||||
QVBoxLayout* CPUWidget::getBotLeftWidget()
|
||||
{
|
||||
return ui->mBotLeftFrameLayout;
|
||||
}
|
||||
|
||||
QVBoxLayout* CPUWidget::getBotRightWidget()
|
||||
{
|
||||
return ui->mBotRightFrameLayout;
|
||||
}
|
||||
|
||||
CPUSideBar* CPUWidget::getSidebarWidget()
|
||||
{
|
||||
return mSideBar;
|
||||
|
|
|
@ -29,12 +29,8 @@ public:
|
|||
void setDefaultDisposition();
|
||||
void setDisasmFocus();
|
||||
|
||||
// Layout getters
|
||||
QVBoxLayout* getTopLeftUpperWidget();
|
||||
QVBoxLayout* getTopLeftLowerWidget();
|
||||
QVBoxLayout* getTopRightWidget();
|
||||
QVBoxLayout* getBotLeftWidget();
|
||||
QVBoxLayout* getBotRightWidget();
|
||||
void saveWindowSettings();
|
||||
void loadWindowSettings();
|
||||
|
||||
// Widget getters
|
||||
CPUSideBar* getSidebarWidget();
|
||||
|
|
|
@ -63,30 +63,66 @@
|
|||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QFrame" name="mTopLeftUpperFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<widget class="QSplitter" name="mTopLeftUpperHSplitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<property name="handleWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="mTopLeftUpperFrameLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
<property name="childrenCollapsible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<widget class="QFrame" name="mTopLeftUpperLeftFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
<layout class="QVBoxLayout" name="mTopLeftUpperLeftFrameLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QFrame" name="mTopLeftUpperRightFrame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
<layout class="QVBoxLayout" name="mTopLeftUpperRightFrameLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QFrame" name="mTopLeftLowerFrame">
|
||||
<property name="frameShape">
|
||||
|
|
|
@ -20,7 +20,7 @@ DebugStatusLabel::DebugStatusLabel(QStatusBar* parent) : QLabel(parent)
|
|||
}
|
||||
this->setTextFormat(Qt::RichText); //rich text
|
||||
parent->setStyleSheet("QStatusBar { background-color: #C0C0C0; } QStatusBar::item { border: none; }");
|
||||
this->setFixedHeight(parent->height());
|
||||
this->setFixedHeight(fm.height() + 5);
|
||||
this->setAlignment(Qt::AlignCenter);
|
||||
this->setFixedWidth(maxWidth + 10);
|
||||
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(debugStateChangedSlot(DBGSTATE)));
|
||||
|
|
|
@ -93,8 +93,6 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
initMenuApi();
|
||||
addMenuToList(this, ui->menuPlugins, GUI_PLUGIN_MENU);
|
||||
|
||||
this->showMaximized();
|
||||
|
||||
// Set window title
|
||||
mWindowMainTitle = QCoreApplication::applicationName();
|
||||
setWindowTitle(QString(mWindowMainTitle));
|
||||
|
@ -225,8 +223,6 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
else
|
||||
loadTabSavedOrder();
|
||||
|
||||
loadWindowSettings();
|
||||
|
||||
setCentralWidget(mTabWidget);
|
||||
|
||||
// Setup the command and status bars
|
||||
|
@ -363,6 +359,8 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
mCloseDialog = new CloseDialog(this);
|
||||
|
||||
mCpuWidget->setDisasmFocus();
|
||||
|
||||
QTimer::singleShot(0, this, SLOT(loadWindowSettings()));
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
@ -571,6 +569,8 @@ void MainWindow::saveWindowSettings()
|
|||
BridgeSettingSet("Tab Window Settings", mWidgetList[i].nativeName.toUtf8().constData(),
|
||||
mWidgetList[i].widget->parentWidget()->saveGeometry().toBase64().data());
|
||||
}
|
||||
|
||||
mCpuWidget->saveWindowSettings();
|
||||
}
|
||||
|
||||
void MainWindow::loadWindowSettings()
|
||||
|
@ -610,6 +610,8 @@ void MainWindow::loadWindowSettings()
|
|||
mWidgetList[i].widget->parentWidget()->restoreGeometry(QByteArray::fromBase64(QByteArray(geometrySetting, int(sizeofgeometrySetting))));
|
||||
}
|
||||
}
|
||||
|
||||
mCpuWidget->loadWindowSettings();
|
||||
}
|
||||
|
||||
void MainWindow::setGlobalShortcut(QAction* action, const QKeySequence & key)
|
||||
|
|
|
@ -54,10 +54,10 @@ public:
|
|||
void loadTabDefaultOrder();
|
||||
void loadTabSavedOrder();
|
||||
void clearTabWidget();
|
||||
void saveWindowSettings();
|
||||
void loadWindowSettings();
|
||||
|
||||
public slots:
|
||||
void saveWindowSettings();
|
||||
void loadWindowSettings();
|
||||
void executeCommand();
|
||||
void execCommandSlot();
|
||||
void setFocusToCommandBar();
|
||||
|
|
Loading…
Reference in New Issue