summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2021-01-18 08:21:41 +0100
committerGitHub <noreply@github.com>2021-01-18 08:21:41 +0100
commit59f055ba93381b965cdc04557ac1dce2df36bd07 (patch)
treeda831741fc6100921fe47ad2f20ab4f8b5605ef2
parent2b1f01cba2a50a17db69187a1b4cbecf5a0fb65d (diff)
parent1644d30e59e03b90a8a392ff54cdec527d4a85a5 (diff)
Merge pull request #1368 from Holt59/new-settings
Add settings to not check update on mod install and to auto-collapse on hover.
-rw-r--r--src/mainwindow.cpp4
-rw-r--r--src/modlistview.cpp2
-rw-r--r--src/settings.cpp20
-rw-r--r--src/settings.h11
-rw-r--r--src/settingsdialog.ui55
-rw-r--r--src/settingsdialoguserinterface.cpp4
6 files changed, 82 insertions, 14 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9c049efa..a2b12686 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2191,6 +2191,10 @@ void MainWindow::directory_refreshed()
void MainWindow::modInstalled(const QString &modName)
{
+ if (!m_OrganizerCore.settings().interface().checkUpdateAfterInstallation()) {
+ return;
+ }
+
unsigned int index = ModInfo::getIndex(modName);
if (index == UINT_MAX) {
diff --git a/src/modlistview.cpp b/src/modlistview.cpp
index 9b461b8f..763e852a 100644
--- a/src/modlistview.cpp
+++ b/src/modlistview.cpp
@@ -1377,7 +1377,7 @@ void ModListView::timerEvent(QTimerEvent* event)
if (state() == QAbstractItemView::DraggingState
&& viewport()->rect().contains(pos)) {
QModelIndex index = indexAt(pos);
- setExpanded(index, true);
+ setExpanded(index, !m_core->settings().interface().autoCollapseOnHover() || !isExpanded(index));
}
m_openTimer.stop();
}
diff --git a/src/settings.cpp b/src/settings.cpp
index 7047fa44..142d3f39 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -2238,6 +2238,26 @@ void InterfaceSettings::setSaveFilters(bool b)
set(m_Settings, "Settings", "save_filters", b);
}
+bool InterfaceSettings::autoCollapseOnHover() const
+{
+ return get<bool>(m_Settings, "Settings", "auto_collapse_on_hover", false);
+}
+
+void InterfaceSettings::setAutoCollapseOnHover(bool b)
+{
+ set(m_Settings, "Settings", "auto_collapse_on_hover", b);
+}
+
+bool InterfaceSettings::checkUpdateAfterInstallation() const
+{
+ return get<bool>(m_Settings, "Settings", "autocheck_update_install", true);
+}
+
+void InterfaceSettings::setCheckUpdateAfterInstallation(bool b)
+{
+ set(m_Settings, "Settings", "autocheck_update_install", b);
+}
+
bool InterfaceSettings::compactDownloads() const
{
return get<bool>(m_Settings, "Settings", "compact_downloads", false);
diff --git a/src/settings.h b/src/settings.h
index 5f6dd37c..96290f55 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -653,6 +653,17 @@ public:
bool saveFilters() const;
void setSaveFilters(bool b);
+ // whether to collapse groups (separators, categories, ...) after
+ // a delay when hovering (similar to auto-expand)
+ //
+ bool autoCollapseOnHover() const;
+ void setAutoCollapseOnHover(bool b);
+
+ // whether to check for update after installing a mod
+ //
+ bool checkUpdateAfterInstallation() const;
+ void setCheckUpdateAfterInstallation(bool b);
+
// whether to show compact downloads
//
bool compactDownloads() const;
diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui
index bcef5d95..a223d628 100644
--- a/src/settingsdialog.ui
+++ b/src/settingsdialog.ui
@@ -282,6 +282,35 @@ If you disable this feature, MO will only display official DLCs this way. Please
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="checkUpdateInstallBox">
+ <property name="toolTip">
+ <string>Check if updates are available for mods after installing them.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Check if updates are available for mods after installing them.</string>
+ </property>
+ <property name="text">
+ <string>Check for updates when installing mods</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="autoCollapseDelayBox">
+ <property name="toolTip">
+ <string>Automatically collapse separators, categories or nexus ids after a delay when hovering them during drag.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Automatically collapse separators, categories or nexus ids after a delay when hovering them during drag.</string>
+ </property>
+ <property name="text">
+ <string>Automatically collapse items during drag on hover</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer_9">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -352,19 +381,6 @@ If you disable this feature, MO will only display official DLCs this way. Please
</property>
</widget>
</item>
- <item row="1" column="0" colspan="3">
- <widget class="QCheckBox" name="collapsibleSeparatorsPerProfileBox">
- <property name="toolTip">
- <string>Do not share the collapse/expanded state of separators between profiles.</string>
- </property>
- <property name="whatsThis">
- <string>Do not share the collapse/expanded state of separators between profiles.</string>
- </property>
- <property name="text">
- <string>Profile-specific collapse states for separators</string>
- </property>
- </widget>
- </item>
<item row="3" column="2">
<widget class="QCheckBox" name="collapsibleSeparatorsIconsFlagsBox">
<property name="text">
@@ -461,6 +477,19 @@ If you disable this feature, MO will only display official DLCs this way. Please
</property>
</widget>
</item>
+ <item row="1" column="0" colspan="5">
+ <widget class="QCheckBox" name="collapsibleSeparatorsPerProfileBox">
+ <property name="toolTip">
+ <string>Do not share the collapse/expanded state of separators between profiles.</string>
+ </property>
+ <property name="whatsThis">
+ <string>Do not share the collapse/expanded state of separators between profiles.</string>
+ </property>
+ <property name="text">
+ <string>Profile-specific collapse states for separators</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
diff --git a/src/settingsdialoguserinterface.cpp b/src/settingsdialoguserinterface.cpp
index 49710771..503e0feb 100644
--- a/src/settingsdialoguserinterface.cpp
+++ b/src/settingsdialoguserinterface.cpp
@@ -32,6 +32,8 @@ UserInterfaceSettingsTab::UserInterfaceSettingsTab(Settings& s, SettingsDialog&
ui->collapsibleSeparatorsHighlightToBox->setChecked(settings().interface().collapsibleSeparatorsHighlightTo());
ui->collapsibleSeparatorsPerProfileBox->setChecked(settings().interface().collapsibleSeparatorsPerProfile());
ui->saveFiltersBox->setChecked(settings().interface().saveFilters());
+ ui->autoCollapseDelayBox->setChecked(settings().interface().autoCollapseOnHover());
+ ui->checkUpdateInstallBox->setChecked(settings().interface().checkUpdateAfterInstallation());
for (auto& p : m_columnToBox) {
p.second->setChecked(settings().interface().collapsibleSeparatorsIcons(p.first));
@@ -60,6 +62,8 @@ void UserInterfaceSettingsTab::update()
settings().interface().setCollapsibleSeparatorsHighlightTo(ui->collapsibleSeparatorsHighlightToBox->isChecked());
settings().interface().setCollapsibleSeparatorsPerProfile(ui->collapsibleSeparatorsPerProfileBox->isChecked());
settings().interface().setSaveFilters(ui->saveFiltersBox->isChecked());
+ settings().interface().setAutoCollapseOnHover(ui->autoCollapseDelayBox->isChecked());
+ settings().interface().setCheckUpdateAfterInstallation(ui->checkUpdateInstallBox->isChecked());
for (auto& p : m_columnToBox) {
settings().interface().setCollapsibleSeparatorsIcons(p.first, p.second->isChecked());