From ef2cbe16e611da68f3cb529f87f4ecb3038af161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 9 Dec 2017 01:30:23 +0100 Subject: NOISSUE when there is a version added already, preselect it in the version select dialog --- application/pages/VersionPage.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'application/pages/VersionPage.cpp') diff --git a/application/pages/VersionPage.cpp b/application/pages/VersionPage.cpp index 632c3734..a4abcd60 100644 --- a/application/pages/VersionPage.cpp +++ b/application/pages/VersionPage.cpp @@ -315,6 +315,11 @@ void VersionPage::on_changeVersionBtn_clicked() return; } VersionSelectDialog vselect(list.get(), tr("Change %1 version").arg(name), this); + auto currentVersion = patch->getVersion(); + if(!currentVersion.isEmpty()) + { + vselect.setCurrentVersion(currentVersion); + } if (!vselect.exec() || !vselect.selectedVersion()) return; @@ -379,6 +384,13 @@ void VersionPage::on_forgeBtn_clicked() vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_profile->getComponentVersion("net.minecraft")); vselect.setEmptyString(tr("No Forge versions are currently available for Minecraft ") + m_profile->getComponentVersion("net.minecraft")); vselect.setEmptyErrorString(tr("Couldn't load or download the Forge version lists!")); + + auto currentVersion = m_profile->getComponentVersion("net.minecraftforge"); + if(!currentVersion.isEmpty()) + { + vselect.setCurrentVersion(currentVersion); + } + if (vselect.exec() && vselect.selectedVersion()) { auto vsn = vselect.selectedVersion(); @@ -439,6 +451,13 @@ void VersionPage::on_liteloaderBtn_clicked() vselect.setExactFilter(BaseVersionList::ParentVersionRole, m_profile->getComponentVersion("net.minecraft")); vselect.setEmptyString(tr("No LiteLoader versions are currently available for Minecraft ") + m_profile->getComponentVersion("net.minecraft")); vselect.setEmptyErrorString(tr("Couldn't load or download the LiteLoader version lists!")); + + auto currentVersion = m_profile->getComponentVersion("com.mumfrey.liteloader"); + if(!currentVersion.isEmpty()) + { + vselect.setCurrentVersion(currentVersion); + } + if (vselect.exec() && vselect.selectedVersion()) { auto vsn = vselect.selectedVersion(); -- cgit v1.2.3