mirror of
https://github.com/ModOrganizer2/modorganizer.git
synced 2026-07-27 13:58:24 -07:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd9cc6254c | ||
|
|
57fd35fc47 | ||
|
|
ee266e5220 | ||
|
|
d0a6321a39 | ||
|
|
b1f91d28fb | ||
|
|
c19ba15337 | ||
|
|
4b98a3f5b6 | ||
|
|
55249ba3a6 | ||
|
|
600b0786eb | ||
|
|
02c5b083dc | ||
|
|
4d8920cec1 | ||
|
|
2106f29224 |
@@ -80,7 +80,8 @@ static T resolveFunction(QLibrary &lib, const char *name)
|
||||
|
||||
InstallationManager::InstallationManager()
|
||||
: m_ParentWidget(nullptr),
|
||||
m_SupportedExtensions({"zip", "rar", "7z", "fomod", "001"}) {
|
||||
m_SupportedExtensions({"zip", "rar", "7z", "fomod", "001"}),
|
||||
m_IsRunning(false) {
|
||||
QLibrary archiveLib(QCoreApplication::applicationDirPath() +
|
||||
"\\dlls\\archive.dll");
|
||||
if (!archiveLib.load()) {
|
||||
@@ -664,6 +665,11 @@ bool InstallationManager::wasCancelled()
|
||||
return m_ArchiveHandler->getLastError() == Archive::ERROR_EXTRACT_CANCELLED;
|
||||
}
|
||||
|
||||
bool InstallationManager::isRunning()
|
||||
{
|
||||
return m_IsRunning;
|
||||
}
|
||||
|
||||
|
||||
void InstallationManager::postInstallCleanup()
|
||||
{
|
||||
@@ -705,6 +711,7 @@ bool InstallationManager::install(const QString &fileName,
|
||||
bool &hasIniTweaks,
|
||||
int modID)
|
||||
{
|
||||
m_IsRunning = true;
|
||||
QFileInfo fileInfo(fileName);
|
||||
if (m_SupportedExtensions.find(fileInfo.suffix()) == m_SupportedExtensions.end()) {
|
||||
reportError(tr("File format \"%1\" not supported").arg(fileInfo.suffix()));
|
||||
@@ -853,6 +860,7 @@ bool InstallationManager::install(const QString &fileName,
|
||||
switch (installResult) {
|
||||
case IPluginInstaller::RESULT_CANCELED:
|
||||
case IPluginInstaller::RESULT_FAILED: {
|
||||
m_IsRunning = false;
|
||||
return false;
|
||||
} break;
|
||||
case IPluginInstaller::RESULT_SUCCESS:
|
||||
@@ -861,8 +869,10 @@ bool InstallationManager::install(const QString &fileName,
|
||||
DirectoryTree::node_iterator iniTweakNode = filesTree->nodeFind(DirectoryTreeInformation("INI Tweaks"));
|
||||
hasIniTweaks = (iniTweakNode != filesTree->nodesEnd()) &&
|
||||
((*iniTweakNode)->numLeafs() != 0);
|
||||
m_IsRunning = false;
|
||||
return true;
|
||||
} else {
|
||||
m_IsRunning = false;
|
||||
return false;
|
||||
}
|
||||
} break;
|
||||
@@ -871,6 +881,8 @@ bool InstallationManager::install(const QString &fileName,
|
||||
|
||||
reportError(tr("None of the available installer plugins were able to handle that archive.\n"
|
||||
"This is likely due to a corrupted or incompatible download or unrecognized archive format."));
|
||||
|
||||
m_IsRunning = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,11 @@ public:
|
||||
**/
|
||||
bool wasCancelled();
|
||||
|
||||
/**
|
||||
* @return true if an installation is currently in progress
|
||||
**/
|
||||
bool isRunning();
|
||||
|
||||
/**
|
||||
* @brief retrieve a string describing the specified error code
|
||||
*
|
||||
@@ -202,6 +207,8 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
bool m_IsRunning;
|
||||
|
||||
QWidget *m_ParentWidget;
|
||||
|
||||
QString m_ModsDirectory;
|
||||
|
||||
+101
-90
@@ -338,7 +338,9 @@ MainWindow::MainWindow(QSettings &initSettings
|
||||
linkMenu->addAction(QIcon(":/MO/gui/link"), tr("Start Menu"), this, SLOT(linkMenu()));
|
||||
ui->linkButton->setMenu(linkMenu);
|
||||
|
||||
ui->listOptionsBtn->setMenu(modListContextMenu(ui->listOptionsBtn));
|
||||
QMenu *listOptionsMenu = new QMenu(ui->listOptionsBtn);
|
||||
initModListContextMenu(listOptionsMenu);
|
||||
ui->listOptionsBtn->setMenu(listOptionsMenu);
|
||||
connect(ui->listOptionsBtn, SIGNAL(pressed()), this, SLOT(on_listOptionsBtn_pressed()));
|
||||
|
||||
ui->openFolderMenu->setMenu(openFolderMenu());
|
||||
@@ -3128,7 +3130,11 @@ void MainWindow::openOriginExplorer_clicked()
|
||||
if (selection->hasSelection() && selection->selectedRows().count() > 0) {
|
||||
for (QModelIndex idx : selection->selectedRows()) {
|
||||
QString fileName = idx.data().toString();
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
|
||||
unsigned int modIndex = ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName));
|
||||
if (modIndex == UINT_MAX) {
|
||||
continue;
|
||||
}
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex);
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
@@ -3137,7 +3143,6 @@ void MainWindow::openOriginExplorer_clicked()
|
||||
else {
|
||||
QModelIndex idx = selection->currentIndex();
|
||||
QString fileName = idx.data().toString();
|
||||
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
|
||||
@@ -3171,14 +3176,15 @@ void MainWindow::openExplorer_activated()
|
||||
QString fileName = idx.data().toString();
|
||||
|
||||
|
||||
unsigned int modInfoIndex = ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName));
|
||||
if (modInfoIndex != UINT_MAX) {
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(modInfoIndex);
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
|
||||
if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
|
||||
if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
|
||||
::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4375,28 +4381,19 @@ QMenu *MainWindow::openFolderMenu()
|
||||
return FolderMenu;
|
||||
}
|
||||
|
||||
QMenu *MainWindow::modListContextMenu(QWidget *parent)
|
||||
void MainWindow::initModListContextMenu(QMenu *menu)
|
||||
{
|
||||
QMenu *menu = new QMenu(parent);
|
||||
menu->addAction(tr("Install Mod..."), this, SLOT(installMod_clicked()));
|
||||
|
||||
menu->addAction(tr("Create empty mod"), this, SLOT(createEmptyMod_clicked()));
|
||||
|
||||
menu->addAction(tr("Create Separator"), this, SLOT(createSeparator_clicked()));
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Enable all visible"), this, SLOT(enableVisibleMods()));
|
||||
menu->addAction(tr("Disable all visible"), this, SLOT(disableVisibleMods()));
|
||||
|
||||
menu->addAction(tr("Check all for update"), this, SLOT(checkModsForUpdates()));
|
||||
|
||||
menu->addAction(tr("Refresh"), &m_OrganizerCore, SLOT(profileRefresh()));
|
||||
|
||||
menu->addAction(tr("Export to csv..."), this, SLOT(exportModListCSV()));
|
||||
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
void MainWindow::addModSendToContextMenu(QMenu *menu)
|
||||
@@ -4438,137 +4435,140 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos)
|
||||
m_ContextIdx = mapToModel(m_OrganizerCore.modList(), modList->indexAt(pos));
|
||||
m_ContextRow = m_ContextIdx.row();
|
||||
|
||||
QMenu *menu = nullptr;
|
||||
if (m_ContextRow == -1) {
|
||||
// no selection
|
||||
menu = modListContextMenu(this);
|
||||
QMenu menu(this);
|
||||
initModListContextMenu(&menu);
|
||||
menu.exec(modList->mapToGlobal(pos));
|
||||
} else {
|
||||
menu = new QMenu(this);
|
||||
QMenu *allMods = modListContextMenu(menu);
|
||||
QMenu menu(this);
|
||||
|
||||
QMenu *allMods = new QMenu(&menu);
|
||||
initModListContextMenu(allMods);
|
||||
allMods->setTitle(tr("All Mods"));
|
||||
menu->addMenu(allMods);
|
||||
menu->addSeparator();
|
||||
menu.addMenu(allMods);
|
||||
menu.addSeparator();
|
||||
|
||||
ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
|
||||
std::vector<ModInfo::EFlag> flags = info->getFlags();
|
||||
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end()) {
|
||||
if (QDir(info->absolutePath()).count() > 2) {
|
||||
menu->addAction(tr("Sync to Mods..."), &m_OrganizerCore, SLOT(syncOverwrite()));
|
||||
menu->addAction(tr("Create Mod..."), this, SLOT(createModFromOverwrite()));
|
||||
menu->addAction(tr("Move content to Mod..."), this, SLOT(moveOverwriteContentToExistingMod()));
|
||||
menu->addAction(tr("Clear Overwrite..."), this, SLOT(clearOverwrite()));
|
||||
menu.addAction(tr("Sync to Mods..."), &m_OrganizerCore, SLOT(syncOverwrite()));
|
||||
menu.addAction(tr("Create Mod..."), this, SLOT(createModFromOverwrite()));
|
||||
menu.addAction(tr("Move content to Mod..."), this, SLOT(moveOverwriteContentToExistingMod()));
|
||||
menu.addAction(tr("Clear Overwrite..."), this, SLOT(clearOverwrite()));
|
||||
}
|
||||
menu->addAction(tr("Open in Explorer"), this, SLOT(openExplorer_clicked()));
|
||||
menu.addAction(tr("Open in Explorer"), this, SLOT(openExplorer_clicked()));
|
||||
} else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_BACKUP) != flags.end()) {
|
||||
menu->addAction(tr("Restore Backup"), this, SLOT(restoreBackup_clicked()));
|
||||
menu->addAction(tr("Remove Backup..."), this, SLOT(removeMod_clicked()));
|
||||
menu.addAction(tr("Restore Backup"), this, SLOT(restoreBackup_clicked()));
|
||||
menu.addAction(tr("Remove Backup..."), this, SLOT(removeMod_clicked()));
|
||||
} else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_SEPARATOR) != flags.end()){
|
||||
menu->addSeparator();
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"), menu);
|
||||
menu.addSeparator();
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"), &menu);
|
||||
populateMenuCategories(addRemoveCategoriesMenu, 0);
|
||||
connect(addRemoveCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(addRemoveCategories_MenuHandler()));
|
||||
addMenuAsPushButton(menu, addRemoveCategoriesMenu);
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"), menu);
|
||||
addMenuAsPushButton(&menu, addRemoveCategoriesMenu);
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"), &menu);
|
||||
connect(primaryCategoryMenu, SIGNAL(aboutToShow()), this, SLOT(addPrimaryCategoryCandidates()));
|
||||
addMenuAsPushButton(menu, primaryCategoryMenu);
|
||||
menu->addSeparator();
|
||||
menu->addAction(tr("Rename Separator..."), this, SLOT(renameMod_clicked()));
|
||||
menu->addAction(tr("Remove Separator..."), this, SLOT(removeMod_clicked()));
|
||||
menu->addSeparator();
|
||||
addModSendToContextMenu(menu);
|
||||
menu->addAction(tr("Select Color..."), this, SLOT(setColor_clicked()));
|
||||
addMenuAsPushButton(&menu, primaryCategoryMenu);
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Rename Separator..."), this, SLOT(renameMod_clicked()));
|
||||
menu.addAction(tr("Remove Separator..."), this, SLOT(removeMod_clicked()));
|
||||
menu.addSeparator();
|
||||
addModSendToContextMenu(&menu);
|
||||
menu.addAction(tr("Select Color..."), this, SLOT(setColor_clicked()));
|
||||
if(info->getColor().isValid())
|
||||
menu->addAction(tr("Reset Color"), this, SLOT(resetColor_clicked()));
|
||||
menu->addSeparator();
|
||||
menu.addAction(tr("Reset Color"), this, SLOT(resetColor_clicked()));
|
||||
menu.addSeparator();
|
||||
} else if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) != flags.end()) {
|
||||
addModSendToContextMenu(menu);
|
||||
addModSendToContextMenu(&menu);
|
||||
} else {
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"), menu);
|
||||
QMenu *addRemoveCategoriesMenu = new QMenu(tr("Change Categories"), &menu);
|
||||
populateMenuCategories(addRemoveCategoriesMenu, 0);
|
||||
connect(addRemoveCategoriesMenu, SIGNAL(aboutToHide()), this, SLOT(addRemoveCategories_MenuHandler()));
|
||||
addMenuAsPushButton(menu, addRemoveCategoriesMenu);
|
||||
addMenuAsPushButton(&menu, addRemoveCategoriesMenu);
|
||||
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"), menu);
|
||||
QMenu *primaryCategoryMenu = new QMenu(tr("Primary Category"), &menu);
|
||||
connect(primaryCategoryMenu, SIGNAL(aboutToShow()), this, SLOT(addPrimaryCategoryCandidates()));
|
||||
addMenuAsPushButton(menu, primaryCategoryMenu);
|
||||
addMenuAsPushButton(&menu, primaryCategoryMenu);
|
||||
|
||||
menu->addSeparator();
|
||||
menu.addSeparator();
|
||||
|
||||
if (info->downgradeAvailable()) {
|
||||
menu->addAction(tr("Change versioning scheme"), this, SLOT(changeVersioningScheme()));
|
||||
menu.addAction(tr("Change versioning scheme"), this, SLOT(changeVersioningScheme()));
|
||||
}
|
||||
|
||||
if (info->updateIgnored()) {
|
||||
menu->addAction(tr("Un-ignore update"), this, SLOT(unignoreUpdate()));
|
||||
menu.addAction(tr("Un-ignore update"), this, SLOT(unignoreUpdate()));
|
||||
}
|
||||
else {
|
||||
if (info->updateAvailable() || info->downgradeAvailable()) {
|
||||
menu->addAction(tr("Ignore update"), this, SLOT(ignoreUpdate()));
|
||||
menu.addAction(tr("Ignore update"), this, SLOT(ignoreUpdate()));
|
||||
}
|
||||
}
|
||||
menu->addSeparator();
|
||||
menu.addSeparator();
|
||||
|
||||
menu->addAction(tr("Enable selected"), this, SLOT(enableSelectedMods_clicked()));
|
||||
menu->addAction(tr("Disable selected"), this, SLOT(disableSelectedMods_clicked()));
|
||||
menu.addAction(tr("Enable selected"), this, SLOT(enableSelectedMods_clicked()));
|
||||
menu.addAction(tr("Disable selected"), this, SLOT(disableSelectedMods_clicked()));
|
||||
|
||||
menu->addSeparator();
|
||||
menu.addSeparator();
|
||||
|
||||
addModSendToContextMenu(menu);
|
||||
addModSendToContextMenu(&menu);
|
||||
|
||||
menu->addAction(tr("Rename Mod..."), this, SLOT(renameMod_clicked()));
|
||||
menu->addAction(tr("Reinstall Mod"), this, SLOT(reinstallMod_clicked()));
|
||||
menu->addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked()));
|
||||
menu->addAction(tr("Create Backup"), this, SLOT(backupMod_clicked()));
|
||||
menu.addAction(tr("Rename Mod..."), this, SLOT(renameMod_clicked()));
|
||||
menu.addAction(tr("Reinstall Mod"), this, SLOT(reinstallMod_clicked()));
|
||||
menu.addAction(tr("Remove Mod..."), this, SLOT(removeMod_clicked()));
|
||||
menu.addAction(tr("Create Backup"), this, SLOT(backupMod_clicked()));
|
||||
|
||||
menu->addSeparator();
|
||||
menu.addSeparator();
|
||||
|
||||
if (info->getNexusID() > 0 && Settings::instance().endorsementIntegration()) {
|
||||
switch (info->endorsedState()) {
|
||||
case ModInfo::ENDORSED_TRUE: {
|
||||
menu->addAction(tr("Un-Endorse"), this, SLOT(unendorse_clicked()));
|
||||
menu.addAction(tr("Un-Endorse"), this, SLOT(unendorse_clicked()));
|
||||
} break;
|
||||
case ModInfo::ENDORSED_FALSE: {
|
||||
menu->addAction(tr("Endorse"), this, SLOT(endorse_clicked()));
|
||||
menu->addAction(tr("Won't endorse"), this, SLOT(dontendorse_clicked()));
|
||||
menu.addAction(tr("Endorse"), this, SLOT(endorse_clicked()));
|
||||
menu.addAction(tr("Won't endorse"), this, SLOT(dontendorse_clicked()));
|
||||
} break;
|
||||
case ModInfo::ENDORSED_NEVER: {
|
||||
menu->addAction(tr("Endorse"), this, SLOT(endorse_clicked()));
|
||||
menu.addAction(tr("Endorse"), this, SLOT(endorse_clicked()));
|
||||
} break;
|
||||
default: {
|
||||
QAction *action = new QAction(tr("Endorsement state unknown"), menu);
|
||||
QAction *action = new QAction(tr("Endorsement state unknown"), &menu);
|
||||
action->setEnabled(false);
|
||||
menu->addAction(action);
|
||||
menu.addAction(action);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
menu.addSeparator();
|
||||
|
||||
std::vector<ModInfo::EFlag> flags = info->getFlags();
|
||||
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_INVALID) != flags.end()) {
|
||||
menu->addAction(tr("Ignore missing data"), this, SLOT(ignoreMissingData_clicked()));
|
||||
menu.addAction(tr("Ignore missing data"), this, SLOT(ignoreMissingData_clicked()));
|
||||
}
|
||||
|
||||
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_ALTERNATE_GAME) != flags.end()) {
|
||||
menu->addAction(tr("Mark as converted/working"), this, SLOT(markConverted_clicked()));
|
||||
menu.addAction(tr("Mark as converted/working"), this, SLOT(markConverted_clicked()));
|
||||
}
|
||||
|
||||
if (info->getNexusID() > 0) {
|
||||
menu->addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
|
||||
menu.addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
|
||||
} else if ((info->getURL() != "")) {
|
||||
menu->addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
|
||||
menu.addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
|
||||
}
|
||||
|
||||
menu->addAction(tr("Open in Explorer"), this, SLOT(openExplorer_clicked()));
|
||||
menu.addAction(tr("Open in Explorer"), this, SLOT(openExplorer_clicked()));
|
||||
}
|
||||
|
||||
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) == flags.end()) {
|
||||
QAction *infoAction = menu->addAction(tr("Information..."), this, SLOT(information_clicked()));
|
||||
menu->setDefaultAction(infoAction);
|
||||
QAction *infoAction = menu.addAction(tr("Information..."), this, SLOT(information_clicked()));
|
||||
menu.setDefaultAction(infoAction);
|
||||
}
|
||||
}
|
||||
|
||||
menu->exec(modList->mapToGlobal(pos));
|
||||
delete menu;
|
||||
menu.exec(modList->mapToGlobal(pos));
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
reportError(tr("Exception: ").arg(e.what()));
|
||||
} catch (...) {
|
||||
@@ -4871,7 +4871,11 @@ void MainWindow::on_actionSettings_triggered()
|
||||
|
||||
void MainWindow::on_actionNexus_triggered()
|
||||
{
|
||||
QDesktopServices::openUrl(QUrl(NexusInterface::instance(&m_PluginContainer)->getGameURL(m_OrganizerCore.managedGame()->gameShortName())));
|
||||
const IPluginGame *game = m_OrganizerCore.managedGame();
|
||||
QString gameName = game->gameShortName();
|
||||
if (game->gameNexusName().isEmpty() && game->primarySources().count())
|
||||
gameName = game->primarySources()[0];
|
||||
QDesktopServices::openUrl(QUrl(NexusInterface::instance(&m_PluginContainer)->getGameURL(gameName)));
|
||||
}
|
||||
|
||||
|
||||
@@ -4921,7 +4925,9 @@ void MainWindow::languageChange(const QString &newLanguage)
|
||||
updateDownloadView();
|
||||
updateProblemsButton();
|
||||
|
||||
ui->listOptionsBtn->setMenu(modListContextMenu(ui->listOptionsBtn));
|
||||
QMenu *listOptionsMenu = new QMenu(ui->listOptionsBtn);
|
||||
initModListContextMenu(listOptionsMenu);
|
||||
ui->listOptionsBtn->setMenu(listOptionsMenu);
|
||||
|
||||
ui->openFolderMenu->setMenu(openFolderMenu());
|
||||
}
|
||||
@@ -5837,15 +5843,20 @@ void MainWindow::on_espList_customContextMenuRequested(const QPoint &pos)
|
||||
}
|
||||
|
||||
menu.addSeparator();
|
||||
menu.addAction(tr("Open Origin in Explorer"), this, SLOT(openOriginExplorer_clicked()));
|
||||
|
||||
|
||||
QModelIndex idx = ui->espList->selectionModel()->currentIndex();
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(idx.data().toString())));
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
unsigned int modInfoIndex = ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(idx.data().toString()));
|
||||
//this is to avoid showing the option on game files like skyrim.esm
|
||||
if (modInfoIndex != UINT_MAX) {
|
||||
menu.addAction(tr("Open Origin in Explorer"), this, SLOT(openOriginExplorer_clicked()));
|
||||
ModInfo::Ptr modInfo = ModInfo::getByIndex(modInfoIndex);
|
||||
std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
|
||||
|
||||
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) == flags.end()) {
|
||||
QAction *infoAction = menu.addAction(tr("Open Origin Info..."), this, SLOT(openOriginInformation_clicked()));
|
||||
menu.setDefaultAction(infoAction);
|
||||
if (std::find(flags.begin(), flags.end(), ModInfo::FLAG_FOREIGN) == flags.end()) {
|
||||
QAction *infoAction = menu.addAction(tr("Open Origin Info..."), this, SLOT(openOriginInformation_clicked()));
|
||||
menu.setDefaultAction(infoAction);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
+1
-1
@@ -281,7 +281,7 @@ private:
|
||||
bool createBackup(const QString &filePath, const QDateTime &time);
|
||||
QString queryRestore(const QString &filePath);
|
||||
|
||||
QMenu *modListContextMenu(QWidget *parent);
|
||||
void initModListContextMenu(QMenu *menu);
|
||||
void addModSendToContextMenu(QMenu *menu);
|
||||
void addPluginSendToContextMenu(QMenu *menu);
|
||||
|
||||
|
||||
+349
-335
File diff suppressed because it is too large
Load Diff
@@ -836,6 +836,13 @@ void OrganizerCore::setCurrentProfile(const QString &profileName)
|
||||
connect(m_CurrentProfile, SIGNAL(modStatusChanged(uint)), this, SLOT(modStatusChanged(uint)));
|
||||
connect(m_CurrentProfile, SIGNAL(modStatusChanged(QList<uint>)), this, SLOT(modStatusChanged(QList<uint>)));
|
||||
refreshDirectoryStructure();
|
||||
|
||||
//This line is not actually needed and was only added to allow some
|
||||
//outside detection of Mo2 profile change. (like BaobobMiller utility)
|
||||
if (m_CurrentProfile != nullptr) {
|
||||
settings().directInterface().setValue("selected_profile",
|
||||
m_CurrentProfile->name().toUtf8().constData());
|
||||
}
|
||||
}
|
||||
|
||||
MOBase::IModRepositoryBridge *OrganizerCore::createNexusBridge() const
|
||||
@@ -981,6 +988,13 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (m_InstallationManager.isRunning()) {
|
||||
QMessageBox::information(
|
||||
qApp->activeWindow(), tr("Installation cancelled"),
|
||||
tr("Another installation is currently in progress."), QMessageBox::Ok);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool hasIniTweaks = false;
|
||||
GuessedValue<QString> modName;
|
||||
if (!initModName.isEmpty()) {
|
||||
@@ -1022,6 +1036,13 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName,
|
||||
|
||||
void OrganizerCore::installDownload(int index)
|
||||
{
|
||||
if (m_InstallationManager.isRunning()) {
|
||||
QMessageBox::information(
|
||||
qApp->activeWindow(), tr("Installation cancelled"),
|
||||
tr("Another installation is currently in progress."), QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
QString fileName = m_DownloadManager.getFilePath(index);
|
||||
QString gameName = m_DownloadManager.getGameName(index);
|
||||
|
||||
@@ -54,7 +54,7 @@ SingleInstance::SingleInstance(bool forcePrimary, QObject *parent) :
|
||||
m_PrimaryInstance = true;
|
||||
}
|
||||
if (m_PrimaryInstance) {
|
||||
connect(&m_Server, SIGNAL(newConnection()), this, SLOT(receiveMessage()));
|
||||
connect(&m_Server, SIGNAL(newConnection()), this, SLOT(receiveMessage()), Qt::QueuedConnection);
|
||||
// has to be called before listen
|
||||
m_Server.setSocketOptions(QLocalServer::WorldAccessOption);
|
||||
m_Server.listen(s_Key);
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
// Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser
|
||||
// Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha
|
||||
#define VER_FILEVERSION 2,2,0
|
||||
#define VER_FILEVERSION_STR "2.2.0beta2\0"
|
||||
#define VER_FILEVERSION_STR "2.2.0beta3\0"
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION VER_FILEVERSION
|
||||
|
||||
Reference in New Issue
Block a user