forked from blue/squawk
may be a bit better quit handling
This commit is contained in:
parent
c708c33a92
commit
802e2f11a1
7 changed files with 46 additions and 12 deletions
|
@ -883,6 +883,10 @@ void Squawk::writeSettings()
|
|||
}
|
||||
settings.endGroup();
|
||||
settings.endGroup();
|
||||
|
||||
settings.sync();
|
||||
|
||||
qDebug() << "Saved settings";
|
||||
}
|
||||
|
||||
void Squawk::onItemCollepsed(const QModelIndex& index)
|
||||
|
|
|
@ -54,8 +54,6 @@ public:
|
|||
explicit Squawk(QWidget *parent = nullptr);
|
||||
~Squawk() override;
|
||||
|
||||
void writeSettings();
|
||||
|
||||
signals:
|
||||
void newAccountRequest(const QMap<QString, QVariant>&);
|
||||
void modifyAccountRequest(const QString&, const QMap<QString, QVariant>&);
|
||||
|
@ -84,6 +82,7 @@ signals:
|
|||
void localPathInvalid(const QString& path);
|
||||
|
||||
public slots:
|
||||
void writeSettings();
|
||||
void readSettings();
|
||||
void newAccount(const QMap<QString, QVariant>& account);
|
||||
void changeAccount(const QString& account, const QMap<QString, QVariant>& data);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
#include "ui_pageappearance.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QStandardPaths>
|
||||
#include <QDir>
|
||||
|
||||
static const QStringList filters = {"*.colors"};
|
||||
|
||||
PageAppearance::PageAppearance(QWidget* parent):
|
||||
QWidget(parent),
|
||||
|
@ -28,6 +32,17 @@ PageAppearance::PageAppearance(QWidget* parent):
|
|||
}
|
||||
|
||||
connect(m_ui->themeInput, qOverload<int>(&QComboBox::currentIndexChanged), this, &PageAppearance::onThemeChanged);
|
||||
|
||||
m_ui->colorInput->addItem(tr("System"));
|
||||
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "color-schemes", QStandardPaths::LocateDirectory);
|
||||
QStringList schemeFiles;
|
||||
for (const QString &dir : dirs) {
|
||||
const QStringList fileNames = QDir(dir).entryList(filters);
|
||||
for (const QString &file : fileNames) {
|
||||
m_ui->colorInput->addItem(dir + QDir::separator() + file);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PageAppearance::~PageAppearance()
|
||||
|
|
|
@ -21,6 +21,16 @@
|
|||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="themeInput"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="colorInput"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="colorLabel">
|
||||
<property name="text">
|
||||
<string>Color scheme</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue