From 7688175c68c2f1ce85951173c0aa3e186587aa1f Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 17 Apr 2018 02:47:07 -0500 Subject: Add source game setter in mod info dialog --- src/modinfodialog.ui | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 05415445..9e9ba77b 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -110,19 +110,19 @@ - + false - + - Ini Tweaks *This feature is non-functional* + Ini Tweaks *This feature is non-functional* - + false - + 228 @@ -238,8 +238,8 @@ 0 0 - 98 - 28 + 676 + 126 @@ -490,7 +490,7 @@ Most mods do not have optional esps, so chances are good you are looking at an e - Qt::CustomContextMenu + Qt::CustomContextMenu Qt::ElideLeft @@ -502,7 +502,7 @@ Most mods do not have optional esps, so chances are good you are looking at an e true - 2 + 2 365 @@ -613,6 +613,36 @@ p, li { white-space: pre-wrap; } + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Source Game + + + + + + + Mod ID for this mod on Nexus. + + + @@ -819,9 +849,9 @@ p, li { white-space: pre-wrap; } - QQuickWidget + QWebEngineView QWidget -
QtQuickWidgets/QQuickWidget
+
QtWebEngineWidgets/QWebEngineView
-- cgit v1.3.1 From 634825e1b8954753315e270ee4744575f14e6ac3 Mon Sep 17 00:00:00 2001 From: Silarn Date: Tue, 17 Apr 2018 03:04:59 -0500 Subject: Adjust mod info dialog, add tooltips, update old --- src/modinfodialog.ui | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 9e9ba77b..20eb7c30 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -6,8 +6,8 @@ 0 0 - 720 - 648 + 790 + 534
@@ -238,7 +238,7 @@ 0 0 - 676 + 746 126 @@ -608,8 +608,8 @@ Most mods do not have optional esps, so chances are good you are looking at an e <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Mod ID for this mod on Nexus. This is filled in automatically if you downloaded and installed the mod from inside MO. Otherwise you can enter it manually. To find the correct id, find the mod on nexus. The URL will look like this: </span><a href=" http://www.skyrimnexus.com/downloads/file.php?id=1334"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">http://skyrim.nexusmods.com/downloads/file.php?id=1334</span></a><a href="http://www.skyrimnexus.com/downloads/file.php?id=1334"><span style=" font-size:8pt; color:#000000;">. In this example, 1334 is the id you're looking for. Besides: The above is the link to Mod Organizer on the Nexus. Why not go there now and endorse?</span></a></p></body></html> +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mod ID for this mod on Nexus. This is filled in automatically if you downloaded and installed the mod from inside MO. Otherwise you can enter it manually. To find the correct id, find the mod on nexus. The URL will look like this: <a href=" https://www.nexusmods.com/skyrimspecialedition/mods/6194"><span style=" text-decoration: underline; color:#0000ff;">https://www.nexusmods.com/skyrimspecialedition/mods/6194</span></a>. In this example, 6194 is the id you're looking for. Besides: The above is the link to Mod Organizer2 on Nexus. Why not go there now and endorse us?</p></body></html>
@@ -637,11 +637,14 @@ p, li { white-space: pre-wrap; } - - - Mod ID for this mod on Nexus. - - + + + Source game for this mod. + + + <html><head/><body><p>Source game for this mod. This determines where the mod was downloaded from and decides where to fetch info, version updates, and send endorsements. Changing this will likely require you to enter a new Mod ID.</p></body></html> + + -- cgit v1.3.1 From a2d7ce67aa236fe52d6e860a27950dc7e3a34bd8 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Mon, 16 Apr 2018 20:40:14 +0200 Subject: Merged the new open in explorer button with Silarn's code. --- src/modinfodialog.cpp | 8 ++++++-- src/modinfodialog.h | 1 + src/modinfodialog.ui | 36 +++++++++++++++++++++++++++++++++--- 3 files changed, 40 insertions(+), 5 deletions(-) (limited to 'src/modinfodialog.ui') diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index e2da6a2c..705f0019 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -721,7 +721,6 @@ void ModInfoDialog::on_deactivateESP_clicked() void ModInfoDialog::on_visitNexusLabel_linkActivated(const QString &link) { - this->close(); emit nexusLinkActivated(link); } @@ -730,7 +729,7 @@ void ModInfoDialog::linkClicked(const QUrl &url) //Ideally we'd ask the mod for the game and the web service then pass the game //and URL to the web service if (NexusInterface::instance(m_PluginContainer)->isURLGameRelated(url)) { - this->close(); + emit nexusLinkActivated(url.toString()); } else { ::ShellExecuteW(nullptr, L"open", ToWString(url.toString()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); @@ -958,6 +957,11 @@ bool ModInfoDialog::recursiveDelete(const QModelIndex &index) } +void ModInfoDialog::on_openInExplorerButton_clicked() +{ + ::ShellExecuteW(nullptr, L"explore", ToWString(m_ModInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); +} + void ModInfoDialog::deleteFile(const QModelIndex &index) { diff --git a/src/modinfodialog.h b/src/modinfodialog.h index 52db5654..b5cc12a8 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -172,6 +172,7 @@ private slots: void hideTriggered(); void unhideTriggered(); + void on_openInExplorerButton_clicked(); void on_closeButton_clicked(); void on_saveButton_clicked(); void on_activateESP_clicked(); diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 20eb7c30..4352ba4e 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -20,7 +20,7 @@ QTabWidget::Rounded - 0 + 8 true @@ -723,8 +723,8 @@ p, li { white-space: pre-wrap; } - - + + about:blank @@ -779,6 +779,36 @@ p, li { white-space: pre-wrap; } Filetree + + + + + + + 0 + 0 + + + + Open Mod in Explorer + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + -- cgit v1.3.1 From 08b56ee783131537d3f87e60819e88316ea1e062 Mon Sep 17 00:00:00 2001 From: Silarn Date: Wed, 18 Apr 2018 03:41:53 -0500 Subject: Improve and fix handling of external links --- src/CMakeLists.txt | 2 ++ src/aboutdialog.cpp | 5 +++++ src/aboutdialog.h | 5 +++++ src/aboutdialog.ui | 2 +- src/mainwindow.cpp | 31 ++++++++++++++----------------- src/mainwindow.h | 1 - src/modidlineedit.cpp | 19 +++++++++++++++++++ src/modidlineedit.h | 22 ++++++++++++++++++++++ src/modinfodialog.cpp | 12 ++++++++++-- src/modinfodialog.h | 3 ++- src/modinfodialog.ui | 15 ++++++++++----- src/modinforegular.cpp | 2 +- 12 files changed, 91 insertions(+), 28 deletions(-) create mode 100644 src/modidlineedit.cpp create mode 100644 src/modidlineedit.h (limited to 'src/modinfodialog.ui') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fef640b3..066d08d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,6 +30,7 @@ SET(organizer_SRCS motddialog.cpp modlistsortproxy.cpp modlist.cpp + modidlineedit.cpp modinfodialog.cpp modinfo.cpp modinfobackup.cpp @@ -120,6 +121,7 @@ SET(organizer_HDRS motddialog.h modlistsortproxy.h modlist.h + modidlineedit.h modinfodialog.h modinfo.h modinfobackup.h diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index a350036f..9d68fe2b 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -114,3 +114,8 @@ void AboutDialog::on_creditsList_currentItemChanged(QListWidgetItem *current, QL ui->licenseText->setText(tr("No license")); } } + +void AboutDialog::on_copyrightText_linkActivated(const QString &link) +{ + emit linkClicked(link); +} \ No newline at end of file diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 3ae3237b..285d0066 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -40,6 +40,10 @@ public: explicit AboutDialog(const QString &version, QWidget *parent = 0); ~AboutDialog(); +signals: + + void linkClicked(QString link); + private: enum Licenses { @@ -70,6 +74,7 @@ private: private slots: void on_creditsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous); + void on_copyrightText_linkActivated(const QString &link); private: diff --git a/src/aboutdialog.ui b/src/aboutdialog.ui index 69e52708..fc2f3290 100644 --- a/src/aboutdialog.ui +++ b/src/aboutdialog.ui @@ -125,7 +125,7 @@ - + <html><head/><body><p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p><p>See the GNU General Public License for more details.</p><p>Source code can be found at <a href="https://github.com/Modorganizer2/modorganizer"><span style=" text-decoration: underline; color:#007af4;">GitHub</span></a>.</p></body></html> diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 00c7895e..6b176868 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -98,6 +98,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -319,6 +320,11 @@ MainWindow::MainWindow(QSettings &initSettings ui->groupCombo->installEventFilter(noWheel); ui->profileBox->installEventFilter(noWheel); + if (organizerCore.managedGame()->sortMechanism() == MOBase::IPluginGame::SortMechanism::NONE) { + ui->bossButton->setDisabled(true); + ui->bossButton->setToolTip(tr("There is no supported sort mechanism for this game. You will probably have to use a third-party tool.")); + } + connect(ui->savegameList, SIGNAL(itemEntered(QListWidgetItem*)), this, SLOT(saveSelectionChanged(QListWidgetItem*))); connect(ui->modList, SIGNAL(dropModeUpdate(bool)), m_OrganizerCore.modList(), SLOT(dropModeUpdate(bool))); @@ -667,6 +673,7 @@ size_t MainWindow::checkForProblems() void MainWindow::about() { AboutDialog dialog(m_OrganizerCore.getVersion().displayString(), this); + connect(&dialog, SIGNAL(linkClicked(QString)), this, SLOT(linkClicked(QString))); dialog.exec(); } @@ -1008,8 +1015,7 @@ void MainWindow::modPagePluginInvoke() m_IntegratedBrowser.setWindowTitle(plugin->displayName()); m_IntegratedBrowser.openUrl(plugin->pageURL()); } else { - ::ShellExecuteW(nullptr, L"open", ToWString(plugin->pageURL().toString()).c_str(), - nullptr, nullptr, SW_SHOWNORMAL); + QDesktopServices::openUrl(QUrl(plugin->pageURL())); } } } @@ -1894,12 +1900,12 @@ void MainWindow::helpTriggered() void MainWindow::wikiTriggered() { - ::ShellExecuteW(nullptr, L"open", L"http://wiki.step-project.com/Guide:Mod_Organizer", nullptr, nullptr, SW_SHOWNORMAL); + QDesktopServices::openUrl(QUrl("http://wiki.step-project.com/Guide:Mod_Organizer")); } void MainWindow::issueTriggered() { - ::ShellExecuteW(nullptr, L"open", L"http://github.com/Modorganizer2/modorganizer/issues", nullptr, nullptr, SW_SHOWNORMAL); + QDesktopServices::openUrl(QUrl("http://github.com/Modorganizer2/modorganizer/issues")); } void MainWindow::tutorialTriggered() @@ -2461,7 +2467,7 @@ void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, } else { modInfo->saveMeta(); ModInfoDialog dialog(modInfo, m_OrganizerCore.directoryStructure(), modInfo->hasFlag(ModInfo::FLAG_FOREIGN), &m_OrganizerCore, &m_PluginContainer,this); - connect(&dialog, SIGNAL(nexusLinkActivated(QString)), this, SLOT(nexusLinkActivated(QString))); + connect(&dialog, SIGNAL(linkActivated(QString)), this, SLOT(linkClicked(QString))); connect(&dialog, SIGNAL(downloadRequest(QString)), &m_OrganizerCore, SLOT(downloadRequestedNXM(QString))); connect(&dialog, SIGNAL(modOpen(QString, int)), this, SLOT(displayModInformation(QString, int)), Qt::QueuedConnection); connect(&dialog, SIGNAL(modOpenNext(int)), this, SLOT(modOpenNext(int)), Qt::QueuedConnection); @@ -2599,7 +2605,7 @@ void MainWindow::visitOnNexus_clicked() int modID = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole).toInt(); QString gameName = m_OrganizerCore.modList()->data(m_OrganizerCore.modList()->index(m_ContextRow, 0), Qt::UserRole + 4).toString(); if (modID > 0) { - nexusLinkActivated(NexusInterface::instance(&m_PluginContainer)->getModURL(modID, gameName)); + linkClicked(NexusInterface::instance(&m_PluginContainer)->getModURL(modID, gameName)); } else { MessageDialog::showMessage(tr("Nexus ID for this Mod is unknown"), this); } @@ -3746,22 +3752,13 @@ void MainWindow::on_actionSettings_triggered() void MainWindow::on_actionNexus_triggered() { - ::ShellExecuteW(nullptr, L"open", - NexusInterface::instance(&m_PluginContainer)->getGameURL(m_OrganizerCore.managedGame()->gameShortName()).toStdWString().c_str(), - nullptr, nullptr, SW_SHOWNORMAL); -} - - -void MainWindow::nexusLinkActivated(const QString &link) -{ - ::ShellExecuteW(nullptr, L"open", ToWString(link).c_str(), nullptr, nullptr, SW_SHOWNORMAL); - ui->tabWidget->setCurrentIndex(4); + QDesktopServices::openUrl(QUrl(NexusInterface::instance(&m_PluginContainer)->getGameURL(m_OrganizerCore.managedGame()->gameShortName()))); } void MainWindow::linkClicked(const QString &url) { - ::ShellExecuteW(nullptr, L"open", ToWString(url).c_str(), nullptr, nullptr, SW_SHOWNORMAL); + QDesktopServices::openUrl(QUrl(url)); } diff --git a/src/mainwindow.h b/src/mainwindow.h index b06da353..7f38d766 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -443,7 +443,6 @@ private slots: // nexus related void checkModsForUpdates(); - void nexusLinkActivated(const QString &link); void loginFailed(const QString &message); diff --git a/src/modidlineedit.cpp b/src/modidlineedit.cpp new file mode 100644 index 00000000..7d1f0c38 --- /dev/null +++ b/src/modidlineedit.cpp @@ -0,0 +1,19 @@ +#include "modidlineedit.h" +#include + +#include +#include + +ModIDLineEdit::ModIDLineEdit(QWidget *parent) : QLineEdit(parent) {} +ModIDLineEdit::ModIDLineEdit(const QString &text, QWidget *parent) : QLineEdit(text, parent) {} + +bool ModIDLineEdit::event(QEvent *event) +{ + if (event->type() == QEvent::WhatsThisClicked) + { + QWhatsThisClickedEvent *wtcEvent = static_cast(event); + emit linkClicked(wtcEvent->href().trimmed()); + } + + return QLineEdit::event(event); +} \ No newline at end of file diff --git a/src/modidlineedit.h b/src/modidlineedit.h new file mode 100644 index 00000000..2a3db36c --- /dev/null +++ b/src/modidlineedit.h @@ -0,0 +1,22 @@ +#ifndef MODIDLINEEDIT_H +#define MODIDLINEEDIT_H + +#include + +class ModIDLineEdit : public QLineEdit +{ + Q_OBJECT + +public: + explicit ModIDLineEdit(QWidget *parent = 0); + explicit ModIDLineEdit(const QString &text, QWidget *parent = 0); + +public: + virtual bool event(QEvent* event) override; + +signals: + void linkClicked(QString); + +}; + +#endif //MODIDLINEEDIT_H \ No newline at end of file diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 710b9696..a137873e 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -22,6 +22,7 @@ along with Mod Organizer. If not, see . #include "descriptionpage.h" #include "mainwindow.h" +#include "modidlineedit.h" #include "iplugingame.h" #include "nexusinterface.h" #include "report.h" @@ -93,6 +94,8 @@ ModInfoDialog::ModInfoDialog(ModInfo::Ptr modInfo, const DirectoryEntry *directo ui->modIDEdit->setValidator(new QIntValidator(modIDEdit)); ui->modIDEdit->setText(QString("%1").arg(modInfo->getNexusID())); + connect(ui->modIDEdit, SIGNAL(linkClicked(QString)), this, SLOT(linkClicked(QString))); + ui->sourceGameEdit->addItem(organizerCore->managedGame()->gameName(), organizerCore->managedGame()->gameShortName()); if (organizerCore->managedGame()->validShortNames().size() == 0) { ui->sourceGameEdit->setDisabled(true); @@ -724,7 +727,7 @@ void ModInfoDialog::on_deactivateESP_clicked() void ModInfoDialog::on_visitNexusLabel_linkActivated(const QString &link) { - emit nexusLinkActivated(link); + emit linkActivated(link); } void ModInfoDialog::linkClicked(const QUrl &url) @@ -733,12 +736,17 @@ void ModInfoDialog::linkClicked(const QUrl &url) //and URL to the web service if (NexusInterface::instance(m_PluginContainer)->isURLGameRelated(url)) { - emit nexusLinkActivated(url.toString()); + emit linkActivated(url.toString()); } else { ::ShellExecuteW(nullptr, L"open", ToWString(url.toString()).c_str(), nullptr, nullptr, SW_SHOWNORMAL); } } +void ModInfoDialog::linkClicked(QString url) +{ + emit linkActivated(url); +} + void ModInfoDialog::refreshNexusData(int modID) { diff --git a/src/modinfodialog.h b/src/modinfodialog.h index 4709a1d2..f3bc48b4 100644 --- a/src/modinfodialog.h +++ b/src/modinfodialog.h @@ -109,7 +109,7 @@ public: signals: void thumbnailClickedSignal(const QString &filename); - void nexusLinkActivated(const QString &link); + void linkActivated(const QString &link); void downloadRequest(const QString &link); void modOpen(const QString &modName, int tab); void modOpenNext(int tab=-1); @@ -164,6 +164,7 @@ private slots: void thumbnailClicked(const QString &fileName); void linkClicked(const QUrl &url); + void linkClicked(QString url); void delete_activated(); diff --git a/src/modinfodialog.ui b/src/modinfodialog.ui index 4352ba4e..de9fe5ed 100644 --- a/src/modinfodialog.ui +++ b/src/modinfodialog.ui @@ -238,8 +238,8 @@ 0 0 - 746 - 126 + 98 + 28 @@ -600,7 +600,7 @@ Most mods do not have optional esps, so chances are good you are looking at an e - + Mod ID for this mod on Nexus. @@ -723,8 +723,8 @@ p, li { white-space: pre-wrap; } - - + + about:blank @@ -886,6 +886,11 @@ p, li { white-space: pre-wrap; } QWidget
QtWebEngineWidgets/QWebEngineView
+ + ModIDLineEdit + QLineEdit +
modidlineedit.h
+
diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index a514e1bf..045366ba 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -459,7 +459,7 @@ std::vector ModInfoRegular::getContents() const if (dir.exists(sePluginPath)) m_CachedContent.push_back(CONTENT_SKSE); } - if (dir.exists("textures")) + if (dir.exists("textures") || dir.exists("icons") || dir.exists("bookart")) m_CachedContent.push_back(CONTENT_TEXTURE); if (dir.exists("meshes")) m_CachedContent.push_back(CONTENT_MESH); -- cgit v1.3.1