From 13bcca816c9b356ecbca981f0ebc8d73b939a651 Mon Sep 17 00:00:00 2001 From: Sheila Aman Date: Sun, 23 May 2021 10:56:39 -0500 Subject: [PATCH] rearrange GUI setup in to functions for clarity --- src/exdeath.cc | 16 +++++++++------- src/exdeath.hh | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/exdeath.cc b/src/exdeath.cc index 6be16d8..d0f0fdd 100644 --- a/src/exdeath.cc +++ b/src/exdeath.cc @@ -42,6 +42,13 @@ Exdeath::Exdeath(QWidget *parent) : QWidget(parent) { layMode = new QVBoxLayout(this); layInnates = new QVBoxLayout(this); + connect(btnROM, &QPushButton::clicked, this, &Exdeath::btnROM_clicked); + connect(btnApply, &QPushButton::clicked, this, &Exdeath::btnApply_clicked); +} + +Exdeath::~Exdeath() {} + +void Exdeath::initMain(void) { grpMain = new QGroupBox("Main"); grpMain->setLayout(layMain); grpInnates = new QGroupBox("Innate abilities"); @@ -49,7 +56,6 @@ Exdeath::Exdeath(QWidget *parent) : QWidget(parent) { layColumns->addWidget(grpMain); layColumns->addWidget(grpInnates); - // Main options txtROM = new QLabel("ROM:"); txtMode = new QLabel("Mode:"); txtPortraits = new QLabel("FFT-style Portraits:"); @@ -93,8 +99,9 @@ Exdeath::Exdeath(QWidget *parent) : QWidget(parent) { layMain->addWidget(chkSound, 4, 1); layMain->addWidget(txtNED, 5, 0); layMain->addWidget(selNED, 5, 1); +} - // Project Demi options +void Exdeath::initInnates(void) { chkPassages = new QCheckBox("Innate Passages"); chkPitfalls = new QCheckBox("Innate Pitfalls"); chkLiteStep = new QCheckBox("Innate Light Step"); @@ -105,13 +112,8 @@ Exdeath::Exdeath(QWidget *parent) : QWidget(parent) { layInnates->addWidget(chkLiteStep); layInnates->addWidget(chkDash); layInnates->addWidget(chkLearning); - - connect(btnROM, &QPushButton::clicked, this, &Exdeath::btnROM_clicked); - connect(btnApply, &QPushButton::clicked, this, &Exdeath::btnApply_clicked); } -Exdeath::~Exdeath() {} - void Exdeath::btnROM_clicked(bool trigger) { filename = QFileDialog::getOpenFileName( this, diff --git a/src/exdeath.hh b/src/exdeath.hh index 2c59e8b..715828c 100644 --- a/src/exdeath.hh +++ b/src/exdeath.hh @@ -66,6 +66,8 @@ private: QCheckBox *chkDash; QCheckBox *chkLearning; + void initMain(void); + void initInnates(void); void btnROM_clicked(bool trigger); void btnApply_clicked(bool trigger); void applyPatch(QFile *file, QString patch);