Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into skin_selector
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -1202,17 +1202,27 @@ void MainWindow::on_actionViewSkinsFolder_triggered()
|
||||
|
||||
void MainWindow::on_actionViewIconThemeFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path());
|
||||
DesktopServices::openDirectory(APPLICATION->themeManager()->getIconThemesFolder().path(), true);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionViewWidgetThemeFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path());
|
||||
DesktopServices::openDirectory(APPLICATION->themeManager()->getApplicationThemesFolder().path(), true);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionViewCatPackFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path());
|
||||
DesktopServices::openDirectory(APPLICATION->themeManager()->getCatPacksFolder().path(), true);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionViewIconsFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory(APPLICATION->icons()->getDirectory(), true);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionViewLogsFolder_triggered()
|
||||
{
|
||||
DesktopServices::openDirectory("logs", true);
|
||||
}
|
||||
|
||||
void MainWindow::refreshInstances()
|
||||
|
||||
@@ -117,6 +117,8 @@ class MainWindow : public QMainWindow {
|
||||
void on_actionViewIconThemeFolder_triggered();
|
||||
void on_actionViewWidgetThemeFolder_triggered();
|
||||
void on_actionViewCatPackFolder_triggered();
|
||||
void on_actionViewIconsFolder_triggered();
|
||||
void on_actionViewLogsFolder_triggered();
|
||||
|
||||
void on_actionViewSkinsFolder_triggered();
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>20</height>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="fileMenu">
|
||||
@@ -195,6 +195,9 @@
|
||||
<addaction name="actionViewIconThemeFolder"/>
|
||||
<addaction name="actionViewWidgetThemeFolder"/>
|
||||
<addaction name="actionViewCatPackFolder"/>
|
||||
<addaction name="actionViewIconsFolder"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionViewLogsFolder"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="accountsMenu">
|
||||
<property name="title">
|
||||
@@ -546,10 +549,10 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View &Instance Folder</string>
|
||||
<string>&Instances</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the instance folder in a file browser.</string>
|
||||
<string>Open the instances folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewLauncherRootFolder">
|
||||
@@ -558,7 +561,7 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View Launcher &Root Folder</string>
|
||||
<string>Launcher &Root</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the launcher's root folder in a file browser.</string>
|
||||
@@ -570,7 +573,7 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View &Central Mods Folder</string>
|
||||
<string>&Central Mods</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the central mods folder in a file browser.</string>
|
||||
@@ -582,12 +585,36 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View &Skins Folder</string>
|
||||
<string>&Skins</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the skins folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewIconsFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Instance Icons</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the instance icons folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewLogsFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Logs</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the logs folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionChangeTheme">
|
||||
<property name="text">
|
||||
<string>Themes</string>
|
||||
@@ -731,10 +758,10 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View &Widget Themes Folder</string>
|
||||
<string>&Widget Themes</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>View Widget Theme Folder</string>
|
||||
<string>Open the widget themes folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewIconThemeFolder">
|
||||
@@ -743,18 +770,22 @@
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View I&con Theme Folder</string>
|
||||
<string>I&con Theme</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>View Icon Theme Folder</string>
|
||||
<string>Open the icon theme folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewCatPackFolder">
|
||||
<property name="icon">
|
||||
<iconset theme="viewfolder"/>
|
||||
<iconset theme="viewfolder">
|
||||
<normaloff>.</normaloff>.</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>View Cat Packs Folder</string>
|
||||
<string>Cat Packs</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open the cat packs folder in a file browser.</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -13,7 +13,6 @@ enum class ResourceProvider;
|
||||
|
||||
class Mod;
|
||||
class NetJob;
|
||||
class ModUpdateDialog;
|
||||
|
||||
class ChooseProviderDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
@@ -105,8 +105,16 @@ void MSALoginDialog::showVerificationUriAndCode(const QUrl& uri, const QString&
|
||||
|
||||
QString urlString = uri.toString();
|
||||
QString linkString = QString("<a href=\"%1\">%2</a>").arg(urlString, urlString);
|
||||
ui->label->setText(
|
||||
tr("<p>Please open up %1 in a browser and put in the code <b>%2</b> to proceed with login.</p>").arg(linkString, code));
|
||||
if (urlString == "https://www.microsoft.com/link" && !code.isEmpty()) {
|
||||
urlString += QString("?otc=%1").arg(code);
|
||||
DesktopServices::openUrl(urlString);
|
||||
ui->label->setText(tr("<p>Please login in the opened browser. If no browser was opened, please open up %1 in "
|
||||
"a browser and put in the code <b>%2</b> to proceed with login.</p>")
|
||||
.arg(linkString, code));
|
||||
} else {
|
||||
ui->label->setText(
|
||||
tr("<p>Please open up %1 in a browser and put in the code <b>%2</b> to proceed with login.</p>").arg(linkString, code));
|
||||
}
|
||||
ui->actionButton->setVisible(true);
|
||||
connect(ui->actionButton, &QPushButton::clicked, [=]() {
|
||||
DesktopServices::openUrl(uri);
|
||||
|
||||
@@ -39,7 +39,8 @@ static std::optional<ModPlatform::ModLoaderTypes> mcLoaders(BaseInstance* inst)
|
||||
ModUpdateDialog::ModUpdateDialog(QWidget* parent,
|
||||
BaseInstance* instance,
|
||||
const std::shared_ptr<ModFolderModel> mods,
|
||||
QList<Mod*>& search_for)
|
||||
QList<Mod*>& search_for,
|
||||
bool includeDeps)
|
||||
: ReviewMessageBox(parent, tr("Confirm mods to update"), "")
|
||||
, m_parent(parent)
|
||||
, m_mod_model(mods)
|
||||
@@ -47,6 +48,7 @@ ModUpdateDialog::ModUpdateDialog(QWidget* parent,
|
||||
, m_second_try_metadata(
|
||||
new ConcurrentTask(nullptr, "Second Metadata Search", APPLICATION->settings()->get("NumberOfConcurrentTasks").toInt()))
|
||||
, m_instance(instance)
|
||||
, m_include_deps(includeDeps)
|
||||
{
|
||||
ReviewMessageBox::setGeometry(0, 0, 800, 600);
|
||||
|
||||
@@ -186,7 +188,7 @@ void ModUpdateDialog::checkCandidates()
|
||||
}
|
||||
}
|
||||
|
||||
if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies
|
||||
if (m_include_deps && !APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies
|
||||
auto depTask = makeShared<GetModDependenciesTask>(this, m_instance, m_mod_model.get(), selectedVers);
|
||||
|
||||
connect(depTask.get(), &Task::failed, this,
|
||||
|
||||
@@ -19,7 +19,8 @@ class ModUpdateDialog final : public ReviewMessageBox {
|
||||
explicit ModUpdateDialog(QWidget* parent,
|
||||
BaseInstance* instance,
|
||||
const std::shared_ptr<ModFolderModel> mod_model,
|
||||
QList<Mod*>& search_for);
|
||||
QList<Mod*>& search_for,
|
||||
bool includeDeps);
|
||||
|
||||
void checkCandidates();
|
||||
|
||||
@@ -61,4 +62,5 @@ class ModUpdateDialog final : public ReviewMessageBox {
|
||||
|
||||
bool m_no_updates = false;
|
||||
bool m_aborted = false;
|
||||
bool m_include_deps = false;
|
||||
};
|
||||
|
||||
@@ -278,12 +278,14 @@ void InstanceView::mousePressEvent(QMouseEvent* event)
|
||||
m_pressedAlreadySelected = selectionModel()->isSelected(m_pressedIndex);
|
||||
m_pressedPosition = geometryPos;
|
||||
|
||||
VisualGroup::HitResults hitResult;
|
||||
m_pressedCategory = categoryAt(geometryPos, hitResult);
|
||||
if (m_pressedCategory && hitResult & VisualGroup::CheckboxHit) {
|
||||
setState(m_pressedCategory->collapsed ? ExpandingState : CollapsingState);
|
||||
event->accept();
|
||||
return;
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
VisualGroup::HitResults hitResult;
|
||||
m_pressedCategory = categoryAt(geometryPos, hitResult);
|
||||
if (m_pressedCategory && hitResult & VisualGroup::CheckboxHit) {
|
||||
setState(m_pressedCategory->collapsed ? ExpandingState : CollapsingState);
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (index.isValid() && (index.flags() & Qt::ItemIsEnabled)) {
|
||||
@@ -366,10 +368,7 @@ void InstanceView::mouseReleaseEvent(QMouseEvent* event)
|
||||
|
||||
VisualGroup::HitResults hitResult;
|
||||
|
||||
bool click =
|
||||
(index == m_pressedIndex && index.isValid()) || (m_pressedCategory && m_pressedCategory == categoryAt(geometryPos, hitResult));
|
||||
|
||||
if (click && m_pressedCategory) {
|
||||
if (event->button() == Qt::LeftButton && m_pressedCategory != nullptr && m_pressedCategory == categoryAt(geometryPos, hitResult)) {
|
||||
if (state() == ExpandingState) {
|
||||
m_pressedCategory->collapsed = false;
|
||||
emit groupStateChanged(m_pressedCategory->text, false);
|
||||
@@ -397,7 +396,7 @@ void InstanceView::mouseReleaseEvent(QMouseEvent* event)
|
||||
|
||||
setState(NoState);
|
||||
|
||||
if (click) {
|
||||
if (index == m_pressedIndex && index.isValid()) {
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
emit clicked(index);
|
||||
}
|
||||
|
||||
@@ -226,6 +226,7 @@ void AccountListPage::updateButtonStates()
|
||||
ui->actionNoDefault->setEnabled(true);
|
||||
ui->actionNoDefault->setChecked(false);
|
||||
}
|
||||
ui->listView->resizeColumnToContents(3);
|
||||
}
|
||||
|
||||
void AccountListPage::on_actionManageSkins_triggered()
|
||||
|
||||
@@ -209,10 +209,10 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="dependenciesDisableBtn">
|
||||
<property name="toolTip">
|
||||
<string>Disable automatically checking and installation of mod dependencies.</string>
|
||||
<string>Disable the automatic detection, installation, and updating of mod dependencies.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Do not install mod dependencies</string>
|
||||
<string>Disable automatic mod dependency management</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "minecraft/mod/ResourceFolderModel.h"
|
||||
#include "ui/GuiUtil.h"
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <algorithm>
|
||||
@@ -95,7 +96,8 @@ ExternalResourcesPage::ExternalResourcesPage(BaseInstance* instance, std::shared
|
||||
|
||||
connect(viewHeader, &QHeaderView::customContextMenuRequested, this, &ExternalResourcesPage::ShowHeaderContextMenu);
|
||||
|
||||
m_model->loadHiddenColumns(ui->treeView);
|
||||
m_model->loadColumns(ui->treeView);
|
||||
connect(ui->treeView->header(), &QHeaderView::sectionResized, this, [this] { m_model->saveColumns(ui->treeView); });
|
||||
}
|
||||
|
||||
ExternalResourcesPage::~ExternalResourcesPage()
|
||||
|
||||
@@ -70,6 +70,9 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="WideBar" name="actionsToolbar">
|
||||
<property name="useDefaultAction" stdset="0">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
@@ -146,17 +149,6 @@
|
||||
<string>Download a new resource</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUpdateItem">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Check for &Updates</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Try to check or update all selected resources (all resources if none are selected)</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionVisitItemPage">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
@@ -168,15 +160,15 @@
|
||||
<string>Go to mods home page</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRemoveItemMetadata">
|
||||
<action name="actionUpdateItem">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove metadata</string>
|
||||
<string>Check for &Updates</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Remove mod's metadata</string>
|
||||
<string>Try to check or update all selected resources (all resources if none are selected)</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -84,50 +84,71 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel>
|
||||
|
||||
connect(ui->actionDownloadItem, &QAction::triggered, this, &ModFolderPage::installMods);
|
||||
|
||||
// update menu
|
||||
auto updateMenu = ui->actionUpdateItem->menu();
|
||||
if (updateMenu) {
|
||||
updateMenu->clear();
|
||||
} else {
|
||||
updateMenu = new QMenu(this);
|
||||
}
|
||||
|
||||
auto update = updateMenu->addAction(tr("Check for Updates"));
|
||||
update->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)"));
|
||||
connect(update, &QAction::triggered, this, &ModFolderPage::updateMods);
|
||||
|
||||
auto updateWithDeps = updateMenu->addAction(tr("Verify Dependencies"));
|
||||
updateWithDeps->setToolTip(
|
||||
tr("Try to update and check for missing dependencies all selected mods (all mods if none are selected)"));
|
||||
connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); });
|
||||
|
||||
auto depsDisabled = APPLICATION->settings()->getSetting("ModDependenciesDisabled");
|
||||
updateWithDeps->setVisible(!depsDisabled->get().toBool());
|
||||
connect(depsDisabled.get(), &Setting::SettingChanged, this,
|
||||
[updateWithDeps](const Setting& setting, QVariant value) { updateWithDeps->setVisible(!value.toBool()); });
|
||||
|
||||
auto actionRemoveItemMetadata = updateMenu->addAction(tr("Reset update metadata"));
|
||||
actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata"));
|
||||
connect(actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata);
|
||||
actionRemoveItemMetadata->setEnabled(false);
|
||||
|
||||
ui->actionUpdateItem->setMenu(updateMenu);
|
||||
|
||||
ui->actionUpdateItem->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)"));
|
||||
ui->actionsToolbar->insertActionAfter(ui->actionAddItem, ui->actionUpdateItem);
|
||||
connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods);
|
||||
ui->actionsToolbar->insertActionBefore(ui->actionAddItem, ui->actionUpdateItem);
|
||||
|
||||
ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page"));
|
||||
ui->actionsToolbar->addAction(ui->actionVisitItemPage);
|
||||
connect(ui->actionVisitItemPage, &QAction::triggered, this, &ModFolderPage::visitModPages);
|
||||
|
||||
ui->actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata"));
|
||||
ui->actionsToolbar->insertActionAfter(ui->actionRemoveItem, ui->actionRemoveItemMetadata);
|
||||
connect(ui->actionRemoveItemMetadata, &QAction::triggered, this, &ModFolderPage::deleteModMetadata);
|
||||
|
||||
auto check_allow_update = [this] { return ui->treeView->selectionModel()->hasSelection() || !m_model->empty(); };
|
||||
|
||||
connect(ui->treeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, [this, check_allow_update] {
|
||||
ui->actionUpdateItem->setEnabled(check_allow_update());
|
||||
connect(ui->treeView->selectionModel(), &QItemSelectionModel::selectionChanged, this,
|
||||
[this, check_allow_update, actionRemoveItemMetadata] {
|
||||
ui->actionUpdateItem->setEnabled(check_allow_update());
|
||||
|
||||
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
|
||||
auto mods_list = m_model->selectedMods(selection);
|
||||
auto selected = std::count_if(mods_list.cbegin(), mods_list.cend(),
|
||||
[](Mod* v) { return v->metadata() != nullptr || v->homeurl().size() != 0; });
|
||||
if (selected <= 1) {
|
||||
ui->actionVisitItemPage->setText(tr("Visit mod's page"));
|
||||
ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page"));
|
||||
auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
|
||||
auto mods_list = m_model->selectedMods(selection);
|
||||
auto selected = std::count_if(mods_list.cbegin(), mods_list.cend(),
|
||||
[](Mod* v) { return v->metadata() != nullptr || v->homeurl().size() != 0; });
|
||||
if (selected <= 1) {
|
||||
ui->actionVisitItemPage->setText(tr("Visit mod's page"));
|
||||
ui->actionVisitItemPage->setToolTip(tr("Go to mod's home page"));
|
||||
|
||||
ui->actionRemoveItemMetadata->setToolTip(tr("Remove mod's metadata"));
|
||||
} else {
|
||||
ui->actionVisitItemPage->setText(tr("Visit mods' pages"));
|
||||
ui->actionVisitItemPage->setToolTip(tr("Go to the pages of the selected mods"));
|
||||
} else {
|
||||
ui->actionVisitItemPage->setText(tr("Visit mods' pages"));
|
||||
ui->actionVisitItemPage->setToolTip(tr("Go to the pages of the selected mods"));
|
||||
}
|
||||
ui->actionVisitItemPage->setEnabled(selected != 0);
|
||||
actionRemoveItemMetadata->setEnabled(selected != 0);
|
||||
});
|
||||
|
||||
ui->actionRemoveItemMetadata->setToolTip(tr("Remove mods' metadata"));
|
||||
}
|
||||
ui->actionVisitItemPage->setEnabled(selected != 0);
|
||||
ui->actionRemoveItemMetadata->setEnabled(selected != 0);
|
||||
});
|
||||
auto updateButtons = [this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); };
|
||||
connect(mods.get(), &ModFolderModel::rowsInserted, this, updateButtons);
|
||||
|
||||
connect(mods.get(), &ModFolderModel::rowsInserted, this,
|
||||
[this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); });
|
||||
connect(mods.get(), &ModFolderModel::rowsRemoved, this, updateButtons);
|
||||
|
||||
connect(mods.get(), &ModFolderModel::rowsRemoved, this,
|
||||
[this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); });
|
||||
|
||||
connect(mods.get(), &ModFolderModel::updateFinished, this,
|
||||
[this, check_allow_update] { ui->actionUpdateItem->setEnabled(check_allow_update()); });
|
||||
connect(mods.get(), &ModFolderModel::updateFinished, this, updateButtons);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +225,7 @@ void ModFolderPage::installMods()
|
||||
}
|
||||
}
|
||||
|
||||
void ModFolderPage::updateMods()
|
||||
void ModFolderPage::updateMods(bool includeDeps)
|
||||
{
|
||||
if (m_instance->typeName() != "Minecraft")
|
||||
return; // this is a null instance or a legacy instance
|
||||
@@ -225,7 +246,7 @@ void ModFolderPage::updateMods()
|
||||
if (use_all)
|
||||
mods_list = m_model->allMods();
|
||||
|
||||
ModUpdateDialog update_dialog(this, m_instance, m_model, mods_list);
|
||||
ModUpdateDialog update_dialog(this, m_instance, m_model, mods_list, includeDeps);
|
||||
update_dialog.checkCandidates();
|
||||
|
||||
if (update_dialog.aborted()) {
|
||||
|
||||
@@ -64,7 +64,7 @@ class ModFolderPage : public ExternalResourcesPage {
|
||||
void deleteModMetadata();
|
||||
|
||||
void installMods();
|
||||
void updateMods();
|
||||
void updateMods(bool includeDeps = false);
|
||||
void visitModPages();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -48,14 +48,14 @@ void ModListView::setModel(QAbstractItemModel* model)
|
||||
return;
|
||||
}
|
||||
if (!string.size()) {
|
||||
head->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||
head->setSectionResizeMode(0, QHeaderView::Interactive);
|
||||
head->setSectionResizeMode(1, QHeaderView::Stretch);
|
||||
for (int i = 2; i < head->count(); i++)
|
||||
head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
|
||||
head->setSectionResizeMode(i, QHeaderView::Interactive);
|
||||
} else {
|
||||
head->setSectionResizeMode(0, QHeaderView::Stretch);
|
||||
for (int i = 1; i < head->count(); i++)
|
||||
head->setSectionResizeMode(i, QHeaderView::ResizeToContents);
|
||||
head->setSectionResizeMode(i, QHeaderView::Interactive);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user