feat: mark folder paths as links

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2022-11-11 18:32:11 -07:00
parent 9af1b00df5
commit 25b306b7e1
2 changed files with 15 additions and 3 deletions

View File

@ -39,12 +39,15 @@ BlockedModsDialog::BlockedModsDialog(QWidget* parent, const QString& title, cons
"are automatically checked for the downloaded mods and they will be copied to the instance if found.<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 " "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/>" "if you did not download the mods to a default location.<br/><br/>"
"Global Mods Folder: %1<br/>" "Global Mods Folder: <a href=\"%1\">%1</a><br/>"
"Default Downloads Folder: %2")) "Default Downloads Folder: <a href=\"%2\">%2</a>"))
.arg(APPLICATION->settings()->get("CentralModsDir").toString(), .arg(APPLICATION->settings()->get("CentralModsDir").toString(),
QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))); QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)));
ui->labelModsFound->setText(tr("Please download the missing mods.")); ui->labelModsFound->setText(tr("Please download the missing mods."));
// force all URL handeling as external
connect(ui->textBrowserWatched, &QTextBrowser::anchorClicked, this, [](const QUrl url) { QDesktopServices::openUrl(url); });
setAcceptDrops(true); setAcceptDrops(true);
update(); update();
@ -118,7 +121,7 @@ void BlockedModsDialog::update()
QString watching; QString watching;
for (auto& dir : m_watcher.directories()) { for (auto& dir : m_watcher.directories()) {
watching += QString("%1<br/>").arg(dir); watching += QString("<a href=\"%1\">%1</a><br/>").arg(dir);
} }
ui->textBrowserWatched->setText(watching); ui->textBrowserWatched->setText(watching);

View File

@ -35,6 +35,9 @@
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -86,6 +89,12 @@
<height>12</height> <height>12</height>
</size> </size>
</property> </property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="openLinks">
<bool>false</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>