Skip to content

Commit

Permalink
Restrict supported modes for text-only meters
Browse files Browse the repository at this point in the history
Limit display to Text mode only for:
* BlankMeter
* HostnameMeter
* SELinuxMeter (Linux)
* SysArchMeter
* SystemdMeter (Linux)

Co-authored-by: Benny Baumann <[email protected]>
Co-authored-by: Kang-Che Sung <[email protected]>
  • Loading branch information
Explorer09 and BenBE committed May 22, 2024
1 parent 1723ed7 commit b131dd8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion HostnameMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ const MeterClass HostnameMeter_class = {
},
.updateValues = HostnameMeter_updateValues,
.defaultMode = TEXT_METERMODE,
.supportedModes = (1 << TEXT_METERMODE),
.maxItems = 0,
.total = 100.0,
.total = 0.0,
.attributes = HostnameMeter_attributes,
.name = "Hostname",
.uiName = "Hostname",
Expand Down
3 changes: 2 additions & 1 deletion Meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,9 @@ const MeterClass BlankMeter_class = {
},
.updateValues = BlankMeter_updateValues,
.defaultMode = TEXT_METERMODE,
.supportedModes = (1 << TEXT_METERMODE),
.maxItems = 0,
.total = 100.0,
.total = 0.0,
.attributes = BlankMeter_attributes,
.name = "Blank",
.uiName = "Blank",
Expand Down
3 changes: 2 additions & 1 deletion SysArchMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ const MeterClass SysArchMeter_class = {
},
.updateValues = SysArchMeter_updateValues,
.defaultMode = TEXT_METERMODE,
.supportedModes = (1 << TEXT_METERMODE),
.maxItems = 0,
.total = 100.0,
.total = 0.0,
.attributes = SysArchMeter_attributes,
.name = "System",
.uiName = "System",
Expand Down
3 changes: 2 additions & 1 deletion linux/SELinuxMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ const MeterClass SELinuxMeter_class = {
},
.updateValues = SELinuxMeter_updateValues,
.defaultMode = TEXT_METERMODE,
.supportedModes = (1 << TEXT_METERMODE),
.maxItems = 0,
.total = 100.0,
.total = 0.0,
.attributes = SELinuxMeter_attributes,
.name = "SELinux",
.uiName = "SELinux",
Expand Down
6 changes: 4 additions & 2 deletions linux/SystemdMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,9 @@ const MeterClass SystemdMeter_class = {
.updateValues = SystemdMeter_updateValues,
.done = SystemdMeter_done,
.defaultMode = TEXT_METERMODE,
.supportedModes = (1 << TEXT_METERMODE),
.maxItems = 0,
.total = 100.0,
.total = 0.0,
.attributes = SystemdMeter_attributes,
.name = "Systemd",
.uiName = "Systemd state",
Expand All @@ -426,8 +427,9 @@ const MeterClass SystemdUserMeter_class = {
.updateValues = SystemdMeter_updateValues,
.done = SystemdMeter_done,
.defaultMode = TEXT_METERMODE,
.supportedModes = (1 << TEXT_METERMODE),
.maxItems = 0,
.total = 100.0,
.total = 0.0,
.attributes = SystemdMeter_attributes,
.name = "SystemdUser",
.uiName = "Systemd user state",
Expand Down

0 comments on commit b131dd8

Please sign in to comment.