summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/pages/modplatform/VanillaPage.cpp32
-rw-r--r--application/pages/modplatform/VanillaPage.h2
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: