Tweak version page: select first item by default, allow changing version of 'version.json'.
This commit is contained in:
parent
c08bfce5f2
commit
478815dae6
@ -84,6 +84,10 @@ VersionPage::VersionPage(OneSixInstance *inst, QWidget *parent)
|
|||||||
connect(ui->libraryTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
|
connect(ui->libraryTreeView->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||||
this, &VersionPage::versionCurrent);
|
this, &VersionPage::versionCurrent);
|
||||||
updateVersionControls();
|
updateVersionControls();
|
||||||
|
// select first item.
|
||||||
|
auto index = main_model->index(0,0);
|
||||||
|
if(index.isValid())
|
||||||
|
ui->libraryTreeView->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -373,7 +377,8 @@ void VersionPage::versionCurrent(const QModelIndex ¤t, const QModelIndex &
|
|||||||
ui->moveLibraryUpBtn->setEnabled(enabled);
|
ui->moveLibraryUpBtn->setEnabled(enabled);
|
||||||
}
|
}
|
||||||
QString selectedId = m_version->versionFileId(current.row());
|
QString selectedId = m_version->versionFileId(current.row());
|
||||||
if (selectedId == "net.minecraft" || selectedId == "org.multimc.custom.json")
|
if (selectedId == "net.minecraft" || selectedId == "org.multimc.custom.json" ||
|
||||||
|
selectedId == "org.multimc.version.json")
|
||||||
{
|
{
|
||||||
ui->changeMCVersionBtn->setEnabled(true);
|
ui->changeMCVersionBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user