diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/aboutdialog.ui | 5 | ||||
| -rw-r--r-- | src/envmodule.cpp | 4 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 55 | ||||
| -rw-r--r-- | src/mainwindow.h | 1 | ||||
| -rw-r--r-- | src/modlistview.cpp | 7 | ||||
| -rw-r--r-- | src/tutorials/TutorialOverlay.qml | 5 | ||||
| -rw-r--r-- | src/tutorials/tutorial_conflictresolution_main.js | 2 | ||||
| -rw-r--r-- | src/tutorials/tutorial_firststeps_main.js | 4 | ||||
| -rw-r--r-- | src/tutorials/tutorial_primer_main.js | 4 |
9 files changed, 77 insertions, 10 deletions
diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui index 16fc57aa..8b0e34e6 100644 --- a/src/aboutdialog.ui +++ b/src/aboutdialog.ui @@ -471,6 +471,11 @@ </item>
<item>
<property name="text">
+ <string notr="true">foresto</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
<string notr="true">GamerPoet</string>
</property>
</item>
diff --git a/src/envmodule.cpp b/src/envmodule.cpp index dc6608d7..5b1e7621 100644 --- a/src/envmodule.cpp +++ b/src/envmodule.cpp @@ -130,7 +130,7 @@ Module::FileInfo Module::getFileInfo() const return {}; } - log::error( + log::debug( "GetFileVersionInfoSizeW() failed on '{}', {}", m_path, formatSystemMessage(e)); @@ -268,7 +268,7 @@ QDateTime Module::getTimestamp(const VS_FIXEDFILEINFO& fi) const if (h.get() == INVALID_HANDLE_VALUE) { const auto e = GetLastError(); - log::error( + log::debug( "can't open file '{}' for timestamp, {}", m_path, formatSystemMessage(e)); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bc9a3ce6..78efa182 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1440,12 +1440,36 @@ void MainWindow::registerModPage(IPluginModPage *modPage) ui->actionModPage->menu()->addAction(action); } +bool MainWindow::registerNexusPage(const QString& gameName) +{ + // Get the plugin + IPluginGame* plugin = m_OrganizerCore.getGame(gameName); + if (plugin == nullptr) + return false; + + // Create an action + QAction* action = new QAction( + plugin->gameIcon(), + QObject::tr("Visit %1 on Nexus").arg(plugin->gameName()), + this); + + // Bind the action + connect(action, &QAction::triggered, this, [this, gameName]() { + shell::Open(QUrl(NexusInterface::instance().getGameURL(gameName))); + }, Qt::QueuedConnection); + + // Add the action + ui->actionModPage->menu()->addAction(action); + + return true; +} + void MainWindow::updateModPageMenu() { // Clear the menu: ui->actionModPage->menu()->clear(); - ui->actionModPage->menu()->addAction(ui->actionNexus); + // Determine the loaded mod page plugins std::vector<IPluginModPage*> modPagePlugins = m_PluginContainer.plugins<IPluginModPage>(); // Sort the plugins by display name @@ -1466,14 +1490,30 @@ void MainWindow::updateModPageMenu() registerModPage(modPagePlugin); } + // Add the primary game (with a separator) + registerNexusPage(m_OrganizerCore.managedGame()->gameShortName()); + ui->actionModPage->menu()->addSeparator(); + + // Add the secondary games (sorted) + bool secondaryGameAdded = false; + QStringList secondaryGames = m_OrganizerCore.managedGame()->validShortNames(); + secondaryGames.sort(Qt::CaseInsensitive); + for (auto gameName : secondaryGames) + { + if (registerNexusPage(gameName)) { + secondaryGameAdded = true; + } + } + // No mod page plugin and the menu was visible: - if (modPagePlugins.empty()) { + bool keepOriginalAction = modPagePlugins.size() == 0 && !secondaryGameAdded; + if (keepOriginalAction) { ui->toolBar->insertAction(ui->actionAdd_Profile, ui->actionNexus); } else { ui->toolBar->removeAction(ui->actionNexus); } - ui->actionModPage->setVisible(!modPagePlugins.empty()); + ui->actionModPage->setVisible(!keepOriginalAction); } void MainWindow::startExeAction() @@ -2148,6 +2188,15 @@ void MainWindow::on_actionAdd_Profile_triggered() profilesDialog.exec(); m_SavesTab->refreshSaveList(); // since the save list may now be outdated we have to refresh it completely + if (profilesDialog.selectedProfile()) + { + // Change profile while blocking signals to prevent extra signals being sent + // Doesn't matter much as refreshProfiles() is being called after this + ui->profileBox->blockSignals(true); + ui->profileBox->setCurrentText(profilesDialog.selectedProfile().value()); + ui->profileBox->blockSignals(false); + } + if (refreshProfiles() && !profilesDialog.failed()) { break; } diff --git a/src/mainwindow.h b/src/mainwindow.h index 7afd954a..6626bf51 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -187,6 +187,7 @@ private: void setToolbarButtonStyle(Qt::ToolButtonStyle s); void registerModPage(MOBase::IPluginModPage* modPage); + bool registerNexusPage(const QString& gameName); void registerPluginTool(MOBase::IPluginTool* tool, QString name = QString(), QMenu* menu = nullptr); void updateToolbarMenu(); diff --git a/src/modlistview.cpp b/src/modlistview.cpp index 47fc880d..2dcd9f92 100644 --- a/src/modlistview.cpp +++ b/src/modlistview.cpp @@ -347,6 +347,9 @@ QModelIndexList ModListView::indexViewToModel(const QModelIndexList& index) cons QModelIndex ModListView::nextIndex(const QModelIndex& index) const
{
auto* model = index.model();
+ if (!model) {
+ return {};
+ }
if (model->rowCount(index) > 0) {
return model->index(0, index.column(), index);
@@ -372,6 +375,10 @@ QModelIndex ModListView::prevIndex(const QModelIndex& index) const }
auto* model = index.model();
+ if (!model) {
+ return {};
+ }
+
auto prev = model->index((index.row() - 1) % model->rowCount(index.parent()), index.column(), index.parent());
if (model->rowCount(prev) > 0) {
diff --git a/src/tutorials/TutorialOverlay.qml b/src/tutorials/TutorialOverlay.qml index 47e5065d..8c2a36e7 100644 --- a/src/tutorials/TutorialOverlay.qml +++ b/src/tutorials/TutorialOverlay.qml @@ -55,7 +55,10 @@ Rectangle { Connections {
target: manager
- onTabChanged: tabChanged(index)
+ function onTabChanged(index)
+ {
+ tabChanged(index)
+ }
}
Tooltip {
diff --git a/src/tutorials/tutorial_conflictresolution_main.js b/src/tutorials/tutorial_conflictresolution_main.js index a2aa278d..46518a93 100644 --- a/src/tutorials/tutorial_conflictresolution_main.js +++ b/src/tutorials/tutorial_conflictresolution_main.js @@ -76,7 +76,7 @@ function getTutorialSteps() { tutorial.text = qsTr("... here, if you mark the highlighted control, the tree will only display files in conflict. "
+"In the right column, it says which mod currently provides the mod (because it has highest priority) "
+"and if you hover your mouse over that info, it will list which other mods contains it.")
- highlightItem("conflictsCheckBox", false)
+ highlightItem("dataTabShowOnlyConflicts", false)
waitForClick()
},
function() {
diff --git a/src/tutorials/tutorial_firststeps_main.js b/src/tutorials/tutorial_firststeps_main.js index 96bfd0e7..76faf973 100644 --- a/src/tutorials/tutorial_firststeps_main.js +++ b/src/tutorials/tutorial_firststeps_main.js @@ -72,8 +72,10 @@ function getTutorialSteps() tutorial.text = qsTr("There are a few ways to get mods into ModOrganizer. "
+ "If you associated MO with NXM links in the settings you can now use your regular browser to send downloads from Nexus to MO. "
+ "Click on \"Nexus\" to open nexus, find a mod and click the green download buttons on Nexus saying \"Download with Manager\".")
- if (tutorialControl.waitForAction("actionNexus")) {
+ if (tutorialControl.waitForAction("actionNexus") &&
+ tutorialControl.waitForAction("actionModPage")) {
highlightAction("actionNexus", true)
+ highlightAction("actionModPage", true)
} else {
console.error("browser action broken")
waitForClick()
diff --git a/src/tutorials/tutorial_primer_main.js b/src/tutorials/tutorial_primer_main.js index 95faa33d..640364cb 100644 --- a/src/tutorials/tutorial_primer_main.js +++ b/src/tutorials/tutorial_primer_main.js @@ -90,7 +90,9 @@ function setupTooptips() { tooltipAction("actionChange_Game", qsTr("Change/manage MO2 instances or switch to portable mode."))
tooltipAction("actionInstallMod", qsTr("Browse to and manually install a mod from an archive on your computer."))
tooltipAction("actionNexus", qsTr("Automatically open NexusMods to browse and install mods via the API."))
+ tooltipAction("actionModPage", qsTr("Automatically open NexusMods to browse and install mods via the API."))
tooltipAction("actionAdd_Profile", qsTr("Manage your MO2 profiles."))
+ tooltipAction("action_Refresh", qsTr("Refresh everything."))
tooltipAction("actionModify_Executables", qsTr("Open the executable editor to add and modify applications you wish to run with MO2."))
tooltipAction("actionTool", qsTr("Select from a collection of additional tools, such as an INI editor, integrated FNIS updater, and more."))
tooltipAction("actionSettings", qsTr("Configure Mod Organizer."))
@@ -136,5 +138,3 @@ function getTutorialSteps() { }
]
}
-
-
|
