aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp11
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp15
-rw-r--r--launcher/ui/dialogs/BlockedModsDialog.cpp27
-rw-r--r--launcher/ui/dialogs/BlockedModsDialog.ui58
4 files changed, 86 insertions, 25 deletions
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index 4b9e7b86..91554b58 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -393,13 +393,10 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop)
qWarning() << "Blocked mods found, displaying mod list";
auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked mods found"),
- tr("The following files are not available for download in third party launchers.<br/>"
- "You will need to manually download them and add them to the instance.<br/><br/>"
- "Your configured global mods folder and default downloads folder<br/>"
- "are automatically checked for the downloaded mods and they will be copied to the instance if found.<br/>"
- "Optionally, you may drag and drop the downloaded mods onto this dialog or add a folder to watch<br/>"
- "if you did not download the mods to a default location."),
- blocked_mods);
+ tr("The following files are not available for download in third party launchers.<br/>"
+ "You will need to manually download them and add them to the instance."),
+ blocked_mods);
+
message_dialog->setModal(true);
if (message_dialog->exec()) {
diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
index 26d0c5a1..4c7b7a4f 100644
--- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
+++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
@@ -211,22 +211,17 @@ void PackInstallTask::onResolveModsSucceeded()
qDebug() << "Blocked files found, displaying file list";
auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked files found"),
- tr("The following files are not available for download in third party launchers.<br/>"
- "You will need to manually download them and add them to the instance.<br/><br/>"
- "Your configured global mods folder and default downloads folder<br/>"
- "are automatically checked for the downloaded mods and they will be copied to the instance if found.<br/>"
- "Optionally, you may drag and drop the downloaded mods onto this dialog or add a folder to watch<br/>"
- "if you did not download the mods to a default location."),
- m_blocked_mods);
+ tr("The following files are not available for download in third party launchers.<br/>"
+ "You will need to manually download them and add them to the instance."),
+ m_blocked_mods);
if (message_dialog->exec() == QDialog::Accepted) {
qDebug() << "Post dialog blocked mods list: " << m_blocked_mods;
createInstance();
- }
- else {
+ } else {
abort();
}
-
+
} else {
createInstance();
}
diff --git a/launcher/ui/dialogs/BlockedModsDialog.cpp b/launcher/ui/dialogs/BlockedModsDialog.cpp
index ff331617..7f6b377b 100644
--- a/launcher/ui/dialogs/BlockedModsDialog.cpp
+++ b/launcher/ui/dialogs/BlockedModsDialog.cpp
@@ -1,5 +1,4 @@
#include "BlockedModsDialog.h"
-#include <qfileinfo.h>
#include <QDesktopServices>
#include <QDialogButtonBox>
#include <QPushButton>
@@ -34,7 +33,16 @@ BlockedModsDialog::BlockedModsDialog(QWidget* parent, const QString& title, cons
scanPaths();
this->setWindowTitle(title);
- ui->label->setText(text);
+ ui->labelDescription->setText(text);
+ ui->labelExplain->setText(
+ QString(tr("Your configured global mods folder and default downloads folder "
+ "are automatically checked for the downloaded mods and they will be copied to the instance if found.<br/>"
+ "Optionally, you may drag and drop the downloaded mods onto this dialog or add a folder to watch "
+ "if you did not download the mods to a default location.<br/><br/>"
+ "Global Mods Folder: %1<br/>"
+ "Default Downloads Folder: %2"))
+ .arg(APPLICATION->settings()->get("CentralModsDir").toString(),
+ QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)));
ui->labelModsFound->setText(tr("Please download the missing mods."));
setAcceptDrops(true);
@@ -56,7 +64,7 @@ void BlockedModsDialog::dragEnterEvent(QDragEnterEvent* e)
void BlockedModsDialog::dropEvent(QDropEvent* e)
{
- foreach (const QUrl& url, e->mimeData()->urls()) {
+ for (const QUrl& url : e->mimeData()->urls()) {
QString filePath = url.toLocalFile();
qDebug() << "[Blocked Mods Dialog] Dropped file:" << filePath;
addHashTask(filePath);
@@ -106,7 +114,14 @@ void BlockedModsDialog::update()
text += QString(tr("%1: <a href='%2'>%2</a> <p>Hash: %3 %4</p> <br/>")).arg(mod.name, mod.websiteUrl, mod.hash, span);
}
- ui->textBrowser->setText(text);
+ ui->textBrowserModsListing->setText(text);
+
+ QString watching;
+ for (auto& dir : m_watcher.directories()) {
+ watching += QString("%1<br/>").arg(dir);
+ }
+
+ ui->textBrowserWatched->setText(watching);
if (allModsMatched()) {
ui->labelModsFound->setText(tr("All mods found ✔"));
@@ -181,8 +196,8 @@ void BlockedModsDialog::buildHashTask(QString path)
qDebug() << "[Blocked Mods Dialog] Creating Hash task for path: " << path;
- connect(hash_task.get(), &Task::succeeded, [this, hash_task, path] { checkMatchHash(hash_task->getResult(), path); });
- connect(hash_task.get(), &Task::failed, [path] { qDebug() << "Failed to hash path: " << path; });
+ connect(hash_task.get(), &Task::succeeded, this, [this, hash_task, path] { checkMatchHash(hash_task->getResult(), path); });
+ connect(hash_task.get(), &Task::failed, this, [path] { qDebug() << "Failed to hash path: " << path; });
m_hashing_task->addTask(hash_task);
}
diff --git a/launcher/ui/dialogs/BlockedModsDialog.ui b/launcher/ui/dialogs/BlockedModsDialog.ui
index 371549cf..fb1036b7 100644
--- a/launcher/ui/dialogs/BlockedModsDialog.ui
+++ b/launcher/ui/dialogs/BlockedModsDialog.ui
@@ -15,17 +15,36 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
- <widget class="QLabel" name="label">
+ <widget class="QLabel" name="labelDescription">
<property name="text">
<string notr="true"/>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item>
- <widget class="QTextBrowser" name="textBrowser">
+ <widget class="QLabel" name="labelExplain">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="textBrowserModsListing">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>165</height>
+ </size>
+ </property>
<property name="acceptRichText">
<bool>true</bool>
</property>
@@ -35,6 +54,41 @@
</widget>
</item>
<item>
+ <widget class="QLabel" name="labelWatched">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Watched Folders:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextBrowser" name="textBrowserWatched">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>16</height>
+ </size>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>0</width>
+ <height>12</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
<layout class="QHBoxLayout" name="bottomBoxH">
<item>
<widget class="QLabel" name="labelModsFound">