Make user plugin path in settings a link. (#2034)

Closes #1793
This commit is contained in:
karliss 2020-01-25 21:26:41 +02:00 committed by GitHub
parent 8266cd074f
commit 63ae6e665e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,6 +12,7 @@
#include <QPushButton>
#include <QTreeWidget>
#include <QVBoxLayout>
#include <QUrl>
PluginsOptionsWidget::PluginsOptionsWidget(PreferencesDialog *dialog)
@ -21,9 +22,12 @@ PluginsOptionsWidget::PluginsOptionsWidget(PreferencesDialog *dialog)
setLayout(layout);
auto dirLabel = new QLabel(this);
dirLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
dirLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
dirLabel->setOpenExternalLinks(true);
layout->addWidget(dirLabel);
dirLabel->setText(tr("Plugins are loaded from <b>%1</b>").arg(Plugins()->getUserPluginsDirectory()));
auto pluginPath = Plugins()->getUserPluginsDirectory();
dirLabel->setText(tr("Plugins are loaded from <a href=\"%1\">%2</a>")
.arg(QUrl::fromLocalFile(pluginPath).toString(), pluginPath.toHtmlEscaped()));
auto treeWidget = new QTreeWidget(this);
layout->addWidget(treeWidget);