mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
formatting fix
This commit is contained in:
@@ -431,7 +431,7 @@ auto CModListView::buttonEnabledState(QString modName, ModState & mod)
|
|||||||
|
|
||||||
QStringList notInstalledDependencies = getModsToInstall(modName);
|
QStringList notInstalledDependencies = getModsToInstall(modName);
|
||||||
QStringList unavailableDependencies = findUnavailableMods(notInstalledDependencies);
|
QStringList unavailableDependencies = findUnavailableMods(notInstalledDependencies);
|
||||||
bool translationMismatch = mod.isTranslation() && CGeneralTextHandler::getPreferredLanguage() != mod.getBaseLanguage().toStdString();
|
bool translationMismatch = mod.isTranslation() && CGeneralTextHandler::getPreferredLanguage() != mod.getBaseLanguage().toStdString();
|
||||||
bool modIsBeingDownloaded = enqueuedModDownloads.contains(mod.getID());
|
bool modIsBeingDownloaded = enqueuedModDownloads.contains(mod.getID());
|
||||||
|
|
||||||
res.disableVisible = modStateModel->isModInstalled(mod.getID()) && modStateModel->isModEnabled(mod.getID());
|
res.disableVisible = modStateModel->isModInstalled(mod.getID()) && modStateModel->isModEnabled(mod.getID());
|
||||||
@@ -470,13 +470,13 @@ void CModListView::onCustomContextMenu(const QPoint &point)
|
|||||||
QList<QAction*> actions;
|
QList<QAction*> actions;
|
||||||
|
|
||||||
auto addContextEntry = [this, &contextMenu, &actions, mod](bool visible, bool enabled, QString name, std::function<void(ModState)> function){
|
auto addContextEntry = [this, &contextMenu, &actions, mod](bool visible, bool enabled, QString name, std::function<void(ModState)> function){
|
||||||
if(visible)
|
if(!visible)
|
||||||
{
|
return;
|
||||||
actions.append(new QAction(name, this));
|
|
||||||
connect(actions.back(), &QAction::triggered, this, [mod, function](){ function(mod); });
|
actions.append(new QAction(name, this));
|
||||||
contextMenu->addAction(actions.back());
|
connect(actions.back(), &QAction::triggered, this, [mod, function](){ function(mod); });
|
||||||
actions.back()->setEnabled(enabled);
|
contextMenu->addAction(actions.back());
|
||||||
}
|
actions.back()->setEnabled(enabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
auto state = buttonEnabledState(modName, mod);
|
auto state = buttonEnabledState(modName, mod);
|
||||||
@@ -517,10 +517,10 @@ void CModListView::onCustomContextMenu(const QPoint &point)
|
|||||||
[](ModState mod){
|
[](ModState mod){
|
||||||
QUrl url(mod.getDownloadUrl());
|
QUrl url(mod.getDownloadUrl());
|
||||||
QString repoUrl = QString("%1://%2/%3/%4")
|
QString repoUrl = QString("%1://%2/%3/%4")
|
||||||
.arg(url.scheme())
|
.arg(url.scheme())
|
||||||
.arg(url.host())
|
.arg(url.host())
|
||||||
.arg(url.path().split('/')[1])
|
.arg(url.path().split('/')[1])
|
||||||
.arg(url.path().split('/')[2]);
|
.arg(url.path().split('/')[2]);
|
||||||
QDesktopServices::openUrl(repoUrl);
|
QDesktopServices::openUrl(repoUrl);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -809,7 +809,7 @@ void CModListView::downloadFinished(QStringList savedFiles, QStringList failedFi
|
|||||||
{
|
{
|
||||||
// some mods were not downloaded
|
// some mods were not downloaded
|
||||||
int result = QMessageBox::warning (this, title, firstLine + errors.join("\n") + lastLine,
|
int result = QMessageBox::warning (this, title, firstLine + errors.join("\n") + lastLine,
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No );
|
||||||
|
|
||||||
if(result == QMessageBox::Yes)
|
if(result == QMessageBox::Yes)
|
||||||
doInstallFiles = true;
|
doInstallFiles = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user