Changeset View
Standalone View
kcms/launch/package/contents/ui/main.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | Copyright (c) 2017 Eike Hein <hein@kde.org> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Library General Public | ||||
6 | License version 2 as published by the Free Software Foundation. | ||||
7 | | ||||
8 | This library is distributed in the hope that it will be useful, | ||||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
11 | Library General Public License for more details. | ||||
12 | | ||||
13 | You should have received a copy of the GNU Library General Public License | ||||
14 | along with this library; see the file COPYING.LIB. If not, write to | ||||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
16 | Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | import QtQuick 2.1 | ||||
20 | import QtQuick.Layouts 1.1 | ||||
21 | import QtQuick.Controls 2.0 as QtControls | ||||
22 | import org.kde.kirigami 2.3 as Kirigami | ||||
23 | import org.kde.kcm 1.1 | ||||
davidedmundson: not used | |||||
24 | | ||||
25 | SimpleKCM { | ||||
26 | id: root | ||||
27 | | ||||
i would like to have a base component for this (which admittedly doesn't exists yet as i need beforehand to merge the cursrs stuff which introduced the kcm components) tough for now would be just for "semantics" and future proofing mart: i would like to have a base component for this (which admittedly doesn't exists yet as i need… | |||||
28 | ConfigModule.quickHelp: i18n("Launch Feedback") | ||||
29 | | ||||
30 | function applyBusyCursorCurrentIndex() { | ||||
31 | if (kcm.busyCursorCurrentIndex == 0) { | ||||
32 | busyCursorDisabled.checked = true; | ||||
33 | } else if (kcm.busyCursorCurrentIndex == 1) { | ||||
34 | busyCursorStatic.checked = true; | ||||
35 | } else if (kcm.busyCursorCurrentIndex == 2) { | ||||
36 | busyCursorBlinking.checked = true; | ||||
37 | } else if (kcm.busyCursorCurrentIndex == 3) { | ||||
38 | busyCursorBouncing.checked = true; | ||||
39 | } | ||||
40 | } | ||||
My personal note is not mandatory but this piece of code can be seen 2 times in C++ part and 1 in QML. Can we add it on C++ part and called here too. anthonyfieroni: My personal note is not mandatory but this piece of code can be seen 2 times in C++ part and 1… | |||||
I hear you, but IMHO it's not really worth it to get inventive for some basic boilerplate. Down the line we just want generated code for this stuff (e.g. using KConfigXT more). hein: I hear you, but IMHO it's not really worth it to get inventive for some basic boilerplate. Down… | |||||
41 | | ||||
42 | Kirigami.FormLayout { | ||||
43 | id: formLayout | ||||
44 | | ||||
45 | Connections { | ||||
46 | target: kcm | ||||
47 | | ||||
48 | onBusyCursorCurrentIndexChanged: applyBusyCursorCurrentIndex() | ||||
49 | | ||||
50 | onTaskManagerNotificationChanged: taskManagerNotification.checked = kcm.taskManagerNotification | ||||
As discussed on https://phabricator.kde.org/T7284#116912, could we change "Startup indication timeout" to "Stop animation after" ? ngraham: As discussed on https://phabricator.kde.org/T7284#116912, could we change
"Startup indication… | |||||
51 | | ||||
52 | onNotificationTimeoutChanged: notificationTimeout.value = kcm.notificationTimeout | ||||
53 | } | ||||
54 | | ||||
55 | ColumnLayout { | ||||
56 | Kirigami.FormData.label: i18n("Cursor:") | ||||
57 | | ||||
58 | QtControls.RadioButton { | ||||
59 | id: busyCursorDisabled | ||||
60 | | ||||
61 | text: i18n("No Feedback") | ||||
62 | | ||||
63 | onCheckedChanged: Qt.later(function() { kcm.busyCursorCurrentIndex = 0; }) | ||||
64 | } | ||||
65 | | ||||
66 | QtControls.RadioButton { | ||||
67 | id: busyCursorStatic | ||||
68 | | ||||
69 | text: i18n("Static") | ||||
70 | | ||||
"Task Manager notification: [checkbox] Enable Task Manager notification" a bit redundant and overly wordy. How about the following? "Task Manager notification: [checkbox]" Paging @abetts for better ideas. :) ngraham: "Task Manager notification: [checkbox] Enable Task Manager notification" a bit redundant and… | |||||
hein: Will do former. | |||||
71 | onCheckedChanged: Qt.later(function() { kcm.busyCursorCurrentIndex = 1; }) | ||||
72 | } | ||||
73 | | ||||
74 | QtControls.RadioButton { | ||||
75 | id: busyCursorBlinking | ||||
76 | | ||||
77 | text: i18n("Blinking") | ||||
78 | | ||||
79 | onCheckedChanged: Qt.later(function() { kcm.busyCursorCurrentIndex = 2; }) | ||||
80 | } | ||||
81 | | ||||
82 | QtControls.RadioButton { | ||||
83 | id: busyCursorBouncing | ||||
84 | | ||||
85 | text: i18n("Bouncing") | ||||
86 | | ||||
87 | onCheckedChanged: Qt.later(function() { kcm.busyCursorCurrentIndex = 3; }) | ||||
88 | } | ||||
once the user clicks the spinbox this binding will break. When defaults is clicked, how does this update? davidedmundson: once the user clicks the spinbox this binding will break.
When defaults is clicked, how does… | |||||
After fixing the binding bug: Via kcm.* signal emission, defaults() calls the setters which emit as needed. hein: > When defaults is clicked, how does this update?
After fixing the binding bug: Via kcm.*… | |||||
89 | } | ||||
davidedmundson: you might want to see valueModified | |||||
valueModified is new in Qt Quick Controls 2.2 (Qt 5.9) and I can't import that because of versioning conflicts with the imports in Kirigami. There are ways to hack around this but they're too awful. hein: valueModified is new in Qt Quick Controls 2.2 (Qt 5.9) and I can't import that because of… | |||||
90 | | ||||
91 | QtControls.CheckBox { | ||||
92 | id: taskManagerNotification | ||||
93 | | ||||
94 | Kirigami.FormData.label: i18n("Task Manager:") | ||||
95 | | ||||
96 | text: i18n("Enable animation") | ||||
97 | | ||||
98 | checked: kcm.taskManagerNotification | ||||
99 | onCheckedChanged: kcm.taskManagerNotification = checked | ||||
100 | } | ||||
101 | | ||||
102 | QtControls.SpinBox { | ||||
103 | id: notificationTimeout | ||||
104 | | ||||
105 | Kirigami.FormData.label: i18n("Stop animation after:") | ||||
106 | | ||||
107 | stepSize: 1 | ||||
108 | | ||||
109 | enabled: taskManagerNotification.checked | ||||
110 | | ||||
111 | value: kcm.notificationTimeout | ||||
112 | onValueChanged: kcm.notificationTimeout = value | ||||
113 | | ||||
114 | textFromValue: function(value, locale) { return i18np("%1 sec", "%1 secs", value)} | ||||
115 | } | ||||
116 | } | ||||
117 | | ||||
118 | Component.onCompleted: applyBusyCursorCurrentIndex() | ||||
119 | } | ||||
120 | |
not used