summaryrefslogtreecommitdiff
path: root/src/modinfodialog.cpp
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-11-26 17:48:50 +0000
committerThomas Tanner <trtanner@btinternet.com>2015-11-26 17:48:50 +0000
commitdd37152eae382ee95535b289b17b0a727e4038f5 (patch)
tree5e88903380163a31c4c1edc1989d600f3859026a /src/modinfodialog.cpp
parent82e6c98043bd18f5329e8b6d0a6f99c4d28cc0a2 (diff)
This removes getNexusPage from GameInfo and is currently in the game plugin.
I'm looking to move it to the nexus interface though as it doesn't really relate to the game plugin. I've also removed the MananagementURL as - you can log into nexus without needing to specify the game - See above - it doesn't belong with the game plugin This gets rid of all dependencies bar game saving and logging in
Diffstat (limited to 'src/modinfodialog.cpp')
-rw-r--r--src/modinfodialog.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp
index 35da228b..c4acb31e 100644
--- a/src/modinfodialog.cpp
+++ b/src/modinfodialog.cpp
@@ -20,6 +20,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "modinfodialog.h"
#include "ui_modinfodialog.h"
+#include "iplugingame.h"
#include "report.h"
#include "utility.h"
#include "messagedialog.h"
@@ -36,9 +37,11 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QMessageBox>
#include <QMenu>
#include <QFileSystemModel>
+#include <QInputDialog>
+
#include <Shlwapi.h>
+
#include <sstream>
-#include <QInputDialog>
using namespace MOBase;
@@ -688,7 +691,9 @@ void ModInfoDialog::on_visitNexusLabel_linkActivated(const QString &link)
void ModInfoDialog::linkClicked(const QUrl &url)
{
- if (url.toString().startsWith(ToQString(GameInfo::instance().getNexusPage(false)))) {
+ //FIXME: See elsewhere. This needs to be a property of the installed mod.
+ IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ if (game->isRelatedURL(url)) {
this->close();
emit nexusLinkActivated(url.toString());
} else {
@@ -832,7 +837,10 @@ void ModInfoDialog::activateNexusTab()
QLineEdit *modIDEdit = findChild<QLineEdit*>("modIDEdit");
int modID = modIDEdit->text().toInt();
if (modID != 0) {
- QString nexusLink = QString("%1/downloads/file.php?id=%2").arg(ToQString(GameInfo::instance().getNexusPage(false))).arg(modID);
+ //FIXME: We should remember the game for which this mod was installed in the
+ //modInfo and get the web page via that.
+ IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
+ QString nexusLink = QString("%1/downloads/file.php?id=%2").arg(game->getNexusDisplayURL()).arg(modID);
QLabel *visitNexusLabel = findChild<QLabel*>("visitNexusLabel");
visitNexusLabel->setText(tr("<a href=\"%1\">Visit on Nexus</a>").arg(nexusLink));
visitNexusLabel->setToolTip(nexusLink);