Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
libksysguard
Commits
5407cd31
Commit
5407cd31
authored
Oct 09, 2020
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
faces/SensorFaceController.cpp
View file @
5407cd31
...
...
@@ -375,6 +375,24 @@ void SensorFaceController::setTitle(const QString &title)
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
{
return
d
->
totalSensors
;
...
...
faces/SensorFaceController.h
View file @
5407cd31
...
...
@@ -45,6 +45,7 @@ class SENSORFACES_EXPORT SensorFaceController : public QObject
{
Q_OBJECT
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
(
QJsonArray
totalSensors
READ
totalSensors
WRITE
setTotalSensors
NOTIFY
totalSensorsChanged
)
Q_PROPERTY
(
QJsonArray
highPrioritySensorIds
READ
highPrioritySensorIds
WRITE
setHighPrioritySensorIds
NOTIFY
highPrioritySensorIdsChanged
)
...
...
@@ -86,6 +87,9 @@ public:
QString
title
()
const
;
void
setTitle
(
const
QString
&
title
);
bool
showTitle
()
const
;
void
setShowTitle
(
bool
show
);
QJsonArray
totalSensors
()
const
;
void
setTotalSensors
(
const
QJsonArray
&
sensor
);
...
...
@@ -124,6 +128,7 @@ public:
Q_SIGNALS:
void
faceIdChanged
();
void
titleChanged
();
void
showTitleChanged
();
void
totalSensorsChanged
();
void
highPrioritySensorIdsChanged
();
void
lowPrioritySensorIdsChanged
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment