feat: add list of watched folders
move explanation text into dialog class and it's own label Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
51c27e2748
commit
9af1b00df5
@ -393,13 +393,10 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop)
|
|||||||
qWarning() << "Blocked mods found, displaying mod list";
|
qWarning() << "Blocked mods found, displaying mod list";
|
||||||
|
|
||||||
auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked mods found"),
|
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/>"
|
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/>"
|
"You will need to manually download them and add them to the instance."),
|
||||||
"Your configured global mods folder and default downloads folder<br/>"
|
blocked_mods);
|
||||||
"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);
|
|
||||||
message_dialog->setModal(true);
|
message_dialog->setModal(true);
|
||||||
|
|
||||||
if (message_dialog->exec()) {
|
if (message_dialog->exec()) {
|
||||||
|
@ -211,22 +211,17 @@ void PackInstallTask::onResolveModsSucceeded()
|
|||||||
qDebug() << "Blocked files found, displaying file list";
|
qDebug() << "Blocked files found, displaying file list";
|
||||||
|
|
||||||
auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked files found"),
|
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/>"
|
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/>"
|
"You will need to manually download them and add them to the instance."),
|
||||||
"Your configured global mods folder and default downloads folder<br/>"
|
m_blocked_mods);
|
||||||
"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);
|
|
||||||
|
|
||||||
if (message_dialog->exec() == QDialog::Accepted) {
|
if (message_dialog->exec() == QDialog::Accepted) {
|
||||||
qDebug() << "Post dialog blocked mods list: " << m_blocked_mods;
|
qDebug() << "Post dialog blocked mods list: " << m_blocked_mods;
|
||||||
createInstance();
|
createInstance();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
createInstance();
|
createInstance();
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include "BlockedModsDialog.h"
|
#include "BlockedModsDialog.h"
|
||||||
#include <qfileinfo.h>
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
@ -34,7 +33,16 @@ BlockedModsDialog::BlockedModsDialog(QWidget* parent, const QString& title, cons
|
|||||||
scanPaths();
|
scanPaths();
|
||||||
|
|
||||||
this->setWindowTitle(title);
|
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."));
|
ui->labelModsFound->setText(tr("Please download the missing mods."));
|
||||||
|
|
||||||
setAcceptDrops(true);
|
setAcceptDrops(true);
|
||||||
@ -56,7 +64,7 @@ void BlockedModsDialog::dragEnterEvent(QDragEnterEvent* e)
|
|||||||
|
|
||||||
void BlockedModsDialog::dropEvent(QDropEvent* e)
|
void BlockedModsDialog::dropEvent(QDropEvent* e)
|
||||||
{
|
{
|
||||||
foreach (const QUrl& url, e->mimeData()->urls()) {
|
for (const QUrl& url : e->mimeData()->urls()) {
|
||||||
QString filePath = url.toLocalFile();
|
QString filePath = url.toLocalFile();
|
||||||
qDebug() << "[Blocked Mods Dialog] Dropped file:" << filePath;
|
qDebug() << "[Blocked Mods Dialog] Dropped file:" << filePath;
|
||||||
addHashTask(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);
|
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()) {
|
if (allModsMatched()) {
|
||||||
ui->labelModsFound->setText(tr("All mods found ✔"));
|
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;
|
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::succeeded, this, [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::failed, this, [path] { qDebug() << "Failed to hash path: " << path; });
|
||||||
|
|
||||||
m_hashing_task->addTask(hash_task);
|
m_hashing_task->addTask(hash_task);
|
||||||
}
|
}
|
||||||
|
@ -15,17 +15,36 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="labelDescription">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::RichText</enum>
|
<enum>Qt::RichText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<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">
|
<property name="acceptRichText">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -34,6 +53,41 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="bottomBoxH">
|
<layout class="QHBoxLayout" name="bottomBoxH">
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
Reference in New Issue
Block a user