diff options
| author | Thomas Tanner <trtanner@btinternet.com> | 2015-10-15 13:34:01 +0100 |
|---|---|---|
| committer | Thomas Tanner <trtanner@btinternet.com> | 2015-10-15 13:34:01 +0100 |
| commit | 9d88ca13b9b6a193dfb17a1ee3ea5e5cbed8a7e9 (patch) | |
| tree | 8ec975d9efa7b4376573a1f3a05e0063e711e364 /src/mainwindow.cpp | |
| parent | ec07d3d4d9ec2245f0b23edf6746f4ae1e5dfce4 (diff) | |
Added functionality to use the web page link in a fomod to supply an optional web page.
Also refactored modinfo into multiple files (as the actual types are opaque anyway) and cleaned up the headers a bit
I also changed 'visit on nexus' from the menu not to open the downloads tab because it was a little confusing
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 26ff4b98..1dca599d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2525,12 +2525,22 @@ void MainWindow::visitOnNexus_clicked() {
int modID = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole).toInt();
if (modID > 0) {
- nexusLinkActivated(QString("%1/mods/%2").arg(ToQString(GameInfo::instance().getNexusPage(false))).arg(modID));
+ linkClicked(QString("%1/mods/%2").arg(ToQString(GameInfo::instance().getNexusPage(false))).arg(modID));
} else {
MessageDialog::showMessage(tr("Nexus ID for this Mod is unknown"), this);
}
}
+void MainWindow::visitWebPage_clicked()
+{
+ ModInfo::Ptr info = ModInfo::getByIndex(m_ContextRow);
+ if (info->getURL() != "") {
+ linkClicked(info->getURL());
+ } else {
+ MessageDialog::showMessage(tr("Web page for this mod is unknown"), this);
+ }
+}
+
void MainWindow::openExplorer_clicked()
{
ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
@@ -3106,7 +3116,14 @@ void MainWindow::on_modList_customContextMenuRequested(const QPoint &pos) menu->addAction(tr("Ignore missing data"), this, SLOT(ignoreMissingData_clicked()));
}
- menu->addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
+ if (info->getNexusID() > 0) {
+ menu->addAction(tr("Visit on Nexus"), this, SLOT(visitOnNexus_clicked()));
+ }
+
+ if (info->getURL() != "") {
+ menu->addAction(tr("Visit web page"), this, SLOT(visitWebPage_clicked()));
+ }
+
menu->addAction(tr("Open in explorer"), this, SLOT(openExplorer_clicked()));
}
|
