diff options
| author | Jeremy Rimpo <jrim@rimpo.org> | 2019-07-03 10:24:14 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-03 10:24:14 -0500 |
| commit | efec72a85a351f53880bffdba2438f6802d4f9ab (patch) | |
| tree | 94cf5dd724a16f29b458776ef5a83477ccfe2a52 /src/organizercore.cpp | |
| parent | 1822c1dc655e60c7693b528004ed715305df45f5 (diff) | |
| parent | 7fe637ce4421e0c6d6ee6b103db5fcc4ef676c25 (diff) | |
Merge pull request #782 from isanae/modinfodialog-rework
Mod info dialog rework
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 2cad9ce8..99ddda1d 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -966,8 +966,8 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName, "want to configure them now?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)) { - m_UserInterface->displayModInformation(modInfo, modIndex, - ModInfoDialog::TAB_INIFILES); + m_UserInterface->displayModInformation( + modInfo, modIndex, ModInfoTabIDs::IniFiles); } m_ModInstalled(modName); m_DownloadManager.markInstalled(fileName); @@ -1033,8 +1033,8 @@ void OrganizerCore::installDownload(int index) "want to configure them now?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes)) { - m_UserInterface->displayModInformation(modInfo, modIndex, - ModInfoDialog::TAB_INIFILES); + m_UserInterface->displayModInformation( + modInfo, modIndex, ModInfoTabIDs::IniFiles); } m_ModInstalled(modName); @@ -2204,6 +2204,21 @@ void OrganizerCore::updateModsInDirectoryStructure(QMap<unsigned int, ModInfo::P } } +void OrganizerCore::loggedInAction(QWidget* parent, std::function<void ()> f) +{ + if (NexusInterface::instance(m_PluginContainer)->getAccessManager()->validated()) { + f(); + } else { + QString apiKey; + if (settings().getNexusApiKey(apiKey)) { + doAfterLogin([f]{ f(); }); + NexusInterface::instance(m_PluginContainer)->getAccessManager()->apiCheck(apiKey); + } else { + MessageDialog::showMessage(tr("You need to be logged in with Nexus"), parent); + } + } +} + void OrganizerCore::requestDownload(const QUrl &url, QNetworkReply *reply) { if (m_PluginContainer != nullptr) { |
