From 57cb241c012cbdfcc62a39fd8356def74cc6020f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Wed, 31 Jul 2024 18:39:15 +0200 Subject: [PATCH 1/2] Move slot connections to avoid issue when starting MO2 to download a NXM link. --- src/mainwindow.cpp | 8 -- src/nexusinterface.cpp | 7 +- src/organizer_en.ts | 222 ++++++++++++++++++++--------------------- 3 files changed, 116 insertions(+), 121 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b14a14a1b..778c05d9e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -406,14 +406,6 @@ MainWindow::MainWindow(Settings& settings, OrganizerCore& organizerCore, connect(&NexusInterface::instance(), SIGNAL(needLogin()), &m_OrganizerCore, SLOT(nexusApi())); - connect(NexusInterface::instance().getAccessManager(), - SIGNAL(credentialsReceived(const APIUserAccount&)), this, - SLOT(updateWindowTitle(const APIUserAccount&))); - - connect(NexusInterface::instance().getAccessManager(), - SIGNAL(credentialsReceived(const APIUserAccount&)), - &NexusInterface::instance(), SLOT(setUserAccount(const APIUserAccount&))); - connect(&NexusInterface::instance(), SIGNAL(requestsChanged(const APIStats&, const APIUserAccount&)), this, SLOT(onRequestsChanged(const APIStats&, const APIUserAccount&))); diff --git a/src/nexusinterface.cpp b/src/nexusinterface.cpp index 6a39128f4..359b7e413 100644 --- a/src/nexusinterface.cpp +++ b/src/nexusinterface.cpp @@ -280,8 +280,11 @@ NexusInterface::NexusInterface(Settings* s) : m_PluginContainer(nullptr) m_DiskCache = new QNetworkDiskCache(this); - connect(m_AccessManager, SIGNAL(requestNXMDownload(QString)), this, - SLOT(downloadRequestedNXM(QString))); + connect(m_AccessManager, &NXMAccessManager::requestNXMDownload, this, + &NexusInterface::downloadRequestedNXM); + + connect(m_AccessManager, &NXMAccessManager::credentialsReceived, this, + &NexusInterface::setUserAccount); } NexusInterface::~NexusInterface() diff --git a/src/organizer_en.ts b/src/organizer_en.ts index dc4bc55e2..81490d91e 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -3267,7 +3267,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Sort the plugins using LOOT. @@ -3401,7 +3401,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Name @@ -3659,7 +3659,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Endorse Mod Organizer @@ -3758,154 +3758,154 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Crash on exit - + MO crashed while exiting. Some settings may not be saved. Error: %1 - + There are notifications to read - + There are no notifications - + Endorse - + Won't Endorse - + First Steps Translation strings for tutorial names - + Conflict Resolution - + Overview - + Help on UI - + Documentation - - + + Game Support Wiki - + Chat on Discord - + Report Issue - + Tutorials - + About - + About Qt - + Please enter a name for the new profile - + failed to create profile: %1 - + Show tutorial? - + You are starting Mod Organizer for the first time. Do you want to show a tutorial of its basic features? If you choose no you can always start the tutorial from the "Help" menu. - + Never ask to show tutorials - + Do you know how to mod this game? Do you need to learn? There's a game support wiki available! Click OK to open the wiki. In the future, you can access this link from the "Help" menu. - + Category Setup - + Please choose how to handle the default category setup. If you've already connected to Nexus, you can automatically import Nexus categories for this game (if applicable). Otherwise, use the old Mod Organizer default category structure, or leave the categories blank (for manual setup). - - + + &Import Nexus Categories - + Use &Old Category Defaults - + Do &Nothing - + This is your first time running version 2.5 or higher with an old MO2 instance. The category system now relies on an updated system to map Nexus categories. In order to assign Nexus categories automatically, you will need to import the Nexus categories for the currently managed game and map them to your preferred category structure. @@ -3916,321 +3916,321 @@ As a final option, you can disable Nexus category mapping altogether, which can - + &Open Categories Dialog - + &Disable Nexus Mappings - + &Close - + &Don't show this again - + Downloads in progress - + There are still downloads in progress, do you really want to quit? - + Plugin "%1" failed: %2 - + Plugin "%1" failed - + <Edit...> - + (no executables) - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previously used one (%2). The GUI may not downgrade gracefully, so you may experience oddities. However, there should be no serious issues. - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + Open Game folder - + Open MyGames folder - + Open INIs folder - + Open Instance folder - + Open Mods folder - + Open Profile folder - + Open Downloads folder - + Open MO2 Install folder - + Open MO2 Plugins folder - + Open MO2 Stylesheets folder - + Open MO2 Logs folder - + Restart Mod Organizer - + Mod Organizer must restart to finish configuration changes - + Restart - + Continue - + Some things might be weird. - + Can't change download directory while downloads are in progress! - + Update available - + Do you want to endorse Mod Organizer on %1 now? - + Abstain from Endorsing Mod Organizer - + Are you sure you want to abstain from endorsing Mod Organizer 2? You will have to visit the mod page on the %1 Nexus site to change your mind. - + Thank you for endorsing MO2! :) - + Please reconsider endorsing MO2 on Nexus! - + There is no supported sort mechanism for this game. You will probably have to use a third-party tool. - + None of your %1 mods appear to have had recent file updates. - + All of your mods have been checked recently. We restrict update checks to help preserve your available API requests. - + Thank you! - + Thank you for your endorsement! - + Mod ID %1 no longer seems to be available on Nexus. - + Error %1: Request to Nexus failed: %2 - - + + failed to read %1: %2 - + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + Remove '%1' from the toolbar - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of mod list created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file @@ -5774,32 +5774,32 @@ Please enter a name: NexusInterface - + Please pick the mod ID for "%1" - + You must authorize MO2 in Settings -> Nexus to use the Nexus API. - + You've exceeded the Nexus API rate limit and requests are now being throttled. Your next batch of requests will be available in approximately %1 minutes and %2 seconds. - + Aborting download: Either you clicked on a premium-only link and your account is not premium, or the download link was generated by a different account than the one stored in Mod Organizer. - + empty response - + invalid response @@ -7618,23 +7618,23 @@ Destination: - + Please use "Help" from the toolbar to get usage instructions to all elements - + Visit %1 on Nexus - - + + <Manage...> - + failed to parse profile %1: %2 From 3605f848dcf5546eb14ffe5af43d4ffafd4d616a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Wed, 31 Jul 2024 19:29:56 +0200 Subject: [PATCH 2/2] Update title on credential received. --- src/mainwindow.cpp | 12 +-- src/mainwindow.h | 2 - src/organizer_en.ts | 210 ++++++++++++++++++++++---------------------- 3 files changed, 109 insertions(+), 115 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 778c05d9e..f346a3e44 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -406,9 +406,10 @@ MainWindow::MainWindow(Settings& settings, OrganizerCore& organizerCore, connect(&NexusInterface::instance(), SIGNAL(needLogin()), &m_OrganizerCore, SLOT(nexusApi())); - connect(&NexusInterface::instance(), - SIGNAL(requestsChanged(const APIStats&, const APIUserAccount&)), this, - SLOT(onRequestsChanged(const APIStats&, const APIUserAccount&))); + connect(NexusInterface::instance().getAccessManager(), + &NXMAccessManager::credentialsReceived, this, &MainWindow::updateWindowTitle); + connect(&NexusInterface::instance(), &NexusInterface::requestsChanged, ui->statusBar, + &StatusBar::setAPI); connect(&TutorialManager::instance(), SIGNAL(windowTutorialFinished(QString)), this, SLOT(windowTutorialFinished(QString))); @@ -650,11 +651,6 @@ void MainWindow::updateWindowTitle(const APIUserAccount& user) this->setWindowTitle(title); } -void MainWindow::onRequestsChanged(const APIStats& stats, const APIUserAccount& user) -{ - ui->statusBar->setAPI(stats, user); -} - void MainWindow::resizeLists(bool pluginListCustom) { // ensure the columns aren't so small you can't see them any more diff --git a/src/mainwindow.h b/src/mainwindow.h index fb424403c..42d3d5e7d 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -385,8 +385,6 @@ private slots: void nxmRequestFailed(QString gameName, int modID, int fileID, QVariant userData, int requestID, int errorCode, const QString& errorString); - void onRequestsChanged(const APIStats& stats, const APIUserAccount& user); - void modRenamed(const QString& oldName, const QString& newName); void modRemoved(const QString& fileName); diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 81490d91e..46169a5ad 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -3267,7 +3267,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Sort the plugins using LOOT. @@ -3401,7 +3401,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Name @@ -3659,7 +3659,7 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Endorse Mod Organizer @@ -3758,154 +3758,154 @@ This is likely due to a corrupted or incompatible download or unrecognized archi - + Crash on exit - + MO crashed while exiting. Some settings may not be saved. Error: %1 - + There are notifications to read - + There are no notifications - + Endorse - + Won't Endorse - + First Steps Translation strings for tutorial names - + Conflict Resolution - + Overview - + Help on UI - + Documentation - - + + Game Support Wiki - + Chat on Discord - + Report Issue - + Tutorials - + About - + About Qt - + Please enter a name for the new profile - + failed to create profile: %1 - + Show tutorial? - + You are starting Mod Organizer for the first time. Do you want to show a tutorial of its basic features? If you choose no you can always start the tutorial from the "Help" menu. - + Never ask to show tutorials - + Do you know how to mod this game? Do you need to learn? There's a game support wiki available! Click OK to open the wiki. In the future, you can access this link from the "Help" menu. - + Category Setup - + Please choose how to handle the default category setup. If you've already connected to Nexus, you can automatically import Nexus categories for this game (if applicable). Otherwise, use the old Mod Organizer default category structure, or leave the categories blank (for manual setup). - - + + &Import Nexus Categories - + Use &Old Category Defaults - + Do &Nothing - + This is your first time running version 2.5 or higher with an old MO2 instance. The category system now relies on an updated system to map Nexus categories. In order to assign Nexus categories automatically, you will need to import the Nexus categories for the currently managed game and map them to your preferred category structure. @@ -3916,321 +3916,321 @@ As a final option, you can disable Nexus category mapping altogether, which can - + &Open Categories Dialog - + &Disable Nexus Mappings - + &Close - + &Don't show this again - + Downloads in progress - + There are still downloads in progress, do you really want to quit? - + Plugin "%1" failed: %2 - + Plugin "%1" failed - + <Edit...> - + (no executables) - + This bsa is enabled in the ini file so it may be required! - + Activating Network Proxy - + Notice: Your current MO version (%1) is lower than the previously used one (%2). The GUI may not downgrade gracefully, so you may experience oddities. However, there should be no serious issues. - + failed to change origin name: %1 - + failed to move "%1" from mod "%2" to "%3": %4 - + Open Game folder - + Open MyGames folder - + Open INIs folder - + Open Instance folder - + Open Mods folder - + Open Profile folder - + Open Downloads folder - + Open MO2 Install folder - + Open MO2 Plugins folder - + Open MO2 Stylesheets folder - + Open MO2 Logs folder - + Restart Mod Organizer - + Mod Organizer must restart to finish configuration changes - + Restart - + Continue - + Some things might be weird. - + Can't change download directory while downloads are in progress! - + Update available - + Do you want to endorse Mod Organizer on %1 now? - + Abstain from Endorsing Mod Organizer - + Are you sure you want to abstain from endorsing Mod Organizer 2? You will have to visit the mod page on the %1 Nexus site to change your mind. - + Thank you for endorsing MO2! :) - + Please reconsider endorsing MO2 on Nexus! - + There is no supported sort mechanism for this game. You will probably have to use a third-party tool. - + None of your %1 mods appear to have had recent file updates. - + All of your mods have been checked recently. We restrict update checks to help preserve your available API requests. - + Thank you! - + Thank you for your endorsement! - + Mod ID %1 no longer seems to be available on Nexus. - + Error %1: Request to Nexus failed: %2 - - + + failed to read %1: %2 - + Error - + failed to extract %1 (errorcode %2) - + Extract BSA - + This archive contains invalid hashes. Some files may be broken. - + Extract... - + Remove '%1' from the toolbar - + Backup of load order created - + Choose backup to restore - + No Backups - + There are no backups to restore - - + + Restore failed - - + + Failed to restore the backup. Errorcode: %1 - + Backup of mod list created - + A file with the same name has already been downloaded. What would you like to do? - + Overwrite - + Rename new file - + Ignore file @@ -7618,23 +7618,23 @@ Destination: - + Please use "Help" from the toolbar to get usage instructions to all elements - + Visit %1 on Nexus - - + + <Manage...> - + failed to parse profile %1: %2