From 84c66727bff954fd0820fc9f33833848496e9531 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 14 Jul 2014 21:22:44 +0200 Subject: - when highlighting a mod the overwritten and overwriting mods are now highlighted in the list - when starting an external application MO now wraps the process in a job and waits on that instead. This way MO is not unlocked early when skyrim is started through skse - mod info dialog no longer offers the esp tab for foreign mods because that caused confusion - updated translation files - download directory and mod directory are now created if necessary - bugfix: staging script created unnecessary copies of translation files - bugfix: potential invalid array access when trying to determine best mod order - bugfix: deleter file wasn't removed after esp hiding was disabled - bugfix: potential access to to un-initialized login reply - bugfix: changed the initialization order to allow more ui controls to be localized --- src/modlist.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 3f46b85f..7e5a5f58 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -23,6 +23,7 @@ along with Mod Organizer. If not, see . #include "messagedialog.h" #include "installationtester.h" #include "qtgroupingproxy.h" +#include "viewmarkingscrollbar.h" #include #include #include @@ -291,6 +292,15 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const } } return QVariant(); + } else if ((role == Qt::BackgroundRole) + || (role == ViewMarkingScrollBar::DEFAULT_ROLE)) { + if (m_Overwrite.find(modIndex) != m_Overwrite.end()) { + return QColor(0, 255, 0, 64); + } else if (m_Overwritten.find(modIndex) != m_Overwritten.end()) { + return QColor(255, 0, 0, 64); + } else { + return QVariant(); + } } else if (role == Qt::ToolTipRole) { if (column == COL_FLAGS) { QString result; @@ -576,6 +586,13 @@ void ModList::changeModPriority(int sourceIndex, int newPriority) emit modorder_changed(); } +void ModList::setOverwriteMarkers(const std::set &overwrite, const std::set &overwritten) +{ + m_Overwrite = overwrite; + m_Overwritten = overwritten; + notifyChange(0, rowCount()); +} + void ModList::modInfoAboutToChange(ModInfo::Ptr info) { m_ChangeInfo.name = info->name(); @@ -903,9 +920,10 @@ bool ModList::eventFilter(QObject *obj, QEvent *event) } else if ((event->type() == QEvent::KeyPress) && (m_Profile != NULL)) { QAbstractItemView *itemView = qobject_cast(obj); QKeyEvent *keyEvent = static_cast(event); - if ((itemView != NULL) && - (keyEvent->modifiers() == Qt::ControlModifier) && - ((keyEvent->key() == Qt::Key_Up) || (keyEvent->key() == Qt::Key_Down))) { + if ((itemView != NULL) + && (keyEvent->modifiers() == Qt::ControlModifier) + && ((keyEvent->key() == Qt::Key_Up) + || (keyEvent->key() == Qt::Key_Down))) { QItemSelectionModel *selectionModel = itemView->selectionModel(); const QAbstractProxyModel *proxyModel = qobject_cast(selectionModel->model()); const QSortFilterProxyModel *filterModel = NULL; -- cgit v1.3.1