From 1b85cda62682d084ea7bc335713131334955d497 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 4 Mar 2018 11:59:18 +0100 Subject: Added open logs folder to open folder toolbar dropdown. --- src/mainwindow.cpp | 25 +++++++++++++++++++++---- src/mainwindow.h | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fe93b546..71df8acf 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3035,6 +3035,12 @@ void MainWindow::openInstanceFolder() ::ShellExecuteW(nullptr, L"explore", ToWString(m_OrganizerCore.settings().getBaseDirectory()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } +void MainWindow::openLogsFolder() +{ + QString logsPath = qApp->property("dataPath").toString() + "/" + QString::fromStdWString(AppConfig::logPath()); + ::ShellExecuteW(nullptr, L"explore", ToWString(logsPath).c_str(), nullptr, nullptr, SW_SHOWNORMAL); +} + void MainWindow::openInstallFolder() { ::ShellExecuteW(nullptr, L"explore", ToWString(qApp->applicationDirPath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); @@ -3231,6 +3237,11 @@ QMenu *MainWindow::openFolderMenu() QMenu *FolderMenu = new QMenu(this); + FolderMenu->addAction(tr("Open Game folder"), this, SLOT(openGameFolder())); + + FolderMenu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder())); + + FolderMenu->addSeparator(); FolderMenu->addAction(tr("Open Instance folder"), this, SLOT(openInstanceFolder())); @@ -3238,13 +3249,19 @@ QMenu *MainWindow::openFolderMenu() FolderMenu->addAction(tr("Open Downloads folder"), this, SLOT(openDownloadsFolder())); - FolderMenu->addAction(tr("Open MO Install folder"), this, SLOT(openInstallFolder())); - FolderMenu->addSeparator(); - FolderMenu->addAction(tr("Open Game folder"), this, SLOT(openGameFolder())); + FolderMenu->addAction(tr("Open MO2 Install folder"), this, SLOT(openInstallFolder())); - FolderMenu->addAction(tr("Open MyGames folder"), this, SLOT(openMyGamesFolder())); + FolderMenu->addAction(tr("Open MO2 Logs folder"), this, SLOT(openLogsFolder())); + + + + + + + + return FolderMenu; diff --git a/src/mainwindow.h b/src/mainwindow.h index 2c2e2723..f84931ca 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -487,6 +487,7 @@ private slots: void disableVisibleMods(); void exportModListCSV(); void openInstanceFolder(); + void openLogsFolder(); void openInstallFolder(); void openDownloadsFolder(); void openProfileFolder(); -- cgit v1.3.1 From a873f7cfe2581716fd908062831d5d5c8f56392f Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 4 Mar 2018 12:52:28 +0100 Subject: Removed "Repace category" menu option from the modlist as it was redundant and cluttering the menu. --- src/mainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 71df8acf..eb612b6b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3326,10 +3326,13 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) connect(addRemoveCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(addRemoveCategories_MenuHandler())); addMenuAsPushButton(menu, addRemoveCategoriesMenu); + //Removed as it was redundant, just making the categories look more complicated. + /* QMenu *replaceCategoriesMenu = new QMenu(tr("Replace Categories")); populateMenuCategories(replaceCategoriesMenu, 0); connect(replaceCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(replaceCategories_MenuHandler())); addMenuAsPushButton(menu, replaceCategoriesMenu); + */ QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category")); connect(primaryCategoryMenu, SIGNAL(aboutToShow()), this, SLOT(addPrimaryCategoryCandidates())); -- cgit v1.3.1 From 7cf0c1a29b463885e37a49691daffb98afdf58db Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 4 Mar 2018 19:12:52 +0100 Subject: Changed tooltip of Open Folder menu. --- src/mainwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 31522c03..451e3c87 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -253,7 +253,7 @@ p, li { white-space: pre-wrap; } - Quickly open in Explorer relevant Folders... + Show Open Folders menu... -- cgit v1.3.1 From 513c0629323c066a7b1d5df5ce81f3b9beac85bd Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 5 Mar 2018 15:16:55 +0100 Subject: Inverted position of reinstall and remove mod, as per user request. --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index eb612b6b..ddd7ef92 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3352,8 +3352,8 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu->addSeparator(); menu->addAction(tr("Rename Mod..."), this, SLOT(renameMod_clicked())); - menu->addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked())); menu->addAction(tr("Reinstall Mod"), this, SLOT(reinstallMod_clicked())); + menu->addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked())); menu->addSeparator(); -- cgit v1.3.1 From 52501e73c9c205c08b1a8a288c88b5c3362a1381 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 4 Mar 2018 21:05:31 +0100 Subject: Updated Open Folder icon as it was not very distinguishable. --- src/resources/open-Folder-Icon.png | Bin 17646 -> 16927 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/resources/open-Folder-Icon.png b/src/resources/open-Folder-Icon.png index 345671f7..c363be0f 100644 Binary files a/src/resources/open-Folder-Icon.png and b/src/resources/open-Folder-Icon.png differ -- cgit v1.3.1 From 7c87e9a64556c588a66482ea9acace52c76af7cd Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 4 Mar 2018 19:12:06 +0100 Subject: Edited "Add/Remove category" menu entry text to "Change Category". --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ddd7ef92..f5be22f0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3321,7 +3321,7 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) } else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) != flags.end()) { // nop, nothing to do with this mod } else { - QMenu *addRemoveCategoriesMenu = new QMenu(tr("Add/Remove Categories")); + QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories")); populateMenuCategories(addRemoveCategoriesMenu, 0); connect(addRemoveCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(addRemoveCategories_MenuHandler())); addMenuAsPushButton(menu, addRemoveCategoriesMenu); -- cgit v1.3.1 From 673a5034f0eb9fb12befdbb52ea8dd5d72ac302e Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 7 Mar 2018 13:49:25 +0100 Subject: Added check for mod rename to ensure the new name is not already used by another mod. --- src/modlist.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/modlist.cpp b/src/modlist.cpp index 4002a424..7b2ad1f9 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -424,6 +424,11 @@ bool ModList::renameMod(int index, const QString &newName) return false; } + if (ModList::allMods().contains(newName,Qt::CaseInsensitive)) { + MessageDialog::showMessage(tr("Name is already in use by another mod"), nullptr); + return false; + } + ModInfo::Ptr modInfo = ModInfo::getByIndex(index); QString oldName = modInfo->name(); if (newName != oldName) { -- cgit v1.3.1 From c7f660e061f92901b80558c2bfe7640944fc1840 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Thu, 8 Mar 2018 15:55:24 -0600 Subject: Remove outdated namespacing and correct the PATH setting to appends dlls --- src/categories.cpp | 2 +- src/categories.h | 2 +- src/main.cpp | 10 +++++----- src/mainwindow.cpp | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/categories.cpp b/src/categories.cpp index d8cd49fb..4d89eff9 100644 --- a/src/categories.cpp +++ b/src/categories.cpp @@ -167,7 +167,7 @@ void CategoryFactory::saveCategories() } -unsigned int CategoryFactory::countCategories(std::tr1::function filter) +unsigned int CategoryFactory::countCategories(std::function filter) { unsigned int result = 0; for (const Category &cat : m_Categories) { diff --git a/src/categories.h b/src/categories.h index 66299c30..474a1440 100644 --- a/src/categories.h +++ b/src/categories.h @@ -99,7 +99,7 @@ public: * @param filter the filter to test * @return number of matching categories */ - unsigned int countCategories(std::tr1::function filter); + unsigned int countCategories(std::function filter); /** * @brief get the id of the parent category diff --git a/src/main.cpp b/src/main.cpp index 935b7404..0464ca9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -402,6 +402,8 @@ void setupPath() qDebug("MO at: %s", qPrintable(QDir::toNativeSeparators( QCoreApplication::applicationDirPath()))); + QCoreApplication::setLibraryPaths(QStringList(QCoreApplication::applicationDirPath() + "/dlls") + QCoreApplication::libraryPaths()); + boost::scoped_array oldPath(new TCHAR[BUFSIZE]); DWORD offset = ::GetEnvironmentVariable(TEXT("PATH"), oldPath.get(), BUFSIZE); if (offset > BUFSIZE) { @@ -409,12 +411,10 @@ void setupPath() ::GetEnvironmentVariable(TEXT("PATH"), oldPath.get(), offset); } - std::wstring newPath(oldPath.get()); + std::wstring newPath(ToWString(QDir::toNativeSeparators( + QCoreApplication::applicationDirPath())) + L"\\dlls"); newPath += L";"; - newPath += ToWString(QDir::toNativeSeparators( - QCoreApplication::applicationDirPath())) - .c_str(); - newPath += L"\\dlls"; + newPath += oldPath.get(); ::SetEnvironmentVariableW(L"PATH", newPath.c_str()); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f5be22f0..83a12437 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4596,8 +4596,8 @@ void MainWindow::processLOOTOut(const std::string &lootOut, std::string &errorMe std::vector lines; boost::split(lines, lootOut, boost::is_any_of("\r\n")); - std::tr1::regex exRequires("\"([^\"]*)\" requires \"([^\"]*)\", but it is missing\\."); - std::tr1::regex exIncompatible("\"([^\"]*)\" is incompatible with \"([^\"]*)\", but both are present\\."); + std::regex exRequires("\"([^\"]*)\" requires \"([^\"]*)\", but it is missing\\."); + std::regex exIncompatible("\"([^\"]*)\" is incompatible with \"([^\"]*)\", but both are present\\."); for (const std::string &line : lines) { if (line.length() > 0) { @@ -4609,12 +4609,12 @@ void MainWindow::processLOOTOut(const std::string &lootOut, std::string &errorMe qWarning("%s", line.c_str()); errorMessages.append(boost::algorithm::trim_copy(line.substr(erroridx + 8)) + "\n"); } else { - std::tr1::smatch match; - if (std::tr1::regex_match(line, match, exRequires)) { + std::smatch match; + if (std::regex_match(line, match, exRequires)) { std::string modName(match[1].first, match[1].second); std::string dependency(match[2].first, match[2].second); m_OrganizerCore.pluginList()->addInformation(modName.c_str(), tr("depends on missing \"%1\"").arg(dependency.c_str())); - } else if (std::tr1::regex_match(line, match, exIncompatible)) { + } else if (std::regex_match(line, match, exIncompatible)) { std::string modName(match[1].first, match[1].second); std::string dependency(match[2].first, match[2].second); m_OrganizerCore.pluginList()->addInformation(modName.c_str(), tr("incompatible with \"%1\"").arg(dependency.c_str())); -- cgit v1.3.1 From 9ee2831c59c379e01bd73ced25ce02270dba48df Mon Sep 17 00:00:00 2001 From: LePresidente Date: Sun, 11 Mar 2018 16:21:06 +0200 Subject: Fix library include for zlibstatic --- src/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c94aa689..60b36683 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -277,6 +277,7 @@ SET(default_project_path "${CMAKE_SOURCE_DIR}/..") GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH) SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects") +#TODO this should not be a hardcoded path SET(lib_path "${project_path}/../../install/libs") @@ -289,11 +290,9 @@ INCLUDE_DIRECTORIES(${project_path}/uibase/src ${project_path}/game_features/src ${project_path}/githubpp/src) - INCLUDE_DIRECTORIES(shared ${ZLIB_INCLUDE_DIRS}) LINK_DIRECTORIES(${lib_path} - ${project_path}/../zlib/lib) - + ${ZLIB_ROOT}/lib) EXECUTE_PROCESS( COMMAND git log -1 --format=%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} -- cgit v1.3.1 From 0983c88c17ec7d3ca42438d9ae07b6a0def3cf3b Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sun, 11 Mar 2018 23:15:07 +0000 Subject: Deploy the qtdds.dll as part of the MO install --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60b36683..ab7b4836 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -368,6 +368,9 @@ INSTALL( file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/bin/qtplugins)" ) +# qdds.dll needs installing manually as Qt no longer ships with it by default. +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../qdds.dll DESTINATION bin/dlls/imageformats) + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/stylesheets ${CMAKE_CURRENT_SOURCE_DIR}/tutorials DESTINATION bin) -- cgit v1.3.1 From 9f61ef5c9e6c8884a14b7d6f1507199f61a64377 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 12 Mar 2018 19:53:43 +0100 Subject: Added a check to the preview function to handle tha case of the file beeing from the actual data folder instead of a mod. --- src/mainwindow.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 83a12437..bdf79bd5 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3929,10 +3929,22 @@ void MainWindow::previewDataFile() // what we have is an absolute path to the file in its actual location (for the primary origin) // what we want is the path relative to the virtual data directory - // crude: we search for the next slash after the base mod directory to skip everything up to the data-relative directory - int offset = m_OrganizerCore.settings().getModDirectory().size() + 1; - offset = fileName.indexOf("/", offset); - fileName = fileName.mid(offset + 1); + // we need to look in the virtual directory for the file to make sure the info is up to date. + + // check if the file comes from the actual data folder instead of a mod + QDir gameDirectory = m_OrganizerCore.managedGame()->dataDirectory().absolutePath(); + QString relativePath = gameDirectory.relativeFilePath(fileName); + if (!relativePath.startsWith("..")) { + fileName = relativePath; + } + else { + // crude: we search for the next slash after the base mod directory to skip everything up to the data-relative directory + int offset = m_OrganizerCore.settings().getModDirectory().size() + 1; + offset = fileName.indexOf("/", offset); + fileName = fileName.mid(offset + 1); + } + + const FileEntry::Ptr file = m_OrganizerCore.directoryStructure()->searchFile(ToWString(fileName), nullptr); -- cgit v1.3.1 From 8305d9215725a49dd9c61c2609fa750a20315af9 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 12 Mar 2018 12:33:05 +0100 Subject: Reverted some changes added by Qt configurator that caused some wird stretching of the mainwindow. I suspect this is caused by the fact that the archive tab was not disabled in a way that Configurator liked and it is messing with it. --- src/mainwindow.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 451e3c87..0c0ac6c6 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -176,7 +176,7 @@ 2 - + @@ -463,7 +463,7 @@ p, li { white-space: pre-wrap; } - + -- cgit v1.3.1 From ccb5ad53e22e54f416c4cc3f33c2b57d0b1b672a Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 12 Mar 2018 23:18:03 +0100 Subject: Fixed wrong Nexus page url in CSV export. --- src/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bdf79bd5..5be5cef3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3201,7 +3201,7 @@ void MainWindow::exportModListCSV() if (nexus_ID->isChecked()) builder.setRowField("#Nexus_ID", info->getNexusID()); if (mod_Nexus_URL->isChecked()) - builder.setRowField("#Mod_Nexus_URL", info->getURL()); + builder.setRowField("#Mod_Nexus_URL",(info->getNexusID()>0)? NexusInterface::instance()->getModURL(info->getNexusID()) : ""); if (mod_Version->isChecked()) builder.setRowField("#Mod_Version", info->getVersion().canonicalString()); if (install_Date->isChecked()) -- cgit v1.3.1 From 8dee1d108b4098a587f3a827c187b3c9c2559d12 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 15 Mar 2018 15:21:37 +0100 Subject: Fixed default size and positioning of some ui elements to accomodate the new ones. Fixed incorrect settings for the layout stretching. --- src/mainwindow.ui | 61 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 0c0ac6c6..e0aa6f36 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -176,7 +176,7 @@ 2 - + @@ -194,7 +194,7 @@ - + Pick a module collection @@ -463,7 +463,7 @@ p, li { white-space: pre-wrap; } - + @@ -507,15 +507,25 @@ p, li { white-space: pre-wrap; } true - - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + - + 0 0 @@ -523,9 +533,15 @@ p, li { white-space: pre-wrap; } 0 - 25 + 22 + + + 95 + 0 + + false @@ -551,7 +567,26 @@ p, li { white-space: pre-wrap; } - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 220 + 0 + + Qt::ClickFocus @@ -573,7 +608,13 @@ p, li { white-space: pre-wrap; } - + + + + 220 + 0 + + Namefilter -- cgit v1.3.1 From 2fa1b04cd430315f3abf45dcdd4975c0117ac98a Mon Sep 17 00:00:00 2001 From: Al12rs Date: Fri, 16 Mar 2018 18:02:57 +0100 Subject: Various text and ui changes: Added description to CSV export. Added line to delete instance error message. Changed delete instance icon for the list of instances. Added red X in the resources, thanks to twizz0r. --- src/instancemanager.cpp | 4 ++-- src/mainwindow.cpp | 4 ++++ src/resources.qrc | 1 + src/resources/multiply-red.png | Bin 0 -> 16018 bytes 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 src/resources/multiply-red.png (limited to 'src') diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index d12ec119..43ae152b 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -105,7 +105,7 @@ QString InstanceManager::manageInstances(const QStringList &instanceList) const nullptr); for (const QString &instance : instanceList) { - selection.addChoice(instance, "", instance); + selection.addChoice(QIcon(":/MO/gui/multiply_red"), instance, "", instance); } if (selection.exec() == QDialog::Rejected) { @@ -120,7 +120,7 @@ QString InstanceManager::manageInstances(const QStringList &instanceList) const if (!deleteLocalInstance(choice)) { QMessageBox::warning(nullptr, QObject::tr("Failed to delete Instance"), - QObject::tr("Could not delete Instance \"%1\"").arg(choice), QMessageBox::Ok); + QObject::tr("Could not delete Instance \"%1\". \nIf the folder was still in use, restart MO and try again.").arg(choice), QMessageBox::Ok); } } } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5be5cef3..2bf25b05 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3079,6 +3079,10 @@ void MainWindow::exportModListCSV() QGridLayout *grid = new QGridLayout; selection.setWindowTitle(tr("Export to csv")); + QLabel *csvDescription = new QLabel(); + csvDescription->setText(tr("CSV (Comma Separated Values) is a format that can be imported in programs like Excel to create a spreadsheet.\nYou can also use online editors and converters instead.")); + grid->addWidget(csvDescription); + QGroupBox *groupBoxRows = new QGroupBox(tr("Select what mods you want export:")); QRadioButton *all = new QRadioButton(tr("All installed mods")); QRadioButton *active = new QRadioButton(tr("Only active (checked) mods from your current profile")); diff --git a/src/resources.qrc b/src/resources.qrc index 618d3cfc..1cfc58a3 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -72,6 +72,7 @@ resources/package.png resources/switch-instance-icon.png resources/open-Folder-Icon.png + resources/multiply-red.png resources/contents/jigsaw-piece.png diff --git a/src/resources/multiply-red.png b/src/resources/multiply-red.png new file mode 100644 index 00000000..c238f07f Binary files /dev/null and b/src/resources/multiply-red.png differ -- cgit v1.3.1 From 8095be550f65b77f36c06cc731c8bfb0b9dad8c4 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 17 Mar 2018 00:58:55 +0100 Subject: Added archive-conflict icons to resources. --- src/resources.qrc | 4 ++++ src/resources/archive-conflict-loser.png | Bin 0 -> 18052 bytes src/resources/archive-conflict-mixed.png | Bin 0 -> 18052 bytes src/resources/archive-conflict-neutral.png | Bin 0 -> 18052 bytes src/resources/archive-conflict-winner.png | Bin 0 -> 18052 bytes 5 files changed, 4 insertions(+) create mode 100644 src/resources/archive-conflict-loser.png create mode 100644 src/resources/archive-conflict-mixed.png create mode 100644 src/resources/archive-conflict-neutral.png create mode 100644 src/resources/archive-conflict-winner.png (limited to 'src') diff --git a/src/resources.qrc b/src/resources.qrc index 1cfc58a3..0197b606 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -73,6 +73,10 @@ resources/switch-instance-icon.png resources/open-Folder-Icon.png resources/multiply-red.png + resources/archive-conflict-looser.png + resources/archive-conflict-mixed.png + resources/archive-conflict-neutral.png + resources/archive-conflict-winner.png resources/contents/jigsaw-piece.png diff --git a/src/resources/archive-conflict-loser.png b/src/resources/archive-conflict-loser.png new file mode 100644 index 00000000..77d2e0fa Binary files /dev/null and b/src/resources/archive-conflict-loser.png differ diff --git a/src/resources/archive-conflict-mixed.png b/src/resources/archive-conflict-mixed.png new file mode 100644 index 00000000..e71e0167 Binary files /dev/null and b/src/resources/archive-conflict-mixed.png differ diff --git a/src/resources/archive-conflict-neutral.png b/src/resources/archive-conflict-neutral.png new file mode 100644 index 00000000..aba45314 Binary files /dev/null and b/src/resources/archive-conflict-neutral.png differ diff --git a/src/resources/archive-conflict-winner.png b/src/resources/archive-conflict-winner.png new file mode 100644 index 00000000..f6260575 Binary files /dev/null and b/src/resources/archive-conflict-winner.png differ -- cgit v1.3.1 From 90165b02ab8686015d41c1fee79e5c6314a65357 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 17 Mar 2018 01:08:02 +0100 Subject: Disabled iniTweaks part of modinfodialog until it is not fixed. --- src/modinfodialog.ui | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 25822fd0..b5331424 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -110,13 +110,19 @@ + + false + - Ini Tweaks + Ini Tweaks *This feature is non-functional* + + false + 228 -- cgit v1.3.1 From 2def87a143cae7521bc8da898fddda73f213d473 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 17 Mar 2018 12:42:15 +0100 Subject: Fixed a typo of the added resource. --- src/resources.qrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/resources.qrc b/src/resources.qrc index 0197b606..1c7c92e1 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -73,7 +73,7 @@ resources/switch-instance-icon.png resources/open-Folder-Icon.png resources/multiply-red.png - resources/archive-conflict-looser.png + resources/archive-conflict-loser.png resources/archive-conflict-mixed.png resources/archive-conflict-neutral.png resources/archive-conflict-winner.png -- cgit v1.3.1 From bbce6506cdf15b5965e12ca2b10063fa8d3b85c0 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sat, 17 Mar 2018 14:41:43 +0100 Subject: Fixed another typo in the same resource --- src/resources.qrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/resources.qrc b/src/resources.qrc index 1c7c92e1..14c8e533 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -73,7 +73,7 @@ resources/switch-instance-icon.png resources/open-Folder-Icon.png resources/multiply-red.png - resources/archive-conflict-loser.png + resources/archive-conflict-loser.png resources/archive-conflict-mixed.png resources/archive-conflict-neutral.png resources/archive-conflict-winner.png -- cgit v1.3.1 From 336216ba9a7e07aad972708c862c1e7306f1c67d Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 20 Mar 2018 01:29:31 -0500 Subject: Various save game improvements related to script extender files * Improve handling of SE save transfers and deletes with main save * Add indicator in save popup dialog if SE save file is present --- src/mainwindow.cpp | 12 ++++++++---- src/transfersavesdialog.cpp | 30 ++++++++++-------------------- 2 files changed, 18 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2bf25b05..8bb40072 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4667,9 +4667,13 @@ void MainWindow::on_bossButton_clicked() QStringList parameters; parameters << "--game" << m_OrganizerCore.managedGame()->gameShortName() - << "--gamePath" << QString("\"%1\"").arg(m_OrganizerCore.managedGame()->gameDirectory().absolutePath()) - << "--pluginListPath" << QString("\"%1/loadorder.txt\"").arg(m_OrganizerCore.profilePath()) - << "--out" << QString("\"%1\"").arg(outPath); + << "--gamePath" << QString("\"%1\"").arg(m_OrganizerCore.managedGame()->gameDirectory().absolutePath()) + << "--out" << QString("\"%1\"").arg(outPath); + + if (m_OrganizerCore.managedGame()->loadOrderMechanism() == IPluginGame::LoadOrderMechanism::FileTime) + parameters << "--pluginListPath" << QString("\"%1/loadorder.txt\"").arg(m_OrganizerCore.profilePath()); + else + parameters << "--pluginListPath" << QString("\"%1/plugins.txt\"").arg(m_OrganizerCore.profilePath()); if (m_DidUpdateMasterList) { parameters << "--skipUpdateMasterlist"; @@ -4802,7 +4806,7 @@ void MainWindow::on_bossButton_clicked() // if the game specifies load order by file time, our own load order file needs to be removed because it's outdated. // refreshESPList will then use the file time as the load order. - if (m_OrganizerCore.managedGame()->loadOrderMechanism() == IPluginGame::LoadOrderMechanism::FileTime) { + if (m_OrganizerCore.managedGame()->loadOrderMechanism() != IPluginGame::LoadOrderMechanism::FileTime) { qDebug("removing loadorder.txt"); QFile::remove(m_OrganizerCore.currentProfile()->getLoadOrderFileName()); } diff --git a/src/transfersavesdialog.cpp b/src/transfersavesdialog.cpp index b8dda056..61dab6e5 100644 --- a/src/transfersavesdialog.cpp +++ b/src/transfersavesdialog.cpp @@ -74,6 +74,11 @@ public: return { m_File }; } + virtual bool hasScriptExtenderFile() const override + { + return false; + } + private: QString m_File; }; @@ -95,6 +100,11 @@ public: { return nullptr; } + + virtual bool hasScriptExtenderSave(QString const &file) const override + { + return false; + } }; } //end anonymous namespace @@ -334,26 +344,6 @@ bool TransferSavesDialog::transferCharacters( sourceFile.absoluteFilePath().toUtf8().constData(), destinationFile.toUtf8().constData()); } - - QFileInfo sourceFileSE(sourceFile.absolutePath() + "/" + sourceFile.completeBaseName() + "." + m_GamePlugin->savegameSEExtension()); - if (sourceFileSE.exists()) { - QString destinationFileSE(destination.absoluteFilePath(sourceFileSE.fileName())); - - //If the file is already there, let them skip (or not). - if (QFile::exists(destinationFileSE)) { - if (!testOverwrite(overwriteMode, destinationFileSE)) { - continue; - } - //OK, they want to remove it. - QFile::remove(destinationFileSE); - } - - if (!method(sourceFileSE.absoluteFilePath(), destinationFileSE)) { - qCritical(errmsg, - sourceFileSE.absoluteFilePath().toUtf8().constData(), - destinationFileSE.toUtf8().constData()); - } - } } } return true; -- cgit v1.3.1 From 0c792d548f44f71cdd358b5811f5ed06196430d9 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 20 Mar 2018 17:10:35 -0500 Subject: Fix lootcli destroying loadorder on newer games --- src/mainwindow.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8bb40072..e562b2f2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4668,13 +4668,9 @@ void MainWindow::on_bossButton_clicked() QStringList parameters; parameters << "--game" << m_OrganizerCore.managedGame()->gameShortName() << "--gamePath" << QString("\"%1\"").arg(m_OrganizerCore.managedGame()->gameDirectory().absolutePath()) + << "--pluginListPath" << QString("\"%1/loadorder.txt\"").arg(m_OrganizerCore.profilePath()) << "--out" << QString("\"%1\"").arg(outPath); - if (m_OrganizerCore.managedGame()->loadOrderMechanism() == IPluginGame::LoadOrderMechanism::FileTime) - parameters << "--pluginListPath" << QString("\"%1/loadorder.txt\"").arg(m_OrganizerCore.profilePath()); - else - parameters << "--pluginListPath" << QString("\"%1/plugins.txt\"").arg(m_OrganizerCore.profilePath()); - if (m_DidUpdateMasterList) { parameters << "--skipUpdateMasterlist"; } @@ -4793,7 +4789,7 @@ void MainWindow::on_bossButton_clicked() if (success) { m_DidUpdateMasterList = true; - /*if (reportURL.length() > 0) { + if (reportURL.length() > 0) { m_IntegratedBrowser.setWindowTitle("LOOT Report"); QString report(reportURL.c_str()); QStringList temp = report.split("?"); @@ -4802,13 +4798,6 @@ void MainWindow::on_bossButton_clicked() url.setQuery(temp.at(1).toUtf8()); } m_IntegratedBrowser.openUrl(url); - }*/ - - // if the game specifies load order by file time, our own load order file needs to be removed because it's outdated. - // refreshESPList will then use the file time as the load order. - if (m_OrganizerCore.managedGame()->loadOrderMechanism() != IPluginGame::LoadOrderMechanism::FileTime) { - qDebug("removing loadorder.txt"); - QFile::remove(m_OrganizerCore.currentProfile()->getLoadOrderFileName()); } m_OrganizerCore.refreshESPList(); m_OrganizerCore.savePluginList(); -- cgit v1.3.1 From 192b0bafa5ade0e8f9f36fe8ce0f1de137d72e3a Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 20 Mar 2018 17:11:00 -0500 Subject: Update about dialogue and licenses --- src/aboutdialog.cpp | 40 ++++++++++++++++++++------- src/aboutdialog.h | 15 +++++++++-- src/aboutdialog.ui | 78 ++++++++++++++++++++++++++++++++++++++++------------- 3 files changed, 103 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index ed57a217..411ef1cf 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -29,7 +29,7 @@ along with Mod Organizer. If not, see . #include #include #include - +#include AboutDialog::AboutDialog(const QString &version, QWidget *parent) : QDialog(parent) @@ -37,24 +37,44 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) { ui->setupUi(this); - m_LicenseFiles[LICENSE_LGPL3] = "lgpl-3.0.txt"; - m_LicenseFiles[LICENSE_GPL3] = "gpl-3.0.txt"; - m_LicenseFiles[LICENSE_BSD3] = "bsd3.txt"; + m_LicenseFiles[LICENSE_LGPL3] = "LGPL-v3.0.txt"; + m_LicenseFiles[LICENSE_LGPL21] = "GNU-LGPL-v2.1.txt"; + m_LicenseFiles[LICENSE_GPL3] = "GPL-v3.0.txt"; + m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt"; m_LicenseFiles[LICENSE_BOOST] = "boost.txt"; + m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt"; m_LicenseFiles[LICENSE_CCBY3] = "by-sa3.txt"; m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt"; - m_LicenseFiles[LICENSE_APACHE2] = "apache-license-2.0.txt"; + m_LicenseFiles[LICENSE_PYTHON] = "python.txt"; + m_LicenseFiles[LICENSE_SSL] = "openssl.txt"; + m_LicenseFiles[LICENSE_CPPTOML] = "cpptoml.txt"; + m_LicenseFiles[LICENSE_UDIS] = "udis86.txt"; + m_LicenseFiles[LICENSE_SPDLOG] = "spdlog.txt"; + m_LicenseFiles[LICENSE_FMT] = "fmt.txt"; + m_LicenseFiles[LICENSE_SIP] = "sip.txt"; + m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt"; + m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt"; + m_LicenseFiles[LICENSE_WIX] = "WixToolkit.txt"; addLicense("Qt", LICENSE_LGPL3); addLicense("Qt Json", LICENSE_GPL3); addLicense("Boost Library", LICENSE_BOOST); - addLicense("7-zip", LICENSE_LGPL3); - addLicense("ZLib", LICENSE_ZLIB); + addLicense("7-zip", LICENSE_7ZIP); + addLicense("ZLib", LICENSE_NONE); addLicense("Tango Icon Theme", LICENSE_NONE); addLicense("RRZE Icon Set", LICENSE_CCBY3); addLicense("Icons by Lorc, Delapouite and sbed available on http://game-icons.net", LICENSE_CCBY3); - addLicense("Castle Core", LICENSE_APACHE2); + addLicense("Castle Core", LICENSE_CASTLE); + addLicense("ANTLR", LICENSE_ANTLR); addLicense("LOOT", LICENSE_GPL3); + addLicense("Python", LICENSE_PYTHON); + addLicense("OpenSSL", LICENSE_SSL); + addLicense("cpptoml", LICENSE_CPPTOML); + addLicense("Udis86", LICENSE_UDIS); + addLicense("spdlog", LICENSE_SPDLOG); + addLicense("{fmt}", LICENSE_FMT); + addLicense("SIP", LICENSE_SIP); + addLicense("WiX Toolset", LICENSE_WIX); ui->nameLabel->setText(QString("%1 %2").arg(ui->nameLabel->text()).arg(version)); #if defined(HGID) @@ -64,6 +84,8 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) #else ui->revisionLabel->setText(ui->revisionLabel->text() + " unknown"); #endif + + ui->licenseText->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); } @@ -85,7 +107,7 @@ void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QL { auto iter = m_LicenseFiles.find(current->data(Qt::UserRole).toInt()); if (iter != m_LicenseFiles.end()) { - QString filePath = qApp->applicationDirPath() + "/license/" + iter->second; + QString filePath = qApp->applicationDirPath() + "/licenses/" + iter->second; QString text = MOBase::readFileText(filePath); ui->licenseText->setText(text); } else { diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 103a0d2f..adf8d2c7 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -45,12 +45,23 @@ private: enum Licenses { LICENSE_NONE, LICENSE_LGPL3, + LICENSE_LGPL21, LICENSE_GPL3, - LICENSE_BSD3, + LICENSE_GPL2, LICENSE_BOOST, LICENSE_CCBY3, + LICENSE_PYTHON, + LICENSE_SSL, + LICENSE_CPPTOML, + LICENSE_7ZIP, LICENSE_ZLIB, - LICENSE_APACHE2 + LICENSE_UDIS, + LICENSE_SPDLOG, + LICENSE_FMT, + LICENSE_SIP, + LICENSE_CASTLE, + LICENSE_ANTLR, + LICENSE_WIX }; private: diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui index 50a9de5f..348a33b0 100644 --- a/src/aboutdialog.ui +++ b/src/aboutdialog.ui @@ -120,14 +120,14 @@ - Copyright 2011-2016 Sebastian Herbord + <html><head/><body><p>Copyright 2011-2016 Sebastian Herbord</p><p>Copyright 2016-2018 Mod Organizer 2 contributors</p></body></html> - <html><head/><body><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p><p>See the GNU General Public License for more details.</p><p>Source code can be found at <a href="https://github.com/TanninOne/modorganizer"><span style=" text-decoration: underline; color:#007af4;">GitHub</span></a>.</p></body></html> + <html><head/><body><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p><p>See the GNU General Public License for more details.</p><p>Source code can be found at <a href="https://github.com/Modorganizer2/modorganizer"><span style=" text-decoration: underline; color:#007af4;">GitHub</span></a>.</p></body></html> true @@ -154,7 +154,7 @@ Thanks - + Current Maintainers @@ -167,12 +167,17 @@ - LePresidente + LePresidente (Project Lead) - Silarn + AL12 + + + + + Diana @@ -182,7 +187,7 @@ - Diana + Silarn @@ -203,17 +208,22 @@ - pndrev (German) + Scythe1912 (Chinese) - DaWul (Spanish) + yc0620shen (Chinese) - Fiama (Spanish) + miraclefreak (Czech) + + + + + Cyb3r (Dutch) @@ -233,17 +243,35 @@ - Scythe1912 (Chinese) + Faron (German) - yc0620shen (Chinese) + pndrev (German) - miraclefreak (Czech) + Mordan (Greek) + + + + + Ren (Korean) + + + + + + + + Yoosk (Polish) + + + + + Brgodfx (Portuguese) @@ -253,15 +281,22 @@ - Ren (Korean) + DaWul (Spanish) - - + + + + Fiama (Spanish) + + + + + Jax (Swedish) - ... more (Can't track) + ...and all other Transifex contributors! @@ -275,7 +310,7 @@ - Other Supporter + Other Supporters && Contributors @@ -283,9 +318,14 @@ QAbstractItemView::NoSelection - + + + SuperSandro2000 + + + - Al12 (Discord) + AnyOldName3 -- cgit v1.3.1 From 149ce846b52689b70781bf7716a4b480862bc402 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 20 Mar 2018 17:12:25 -0500 Subject: Installer license not needed for application --- src/aboutdialog.cpp | 2 -- src/aboutdialog.h | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index 411ef1cf..9b909ccb 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -54,7 +54,6 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) m_LicenseFiles[LICENSE_SIP] = "sip.txt"; m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt"; m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt"; - m_LicenseFiles[LICENSE_WIX] = "WixToolkit.txt"; addLicense("Qt", LICENSE_LGPL3); addLicense("Qt Json", LICENSE_GPL3); @@ -74,7 +73,6 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) addLicense("spdlog", LICENSE_SPDLOG); addLicense("{fmt}", LICENSE_FMT); addLicense("SIP", LICENSE_SIP); - addLicense("WiX Toolset", LICENSE_WIX); ui->nameLabel->setText(QString("%1 %2").arg(ui->nameLabel->text()).arg(version)); #if defined(HGID) diff --git a/src/aboutdialog.h b/src/aboutdialog.h index adf8d2c7..a67c9c73 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -60,8 +60,7 @@ private: LICENSE_FMT, LICENSE_SIP, LICENSE_CASTLE, - LICENSE_ANTLR, - LICENSE_WIX + LICENSE_ANTLR }; private: -- cgit v1.3.1 From bcc4c8d6aaab9ca4a641f7fa6b71a9f927d9bb52 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Tue, 20 Mar 2018 17:18:57 -0500 Subject: Update BY SA v3 license file to match others --- src/aboutdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index 9b909ccb..5ac05df7 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -43,7 +43,7 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) m_LicenseFiles[LICENSE_GPL2] = "GPL-v2.0.txt"; m_LicenseFiles[LICENSE_BOOST] = "boost.txt"; m_LicenseFiles[LICENSE_7ZIP] = "7zip.txt"; - m_LicenseFiles[LICENSE_CCBY3] = "by-sa3.txt"; + m_LicenseFiles[LICENSE_CCBY3] = "BY-SA-v3.0.txt"; m_LicenseFiles[LICENSE_ZLIB] = "zlib.txt"; m_LicenseFiles[LICENSE_PYTHON] = "python.txt"; m_LicenseFiles[LICENSE_SSL] = "openssl.txt"; -- cgit v1.3.1 From 92a8a3dce863c80f540537162e7c7e415cdfd57d Mon Sep 17 00:00:00 2001 From: Al12rs Date: Wed, 21 Mar 2018 00:12:39 +0100 Subject: Fixed preview "file not found" error if the mod folder containing the file was on a different drive. --- src/mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2bf25b05..f38ddf15 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3938,7 +3938,9 @@ void MainWindow::previewDataFile() // check if the file comes from the actual data folder instead of a mod QDir gameDirectory = m_OrganizerCore.managedGame()->dataDirectory().absolutePath(); QString relativePath = gameDirectory.relativeFilePath(fileName); - if (!relativePath.startsWith("..")) { + QDir direRelativePath = gameDirectory.relativeFilePath(fileName); + // if the file is on a different drive the dirRelativePath will actually be an absolute path so we make sure that is not the case + if (!direRelativePath.isAbsolute() && !relativePath.startsWith("..")) { fileName = relativePath; } else { -- cgit v1.3.1 From 82d4742e2814755a4aa812fadb382b2831680692 Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Wed, 21 Mar 2018 08:23:03 +0100 Subject: Proper variable naming and fixed Sandros OCD --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e5eacc41..cae5ee52 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3938,9 +3938,9 @@ void MainWindow::previewDataFile() // check if the file comes from the actual data folder instead of a mod QDir gameDirectory = m_OrganizerCore.managedGame()->dataDirectory().absolutePath(); QString relativePath = gameDirectory.relativeFilePath(fileName); - QDir direRelativePath = gameDirectory.relativeFilePath(fileName); + QDir dirRelativePath = gameDirectory.relativeFilePath(fileName); // if the file is on a different drive the dirRelativePath will actually be an absolute path so we make sure that is not the case - if (!direRelativePath.isAbsolute() && !relativePath.startsWith("..")) { + if (!dirRelativePath.isAbsolute() && !relativePath.startsWith("..")) { fileName = relativePath; } else { -- cgit v1.3.1 From ba0a1bd50191fb6387489c6562a2e1fe8e0451d0 Mon Sep 17 00:00:00 2001 From: LePresidente Date: Thu, 22 Mar 2018 09:41:35 +0200 Subject: Updater and Issue reports now point to Modorganizer2/modorganizer --- src/mainwindow.cpp | 17 ++++++++--------- src/selfupdater.cpp | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e5eacc41..a79e42ba 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1886,7 +1886,7 @@ void MainWindow::wikiTriggered() void MainWindow::issueTriggered() { - ::ShellExecuteW(nullptr, L"open", L"http://github.com/LePresidente/modorganizer/issues", nullptr, nullptr, SW_SHOWNORMAL); + ::ShellExecuteW(nullptr, L"open", L"http://github.com/Modorganizer2/modorganizer/issues", nullptr, nullptr, SW_SHOWNORMAL); } void MainWindow::tutorialTriggered() @@ -3036,7 +3036,7 @@ void MainWindow::openInstanceFolder() } void MainWindow::openLogsFolder() -{ +{ QString logsPath = qApp->property("dataPath").toString() + "/" + QString::fromStdWString(AppConfig::logPath()); ::ShellExecuteW(nullptr, L"explore", ToWString(logsPath).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } @@ -3237,7 +3237,7 @@ static void addMenuAsPushButton(QMenu *menu, QMenu *subMenu) } QMenu *MainWindow::openFolderMenu() -{ +{ QMenu *FolderMenu = new QMenu(this); @@ -3261,11 +3261,11 @@ QMenu *MainWindow::openFolderMenu() - - - + + + return FolderMenu; @@ -3950,7 +3950,7 @@ void MainWindow::previewDataFile() fileName = fileName.mid(offset + 1); } - + const FileEntry::Ptr file = m_OrganizerCore.directoryStructure()->searchFile(ToWString(fileName), nullptr); @@ -4666,7 +4666,7 @@ void MainWindow::on_bossButton_clicked() dialog.show(); QString outPath = QDir::temp().absoluteFilePath("lootreport.json"); - + QStringList parameters; parameters << "--game" << m_OrganizerCore.managedGame()->gameShortName() << "--gamePath" << QString("\"%1\"").arg(m_OrganizerCore.managedGame()->gameDirectory().absolutePath()) @@ -5076,4 +5076,3 @@ void MainWindow::on_clearFiltersButton_clicked() { deselectFilters(); } - diff --git a/src/selfupdater.cpp b/src/selfupdater.cpp index 273e9b45..8f962ba4 100644 --- a/src/selfupdater.cpp +++ b/src/selfupdater.cpp @@ -125,7 +125,7 @@ void SelfUpdater::testForUpdate() // TODO: if prereleases are disabled we could just request the latest release // directly try { - m_GitHub.releases(GitHub::Repository("LePresidente", "modorganizer"), + m_GitHub.releases(GitHub::Repository("Modorganizer2", "modorganizer"), [this](const QJsonArray &releases) { QJsonObject newest; for (const QJsonValue &releaseVal : releases) { -- cgit v1.3.1 From 5eb03a687c2cc676a33b2accef1d4dbc46fc9233 Mon Sep 17 00:00:00 2001 From: ImgBotApp Date: Fri, 23 Mar 2018 14:09:58 +0000 Subject: [ImgBot] optimizes images *Total -- 173.23kb -> 19.45kb (88.77%) /src/resources/multiply-red.png -- 15.64kb -> 0.65kb (95.84%) /src/resources/archive-conflict-neutral.png -- 17.63kb -> 0.83kb (95.31%) /src/resources/archive-conflict-loser.png -- 17.63kb -> 0.87kb (95.09%) /src/resources/archive-conflict-winner.png -- 17.63kb -> 0.92kb (94.8%) /src/resources/archive-conflict-mixed.png -- 17.63kb -> 0.95kb (94.63%) /src/resources/switch-instance-icon.png -- 56.17kb -> 4.23kb (92.47%) /src/resources/open-Folder-Icon.png -- 16.53kb -> 1.40kb (91.53%) /src/resources/contents/conversation.png -- 1.47kb -> 0.81kb (44.75%) /src/resources/contents/breastplate.png -- 1.39kb -> 0.77kb (44.47%) /src/resources/contents/locked-chest.png -- 1.41kb -> 0.78kb (44.38%) /src/resources/contents/lyre.png -- 1.36kb -> 0.76kb (43.59%) /src/resources/contents/usable.png -- 1.31kb -> 0.81kb (37.99%) /src/resources/contents/hand-of-god.png -- 1.08kb -> 0.67kb (37.6%) /src/resources/contents/double-quaver.png -- 0.99kb -> 0.63kb (36.57%) /src/resources/contents/jigsaw-piece.png -- 0.93kb -> 0.66kb (28.78%) /src/resources/contents/tinker.png -- 1.01kb -> 0.72kb (28.52%) /src/resources/contents/empty-chessboard.png -- 0.69kb -> 0.52kb (23.94%) /src/resources/contents/checkbox-tree.png -- 0.64kb -> 0.52kb (19.15%) /src/resources/check.png -- 0.44kb -> 0.39kb (13.19%) /src/resources/contents/config.png -- 0.54kb -> 0.47kb (13.04%) /src/resources/document-save.png -- 1.12kb -> 1.09kb (2.87%) --- src/resources/archive-conflict-loser.png | Bin 18052 -> 886 bytes src/resources/archive-conflict-mixed.png | Bin 18052 -> 969 bytes src/resources/archive-conflict-neutral.png | Bin 18052 -> 846 bytes src/resources/archive-conflict-winner.png | Bin 18052 -> 939 bytes src/resources/check.png | Bin 455 -> 395 bytes src/resources/contents/breastplate.png | Bin 1419 -> 788 bytes src/resources/contents/checkbox-tree.png | Bin 658 -> 532 bytes src/resources/contents/config.png | Bin 552 -> 480 bytes src/resources/contents/conversation.png | Bin 1506 -> 832 bytes src/resources/contents/double-quaver.png | Bin 1009 -> 640 bytes src/resources/contents/empty-chessboard.png | Bin 706 -> 537 bytes src/resources/contents/hand-of-god.png | Bin 1101 -> 687 bytes src/resources/contents/jigsaw-piece.png | Bin 952 -> 678 bytes src/resources/contents/locked-chest.png | Bin 1440 -> 801 bytes src/resources/contents/lyre.png | Bin 1388 -> 783 bytes src/resources/contents/tinker.png | Bin 1038 -> 742 bytes src/resources/contents/usable.png | Bin 1345 -> 834 bytes src/resources/document-save.png | Bin 1150 -> 1117 bytes src/resources/multiply-red.png | Bin 16018 -> 666 bytes src/resources/open-Folder-Icon.png | Bin 16927 -> 1434 bytes src/resources/switch-instance-icon.png | Bin 57516 -> 4333 bytes 21 files changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/resources/archive-conflict-loser.png b/src/resources/archive-conflict-loser.png index 77d2e0fa..561e8be8 100644 Binary files a/src/resources/archive-conflict-loser.png and b/src/resources/archive-conflict-loser.png differ diff --git a/src/resources/archive-conflict-mixed.png b/src/resources/archive-conflict-mixed.png index e71e0167..df20532c 100644 Binary files a/src/resources/archive-conflict-mixed.png and b/src/resources/archive-conflict-mixed.png differ diff --git a/src/resources/archive-conflict-neutral.png b/src/resources/archive-conflict-neutral.png index aba45314..5bedd9c4 100644 Binary files a/src/resources/archive-conflict-neutral.png and b/src/resources/archive-conflict-neutral.png differ diff --git a/src/resources/archive-conflict-winner.png b/src/resources/archive-conflict-winner.png index f6260575..5cc568c8 100644 Binary files a/src/resources/archive-conflict-winner.png and b/src/resources/archive-conflict-winner.png differ diff --git a/src/resources/check.png b/src/resources/check.png index 0f294a02..5df44755 100644 Binary files a/src/resources/check.png and b/src/resources/check.png differ diff --git a/src/resources/contents/breastplate.png b/src/resources/contents/breastplate.png index d3d39407..f8c787e2 100644 Binary files a/src/resources/contents/breastplate.png and b/src/resources/contents/breastplate.png differ diff --git a/src/resources/contents/checkbox-tree.png b/src/resources/contents/checkbox-tree.png index a44dd5fd..f4a63237 100644 Binary files a/src/resources/contents/checkbox-tree.png and b/src/resources/contents/checkbox-tree.png differ diff --git a/src/resources/contents/config.png b/src/resources/contents/config.png index 3896d885..3aaa2e5c 100644 Binary files a/src/resources/contents/config.png and b/src/resources/contents/config.png differ diff --git a/src/resources/contents/conversation.png b/src/resources/contents/conversation.png index 11030fff..76286e33 100644 Binary files a/src/resources/contents/conversation.png and b/src/resources/contents/conversation.png differ diff --git a/src/resources/contents/double-quaver.png b/src/resources/contents/double-quaver.png index 7102f472..21dcf4c1 100644 Binary files a/src/resources/contents/double-quaver.png and b/src/resources/contents/double-quaver.png differ diff --git a/src/resources/contents/empty-chessboard.png b/src/resources/contents/empty-chessboard.png index b5983010..fccb3aa5 100644 Binary files a/src/resources/contents/empty-chessboard.png and b/src/resources/contents/empty-chessboard.png differ diff --git a/src/resources/contents/hand-of-god.png b/src/resources/contents/hand-of-god.png index e3a05335..7cbd0102 100644 Binary files a/src/resources/contents/hand-of-god.png and b/src/resources/contents/hand-of-god.png differ diff --git a/src/resources/contents/jigsaw-piece.png b/src/resources/contents/jigsaw-piece.png index 0b26d56b..4949be40 100644 Binary files a/src/resources/contents/jigsaw-piece.png and b/src/resources/contents/jigsaw-piece.png differ diff --git a/src/resources/contents/locked-chest.png b/src/resources/contents/locked-chest.png index d70d448e..b49e1165 100644 Binary files a/src/resources/contents/locked-chest.png and b/src/resources/contents/locked-chest.png differ diff --git a/src/resources/contents/lyre.png b/src/resources/contents/lyre.png index 041dbb01..3adff24e 100644 Binary files a/src/resources/contents/lyre.png and b/src/resources/contents/lyre.png differ diff --git a/src/resources/contents/tinker.png b/src/resources/contents/tinker.png index 9709cee8..dceb1367 100644 Binary files a/src/resources/contents/tinker.png and b/src/resources/contents/tinker.png differ diff --git a/src/resources/contents/usable.png b/src/resources/contents/usable.png index 2bc93a7d..c705997a 100644 Binary files a/src/resources/contents/usable.png and b/src/resources/contents/usable.png differ diff --git a/src/resources/document-save.png b/src/resources/document-save.png index a94e0eab..18e1f974 100644 Binary files a/src/resources/document-save.png and b/src/resources/document-save.png differ diff --git a/src/resources/multiply-red.png b/src/resources/multiply-red.png index c238f07f..f35adc74 100644 Binary files a/src/resources/multiply-red.png and b/src/resources/multiply-red.png differ diff --git a/src/resources/open-Folder-Icon.png b/src/resources/open-Folder-Icon.png index c363be0f..6218ed39 100644 Binary files a/src/resources/open-Folder-Icon.png and b/src/resources/open-Folder-Icon.png differ diff --git a/src/resources/switch-instance-icon.png b/src/resources/switch-instance-icon.png index b992babe..cd509d3d 100644 Binary files a/src/resources/switch-instance-icon.png and b/src/resources/switch-instance-icon.png differ -- cgit v1.3.1 From 5a98d69dcdf470308823b8648367c2f13b52c593 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 23 Mar 2018 11:35:27 -0500 Subject: Fix tab index now that the archive tab is back --- src/tutorials/tutorial_conflictresolution_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tutorials/tutorial_conflictresolution_main.js b/src/tutorials/tutorial_conflictresolution_main.js index a60a5c8d..3c782af2 100644 --- a/src/tutorials/tutorial_conflictresolution_main.js +++ b/src/tutorials/tutorial_conflictresolution_main.js @@ -65,7 +65,7 @@ function getTutorialSteps() { }, function() { tutorial.text = qsTr("Option A: Switch to the \"Data\"-tab if necessary") - if (!tutorialControl.waitForTabOpen("tabWidget", 1)) { + if (!tutorialControl.waitForTabOpen("tabWidget", 2)) { highlightItem("tabWidget", false) waitForClick() } else { -- cgit v1.3.1 From dcbcb29ec733801025556d294b90c9b8061a31e5 Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 3 Apr 2018 14:59:04 -0500 Subject: Update to allow linking to updated bsatk --- CMakeLists.txt | 1 + src/CMakeLists.txt | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c6351f7..b63e8b81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY VS_STARTUP_PROJECT SET(DEPENDENCIES_DIR CACHE PATH "") # hint to find qt in dependencies path LIST(APPEND CMAKE_PREFIX_PATH ${QT_ROOT}/lib/cmake) +LIST(APPEND CMAKE_PREFIX_PATH ${LZ4_ROOT}/dll) FILE(GLOB_RECURSE BOOST_ROOT ${DEPENDENCIES_DIR}/boost*/project-config.jam) GET_FILENAME_COMPONENT(BOOST_ROOT ${BOOST_ROOT} DIRECTORY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ab7b4836..70886f81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -288,11 +288,13 @@ INCLUDE_DIRECTORIES(${project_path}/uibase/src ${project_path}/../usvfs/include ${project_path}/game_gamebryo/src ${project_path}/game_features/src - ${project_path}/githubpp/src) + ${project_path}/githubpp/src + ${LZ4_ROOT}/include) INCLUDE_DIRECTORIES(shared ${ZLIB_INCLUDE_DIRS}) LINK_DIRECTORIES(${lib_path} - ${ZLIB_ROOT}/lib) + ${ZLIB_ROOT}/lib + ${LZ4_ROOT}/dll) EXECUTE_PROCESS( COMMAND git log -1 --format=%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} @@ -315,7 +317,7 @@ TARGET_LINK_LIBRARIES(ModOrganizer zlibstatic uibase esptk bsatk githubpp ${usvfs_name} - Dbghelp advapi32 Version Shlwapi) + Dbghelp advapi32 Version Shlwapi liblz4) IF (NOT "${OPTIMIZE_COMPILE_FLAGS}" STREQUAL "") SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES COMPILE_FLAGS_RELWITHDEBINFO ${OPTIMIZE_COMPILE_FLAGS}) -- cgit v1.3.1 From 74dd2bb914a1f2a31506c3544b6ee198f65e2b6b Mon Sep 17 00:00:00 2001 From: Silarn Date: Thu, 5 Apr 2018 23:57:24 -0500 Subject: Return extraction context menu to archive list --- src/mainwindow.cpp | 12 ++++++++++++ src/mainwindow.h | 1 + 2 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0dbe4d53..faa4b880 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4345,6 +4345,18 @@ void MainWindow::displayColumnSelection(const QPoint &pos) } } +void MainWindow::on_bsaList_customContextMenuRequested(const QPoint &pos) +{ + m_ContextItem = ui->bsaList->itemAt(pos); + +// m_ContextRow = ui->bsaList->indexOfTopLevelItem(ui->bsaList->itemAt(pos)); + + QMenu menu; + menu.addAction(tr("Extract..."), this, SLOT(extractBSATriggered())); + + menu.exec(ui->bsaList->mapToGlobal(pos)); +} + void MainWindow::on_bsaList_itemChanged(QTreeWidgetItem*, int) { m_ArchiveListWriter.write(); diff --git a/src/mainwindow.h b/src/mainwindow.h index f84931ca..d0957305 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -553,6 +553,7 @@ private slots: // ui slots void on_actionUpdate_triggered(); void on_actionEndorseMO_triggered(); + void on_bsaList_customContextMenuRequested(const QPoint &pos); void on_clearFiltersButton_clicked(); void on_btnRefreshData_clicked(); void on_categoriesList_customContextMenuRequested(const QPoint &pos); -- cgit v1.3.1 From fed89352d1c9870bb34cbc1a65c3a8d3043086f9 Mon Sep 17 00:00:00 2001 From: Silarn Date: Fri, 6 Apr 2018 00:56:58 -0500 Subject: Changes to allow plugin loading in the mod info dialog (and rename SE) --- src/modinfo.cpp | 6 +++--- src/modinfo.h | 1 + src/modinfodialog.h | 1 + src/modinforegular.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modinfo.cpp b/src/modinfo.cpp index c14eedb7..d80c636b 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -55,7 +55,7 @@ QMutex ModInfo::s_Mutex(QMutex::Recursive); QString ModInfo::s_HiddenExt(".mohidden"); -static bool ByName(const ModInfo::Ptr &LHS, const ModInfo::Ptr &RHS) +bool ModInfo::ByName(const ModInfo::Ptr &LHS, const ModInfo::Ptr &RHS) { return QString::compare(LHS->name(), RHS->name(), Qt::CaseInsensitive) < 0; } @@ -98,7 +98,7 @@ QString ModInfo::getContentTypeName(int contentType) case CONTENT_INTERFACE: return tr("UI Changes"); case CONTENT_SOUND: return tr("Sound Effects"); case CONTENT_SCRIPT: return tr("Scripts"); - case CONTENT_SKSE: return tr("SKSE Plugins"); + case CONTENT_SKSE: return tr("Script Extender"); case CONTENT_SKYPROC: return tr("SkyProc Tools"); case CONTENT_MCM: return tr("MCM Data"); default: throw MyException(tr("invalid content type %1").arg(contentType)); @@ -239,7 +239,7 @@ void ModInfo::updateFromDisc(const QString &modDirectory, createFromOverwrite(); - std::sort(s_Collection.begin(), s_Collection.end(), ByName); + std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName); updateIndices(); } diff --git a/src/modinfo.h b/src/modinfo.h index d00c04e7..1ceb8e1f 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -599,6 +599,7 @@ protected: ModInfo(); static void updateIndices(); + static bool ByName(const ModInfo::Ptr &LHS, const ModInfo::Ptr &RHS); private: diff --git a/src/modinfodialog.h b/src/modinfodialog.h index 312ff99e..e7c70762 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -23,6 +23,7 @@ along with Mod Organizer. If not, see . #include "modinfo.h" #include "tutorabledialog.h" +#include "plugincontainer.h" #include #include diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index 5486bb2c..4572f5bf 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -299,7 +299,7 @@ bool ModInfoRegular::setName(const QString &name) s_ModsByName[m_Name] = index; - std::sort(s_Collection.begin(), s_Collection.end(), ByName); + std::sort(s_Collection.begin(), s_Collection.end(), ModInfo::ByName); updateIndices(); } else { // otherwise mod isn't registered yet? m_Name = name; -- cgit v1.3.1 From a905ce130d0f1f4894f135660d9cf515788bb2ad Mon Sep 17 00:00:00 2001 From: Silarn Date: Fri, 6 Apr 2018 18:25:11 -0500 Subject: Update About dialog with new contributors (and don't translate names) --- src/aboutdialog.ui | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui index 348a33b0..69e52708 100644 --- a/src/aboutdialog.ui +++ b/src/aboutdialog.ui @@ -6,8 +6,8 @@ 0 0 - 604 - 369 + 1010 + 477 @@ -231,6 +231,11 @@ Alyndiar (French) + + + fruttyx (French) + + Jlkawaii (French) @@ -241,6 +246,11 @@ Rigoletto (French) + + + Yoplala (French) + + Faron (German) @@ -320,12 +330,7 @@ - SuperSandro2000 - - - - - AnyOldName3 + AnyOldName3 @@ -348,6 +353,11 @@ Bridger + + + Brixified + + GamerPoet @@ -365,27 +375,37 @@ - Uhuru + ogrotten - Wolverine2710 + Schilduin - z929669 + SuperSandro2000 - thosrtanner + Uhuru + + + + + Wolverine2710 + + + + + z929669 - ogrotten + thosrtanner -- cgit v1.3.1 From 5c39a762e68c3559438a622dbf747eb8bddec7ed Mon Sep 17 00:00:00 2001 From: Al12rs Date: Fri, 6 Apr 2018 21:35:15 +0200 Subject: Allow MO2 shortcuts that open the indicated MO2 instance in the argument if the executable name is omitted. This should be added after the MO2 exe path: ' "moshortcut://myInstanceName:" '. If there are caracters after the ":" then MO2 will assume that is an execuatble and will try to run it. --- src/main.cpp | 66 ++++++++++++++++++++++++++++----------------------- src/moshortcut.cpp | 3 +++ src/moshortcut.h | 3 +++ src/organizercore.cpp | 5 ++-- 4 files changed, 45 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 0464ca9a..fc332fe7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -561,36 +561,42 @@ int runApplication(MOApplication &application, SingleInstance &instance, // if we have a command line parameter, it is either a nxm link or // a binary to start - if (arguments.size() > 1) { - if (MOShortcut shortcut{ arguments.at(1) }) { - try { - organizer.runShortcut(shortcut); - return 0; - } catch (const std::exception &e) { - reportError( - QObject::tr("failed to start shortcut: %1").arg(e.what())); - return 1; - } - } else if (OrganizerCore::isNxmLink(arguments.at(1))) { - qDebug("starting download from command line: %s", - qPrintable(arguments.at(1))); - organizer.externalMessage(arguments.at(1)); - } else { - QString exeName = arguments.at(1); - qDebug("starting %s from command line", qPrintable(exeName)); - arguments.removeFirst(); // remove application name (ModOrganizer.exe) - arguments.removeFirst(); // remove binary name - // pass the remaining parameters to the binary - try { - organizer.startApplication(exeName, arguments, QString(), QString()); - return 0; - } catch (const std::exception &e) { - reportError( - QObject::tr("failed to start application: %1").arg(e.what())); - return 1; - } - } - } + if (arguments.size() > 1) { + if (MOShortcut shortcut{ arguments.at(1) }) { + if (shortcut.hasExecutable()) { + try { + organizer.runShortcut(shortcut); + return 0; + } + catch (const std::exception &e) { + reportError( + QObject::tr("failed to start shortcut: %1").arg(e.what())); + return 1; + } + } + } + else if (OrganizerCore::isNxmLink(arguments.at(1))) { + qDebug("starting download from command line: %s", + qPrintable(arguments.at(1))); + organizer.externalMessage(arguments.at(1)); + } + else { + QString exeName = arguments.at(1); + qDebug("starting %s from command line", qPrintable(exeName)); + arguments.removeFirst(); // remove application name (ModOrganizer.exe) + arguments.removeFirst(); // remove binary name + // pass the remaining parameters to the binary + try { + organizer.startApplication(exeName, arguments, QString(), QString()); + return 0; + } + catch (const std::exception &e) { + reportError( + QObject::tr("failed to start application: %1").arg(e.what())); + return 1; + } + } + } QPixmap pixmap(splashPath); QSplashScreen splash(pixmap); diff --git a/src/moshortcut.cpp b/src/moshortcut.cpp index c8c2ef6f..aad7380e 100644 --- a/src/moshortcut.cpp +++ b/src/moshortcut.cpp @@ -24,6 +24,7 @@ along with Mod Organizer. If not, see . MOShortcut::MOShortcut(const QString& link) : m_valid(link.startsWith("moshortcut://")) , m_hasInstance(false) + , m_hasExecutable(false) { if (m_valid) { int start = (int)strlen("moshortcut://"); @@ -35,5 +36,7 @@ MOShortcut::MOShortcut(const QString& link) } else m_executable = link.mid(start); + if(!(m_executable=="")) + m_hasExecutable=true; } } diff --git a/src/moshortcut.h b/src/moshortcut.h index 7b7574b9..2ce54910 100644 --- a/src/moshortcut.h +++ b/src/moshortcut.h @@ -33,6 +33,8 @@ public: operator bool() const { return m_valid; } bool hasInstance() const { return m_hasInstance; } + + bool hasExecutable() const { return m_hasExecutable; } const QString& instance() const { return m_instance; } @@ -43,4 +45,5 @@ private: QString m_executable; bool m_valid; bool m_hasInstance; + bool m_hasExecutable; }; diff --git a/src/organizercore.cpp b/src/organizercore.cpp index b84488da..0398e9ac 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -602,8 +602,9 @@ void OrganizerCore::downloadRequestedNXM(const QString &url) void OrganizerCore::externalMessage(const QString &message) { - if (MOShortcut moshortcut{ message }) { - runShortcut(moshortcut); + if (MOShortcut moshortcut{ message } ) { + if(moshortcut.hasExecutable()) + runShortcut(moshortcut); } else if (isNxmLink(message)) { MessageDialog::showMessage(tr("Download started"), qApp->activeWindow()); -- cgit v1.3.1 From fd9eb032b6df5eafa89a60a515963ba7d4652f24 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Fri, 23 Mar 2018 17:48:00 +0100 Subject: Added file preview in conflicts tab in the mod information dialog. The preview is not working for the lower file list for some reason but I left the setup of the context menu and all in case somebody else can figure out what I'm missing. --- src/mainwindow.cpp | 2 +- src/modinfodialog.cpp | 98 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/modinfodialog.h | 8 ++++- src/modinfodialog.ui | 6 ++++ 4 files changed, 110 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index faa4b880..d9d83231 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2450,7 +2450,7 @@ void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, } } else { modInfo->saveMeta(); - ModInfoDialog dialog(modInfo, m_OrganizerCore.directoryStructure(), modInfo->hasFlag(ModInfo::FLAG_FOREIGN), this); + ModInfoDialog dialog(modInfo, m_OrganizerCore.directoryStructure(), modInfo->hasFlag(ModInfo::FLAG_FOREIGN), &m_OrganizerCore, &m_PluginContainer,this); connect(&dialog, SIGNAL(nexusLinkActivated(QString)), this, SLOT(nexusLinkActivated(QString))); connect(&dialog, SIGNAL(downloadRequest(QString)), &m_OrganizerCore, SLOT(downloadRequestedNXM(QString))); connect(&dialog, SIGNAL(modOpen(QString, int)), this, SLOT(displayModInformation(QString, int)), Qt::QueuedConnection); diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index ccd2a122..f2042d15 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -30,6 +30,10 @@ along with Mod Organizer. If not, see . #include "questionboxmemory.h" #include "settings.h" #include "categories.h" +#include "organizercore.h" +#include "pluginlistsortproxy.h" +#include "previewgenerator.h" +#include "previewdialog.h" #include #include @@ -66,11 +70,12 @@ static bool operator<(const ModFileListWidget &LHS, const ModFileListWidget &RHS } -ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directory, bool unmanaged, QWidget *parent) +ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directory, bool unmanaged, OrganizerCore *organizerCore, PluginContainer *pluginContainer, QWidget *parent) : TutorableDialog("ModInfoDialog", parent), ui(new Ui::ModInfoDialog), m_ModInfo(modInfo), m_ThumbnailMapper(this), m_RequestStarted(false), m_DeleteAction(nullptr), m_RenameAction(nullptr), m_OpenAction(nullptr), - m_Directory(directory), m_Origin(nullptr) + m_Directory(directory), m_Origin(nullptr), + m_OrganizerCore(organizerCore), m_PluginContainer(pluginContainer) { ui->setupUi(this); this->setWindowTitle(modInfo->name()); @@ -1198,6 +1203,69 @@ void ModInfoDialog::unhideConflictFile() } +void ModInfoDialog::previewDataFile() +{ + QString fileName = QDir::fromNativeSeparators(m_ConflictsContextItem->data(0, Qt::UserRole).toString()); + + // what we have is an absolute path to the file in its actual location (for the primary origin) + // what we want is the path relative to the virtual data directory + + // we need to look in the virtual directory for the file to make sure the info is up to date. + + // check if the file comes from the actual data folder instead of a mod + QDir gameDirectory = m_OrganizerCore->managedGame()->dataDirectory().absolutePath(); + QString relativePath = gameDirectory.relativeFilePath(fileName); + QDir direRelativePath = gameDirectory.relativeFilePath(fileName); + // if the file is on a different drive the dirRelativePath will actually be an absolute path so we make sure that is not the case + if (!direRelativePath.isAbsolute() && !relativePath.startsWith("..")) { + fileName = relativePath; + } + else { + // crude: we search for the next slash after the base mod directory to skip everything up to the data-relative directory + int offset = m_OrganizerCore->settings().getModDirectory().size() + 1; + offset = fileName.indexOf("/", offset); + fileName = fileName.mid(offset + 1); + } + + + + const FileEntry::Ptr file = m_OrganizerCore->directoryStructure()->searchFile(ToWString(fileName), nullptr); + + if (file.get() == nullptr) { + reportError(tr("file not found: %1").arg(fileName)); + return; + } + + // set up preview dialog + PreviewDialog preview(fileName); + auto addFunc = [&](int originId) { + FilesOrigin &origin = m_OrganizerCore->directoryStructure()->getOriginByID(originId); + QString filePath = QDir::fromNativeSeparators(ToQString(origin.getPath())) + "/" + fileName; + if (QFile::exists(filePath)) { + // it's very possible the file doesn't exist, because it's inside an archive. we don't support that + QWidget *wid = m_PluginContainer->previewGenerator().genPreview(filePath); + if (wid == nullptr) { + reportError(tr("failed to generate preview for %1").arg(filePath)); + } + else { + preview.addVariant(ToQString(origin.getName()), wid); + } + } + }; + + addFunc(file->getOrigin()); + for (auto alt : file->getAlternatives()) { + addFunc(alt.first); + } + if (preview.numVariants() > 0) { + preview.exec(); + } + else { + QMessageBox::information(this, tr("Sorry"), tr("Sorry, can't preview anything. This function currently does not support extracting from bsas.")); + } +} + + void ModInfoDialog::on_overwriteTree_customContextMenuRequested(const QPoint &pos) { m_ConflictsContextItem = ui->overwriteTree->itemAt(pos.x(), pos.y()); @@ -1211,11 +1279,37 @@ void ModInfoDialog::on_overwriteTree_customContextMenuRequested(const QPoint &po } else { menu.addAction(tr("Hide"), this, SLOT(hideConflictFile())); } + + QString fileName = m_ConflictsContextItem->data(0, Qt::UserRole).toString(); + if (m_PluginContainer->previewGenerator().previewSupported(QFileInfo(fileName).suffix())) { + menu.addAction(tr("Preview"), this, SLOT(previewDataFile())); + } + menu.exec(ui->overwriteTree->mapToGlobal(pos)); } } } +void ModInfoDialog::on_overwrittenTree_customContextMenuRequested(const QPoint &pos) +{ + //For some reason the m_ConflictsContextItem does not pick up valid data from the overwrittenTree. + //TODO: find out what is going wrong. + /*m_ConflictsContextItem = ui->overwrittenTree->itemAt(pos.x(), pos.y()); + + if (m_ConflictsContextItem != nullptr) { + if (!m_ConflictsContextItem->data(1, Qt::UserRole + 2).toBool()) { + QMenu menu; + + QString fileName = m_ConflictsContextItem->data(0, Qt::UserRole).toString(); + if (m_PluginContainer->previewGenerator().previewSupported(QFileInfo(fileName).suffix())) { + menu.addAction(tr("Preview"), this, SLOT(previewDataFile())); + } + + menu.exec(ui->overwrittenTree->mapToGlobal(pos)); + } + }*/ +} + void ModInfoDialog::on_overwrittenTree_itemDoubleClicked(QTreeWidgetItem *item, int) { diff --git a/src/modinfodialog.h b/src/modinfodialog.h index e7c70762..ab878cf9 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -24,6 +24,7 @@ along with Mod Organizer. If not, see . #include "modinfo.h" #include "tutorabledialog.h" #include "plugincontainer.h" +#include "organizercore.h" #include #include @@ -77,7 +78,7 @@ public: * @param modInfo info structure about the mod to display * @param parent parend widget **/ - explicit ModInfoDialog(ModInfo::Ptr modInfo, const MOShared::DirectoryEntry *directory, bool unmanaged, QWidget *parent = 0); + explicit ModInfoDialog(ModInfo::Ptr modInfo, const MOShared::DirectoryEntry *directory, bool unmanaged, OrganizerCore *organizerCore, PluginContainer *pluginContainer,QWidget *parent = 0); ~ModInfoDialog(); /** @@ -156,6 +157,7 @@ private slots: void hideConflictFile(); void unhideConflictFile(); + void previewDataFile(); void thumbnailClicked(const QString &fileName); void linkClicked(const QUrl &url); @@ -186,6 +188,7 @@ private slots: void on_overwriteTree_itemDoubleClicked(QTreeWidgetItem *item, int column); void on_overwrittenTree_itemDoubleClicked(QTreeWidgetItem *item, int column); void on_overwriteTree_customContextMenuRequested(const QPoint &pos); + void on_overwrittenTree_customContextMenuRequested(const QPoint &pos); void on_fileTree_customContextMenuRequested(const QPoint &pos); void on_refreshButton_clicked(); @@ -209,6 +212,9 @@ private: QSignalMapper m_ThumbnailMapper; QString m_RootPath; + OrganizerCore *m_OrganizerCore; + PluginContainer *m_PluginContainer; + QFileSystemModel *m_FileSystemModel; QTreeView *m_FileTree; QModelIndexList m_FileSelection; diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index b5331424..05415445 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -489,6 +489,9 @@ Most mods do not have optional esps, so chances are good you are looking at an e + + Qt::CustomContextMenu + Qt::ElideLeft @@ -498,6 +501,9 @@ Most mods do not have optional esps, so chances are good you are looking at an e true + + 2 + 365 -- cgit v1.3.1 From d62669e1b48687842fb856f2190c3bd84c514fd0 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sat, 7 Apr 2018 18:58:12 -0500 Subject: Fix overwritten file preview --- src/modinfodialog.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index f2042d15..f8655d6b 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -298,7 +298,9 @@ void ModInfoDialog::refreshLists() QStringList fields(relativeName); fields.append(ToQString(realOrigin.getName())); QTreeWidgetItem *item = new QTreeWidgetItem(fields); + item->setData(0, Qt::UserRole, fileName); item->setData(1, Qt::UserRole, ToQString(realOrigin.getName())); + item->setData(1, Qt::UserRole + 2, archive); ui->overwrittenTree->addTopLevelItem(item); ++numOverwritten; } @@ -1280,10 +1282,10 @@ void ModInfoDialog::on_overwriteTree_customContextMenuRequested(const QPoint &po menu.addAction(tr("Hide"), this, SLOT(hideConflictFile())); } - QString fileName = m_ConflictsContextItem->data(0, Qt::UserRole).toString(); - if (m_PluginContainer->previewGenerator().previewSupported(QFileInfo(fileName).suffix())) { - menu.addAction(tr("Preview"), this, SLOT(previewDataFile())); - } + QString fileName = m_ConflictsContextItem->data(0, Qt::UserRole).toString(); + if (m_PluginContainer->previewGenerator().previewSupported(QFileInfo(fileName).suffix())) { + menu.addAction(tr("Preview"), this, SLOT(previewDataFile())); + } menu.exec(ui->overwriteTree->mapToGlobal(pos)); } @@ -1294,7 +1296,7 @@ void ModInfoDialog::on_overwrittenTree_customContextMenuRequested(const QPoint & { //For some reason the m_ConflictsContextItem does not pick up valid data from the overwrittenTree. //TODO: find out what is going wrong. - /*m_ConflictsContextItem = ui->overwrittenTree->itemAt(pos.x(), pos.y()); + m_ConflictsContextItem = ui->overwrittenTree->itemAt(pos.x(), pos.y()); if (m_ConflictsContextItem != nullptr) { if (!m_ConflictsContextItem->data(1, Qt::UserRole + 2).toBool()) { @@ -1307,7 +1309,7 @@ void ModInfoDialog::on_overwrittenTree_customContextMenuRequested(const QPoint & menu.exec(ui->overwrittenTree->mapToGlobal(pos)); } - }*/ + } } -- cgit v1.3.1 From b409a0bef934eb20d10ecd2f7448c2da00c8e500 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sat, 7 Apr 2018 20:09:41 -0500 Subject: Install the translation file (we need at least one) --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 70886f81..ef009e03 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -253,6 +253,7 @@ FIND_PACKAGE(Qt5LinguistTools) QT5_WRAP_UI(organizer_UIHDRS ${organizer_UIS}) QT5_ADD_RESOURCES(organizer_RCCPPS ${organizer_QRCS}) QT5_CREATE_TRANSLATION(organizer_translations_qm ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/organizer_en.ts) +ADD_CUSTOM_TARGET(translations DEPENDS ${organizer_translations_qm}) INCLUDE_DIRECTORIES(${Qt5Declarative_INCLUDES}) @@ -373,6 +374,8 @@ INSTALL( # qdds.dll needs installing manually as Qt no longer ships with it by default. INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../qdds.dll DESTINATION bin/dlls/imageformats) +install(FILES ${organizer_translations_qm} DESTINATION bin/translations) + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/stylesheets ${CMAKE_CURRENT_SOURCE_DIR}/tutorials DESTINATION bin) -- cgit v1.3.1 From cc2bd152568a4f1164a0a4ba5e6232e77e7c9945 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sat, 7 Apr 2018 22:18:45 -0500 Subject: Fix for re-downloading a mod already downloading --- src/downloadmanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index a4fde093..c0d7fbf3 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -460,7 +460,14 @@ void DownloadManager::addNXMDownload(const QString &url) return; } + if (m_PendingDownloads.contains(std::pair(nxmInfo.modId(), nxmInfo.fileId()))) { + qDebug("download requested is already started (mod: %s, file: %s)", qPrintable(nxmInfo.modId()), qPrintable(nxmInfo.fileId())); + QMessageBox::information(nullptr, tr("Already Started"), tr("A download for this mod file has already been started."), QMessageBox::Ok); + return; + } + emit aboutToUpdate(); + m_PendingDownloads.append(std::make_pair(nxmInfo.modId(), nxmInfo.fileId())); emit update(-1); -- cgit v1.3.1 From 7eba6837dd65eb0e5f3b9f71e67e82fe553a56a6 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sat, 7 Apr 2018 23:54:22 -0500 Subject: Prevent redownloading a mod if the download is still in progress --- src/downloadmanager.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index c0d7fbf3..45070885 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -460,10 +460,25 @@ void DownloadManager::addNXMDownload(const QString &url) return; } - if (m_PendingDownloads.contains(std::pair(nxmInfo.modId(), nxmInfo.fileId()))) { - qDebug("download requested is already started (mod: %s, file: %s)", qPrintable(nxmInfo.modId()), qPrintable(nxmInfo.fileId())); - QMessageBox::information(nullptr, tr("Already Started"), tr("A download for this mod file has already been started."), QMessageBox::Ok); - return; + for (auto pair : m_PendingDownloads) { + if (pair.first == nxmInfo.modId() && pair.second == nxmInfo.fileId()) { + qDebug("download requested is already started (mod id: %s, file id: %s)", qPrintable(nxmInfo.modId()), qPrintable(nxmInfo.fileId())); + QMessageBox::information(nullptr, tr("Already Started"), tr("A download for this mod file has already been queued."), QMessageBox::Ok); + return; + } + } + + for (DownloadInfo *download : m_ActiveDownloads) { + if (download->m_FileInfo->modID == nxmInfo.modId() && download->m_FileInfo->fileID == nxmInfo.fileId()) { + if (download->m_State == STATE_DOWNLOADING || download->m_State == STATE_PAUSED || download->m_State == STATE_STARTED) { + qDebug("download requested is already started (mod: %s, file: %s)", qPrintable(download->m_FileInfo->modName), + qPrintable(download->m_FileInfo->fileName)); + + QMessageBox::information(nullptr, tr("Already Started"), tr("There is already a download started for this file (%2).") + .arg(download->m_FileInfo->modName).arg(download->m_FileInfo->name), QMessageBox::Ok); + return; + } + } } emit aboutToUpdate(); -- cgit v1.3.1 From 0f8852f487cb1f8b993141042da4196db965e038 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sun, 8 Apr 2018 03:58:08 -0500 Subject: Also mark hidden downloads as uninstalled; refresh plugins after files --- src/downloadmanager.cpp | 20 ++++++++++++++++++++ src/downloadmanager.h | 3 +++ src/mainwindow.cpp | 6 ++---- 3 files changed, 25 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 45070885..161656b2 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -918,6 +918,10 @@ void DownloadManager::markInstalled(int index) setState(m_ActiveDownloads.at(index), STATE_INSTALLED); } +DownloadManager::DownloadInfo* DownloadManager::getDownloadInfo(QString fileName) +{ + return DownloadInfo::createFromMeta(fileName, true); +} void DownloadManager::markUninstalled(int index) { @@ -933,6 +937,22 @@ void DownloadManager::markUninstalled(int index) } +void DownloadManager::markUninstalled(QString fileName) +{ + int index = indexByName(fileName); + if (index >= 0) { + markUninstalled(index); + } else { + DownloadInfo *info = getDownloadInfo(fileName); + if (info != nullptr) { + QSettings metaFile(info->m_Output.fileName() + ".meta", QSettings::IniFormat); + metaFile.setValue("uninstalled", true); + setState(info, STATE_UNINSTALLED); + } + } +} + + QString DownloadManager::getDownloadFileName(const QString &baseName) const { QString fullPath = m_OutputDirectory + "/" + baseName; diff --git a/src/downloadmanager.h b/src/downloadmanager.h index e63a0113..059c6cb5 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -314,6 +314,8 @@ public: */ void markUninstalled(int index); + void markUninstalled(QString download); + /** * @brief refreshes the list of downloads */ @@ -431,6 +433,7 @@ private slots: private: void createMetaFile(DownloadInfo *info); + DownloadManager::DownloadInfo* getDownloadInfo(QString fileName); public: diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d9d83231..48a09718 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1980,6 +1980,7 @@ void MainWindow::directory_refreshed() refreshDataTree(); updateProblemsButton(); statusBar()->hide(); + m_OrganizerCore.refreshESPList(); } void MainWindow::modorder_changed() @@ -2307,10 +2308,7 @@ void MainWindow::removeMod_clicked() void MainWindow::modRemoved(const QString &fileName) { if (!fileName.isEmpty() && !QFileInfo(fileName).isAbsolute()) { - int index = m_OrganizerCore.downloadManager()->indexByName(fileName); - if (index >= 0) { - m_OrganizerCore.downloadManager()->markUninstalled(index); - } + m_OrganizerCore.downloadManager()->markUninstalled(fileName); } } -- cgit v1.3.1 From fb1c3765338d600a6362c6583b473de9dd26dc02 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Sun, 8 Apr 2018 14:41:03 +0200 Subject: Added "Open/Execute" context menu entry to the conflicts tab in the modinfodialog. --- src/modinfodialog.cpp | 90 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/modinfodialog.h | 3 ++ 2 files changed, 91 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index f8655d6b..6a53d915 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -20,6 +20,7 @@ along with Mod Organizer. If not, see . #include "modinfodialog.h" #include "ui_modinfodialog.h" #include "descriptionpage.h" +#include "mainwindow.h" #include "iplugingame.h" #include "nexusinterface.h" @@ -44,6 +45,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include @@ -1204,6 +1206,88 @@ void ModInfoDialog::unhideConflictFile() } } +int ModInfoDialog::getBinaryExecuteInfo(const QFileInfo &targetInfo, QFileInfo &binaryInfo, QString &arguments) +{ + QString extension = targetInfo.suffix(); + if ((extension.compare("cmd", Qt::CaseInsensitive) == 0) || + (extension.compare("com", Qt::CaseInsensitive) == 0) || + (extension.compare("bat", Qt::CaseInsensitive) == 0)) { + binaryInfo = QFileInfo("C:\\Windows\\System32\\cmd.exe"); + arguments = QString("/C \"%1\"").arg(QDir::toNativeSeparators(targetInfo.absoluteFilePath())); + return 1; + } + else if (extension.compare("exe", Qt::CaseInsensitive) == 0) { + binaryInfo = targetInfo; + return 1; + } + else if (extension.compare("jar", Qt::CaseInsensitive) == 0) { + // types that need to be injected into + std::wstring targetPathW = ToWString(targetInfo.absoluteFilePath()); + QString binaryPath; + + { // try to find java automatically + WCHAR buffer[MAX_PATH]; + if (::FindExecutableW(targetPathW.c_str(), nullptr, buffer) > (HINSTANCE)32) { + DWORD binaryType = 0UL; + if (!::GetBinaryTypeW(buffer, &binaryType)) { + qDebug("failed to determine binary type of \"%ls\": %lu", buffer, ::GetLastError()); + } + else if (binaryType == SCS_32BIT_BINARY) { + binaryPath = ToQString(buffer); + } + } + } + if (binaryPath.isEmpty() && (extension == "jar")) { + // second attempt: look to the registry + QSettings javaReg("HKEY_LOCAL_MACHINE\\Software\\JavaSoft\\Java Runtime Environment", QSettings::NativeFormat); + if (javaReg.contains("CurrentVersion")) { + QString currentVersion = javaReg.value("CurrentVersion").toString(); + binaryPath = javaReg.value(QString("%1/JavaHome").arg(currentVersion)).toString().append("\\bin\\javaw.exe"); + } + } + if (binaryPath.isEmpty()) { + binaryPath = QFileDialog::getOpenFileName(this, tr("Select binary"), QString(), tr("Binary") + " (*.exe)"); + } + if (binaryPath.isEmpty()) { + return 0; + } + binaryInfo = QFileInfo(binaryPath); + if (extension == "jar") { + arguments = QString("-jar \"%1\"").arg(QDir::toNativeSeparators(targetInfo.absoluteFilePath())); + } + else { + arguments = QString("\"%1\"").arg(QDir::toNativeSeparators(targetInfo.absoluteFilePath())); + } + return 1; + } + else { + return 2; + } +} + +void ModInfoDialog::openDataFile() +{ + if (m_ConflictsContextItem != nullptr) { + QFileInfo targetInfo(m_ConflictsContextItem->data(0, Qt::UserRole).toString()); + QFileInfo binaryInfo; + QString arguments; + switch (getBinaryExecuteInfo(targetInfo, binaryInfo, arguments)) { + case 1: { + m_OrganizerCore->spawnBinaryDirect( + binaryInfo, arguments, m_OrganizerCore->currentProfile()->name(), + targetInfo.absolutePath(), "", ""); + } break; + case 2: { + ::ShellExecuteW(nullptr, L"open", + ToWString(targetInfo.absoluteFilePath()).c_str(), + nullptr, nullptr, SW_SHOWNORMAL); + } break; + default: { + // nop + } break; + } + } +} void ModInfoDialog::previewDataFile() { @@ -1282,6 +1366,8 @@ void ModInfoDialog::on_overwriteTree_customContextMenuRequested(const QPoint &po menu.addAction(tr("Hide"), this, SLOT(hideConflictFile())); } + menu.addAction(tr("Open/Execute"), this, SLOT(openDataFile())); + QString fileName = m_ConflictsContextItem->data(0, Qt::UserRole).toString(); if (m_PluginContainer->previewGenerator().previewSupported(QFileInfo(fileName).suffix())) { menu.addAction(tr("Preview"), this, SLOT(previewDataFile())); @@ -1294,14 +1380,14 @@ void ModInfoDialog::on_overwriteTree_customContextMenuRequested(const QPoint &po void ModInfoDialog::on_overwrittenTree_customContextMenuRequested(const QPoint &pos) { - //For some reason the m_ConflictsContextItem does not pick up valid data from the overwrittenTree. - //TODO: find out what is going wrong. m_ConflictsContextItem = ui->overwrittenTree->itemAt(pos.x(), pos.y()); if (m_ConflictsContextItem != nullptr) { if (!m_ConflictsContextItem->data(1, Qt::UserRole + 2).toBool()) { QMenu menu; + menu.addAction(tr("Open/Execute"), this, SLOT(openDataFile())); + QString fileName = m_ConflictsContextItem->data(0, Qt::UserRole).toString(); if (m_PluginContainer->previewGenerator().previewSupported(QFileInfo(fileName).suffix())) { menu.addAction(tr("Preview"), this, SLOT(previewDataFile())); diff --git a/src/modinfodialog.h b/src/modinfodialog.h index ab878cf9..9eb17be5 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -157,7 +157,10 @@ private slots: void hideConflictFile(); void unhideConflictFile(); + int getBinaryExecuteInfo(const QFileInfo &targetInfo, QFileInfo &binaryInfo, QString &arguments); void previewDataFile(); + void openDataFile(); + void thumbnailClicked(const QString &fileName); void linkClicked(const QUrl &url); -- cgit v1.3.1 From 208eaccbf7f1fc0441861d55c68c4b66e5c7d387 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sun, 8 Apr 2018 14:56:46 -0500 Subject: Updates to allow a full plugin data refresh in certain circumstances --- src/mainwindow.cpp | 5 ++--- src/organizercore.cpp | 16 ++++++++-------- src/organizercore.h | 2 +- src/pluginlist.cpp | 9 ++++++++- src/pluginlist.h | 3 ++- 5 files changed, 21 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 48a09718..85e96993 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1980,7 +1980,6 @@ void MainWindow::directory_refreshed() refreshDataTree(); updateProblemsButton(); statusBar()->hide(); - m_OrganizerCore.refreshESPList(); } void MainWindow::modorder_changed() @@ -4811,7 +4810,7 @@ void MainWindow::on_bossButton_clicked() } m_IntegratedBrowser.openUrl(url); } - m_OrganizerCore.refreshESPList(); + m_OrganizerCore.refreshESPList(false); m_OrganizerCore.savePluginList(); } } @@ -4888,7 +4887,7 @@ void MainWindow::on_restoreButton_clicked() QMessageBox::critical(this, tr("Restore failed"), tr("Failed to restore the backup. Errorcode: %1").arg(windowsErrorString(::GetLastError()))); } - m_OrganizerCore.refreshESPList(); + m_OrganizerCore.refreshESPList(true); } } diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 0398e9ac..895b3b9c 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1107,7 +1107,7 @@ void OrganizerCore::spawnBinary(const QFileInfo &binary, const QString &argument } refreshDirectoryStructure(); - refreshESPList(); + refreshESPList(true); savePluginList(); //These callbacks should not fiddle with directoy structure and ESPs. @@ -1559,13 +1559,13 @@ void OrganizerCore::refreshModList(bool saveChanges) refreshDirectoryStructure(); } -void OrganizerCore::refreshESPList() +void OrganizerCore::refreshESPList(bool force) { if (m_DirectoryUpdate) { // don't mess up the esp list if we're currently updating the directory // structure - m_PostRefreshTasks.append([this]() { - this->refreshESPList(); + m_PostRefreshTasks.append([=]() { + this->refreshESPList(force); }); return; } @@ -1574,7 +1574,7 @@ void OrganizerCore::refreshESPList() // clear list try { m_PluginList.refresh(m_CurrentProfile->name(), *m_DirectoryStructure, - m_CurrentProfile->getLockedOrderFileName()); + m_CurrentProfile->getLockedOrderFileName(), force); } catch (const std::exception &e) { reportError(tr("Failed to refresh list of esps: %1").arg(e.what())); } @@ -1615,7 +1615,7 @@ void OrganizerCore::refreshBSAList() void OrganizerCore::refreshLists() { if ((m_CurrentProfile != nullptr) && m_DirectoryStructure->isPopulated()) { - refreshESPList(); + refreshESPList(true); refreshBSAList(); } // no point in refreshing lists if no files have been added to the directory // tree @@ -1678,7 +1678,7 @@ void OrganizerCore::updateModInDirectoryStructure(unsigned int index, modInfo->stealFiles()); DirectoryRefresher::cleanStructure(m_DirectoryStructure); // need to refresh plugin list now so we can activate esps - refreshESPList(); + refreshESPList(true); // activate all esps of the specified mod so the bsas get activated along with // it updateModActiveState(index, true); @@ -1839,7 +1839,7 @@ void OrganizerCore::modStatusChanged(unsigned int index) updateModInDirectoryStructure(index, modInfo); } else { updateModActiveState(index, false); - refreshESPList(); + refreshESPList(true); if (m_DirectoryStructure->originExists(ToWString(modInfo->name()))) { FilesOrigin &origin = m_DirectoryStructure->getOriginByName(ToWString(modInfo->name())); diff --git a/src/organizercore.h b/src/organizercore.h index 9e81f0c3..54d9dd6d 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -130,7 +130,7 @@ public: void prepareStart(); - void refreshESPList(); + void refreshESPList(bool force = false); void refreshBSAList(); void refreshDirectoryStructure(); diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 8bf438f1..9bbcdc11 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -140,8 +140,15 @@ void PluginList::highlightPlugins(const QItemSelection &selected, const MOShared void PluginList::refresh(const QString &profileName , const DirectoryEntry &baseDirectory - , const QString &lockedOrderFile) + , const QString &lockedOrderFile + , bool force) { + if (force) { + m_ESPs.clear(); + m_ESPsByName.clear(); + m_ESPsByPriority.clear(); + } + ChangeBracket layoutChange(this); QStringList primaryPlugins = m_GamePlugin->primaryPlugins(); diff --git a/src/pluginlist.h b/src/pluginlist.h index 4762f79f..f9173810 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -116,7 +116,8 @@ public: **/ void refresh(const QString &profileName , const MOShared::DirectoryEntry &baseDirectory - , const QString &lockedOrderFile); + , const QString &lockedOrderFile + , bool refresh); /** * @brief enable a plugin based on its name -- cgit v1.3.1 From 47dc5cded72ff79a3964ef39b7ad23e6b27fcdff Mon Sep 17 00:00:00 2001 From: Silarn Date: Mon, 9 Apr 2018 12:17:15 -0500 Subject: Add DXTex header licenses for new BSATK handling of FO4 texture BA2s --- src/aboutdialog.cpp | 2 ++ src/aboutdialog.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index 5ac05df7..a350036f 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -54,6 +54,7 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) m_LicenseFiles[LICENSE_SIP] = "sip.txt"; m_LicenseFiles[LICENSE_CASTLE] = "Castle.txt"; m_LicenseFiles[LICENSE_ANTLR] = "AntlrBuildTask.txt"; + m_LicenseFiles[LICENSE_DXTEX] = "DXTex.txt"; addLicense("Qt", LICENSE_LGPL3); addLicense("Qt Json", LICENSE_GPL3); @@ -73,6 +74,7 @@ AboutDialog::AboutDialog(const QString &version, QWidget *parent) addLicense("spdlog", LICENSE_SPDLOG); addLicense("{fmt}", LICENSE_FMT); addLicense("SIP", LICENSE_SIP); + addLicense("DXTex Headers", LICENSE_DXTEX); ui->nameLabel->setText(QString("%1 %2").arg(ui->nameLabel->text()).arg(version)); #if defined(HGID) diff --git a/src/aboutdialog.h b/src/aboutdialog.h index a67c9c73..3ae3237b 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -60,7 +60,8 @@ private: LICENSE_FMT, LICENSE_SIP, LICENSE_CASTLE, - LICENSE_ANTLR + LICENSE_ANTLR, + LICENSE_DXTEX }; private: -- cgit v1.3.1 From 9465966b2c782a3b86ed933e868b306194289bbd Mon Sep 17 00:00:00 2001 From: Silarn Date: Mon, 9 Apr 2018 12:18:22 -0500 Subject: Created threaded process for writing mod meta files to prevent hangs --- src/mainwindow.cpp | 14 +++++++++----- src/mainwindow.h | 3 +++ src/nexusinterface.cpp | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 85e96993..1e2ec68b 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -153,8 +153,6 @@ along with Mod Organizer. If not, see . #include #include -#include - #ifndef Q_MOC_RUN #include #include @@ -901,6 +899,8 @@ void MainWindow::cleanup() QWebEngineProfile::defaultProfile()->clearAllVisitedLinks(); m_IntegratedBrowser.close(); + m_SaveMetaTimer.stop(); + m_MetaSave.waitForFinished(); } @@ -1568,9 +1568,13 @@ void MainWindow::checkBSAList() void MainWindow::saveModMetas() { - for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) { - ModInfo::Ptr modInfo = ModInfo::getByIndex(i); - modInfo->saveMeta(); + if (m_MetaSave.isFinished()) { + m_MetaSave = QtConcurrent::run([this]() { + for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) { + ModInfo::Ptr modInfo = ModInfo::getByIndex(i); + modInfo->saveMeta(); + } + }); } } diff --git a/src/mainwindow.h b/src/mainwindow.h index d0957305..ef6eb262 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -63,6 +63,7 @@ namespace MOShared { class DirectoryEntry; } #include #include #include +#include class QAction; class QAbstractItemModel; @@ -336,6 +337,8 @@ private: QTimer m_SaveMetaTimer; QTimer m_UpdateProblemsTimer; + QFuture m_MetaSave; + QTime m_StartTime; //SaveGameInfoWidget *m_CurrentSaveView; MOBase::ISaveGameInfoWidget *m_CurrentSaveView; diff --git a/src/nexusinterface.cpp b/src/nexusinterface.cpp index eba02a6f..97186e8b 100644 --- a/src/nexusinterface.cpp +++ b/src/nexusinterface.cpp @@ -500,7 +500,7 @@ void NexusInterface::requestFinished(std::list::iterator iter) iter->m_URL = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString(); iter->m_Reroute = true; m_RequestQueue.enqueue(*iter); - nextRequest(); + //nextRequest(); return; } QByteArray data = reply->readAll(); -- cgit v1.3.1 From 5a24d2b60cbe93cabb8070ddbdccb17801bee8eb Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 10 Apr 2018 01:53:59 -0500 Subject: Minor improvements to download hiding --- src/downloadmanager.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 161656b2..8977492c 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -580,36 +580,20 @@ void DownloadManager::removeDownload(int index, bool deleteFile) emit aboutToUpdate(); if (index < 0) { - if (index == -1) { - DownloadState minState = STATE_READY; + DownloadState minState = index == -1 ? STATE_READY : STATE_INSTALLED; index = 0; for (QVector::iterator iter = m_ActiveDownloads.begin(); iter != m_ActiveDownloads.end();) { if ((*iter)->m_State >= minState) { removeFile(index, deleteFile); delete *iter; iter = m_ActiveDownloads.erase(iter); + QCoreApplication::processEvents(); } else { ++iter; ++index; } } - } - else { - DownloadState minState = STATE_INSTALLED; - index = 0; - for (QVector::iterator iter = m_ActiveDownloads.begin(); iter != m_ActiveDownloads.end();) { - if ((*iter)->m_State == minState) { - removeFile(index, deleteFile); - delete *iter; - iter = m_ActiveDownloads.erase(iter); - } - else { - ++iter; - ++index; - } - } - } } else { if (index >= m_ActiveDownloads.size()) { reportError(tr("remove: invalid download index %1").arg(index)); -- cgit v1.3.1 From c4bfee0089512e37a84742cf3981545bc0072413 Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 10 Apr 2018 23:28:33 -0500 Subject: Prep for Qt 5.11 (backward-compatible) --- src/CMakeLists.txt | 8 ++++---- src/downloadmanager.cpp | 2 +- src/mainwindow.cpp | 1 + src/queryoverwritedialog.cpp | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef009e03..fef640b3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.8) +CMAKE_MINIMUM_REQUIRED (VERSION 2.8.11) CMAKE_POLICY(SET CMP0020 NEW) #CMAKE_POLICY(SET CMP0043 NEW) @@ -249,6 +249,8 @@ FIND_PACKAGE(Qt5Quick REQUIRED) FIND_PACKAGE(Qt5Network REQUIRED) FIND_PACKAGE(Qt5WinExtras REQUIRED) FIND_PACKAGE(Qt5WebEngineWidgets REQUIRED) +FIND_PACKAGE(Qt5Script REQUIRED) +FIND_PACKAGE(Qt5Qml REQUIRED) FIND_PACKAGE(Qt5LinguistTools) QT5_WRAP_UI(organizer_UIHDRS ${organizer_UIS}) QT5_ADD_RESOURCES(organizer_RCCPPS ${organizer_QRCS}) @@ -314,6 +316,7 @@ ENDIF() ADD_EXECUTABLE(ModOrganizer WIN32 ${organizer_HDRS} ${organizer_SRCS} ${organizer_UIHDRS} ${organizer_RCS} ${organizer_RCCPPS} ${organizer_translations_qm}) TARGET_LINK_LIBRARIES(ModOrganizer Qt5::Widgets Qt5::WinExtras Qt5::WebEngineWidgets Qt5::Quick + Qt5::Script Qt5::Qml Qt5::QuickWidgets Qt5::Network ${Boost_LIBRARIES} zlibstatic uibase esptk bsatk githubpp @@ -327,9 +330,6 @@ SET_TARGET_PROPERTIES(ModOrganizer PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/LARGEADDRESSAWARE ${OPTIMIZE_LINK_FLAGS}") -QT5_USE_MODULES(ModOrganizer Widgets Script Qml QuickWidgets Quick Network WebEngineWidgets) - - ############### ## Installation diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 8977492c..c935d20b 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -462,7 +462,7 @@ void DownloadManager::addNXMDownload(const QString &url) for (auto pair : m_PendingDownloads) { if (pair.first == nxmInfo.modId() && pair.second == nxmInfo.fileId()) { - qDebug("download requested is already started (mod id: %s, file id: %s)", qPrintable(nxmInfo.modId()), qPrintable(nxmInfo.fileId())); + qDebug("download requested is already started (mod id: %s, file id: %s)", qPrintable(QString(nxmInfo.modId())), qPrintable(QString(nxmInfo.fileId()))); QMessageBox::information(nullptr, tr("Already Started"), tr("A download for this mod file has already been queued."), QMessageBox::Ok); return; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 1e2ec68b..0f66e505 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -89,6 +89,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include diff --git a/src/queryoverwritedialog.cpp b/src/queryoverwritedialog.cpp index 932b2637..eb67719d 100644 --- a/src/queryoverwritedialog.cpp +++ b/src/queryoverwritedialog.cpp @@ -20,6 +20,8 @@ along with Mod Organizer. If not, see . #include "queryoverwritedialog.h" #include "ui_queryoverwritedialog.h" +#include + QueryOverwriteDialog::QueryOverwriteDialog(QWidget *parent, Backup b) : QDialog(parent), ui(new Ui::QueryOverwriteDialog), m_Action(ACT_NONE) -- cgit v1.3.1 From e33da8402c9f843b2efe3883fba518bdd42bcdd3 Mon Sep 17 00:00:00 2001 From: Silarn Date: Wed, 11 Apr 2018 00:55:52 -0500 Subject: Allow multi-extract via archive origin entry in the BSA tab --- src/mainwindow.cpp | 45 +++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0f66e505..abcb5312 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4290,27 +4290,40 @@ bool MainWindow::extractProgress(QProgressDialog &progress, int percentage, std: void MainWindow::extractBSATriggered() { QTreeWidgetItem *item = m_ContextItem; + QString origin; QString targetFolder = FileDialogMemory::getExistingDirectory("extractBSA", this, tr("Extract BSA")); + QStringList archives = {}; if (!targetFolder.isEmpty()) { - BSA::Archive archive; - QString originPath = QDir::fromNativeSeparators(ToQString(m_OrganizerCore.directoryStructure()->getOriginByName(ToWString(item->text(1))).getPath())); - QString archivePath = QString("%1\\%2").arg(originPath).arg(item->text(0)); - - BSA::EErrorCode result = archive.read(archivePath.toLocal8Bit().constData(), true); - if ((result != BSA::ERROR_NONE) && (result != BSA::ERROR_INVALIDHASHES)) { - reportError(tr("failed to read %1: %2").arg(archivePath).arg(result)); - return; + if (!item->parent()) { + for (int i = 0; i < item->childCount(); ++i) { + archives.append(item->child(i)->text(0)); + } + origin = QDir::fromNativeSeparators(ToQString(m_OrganizerCore.directoryStructure()->getOriginByName(ToWString(item->text(0))).getPath())); + } else { + origin = QDir::fromNativeSeparators(ToQString(m_OrganizerCore.directoryStructure()->getOriginByName(ToWString(item->text(1))).getPath())); + archives = QStringList({ item->text(0) }); } - QProgressDialog progress(this); - progress.setMaximum(100); - progress.setValue(0); - progress.show(); - archive.extractAll(QDir::toNativeSeparators(targetFolder).toLocal8Bit().constData(), - boost::bind(&MainWindow::extractProgress, this, boost::ref(progress), _1, _2)); - if (result == BSA::ERROR_INVALIDHASHES) { - reportError(tr("This archive contains invalid hashes. Some files may be broken.")); + for (auto archiveName : archives) { + BSA::Archive archive; + QString archivePath = QString("%1\\%2").arg(origin).arg(archiveName); + BSA::EErrorCode result = archive.read(archivePath.toLocal8Bit().constData(), true); + if ((result != BSA::ERROR_NONE) && (result != BSA::ERROR_INVALIDHASHES)) { + reportError(tr("failed to read %1: %2").arg(archivePath).arg(result)); + return; + } + + QProgressDialog progress(this); + progress.setMaximum(100); + progress.setValue(0); + progress.show(); + archive.extractAll(QDir::toNativeSeparators(targetFolder).toLocal8Bit().constData(), + boost::bind(&MainWindow::extractProgress, this, boost::ref(progress), _1, _2)); + if (result == BSA::ERROR_INVALIDHASHES) { + reportError(tr("This archive contains invalid hashes. Some files may be broken.")); + } + archive.close(); } } } -- cgit v1.3.1 From e037caf58e918c5bf4693e800069098d74ff5e96 Mon Sep 17 00:00:00 2001 From: Silarn Date: Wed, 11 Apr 2018 10:58:22 -0500 Subject: Fix both remove and reinstall updating hidden downloads --- src/downloadmanager.cpp | 21 +++++++++++++++++++-- src/downloadmanager.h | 2 ++ src/organizercore.cpp | 2 ++ 3 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index c935d20b..569a7d31 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -902,6 +902,22 @@ void DownloadManager::markInstalled(int index) setState(m_ActiveDownloads.at(index), STATE_INSTALLED); } +void DownloadManager::markInstalled(QString fileName) +{ + int index = indexByName(fileName); + if (index >= 0) { + markInstalled(index); + } else { + DownloadInfo *info = getDownloadInfo(fileName); + if (info != nullptr) { + QSettings metaFile(info->m_Output.fileName() + ".meta", QSettings::IniFormat); + metaFile.setValue("installed", true); + metaFile.setValue("uninstalled", false); + } + delete info; + } +} + DownloadManager::DownloadInfo* DownloadManager::getDownloadInfo(QString fileName) { return DownloadInfo::createFromMeta(fileName, true); @@ -927,12 +943,13 @@ void DownloadManager::markUninstalled(QString fileName) if (index >= 0) { markUninstalled(index); } else { - DownloadInfo *info = getDownloadInfo(fileName); + QString filePath = QDir::fromNativeSeparators(m_OutputDirectory) + "/" + fileName; + DownloadInfo *info = getDownloadInfo(filePath); if (info != nullptr) { QSettings metaFile(info->m_Output.fileName() + ".meta", QSettings::IniFormat); metaFile.setValue("uninstalled", true); - setState(info, STATE_UNINSTALLED); } + delete info; } } diff --git a/src/downloadmanager.h b/src/downloadmanager.h index 059c6cb5..a6d3b20c 100644 --- a/src/downloadmanager.h +++ b/src/downloadmanager.h @@ -307,6 +307,8 @@ public: */ void markInstalled(int index); + void markInstalled(QString download); + /** * @brief mark a download as uninstalled * diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 895b3b9c..999c7732 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -895,6 +895,8 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName, ModInfoDialog::TAB_INIFILES); } m_ModInstalled(modName); + m_DownloadManager.markInstalled(fileName); + emit modInstalled(modName); return modInfo.data(); } else { reportError(tr("mod \"%1\" not found").arg(modName)); -- cgit v1.3.1 From 37b1bdd9e66f0c377b51b34ac94a4356dd337a5d Mon Sep 17 00:00:00 2001 From: Silarn Date: Wed, 11 Apr 2018 12:58:46 -0500 Subject: Bump version to 2.1.2 and update meta info --- src/version.rc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/version.rc b/src/version.rc index a71a462a..142065bf 100644 --- a/src/version.rc +++ b/src/version.rc @@ -1,7 +1,7 @@ #include "Winver.h" -#define VER_FILEVERSION 2,1,1 -#define VER_FILEVERSION_STR "2.1.1\0" +#define VER_FILEVERSION 2,1,2 +#define VER_FILEVERSION_STR "2.1.2\0" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION @@ -10,17 +10,19 @@ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS (0) FILEOS VOS__WINDOWS32 FILETYPE VFT_APP -FILESUBTYPE VFT2_UNKNOWN +FILESUBTYPE (0) BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904B0" BEGIN VALUE "FileVersion", VER_FILEVERSION_STR - VALUE "CompanyName", "Tannin\0" - VALUE "FileDescription", "Mod Organizer UI\0" + VALUE "CompanyName", "Mod Organizer 2 Team\0" + VALUE "FileDescription", "Main Mod Oranizer 2 UI\0" VALUE "OriginalFilename", "ModOrganizer.exe\0" - VALUE "ProductName", "Mod Organizer\0" + VALUE "InternalName", "ModOrganizer\0" + VALUE "LegalCopyright", "Copyright 2011-2016 Sebastian Herbord\r\nCopyright 2016-2018 Mod Organizer 2 contributors\0" + VALUE "ProductName", "Mod Organizer 2\0" VALUE "ProductVersion", VER_FILEVERSION_STR END END -- cgit v1.3.1 From be2d39b03583fdd5a60318c73e19a14f99a38374 Mon Sep 17 00:00:00 2001 From: Silarn Date: Wed, 11 Apr 2018 15:12:31 -0500 Subject: Add flag and description text to ESL-flagged ESPs --- src/pluginlist.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 9bbcdc11..bd863f52 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -878,8 +878,12 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const text += "
" + tr("Enabled Masters") + ": " + SetJoin(enabledMasters, ", "); } 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."; + text += "
" + tr("There is an ini file connected to this esp. " + "Its settings will be added to your game settings, overwriting in case of conflicts."); + } + if (m_ESPs[index].m_IsLightFlagged && !m_ESPs[index].m_IsLight) { + text += "

" + tr("This ESP is flagged as an ESL. " + "It will adhere to the ESP load order but the records will be loaded in ESL space."); } toolTip += text; } @@ -902,6 +906,9 @@ QVariant PluginList::data(const QModelIndex &modelIndex, int role) const if (m_ESPs[index].m_HasIni) { result.append(":/MO/gui/attachment"); } + if (m_ESPs[index].m_IsLightFlagged && !m_ESPs[index].m_IsLight) { + result.append(":/MO/gui/awaiting"); + } return result; } return QVariant(); -- cgit v1.3.1