diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-03-27 23:19:29 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-03-27 23:19:29 +0200 |
commit | b46a34d0aeda613a3c0b8eb8206c39a5dd45aef3 (patch) | |
tree | 9c6e7d4afbd310f971947c28d9f2ddcb599fab7e /application/pages | |
parent | 6188c577e3f36480cbbc35825979f15714e15624 (diff) | |
download | MultiMC-b46a34d0aeda613a3c0b8eb8206c39a5dd45aef3.tar MultiMC-b46a34d0aeda613a3c0b8eb8206c39a5dd45aef3.tar.gz MultiMC-b46a34d0aeda613a3c0b8eb8206c39a5dd45aef3.tar.lz MultiMC-b46a34d0aeda613a3c0b8eb8206c39a5dd45aef3.tar.xz MultiMC-b46a34d0aeda613a3c0b8eb8206c39a5dd45aef3.zip |
NOISSUE make vanilla refresh button work
Diffstat (limited to 'application/pages')
-rw-r--r-- | application/pages/modplatform/VanillaPage.cpp | 32 | ||||
-rw-r--r-- | application/pages/modplatform/VanillaPage.h | 2 |
2 files changed, 7 insertions, 27 deletions
diff --git a/application/pages/modplatform/VanillaPage.cpp b/application/pages/modplatform/VanillaPage.cpp index 013ca426..77dbc42a 100644 --- a/application/pages/modplatform/VanillaPage.cpp +++ b/application/pages/modplatform/VanillaPage.cpp @@ -25,6 +25,7 @@ VanillaPage::VanillaPage(NewInstanceDialog *dialog, QWidget *parent) connect(ui->snapshotFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged); connect(ui->oldSnapshotFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged); connect(ui->releaseFilter, &QCheckBox::stateChanged, this, &VanillaPage::filterChanged); + connect(ui->refreshBtn, &QPushButton::clicked, this, &VanillaPage::refresh); } void VanillaPage::openedImpl() @@ -33,23 +34,6 @@ void VanillaPage::openedImpl() { auto vlist = ENV.metadataIndex()->get("net.minecraft"); ui->versionList->initialize(vlist.get()); - if(vlist->isLoaded()) - { - setSelectedVersion(vlist->getRecommended()); - } - else - { - vlist->load(Net::Mode::Online); - auto task = vlist->getLoadTask(); - if(vlist->isLoaded()) - { - setSelectedVersion(vlist->getRecommended()); - } - if(task) - { - connect(task.get(), &Task::succeeded, this, &VanillaPage::versionListUpdated); - } - } initialized = true; } else @@ -58,6 +42,11 @@ void VanillaPage::openedImpl() } } +void VanillaPage::refresh() +{ + ui->versionList->loadList(); +} + void VanillaPage::filterChanged() { QStringList out; @@ -90,15 +79,6 @@ BaseVersionPtr VanillaPage::selectedVersion() const return m_selectedVersion; } -void VanillaPage::versionListUpdated() -{ - if(!m_versionSetByUser) - { - auto vlist = ENV.metadataIndex()->get("net.minecraft"); - setSelectedVersion(vlist->getRecommended()); - } -} - void VanillaPage::suggestCurrent() { if(m_selectedVersion && isOpened) diff --git a/application/pages/modplatform/VanillaPage.h b/application/pages/modplatform/VanillaPage.h index 3f9d20ec..91c65edf 100644 --- a/application/pages/modplatform/VanillaPage.h +++ b/application/pages/modplatform/VanillaPage.h @@ -60,10 +60,10 @@ public slots: void setSelectedVersion(BaseVersionPtr version); private slots: - void versionListUpdated(); void filterChanged(); private: + void refresh(); void suggestCurrent(); private: |