Bug 339428 - systray config dialog has broken apply button
Summary: systray config dialog has broken apply button
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL:
Keywords:
: 339316 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-26 13:40 UTC by Harald Sitter
Modified: 2014-09-29 12:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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