[Desktop Sessions KCM] Add Restart to BIOS/UEFI checkbox
ClosedPublic

Authored by broulik on Mar 6 2019, 10:46 AM.

Details

Summary

This sets a logind flag that tells the system to boot into the BIOS/UEFI setup screen on next boot.
It can be quite a challenge to enter the setup screen on boot these days as with quick boot and what not the timeframe for the keypress is often quite narrow.

Test Plan
  • Checked checkbox, entered my password, rebooted, ended up in UEFI screen
  • When opening the checkbox reflects the state of the flag (e.g. checking, closing, opening will keep the checkbox checked so you can unset the flag again)
  • Unchecked checkbox, entered my password, flag was unset
  • Checkbox is only shown if supported
  • Checks for UEFI and shows "UEFI" instead of generic "Firmware" labels, not sure if that stuff actually works when you didn't set up your machine as UEFI boot

I originally considered adding a dropdown to logout screen or some context menu action in the app launcher but since this is quite a niche task to do it's fine to have it in systemsettings somewhere imho.

Checkbox with tooltip


After typing the password when having checked it

Suggestions on wording welcome

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 6 2019, 10:46 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 6 2019, 10:46 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Mar 6 2019, 10:46 AM
broulik updated this revision to Diff 53267.Mar 6 2019, 10:55 AM
broulik retitled this revision from [Desktop Sessions KCM] Add Reboot to BIOS/UEFI checkbox to [Desktop Sessions KCM] Add Restart to BIOS/UEFI checkbox.
  • Change wording to "restarted" instead of rebooted and talk about computers, not systems
broulik updated this revision to Diff 53279.Mar 6 2019, 2:26 PM
broulik edited the test plan for this revision. (Show Details)
  • Simplify, totally didn't realize the "impl" was just a UI subclass, just access its controls directly from the kcm class
  • Add "Restart Now" button to message widget
  • Drop icon on checkbox
ngraham added a subscriber: ngraham.Mar 6 2019, 4:01 PM

Not sure we need the restart icon in the checkbox label.

ngraham accepted this revision as: VDG.Mar 6 2019, 4:07 PM

Never mind, it's already gone. UI looks good to me!

broulik edited the test plan for this revision. (Show Details)Mar 6 2019, 4:07 PM
broulik updated this revision to Diff 53290.Mar 6 2019, 4:11 PM
  • Add efi, uefi, bios as keywords so the KCM can be found this way through KRunner
sitter added a subscriber: sitter.Mar 11 2019, 11:13 AM

I feel like this would be nicer a dbus interface class thingy.

kcms/ksmserver/kcmsmserver.cpp
116

Perhaps reduce the nesting by returning early if (!enable) { return; }?

kcms/ksmserver/smserverconfigimpl.cpp
20

Not needed? .h includes ui_.h and that would include kmessagewidget.h

broulik updated this revision to Diff 53652.Mar 11 2019, 1:17 PM
  • Use introspected DBus stuff; used the nicer synchronous APIs, should be fine since this isn't a background service that we must not block
sitter requested changes to this revision.Mar 11 2019, 2:00 PM

XML broken.

The KMessageWidget being inside the groupbox looks a bit weird to me. Don't we usually put the messages at the top of the KCM?

kcms/ksmserver/kcmsmserver.cpp
74

possibly should be up in the member initializer list?

kcms/ksmserver/kcmsmserver.h
48

= nullptr

kcms/ksmserver/org.freedesktop.login1.Manager.xml
14

interface end tag missing.

This revision now requires changes to proceed.Mar 11 2019, 2:00 PM
broulik updated this revision to Diff 53659.Mar 11 2019, 2:42 PM
  • Fix xml
  • Better init dbus iface
broulik updated this revision to Diff 53661.Mar 11 2019, 2:58 PM
  • Enable word wrap for message widget
sitter accepted this revision.Mar 11 2019, 3:46 PM

LGTM.

I'll put it on the record that I still think the "yo you wanna restart now" message should be at the top of the KCM and not inside the groupbox.

This revision is now accepted and ready to land.Mar 11 2019, 3:46 PM
ngraham accepted this revision.Mar 11 2019, 8:46 PM

The KMessageWidget within the group box is only weird because there's a group box IMO. This KCM is a good candidate for being re-laid-out with a FormLayout so it looks and feels like everything else these days. I can do that after this lands. :)

This revision was automatically updated to reflect the committed changes.