mirror of
https://github.com/mumble-voip/mumble.git
synced 2025-10-26 11:19:16 +00:00
Add link to user themes directory to LookConfig
This commit is contained in:
parent
3576e52981
commit
426edb6fe7
@ -81,6 +81,13 @@ LookConfig::LookConfig(Settings &st) : ConfigWidget(st) {
|
||||
qcbChannelDrag->insertItem(Settings::Ask, tr("Ask"), Settings::Ask);
|
||||
qcbChannelDrag->insertItem(Settings::DoNothing, tr("Do Nothing"), Settings::DoNothing);
|
||||
qcbChannelDrag->insertItem(Settings::Move, tr("Move"), Settings::Move);
|
||||
|
||||
QDir userThemeDirectory = Themes::getUserThemesDirectory();
|
||||
if (userThemeDirectory.exists()) {
|
||||
QUrl userThemeDirectoryUrl = QUrl::fromLocalFile(userThemeDirectory.path());
|
||||
qlThemesDirectory->setText(tr("<a href=\"%1\">Browse</a>").arg(userThemeDirectoryUrl.toString()));
|
||||
qlThemesDirectory->setOpenExternalLinks(true);
|
||||
}
|
||||
}
|
||||
|
||||
QString LookConfig::title() const {
|
||||
@ -148,17 +155,17 @@ void LookConfig::load(const Settings &r) {
|
||||
theme != themes.end();
|
||||
++theme) {
|
||||
|
||||
for (ThemeInfo::StylesMap::const_iterator style = theme->styles.begin();
|
||||
style != theme->styles.end();
|
||||
++style) {
|
||||
for (ThemeInfo::StylesMap::const_iterator styleit = theme->styles.begin();
|
||||
styleit != theme->styles.end();
|
||||
++styleit) {
|
||||
|
||||
if (configuredStyle
|
||||
&& configuredStyle->themeName == style->themeName
|
||||
&& configuredStyle->name == style->name) {
|
||||
&& configuredStyle->themeName == styleit->themeName
|
||||
&& configuredStyle->name == styleit->name) {
|
||||
selectedThemeEntry = qcbTheme->count();
|
||||
}
|
||||
|
||||
qcbTheme->addItem(theme->name + QLatin1String(" - ") + style->name, QVariant::fromValue(*style));
|
||||
qcbTheme->addItem(theme->name + QLatin1String(" - ") + styleit->name, QVariant::fromValue(*styleit));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>644</width>
|
||||
<width>702</width>
|
||||
<height>611</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -93,6 +93,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="qlThemesDirectory">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -124,6 +124,10 @@ ThemeMap Themes::getThemes() {
|
||||
return ThemeInfo::scanDirectories(getSearchDirectories());
|
||||
}
|
||||
|
||||
QDir Themes::getUserThemesDirectory() {
|
||||
return QDir(g.qdBasePath.absolutePath() + QLatin1String("/Themes"));
|
||||
}
|
||||
|
||||
QVector<QDir> Themes::getSearchDirectories() {
|
||||
QVector<QDir> themeSearchDirectories;
|
||||
|
||||
@ -132,7 +136,7 @@ QVector<QDir> Themes::getSearchDirectories() {
|
||||
// Next come themes found in the applications Themes directory
|
||||
themeSearchDirectories << QDir(MumbleApplication::instance()->applicationVersionRootPath() + QLatin1String("/Themes"));
|
||||
// Highest priorty have themes located in the user directory
|
||||
themeSearchDirectories << QDir(g.qdBasePath.absolutePath() + QLatin1String("/Themes"));
|
||||
themeSearchDirectories << getUserThemesDirectory();
|
||||
|
||||
return themeSearchDirectories;
|
||||
}
|
||||
|
||||
@ -58,6 +58,9 @@ public:
|
||||
/// Return a theme name to theme map
|
||||
static ThemeMap getThemes();
|
||||
|
||||
/// Returns the per user themes directory
|
||||
static QDir getUserThemesDirectory();
|
||||
|
||||
private:
|
||||
/// Applies the fallback stylesheet
|
||||
static void applyFallback();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user