Commit 5407cd31 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Add a "showTitle" property to SensorFaceController

Can be used by faces to determine if they should show a title at all.
parent f9ff4480
...@@ -375,6 +375,24 @@ void SensorFaceController::setTitle(const QString &title) ...@@ -375,6 +375,24 @@ void SensorFaceController::setTitle(const QString &title)
emit titleChanged(); emit titleChanged();
} }
bool SensorFaceController::showTitle() const
{
return d->appearanceGroup.readEntry("showTitle", true);
}
void SensorFaceController::setShowTitle(bool show)
{
if (show == showTitle()) {
return;
}
d->appearanceGroup.writeEntry("showTitle", show);
d->syncTimer->start();
emit showTitleChanged();
}
QJsonArray SensorFaceController::totalSensors() const QJsonArray SensorFaceController::totalSensors() const
{ {
return d->totalSensors; return d->totalSensors;
......
...@@ -45,6 +45,7 @@ class SENSORFACES_EXPORT SensorFaceController : public QObject ...@@ -45,6 +45,7 @@ class SENSORFACES_EXPORT SensorFaceController : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(bool showTitle READ showTitle WRITE setShowTitle NOTIFY showTitleChanged)
Q_PROPERTY(QString faceId READ faceId WRITE setFaceId NOTIFY faceIdChanged) Q_PROPERTY(QString faceId READ faceId WRITE setFaceId NOTIFY faceIdChanged)
Q_PROPERTY(QJsonArray totalSensors READ totalSensors WRITE setTotalSensors NOTIFY totalSensorsChanged) Q_PROPERTY(QJsonArray totalSensors READ totalSensors WRITE setTotalSensors NOTIFY totalSensorsChanged)
Q_PROPERTY(QJsonArray highPrioritySensorIds READ highPrioritySensorIds WRITE setHighPrioritySensorIds NOTIFY highPrioritySensorIdsChanged) Q_PROPERTY(QJsonArray highPrioritySensorIds READ highPrioritySensorIds WRITE setHighPrioritySensorIds NOTIFY highPrioritySensorIdsChanged)
...@@ -86,6 +87,9 @@ public: ...@@ -86,6 +87,9 @@ public:
QString title() const; QString title() const;
void setTitle(const QString &title); void setTitle(const QString &title);
bool showTitle() const;
void setShowTitle(bool show);
QJsonArray totalSensors() const; QJsonArray totalSensors() const;
void setTotalSensors(const QJsonArray &sensor); void setTotalSensors(const QJsonArray &sensor);
...@@ -124,6 +128,7 @@ public: ...@@ -124,6 +128,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void faceIdChanged(); void faceIdChanged();
void titleChanged(); void titleChanged();
void showTitleChanged();
void totalSensorsChanged(); void totalSensorsChanged();
void highPrioritySensorIdsChanged(); void highPrioritySensorIdsChanged();
void lowPrioritySensorIdsChanged(); void lowPrioritySensorIdsChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment