summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp2
-rw-r--r--src/mainwindow.cpp43
-rw-r--r--src/mainwindow.h2
-rw-r--r--src/mainwindow.ui6
-rw-r--r--src/modconflicticondelegate.h2
-rw-r--r--src/modlist.h5
-rw-r--r--src/settings.cpp2
7 files changed, 38 insertions, 24 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1f6c57d1..eeabd497 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -735,8 +735,6 @@ int runApplication(MOApplication &application, SingleInstance &instance,
QObject::connect(&instance, SIGNAL(messageSent(QString)), &organizer,
SLOT(externalMessage(QString)));
- mainWindow.processUpdates(settings);
-
// this must be before readSettings(), see DockFixer in mainwindow.cpp
splash.finish(&mainWindow);
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 1ea2a612..f58473e9 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -178,6 +178,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <stdexcept>
#include <sstream>
#include <utility>
+#include <iterator>
#ifdef TEST_MODELS
#include "modeltest.h"
@@ -461,6 +462,7 @@ MainWindow::MainWindow(Settings &settings
resetActionIcons();
updatePluginCount();
updateModCount();
+ processUpdates();
}
void MainWindow::setupModList()
@@ -504,7 +506,7 @@ void MainWindow::setupModList()
ModConflictIconDelegate* conflictFlagDelegate = new ModConflictIconDelegate(
- ui->modList, ModList::COL_CONFLICTFLAGS, 120);
+ ui->modList, ModList::COL_CONFLICTFLAGS, 80);
connect(
ui->modList->header(), SIGNAL(sectionResized(int, int, int)),
@@ -2228,7 +2230,8 @@ void MainWindow::readSettings()
}
}
-void MainWindow::processUpdates(Settings& settings) {
+void MainWindow::processUpdates() {
+ auto& settings = m_OrganizerCore.settings();
const auto earliest = QVersionNumber::fromString("2.1.2").normalized();
const auto lastVersion = settings.version().value_or(earliest);
@@ -2237,15 +2240,6 @@ void MainWindow::processUpdates(Settings& settings) {
settings.processUpdates(currentVersion, lastVersion);
if (!settings.firstStart()) {
- if (lastVersion < QVersionNumber(2, 1, 3)) {
- bool lastHidden = true;
- for (int i = ModList::COL_GAME; i < ui->modList->model()->columnCount(); ++i) {
- bool hidden = ui->modList->header()->isSectionHidden(i);
- ui->modList->header()->setSectionHidden(i, lastHidden);
- lastHidden = hidden;
- }
- }
-
if (lastVersion < QVersionNumber(2, 1, 6)) {
ui->modList->header()->setSectionHidden(ModList::COL_NOTES, true);
}
@@ -2258,11 +2252,28 @@ void MainWindow::processUpdates(Settings& settings) {
}
if (lastVersion < QVersionNumber(2, 2, 2)) {
- bool lastHidden = true;
- for (int i = ModList::COL_CONFLICTFLAGS; i < ui->modList->model()->columnCount(); ++i) {
- bool hidden = ui->modList->header()->isSectionHidden(i);
- ui->modList->header()->setSectionHidden(i, lastHidden);
- lastHidden = hidden;
+ int pos1 = ui->modList->columnViewportPosition(ModList::COL_FLAGS);
+ int pos2 = 0;
+ if (pos1) {
+ ui->modList->showColumn(ModList::COL_CONFLICTFLAGS);
+ pos2 = ui->modList->columnViewportPosition(ModList::COL_CONFLICTFLAGS);
+ ui->modList->header()->moveSection(
+ ui->modList->header()->visualIndexAt(pos2),
+ ui->modList->header()->visualIndexAt(pos1)
+ );
+ }
+ }
+ } else {
+ { // Move conflict flags
+ int pos1 = ui->modList->columnViewportPosition(ModList::COL_FLAGS);
+ int pos2 = 0;
+ if (pos1) {
+ ui->modList->showColumn(ModList::COL_CONFLICTFLAGS);
+ pos2 = ui->modList->columnViewportPosition(ModList::COL_CONFLICTFLAGS);
+ ui->modList->header()->moveSection(
+ ui->modList->header()->visualIndexAt(pos2),
+ ui->modList->header()->visualIndexAt(pos1)
+ );
}
}
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
index c462a186..4adab809 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -116,7 +116,7 @@ public:
QWidget *parent = 0);
~MainWindow();
- void processUpdates(Settings& settings);
+ void processUpdates();
QWidget* qtWidget() override;
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index 309e9f62..a7e7b937 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -1076,6 +1076,9 @@ p, li { white-space: pre-wrap; }
<property name="whatsThis">
<string>This is an overview of your data directory as visible to the game (and tools). </string>
</property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
<property name="uniformRowHeights">
<bool>true</bool>
</property>
@@ -1165,6 +1168,9 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt;If you click &amp;quot;Fix Mods...&amp;quot; in the context menu, MO will try to activate all mods and esps to fix those missing esps. It will not disable anything!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
+ <property name="alternatingRowColors">
+ <bool>true</bool>
+ </property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
diff --git a/src/modconflicticondelegate.h b/src/modconflicticondelegate.h
index d36477c6..8645da12 100644
--- a/src/modconflicticondelegate.h
+++ b/src/modconflicticondelegate.h
@@ -8,7 +8,7 @@ class ModConflictIconDelegate : public IconDelegate
Q_OBJECT;
public:
- explicit ModConflictIconDelegate(QObject *parent = 0, int logicalIndex = -1, int compactSize = 120);
+ explicit ModConflictIconDelegate(QObject *parent = 0, int logicalIndex = -1, int compactSize = 80);
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
static QList<QString> getIconsForFlags(
diff --git a/src/modlist.h b/src/modlist.h
index 8841ec29..ce439f7b 100644
--- a/src/modlist.h
+++ b/src/modlist.h
@@ -57,7 +57,6 @@ public:
enum EColumn {
COL_NAME,
- COL_CONFLICTFLAGS,
COL_FLAGS,
COL_CONTENT,
COL_CATEGORY,
@@ -67,8 +66,8 @@ public:
COL_INSTALLTIME,
COL_PRIORITY,
COL_NOTES,
-
- COL_LASTCOLUMN = COL_NOTES
+ COL_CONFLICTFLAGS,
+ COL_LASTCOLUMN = COL_CONFLICTFLAGS,
};
typedef boost::signals2::signal<void (const QString &, ModStates)> SignalModStateChanged;
diff --git a/src/settings.cpp b/src/settings.cpp
index 68dc19d9..5170a5de 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1973,7 +1973,7 @@ void InterfaceSettings::setShowChangeGameConfirmation(bool b)
bool InterfaceSettings::doubleClicksOpenPreviews() const
{
- return get<bool>(m_Settings, "Settings", "double_click_previews", false);
+ return get<bool>(m_Settings, "Settings", "double_click_previews", true);
}
void InterfaceSettings::setDoubleClicksOpenPreviews(bool b)