mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-22 22:13:35 +02:00
Merge pull request #5035 from IvanSavenko/launcher_fix
Fixes for mod management in Launcher
This commit is contained in:
commit
55c594e591
@ -144,6 +144,7 @@ CModListView::CModListView(QWidget * parent)
|
|||||||
|
|
||||||
ui->splitter->setStyleSheet("QSplitter::handle {background: palette('window');}");
|
ui->splitter->setStyleSheet("QSplitter::handle {background: palette('window');}");
|
||||||
|
|
||||||
|
disableModInfo();
|
||||||
setupModModel();
|
setupModModel();
|
||||||
setupFilterModel();
|
setupFilterModel();
|
||||||
setupModsView();
|
setupModsView();
|
||||||
@ -151,6 +152,7 @@ CModListView::CModListView(QWidget * parent)
|
|||||||
ui->progressWidget->setVisible(false);
|
ui->progressWidget->setVisible(false);
|
||||||
dlManager = nullptr;
|
dlManager = nullptr;
|
||||||
|
|
||||||
|
modModel->reloadRepositories();
|
||||||
if(settings["launcher"]["autoCheckRepositories"].Bool())
|
if(settings["launcher"]["autoCheckRepositories"].Bool())
|
||||||
loadRepositories();
|
loadRepositories();
|
||||||
|
|
||||||
@ -597,6 +599,10 @@ QStringList CModListView::getModsToInstall(QString mod)
|
|||||||
void CModListView::on_updateButton_clicked()
|
void CModListView::on_updateButton_clicked()
|
||||||
{
|
{
|
||||||
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
QString modName = ui->allModsView->currentIndex().data(ModRoles::ModNameRole).toString();
|
||||||
|
auto targetMod = modStateModel->getMod(modName);
|
||||||
|
|
||||||
|
if(targetMod.isUpdateAvailable())
|
||||||
|
downloadFile(modName + ".zip", targetMod.getDownloadUrl(), modName, targetMod.getDownloadSizeBytes());
|
||||||
|
|
||||||
for(const auto & name : getModsToInstall(modName))
|
for(const auto & name : getModsToInstall(modName))
|
||||||
{
|
{
|
||||||
@ -928,6 +934,7 @@ void CModListView::installMods(QStringList archives)
|
|||||||
manager->installMod(modNames[i], archives[i]);
|
manager->installMod(modNames[i], archives[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!modsToEnable.empty())
|
||||||
manager->enableMods(modsToEnable);
|
manager->enableMods(modsToEnable);
|
||||||
|
|
||||||
checkManagerErrors();
|
checkManagerErrors();
|
||||||
|
Loading…
Reference in New Issue
Block a user