diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-08-11 18:58:24 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-08-11 19:05:22 +0200 |
commit | 7e78a422e8bb22572706b7fadb58fc45e7b8a7db (patch) | |
tree | e91e2aa3364d1a5cb8329a6b7e49b7a46e720ab5 /gui/newinstancedialog.cpp | |
parent | e5dc113bfceb1e9b52535b7d1abd6f0ec51e1332 (diff) | |
download | MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar.gz MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar.lz MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.tar.xz MultiMC-7e78a422e8bb22572706b7fadb58fc45e7b8a7db.zip |
Version filtering and general related code sanitization.
Version list dialog has alternating row background set.
Nostalgia versions, based on OneSix.
Diffstat (limited to 'gui/newinstancedialog.cpp')
-rw-r--r-- | gui/newinstancedialog.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gui/newinstancedialog.cpp b/gui/newinstancedialog.cpp index 38fbc2e3..4f19e9a2 100644 --- a/gui/newinstancedialog.cpp +++ b/gui/newinstancedialog.cpp @@ -37,8 +37,6 @@ NewInstanceDialog::NewInstanceDialog(QWidget *parent) : QDialog(parent), ui(new Ui::NewInstanceDialog) { - m_selectedVersion = NULL; - ui->setupUi(this); resize(minimumSizeHint()); layout()->setSizeConstraint(QLayout::SetFixedSize); @@ -64,17 +62,16 @@ NewInstanceDialog::~NewInstanceDialog() void NewInstanceDialog::updateDialogState() { - ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled( - !instName().isEmpty() && m_selectedVersion); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!instName().isEmpty() && m_selectedVersion); } -void NewInstanceDialog::setSelectedVersion(const InstVersion *version) +void NewInstanceDialog::setSelectedVersion(InstVersionPtr version) { m_selectedVersion = version; if (m_selectedVersion) { - ui->versionTextBox->setText(version->name()); + ui->versionTextBox->setText(version->name); } else { @@ -94,7 +91,7 @@ QString NewInstanceDialog::iconKey() const return InstIconKey; } -const InstVersion *NewInstanceDialog::selectedVersion() const +InstVersionPtr NewInstanceDialog::selectedVersion() const { return m_selectedVersion; } @@ -105,7 +102,7 @@ void NewInstanceDialog::on_btnChangeVersion_clicked() vselect.exec(); if (vselect.result() == QDialog::Accepted) { - const InstVersion *version = vselect.selectedVersion(); + InstVersionPtr version = vselect.selectedVersion(); if (version) setSelectedVersion(version); } |