From c6101e34e1e142a3442c3a4543ea22dabd31fa33 Mon Sep 17 00:00:00 2001 From: Tannin Date: Mon, 18 Nov 2013 20:17:14 +0100 Subject: - archive.dll now supports querying the crc value of files - esptk now determines if a esp is a dummy (without records) - hook.dll no longer creates a log file if noone wrote to it - nexus id and installtime columns are now hidden by default - modlist can now be refreshed without saving first (so plugins can replace the modlist.txt as a whole) - plugins can now query more details about virtualised files - added style options "plastique" and "cleanlooks" - "overwrite" is no longer listed with a creation time - a warning will now be displayed if the user has too many plugins active - a warning will now be displayed if mods with scripts have an installation order that doesn't match the corresponding esp load order - nmm importer now has select all/deselect all buttons - nmm importer no longer tries to unpack missing files from archives (won't work anyway) - initial support for importing from nmm 0.5 alpha - removed some broken warning suppresions - python runner now works with bundled python - extended qbs build system (still fails to build the main gui application) - implemented a nsis-based installer --- src/mainwindow.cpp | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f726757c..a8026b68 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -188,8 +188,13 @@ MainWindow::MainWindow(const QString &exeName, QSettings &initSettings, QWidget ui->modList->header()->installEventFilter(&m_ModList); if (initSettings.contains("mod_list_state")) { ui->modList->header()->restoreState(initSettings.value("mod_list_state").toByteArray()); + } else { + // hide these columns by default + ui->modList->header()->setSectionHidden(ModList::COL_MODID, true); + ui->modList->header()->setSectionHidden(ModList::COL_INSTALLTIME, true); } - ui->modList->header()->setSectionHidden(0, false); // prevent the name-column from being hidden + + ui->modList->header()->setSectionHidden(ModList::COL_NAME, false); // prevent the name-column from being hidden ui->modList->installEventFilter(&m_ModList); // set up plugin list @@ -1364,10 +1369,12 @@ void MainWindow::startExeAction() } -void MainWindow::refreshModList() +void MainWindow::refreshModList(bool saveChanges) { // don't lose changes! - m_CurrentProfile->writeModlistNow(true); + if (saveChanges) { + m_CurrentProfile->writeModlistNow(true); + } ModInfo::updateFromDisc(m_Settings.getModDirectory(), &m_DirectoryStructure); m_CurrentProfile->refreshModStatus(); @@ -2096,6 +2103,32 @@ QStringList MainWindow::findFiles(const QString &path, const std::function MainWindow::findFileInfos(const QString &path, const std::function &filter) const +{ + QList result; + DirectoryEntry *dir = m_DirectoryStructure->findSubDirectoryRecursive(ToWString(path)); + if (dir != NULL) { + std::vector files = dir->getFiles(); + foreach (FileEntry::Ptr file, files) { + FileInfo info; + info.filePath = ToQString(file->getFullPath()); + bool fromArchive = false; + info.origins.append(ToQString(m_DirectoryStructure->getOriginByID(file->getOrigin(fromArchive)).getName())); + info.archive = fromArchive ? ToQString(file->getArchive()) : ""; + foreach (int idx, file->getAlternatives()) { + info.origins.append(ToQString(m_DirectoryStructure->getOriginByID(idx).getName())); + } + + if (filter(info)) { + result.append(info); + } + } + } else { + qWarning("directory %s not found", qPrintable(path)); + } + return result; +} + IDownloadManager *MainWindow::downloadManager() { return &m_DownloadManager; @@ -2161,6 +2194,9 @@ std::vector MainWindow::activeProblems() const if (m_UnloadedPlugins.size() != 0) { problems.push_back(PROBLEM_PLUGINSNOTLOADED); } + if (m_PluginList.enabledCount() > 256) { + problems.push_back(PROBLEM_TOOMANYPLUGINS); + } return problems; } @@ -2170,6 +2206,9 @@ QString MainWindow::shortDescription(unsigned int key) const case PROBLEM_PLUGINSNOTLOADED: { return tr("Some plugins could not be loaded"); } break; + case PROBLEM_TOOMANYPLUGINS: { + return tr("Too many esps and esms enabled"); + } break; default: { return tr("Description missing"); } break; @@ -2187,6 +2226,10 @@ QString MainWindow::fullDescription(unsigned int key) const result += "
    "; return result; } break; + case PROBLEM_TOOMANYPLUGINS: { + return tr("The game doesn't allow more than 256 active plugins (including the official ones) to be loaded. You have to disable some unused plugins or " + "merge some plugins into one. You can find a guide here: http://wiki.step-project.com/Guide:Merging_Plugins"); + } break; default: { return tr("Description missing"); } break; @@ -3195,6 +3238,7 @@ void MainWindow::syncOverwrite() modInfo->testValid(); refreshDirectoryStructure(); } + } void MainWindow::createModFromOverwrite() -- cgit v1.3.1