summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-11-18 20:17:14 +0100
committerTannin <devnull@localhost>2013-11-18 20:17:14 +0100
commitc6101e34e1e142a3442c3a4543ea22dabd31fa33 (patch)
tree0e737a47f5cec0afac715ae7f6e5fd1e5fb108b9 /src/mainwindow.cpp
parent75475a7984466afd1cf77f2e4a9f722c0a859404 (diff)
- 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
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp50
1 files changed, 47 insertions, 3 deletions
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<bool(
return result;
}
+QList<IOrganizer::FileInfo> MainWindow::findFileInfos(const QString &path, const std::function<bool (const IOrganizer::FileInfo &)> &filter) const
+{
+ QList<IOrganizer::FileInfo> result;
+ DirectoryEntry *dir = m_DirectoryStructure->findSubDirectoryRecursive(ToWString(path));
+ if (dir != NULL) {
+ std::vector<FileEntry::Ptr> 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<unsigned int> 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 += "<ul>";
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: <a href=\"http://wiki.step-project.com/Guide:Merging_Plugins\">http://wiki.step-project.com/Guide:Merging_Plugins</a>");
+ } break;
default: {
return tr("Description missing");
} break;
@@ -3195,6 +3238,7 @@ void MainWindow::syncOverwrite()
modInfo->testValid();
refreshDirectoryStructure();
}
+
}
void MainWindow::createModFromOverwrite()