From 14ac234daf1680b0685f6bea3e74aa09dfcf38ef Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 14 Dec 2013 13:23:13 +0100 Subject: - plugin list now highlights plugins with attached ini files - bugfix: opening nexus through the globe icon used the nmm.nexusmods.com url --- src/pluginlist.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/pluginlist.cpp') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 8eeed76e..20d4d357 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -146,7 +146,11 @@ void PluginList::refresh(const QString &profileName, const DirectoryEntry &baseD bool archive = false; try { FilesOrigin &origin = baseDirectory.getOriginByID(current->getOrigin(archive)); - m_ESPs.push_back(ESPInfo(filename, forceEnabled, current->getFileTime(), ToQString(origin.getName()), ToQString(current->getFullPath()))); + + QString iniPath = QFileInfo(filename).baseName() + ".ini"; + bool hasIni = baseDirectory.findFile(ToWString(iniPath)).get() != NULL; + + m_ESPs.push_back(ESPInfo(filename, forceEnabled, current->getFileTime(), ToQString(origin.getName()), ToQString(current->getFullPath()), hasIni)); } catch (const std::exception &e) { reportError(tr("failed to update esp info for file %1 (source id: %2), error: %3").arg(filename).arg(current->getOrigin(archive)).arg(e.what())); } @@ -724,7 +728,9 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const return QIcon(":/MO/gui/warning"); } else if (m_LockedOrder.find(m_ESPs[index].m_Name.toLower()) != m_LockedOrder.end()) { return QIcon(":/MO/gui/locked"); - } else if (m_ESPs[index].m_IsDummy && m_ESPs[index].m_Enabled) { + } else if (m_ESPs[index].m_HasIni) { + return QIcon(":/MO/gui/attachment"); + } else if (m_ESPs[index].m_IsDummy && m_ESPs[index].m_Enabled && !m_ESPs[index].m_HasIni) { return QIcon(":/MO/gui/edit_clear"); } else { return QVariant(); @@ -759,7 +765,10 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const m_ESPs[index].m_MasterUnset.begin(), m_ESPs[index].m_MasterUnset.end(), std::inserter(enabledMasters, enabledMasters.end())); text += "
" + tr("Enabled Masters") + ": " + SetJoin(enabledMasters, ", "); - if (m_ESPs[index].m_IsDummy) { + if (m_ESPs[index].m_HasIni) { + text += "
There is an ini file connected to this esp. Its settings will be added to your game settings, overwriting " + "in case of conflicts."; + } else if (m_ESPs[index].m_IsDummy) { text += "
This file is a dummy! It exists only so the bsa with the same name gets loaded. With MO you don't need this: " "If you enable the archive with the same name in the \"Archive\" tab you can disable this plugin."; } @@ -1021,9 +1030,11 @@ bool PluginList::eventFilter(QObject *obj, QEvent *event) } -PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, FILETIME time, const QString &originName, const QString &fullPath) - : m_Name(name), m_Enabled(enabled), m_ForceEnabled(enabled), m_Removed(false), m_Priority(0), - m_LoadOrder(-1), m_Time(time), m_OriginName(originName) +PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, FILETIME time, + const QString &originName, const QString &fullPath, + bool hasIni) + : m_Name(name), m_Enabled(enabled), m_ForceEnabled(enabled), m_Removed(false), + m_Priority(0), m_LoadOrder(-1), m_Time(time), m_OriginName(originName), m_HasIni(hasIni) { try { ESP::File file(ToWString(fullPath)); -- cgit v1.3.1