Keep at least one system monitor alive

Added a ban on disabling the last checkbox in the widget settings.
There will always be at least one graph.

If the user disables the last checkbox, all other checkboxes will automatically get enabled in the settings.
It may be inconvenient for users to uncheck a large number of checkboxes.
wilder-5.18
Pavel Mars 6 years ago committed by David Edmundson
parent df0254c789
commit eb6f6c2566
  1. 6
      applets/systemmonitor/common/contents/ui/ConfigGeneral.qml

@ -160,8 +160,10 @@ Item {
}
} else {
var idx = cfg_sources.indexOf(model.source);
if (idx !== -1) {
cfg_sources.splice(idx, 1);
if (cfg_sources.length !== 1) { // This condition prohibits turning off the last item from the list.
if (idx !== -1) {
cfg_sources.splice(idx, 1);
}
}
}
cfg_sourcesChanged();

Loading…
Cancel
Save