Refactored Deck Editor tab

- removed heap allocation
This commit is contained in:
Matt Lowe 2015-01-17 17:55:13 +01:00
parent 5cf801eb94
commit d02d3ed521
2 changed files with 5 additions and 7 deletions

View file

@ -537,14 +537,13 @@ void UserInterfaceSettingsPage::soundPathButtonClicked()
DeckEditorSettingsPage::DeckEditorSettingsPage() DeckEditorSettingsPage::DeckEditorSettingsPage()
{ {
priceTagsCheckBox = new QCheckBox; priceTagsCheckBox.setChecked(settingsCache->getPriceTagFeature());
priceTagsCheckBox->setChecked(settingsCache->getPriceTagFeature()); connect(&priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
connect(priceTagsCheckBox, SIGNAL(stateChanged(int)), settingsCache, SLOT(setPriceTagFeature(int)));
connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int))); connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
QGridLayout *generalGrid = new QGridLayout; QGridLayout *generalGrid = new QGridLayout;
generalGrid->addWidget(priceTagsCheckBox, 0, 0); generalGrid->addWidget(&priceTagsCheckBox, 0, 0);
generalGroupBox = new QGroupBox; generalGroupBox = new QGroupBox;
generalGroupBox->setLayout(generalGrid); generalGroupBox->setLayout(generalGrid);
@ -557,7 +556,7 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
void DeckEditorSettingsPage::retranslateUi() void DeckEditorSettingsPage::retranslateUi()
{ {
priceTagsCheckBox->setText(tr("Enable &price tag feature from deckbrew.com")); priceTagsCheckBox.setText(tr("Enable &price tag feature from deckbrew.com"));
generalGroupBox->setTitle(tr("General")); generalGroupBox->setTitle(tr("General"));
} }

View file

@ -144,8 +144,7 @@ private slots:
signals: signals:
void priceTagSourceChanged(int _priceTagSource); void priceTagSourceChanged(int _priceTagSource);
private: private:
QCheckBox *priceTagsCheckBox; QCheckBox priceTagsCheckBox;
QRadioButton *priceTagSource0, *priceTagSource1;
QGroupBox *generalGroupBox; QGroupBox *generalGroupBox;
}; };