Bug 339428

Summary: systray config dialog has broken apply button
Product: [Plasma] plasmashell Reporter: Harald Sitter <sitter>
Component: System Tray widgetAssignee: Sebastian Kügler <sebas>
Status: RESOLVED FIXED    
Severity: normal CC: bhush94, kde, kde
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.1
Sentry Crash Report:

Description Harald Sitter 2014-09-26 13:40:06 UTC
on a newly started plasmashell opening the config dialog of the systray will have a *disabled* apply button. changing the enabled tray widgets will not turn the apply button enabled. doing nothing and clicking 'ok' closes the window. opening the window again it will now have an *enabled* apply button that as far as I can tell will not ever turn disabled again.

Reproducible: Always
Comment 1 Bhushan Shah 2014-09-26 14:06:10 UTC
I can confirm
Comment 2 David Edmundson 2014-09-26 15:43:19 UTC
*** Bug 339316 has been marked as a duplicate of this bug. ***
Comment 3 Kai Uwe Broulik 2014-09-27 10:22:55 UTC
The issue only happens when opening the system tray configuration. When switching to eg. Entries and back to General the apply button works. There's some strange behavior when the dialog opens, though:

qml: Connecting to changed signal of cfg_shownCategoriesChanged
qml: Connecting to changed signal of cfg_extraItemsChanged
qml: Connecting to changed signal of cfg_applicationStatusShownChanged
qml: Connecting to changed signal of cfg_communicationsShownChanged
qml: Connecting to changed signal of cfg_systemServicesShownChanged
qml: Connecting to changed signal of cfg_hardwareControlShownChanged
qml: Signal cfg_hardwareControlShownChanged emitted
↑ Why does it think the property changed? It's always the last alias prop (to a checkbox' checked value) it connected to.

And the reason it doesn't enable for the list of applets is that QML cannot detect changes *inside* an Array. It can only detect when you assign something new to it. You would either need to create a temporary Array to which you push/pop and assign it to the property, or in this case simply emit configurationChanged.
Comment 4 Kai Uwe Broulik 2014-09-27 10:39:50 UTC
Git commit 9988264d1a4d70b34dfefacf7053eb2921b5d01f by Kai Uwe Broulik.
Committed on 27/09/2014 at 10:38.
Pushed by broulik into branch 'Plasma/5.1'.

Cleanup system tray configuration

- Remove dead properties and runtime warnings
- Use Array literal instead of Array()
- Use ColumnLayout instead of generic Column

- Emit configurationChanged signal when changing the "Additional Items" because QML
  cannot detect changes that happen *inside* an Array

REVIEW: 120385

M  +8    -7    applets/systemtray/package/contents/ui/ConfigGeneral.qml

http://commits.kde.org/plasma-workspace/9988264d1a4d70b34dfefacf7053eb2921b5d01f
Comment 5 Kai Uwe Broulik 2014-09-29 12:24:09 UTC
Git commit c661ff63c944ebbcb3075a0e2ea89678724efc50 by Kai Uwe Broulik.
Committed on 29/09/2014 at 12:22.
Pushed by broulik into branch 'Plasma/5.1'.

Fix Apply button in applet configuration

There's no need to call restoreConfiguration() in Component.onCompleted since the manipulation
of the StackView's sourceFile property in said method will already trigger the onSourceFileChanged
handler which will restoreConfigration() also.

This lead to the issue that for data structures QML cannot compare, like the Array of extra items
in systray config, triggered the change handler on re-assignment by the method running a second
time enabling the Apply button.

REVIEW: 120386
FIXED-IN: 5.1

M  +0    -1    desktoppackage/contents/configuration/AppletConfiguration.qml

http://commits.kde.org/plasma-desktop/c661ff63c944ebbcb3075a0e2ea89678724efc50