Merge lp:~nick-dedekind/unity8/indicators.menu-items-cleaning into lp:unity8

Proposed by Nick Dedekind
Status: Merged
Approved by: Michael Zanetti
Approved revision: 233
Merged at revision: 249
Proposed branch: lp:~nick-dedekind/unity8/indicators.menu-items-cleaning
Merge into: lp:unity8
Diff against target: 637 lines (+174/-184)
16 files modified
plugins/Unity/Indicators/Network/qml/AccessPoint.qml (+18/-8)
plugins/Unity/Indicators/Network/qml/PasswordPage.qml (+1/-1)
plugins/Unity/Indicators/Network/qml/WifiSection.qml (+0/-28)
plugins/Unity/Indicators/Network/qml/qmldir (+1/-2)
plugins/Unity/Indicators/qml/BaseMenuItem.qml (+0/-4)
plugins/Unity/Indicators/qml/ButtonMenuItem.qml (+4/-9)
plugins/Unity/Indicators/qml/FramedMenuItem.qml (+0/-2)
plugins/Unity/Indicators/qml/IndicatorPage.qml (+4/-9)
plugins/Unity/Indicators/qml/MenuAction.qml (+0/-59)
plugins/Unity/Indicators/qml/MenuItemFactory.qml (+124/-7)
plugins/Unity/Indicators/qml/ProgressMenuItem.qml (+1/-8)
plugins/Unity/Indicators/qml/SectionMenuItem.qml (+3/-3)
plugins/Unity/Indicators/qml/SliderMenuItem.qml (+8/-23)
plugins/Unity/Indicators/qml/StandardMenuItem.qml (+6/-11)
plugins/Unity/Indicators/qml/SwitchMenuItem.qml (+4/-9)
plugins/Unity/Indicators/qml/qmldir (+0/-1)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/indicators.menu-items-cleaning
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+181410@code.launchpad.net

Commit message

Abstraction of indicator menu item properties prior to move into common components library.

Description of the change

Abstraction of indicator menu item properties prior to move into common components library.

Changes:
* Moved activate/changeState signals from BaseMenuItem to specific menu items. Now handled by MenuFactory components.
* Moved menu model related code (setup of menu item data [labels/icons/values/etc]) into MenuFactoryComponents.

MenuItems now only have properties and signals for updating visual/backend data. They do not directly access any implementation specific model data. The MenuFactory now holds the unityumenumodel specifc code.

To post a comment you must log in.
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

436 +// property var strenthAction: QMenuModel.UnityMenuAction {
437 +// model: menuFactory.model ? menuFactory.model : null
438 +// name: menu ? menu.ext.xCanonicalWifiApStrengthAction : ""
439 +// }

446 +// signalStrength: strenthAction.valid ? strenthAction.state : 0

Waiting for new code from qmenumodel.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

We don't need
text: ""
in FramedMenuItem.qml, no?

review: Needs Information
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> We don't need
> text: ""
> in FramedMenuItem.qml, no?

Nope. removed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Indicators/Network/qml/AccessPoint.qml'
2--- plugins/Unity/Indicators/Network/qml/AccessPoint.qml 2013-08-20 19:50:07 +0000
3+++ plugins/Unity/Indicators/Network/qml/AccessPoint.qml 2013-08-23 11:34:24 +0000
4@@ -25,29 +25,39 @@
5 Indicators.FramedMenuItem {
6 id: accessPoint
7
8- readonly property bool checked: menu ? menu.isToggled : false
9+ property bool checked: false
10+ property bool secure: false
11+ property bool adHoc: false
12+ property int signalStrength: 0
13+
14+ signal activate()
15
16 onCheckedChanged: {
17 // Can't rely on binding. Checked is assigned on click.
18 checkBoxActive.checked = checked;
19 }
20
21- // FIXME - we need to get the strength from menu.ext.xCanonicalWifiApStrengthAction
22- // but UnityMenuModel doesnt support fetching actions not attached to menu item.
23- function getNetworkIcon(data) {
24+ icon: {
25 var imageName = "nm-signal-100"
26
27- if (data.ext.xCanonicalWifiApIsAdhoc) {
28+ if (adHoc) {
29 imageName = "nm-adhoc";
30+ } else if (signalStrength == 0) {
31+ imageName = "nm-signal-00";
32+ } else if (signalStrength <= 25) {
33+ imageName = "nm-signal-25";
34+ } else if (signalStrength <= 50) {
35+ imageName = "nm-signal-50";
36+ } else if (signalStrength <= 75) {
37+ imageName = "nm-signal-75";
38 }
39- if (data.ext.xCanonicalWifiApIsSecure) {
40+
41+ if (secure) {
42 imageName += "-secure";
43 }
44-
45 return "image://gicon/" + imageName;
46 }
47
48- icon: menu ? getNetworkIcon(menu) : "image://gicon/wifi-none"
49 iconFrame: false
50 control: CheckBox {
51 id: checkBoxActive
52
53=== modified file 'plugins/Unity/Indicators/Network/qml/PasswordPage.qml'
54--- plugins/Unity/Indicators/Network/qml/PasswordPage.qml 2013-08-20 19:50:07 +0000
55+++ plugins/Unity/Indicators/Network/qml/PasswordPage.qml 2013-08-23 11:34:24 +0000
56@@ -38,7 +38,7 @@
57 }
58
59 Indicators.SectionMenuItem {
60- label: "Authentication"
61+ text: "Authentication"
62 }
63
64 Indicators.FramedMenuItem {
65
66=== removed file 'plugins/Unity/Indicators/Network/qml/WifiSection.qml'
67--- plugins/Unity/Indicators/Network/qml/WifiSection.qml 2013-08-20 19:50:07 +0000
68+++ plugins/Unity/Indicators/Network/qml/WifiSection.qml 1970-01-01 00:00:00 +0000
69@@ -1,28 +0,0 @@
70-/*
71- * Copyright 2013 Canonical Ltd.
72- *
73- * This program is free software; you can redistribute it and/or modify
74- * it under the terms of the GNU Lesser General Public License as published by
75- * the Free Software Foundation; version 3.
76- *
77- * This program is distributed in the hope that it will be useful,
78- * but WITHOUT ANY WARRANTY; without even the implied warranty of
79- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80- * GNU Lesser General Public License for more details.
81- *
82- * You should have received a copy of the GNU Lesser General Public License
83- * along with this program. If not, see <http://www.gnu.org/licenses/>.
84- *
85- * Authors:
86- * Renato Araujo Oliveira Filho <renato@canonical.com>
87- */
88-
89-import QtQuick 2.0
90-import Ubuntu.Components 0.1
91-import Unity.Indicators 0.1 as Indicators
92-
93-Indicators.SectionMenuItem {
94- id: wifiSectionMenu
95-
96- busy: menu ? menu.ext.xCanonicalBusyAction : false
97-}
98
99=== modified file 'plugins/Unity/Indicators/Network/qml/qmldir'
100--- plugins/Unity/Indicators/Network/qml/qmldir 2013-08-20 19:50:07 +0000
101+++ plugins/Unity/Indicators/Network/qml/qmldir 2013-08-23 11:34:24 +0000
102@@ -5,5 +5,4 @@
103 NetworkPage 0.1 NetworkPage.qml
104 AccessPoint 0.1 AccessPoint.qml
105 PasswordPage 0.1 PasswordPage.qml
106-PasswordTextField 0.1 PasswordTextField.qml
107-WifiSection 0.1 WifiSection.qml
108\ No newline at end of file
109+PasswordTextField 0.1 PasswordTextField.qml
110\ No newline at end of file
111
112=== modified file 'plugins/Unity/Indicators/qml/BaseMenuItem.qml'
113--- plugins/Unity/Indicators/qml/BaseMenuItem.qml 2013-08-14 09:07:45 +0000
114+++ plugins/Unity/Indicators/qml/BaseMenuItem.qml 2013-08-23 11:34:24 +0000
115@@ -25,14 +25,10 @@
116 id: baseMenu
117
118 property bool menuActivated: false
119- property QtObject menu
120
121 signal selectMenu()
122 signal deselectMenu()
123
124- signal activate()
125- signal changeState(var value)
126-
127 showDivider: false
128 __foregroundColor: "#e8e1d0" // FIXME not in palette yet
129
130
131=== modified file 'plugins/Unity/Indicators/qml/ButtonMenuItem.qml'
132--- plugins/Unity/Indicators/qml/ButtonMenuItem.qml 2013-08-14 09:07:45 +0000
133+++ plugins/Unity/Indicators/qml/ButtonMenuItem.qml 2013-08-23 11:34:24 +0000
134@@ -24,14 +24,14 @@
135
136 BaseMenuItem {
137 id: menuItem
138- objectName: menuAction.name
139 implicitHeight: units.gu(7)
140- enabled: menuAction.active
141+
142+ property alias text: button.text
143+
144+ signal activate()
145
146 Button {
147 id: button
148- enabled: menuAction.enabled
149- text: menu ? menu.label : ""
150 anchors.centerIn: parent
151 height: units.gu(4)
152 width: units.gu(16)
153@@ -41,9 +41,4 @@
154 menuItem.activate();
155 }
156 }
157-
158- Indicators.MenuAction {
159- id: menuAction
160- menu: menuItem.menu
161- }
162 }
163
164=== modified file 'plugins/Unity/Indicators/qml/FramedMenuItem.qml'
165--- plugins/Unity/Indicators/qml/FramedMenuItem.qml 2013-08-14 09:07:45 +0000
166+++ plugins/Unity/Indicators/qml/FramedMenuItem.qml 2013-08-23 11:34:24 +0000
167@@ -23,10 +23,8 @@
168 import Ubuntu.Components.ListItems 0.1 as ListItem
169
170 BaseMenuItem {
171- text: menu && menu.label ? menu.label : ""
172 implicitHeight: units.gu(7)
173
174- icon: menu ? menu.icon : ""
175 iconFrame: false
176
177 HLine {
178
179=== modified file 'plugins/Unity/Indicators/qml/IndicatorPage.qml'
180--- plugins/Unity/Indicators/qml/IndicatorPage.qml 2013-08-14 09:07:45 +0000
181+++ plugins/Unity/Indicators/qml/IndicatorPage.qml 2013-08-23 11:34:24 +0000
182@@ -96,18 +96,13 @@
183 }
184 if (item.hasOwnProperty("menu")) {
185 item.menu = Qt.binding(function() { return model; });
186-
187- item.activate.connect(onActivateMenu);
188- item.changeState.connect(onChangeState);
189 }
190 }
191
192- function onActivateMenu(value) {
193- mainMenu.model.activate(index, value);
194- }
195-
196- function onChangeState(value) {
197- mainMenu.model.changeState(index, value);
198+ Binding {
199+ target: item ? item : null
200+ property: "objectName"
201+ value: model.action
202 }
203 }
204 }
205
206=== removed file 'plugins/Unity/Indicators/qml/MenuAction.qml'
207--- plugins/Unity/Indicators/qml/MenuAction.qml 2013-08-14 09:07:45 +0000
208+++ plugins/Unity/Indicators/qml/MenuAction.qml 1970-01-01 00:00:00 +0000
209@@ -1,59 +0,0 @@
210-/*
211- * Copyright 2013 Canonical Ltd.
212- *
213- * This program is free software; you can redistribute it and/or modify
214- * it under the terms of the GNU Lesser General Public License as published by
215- * the Free Software Foundation; version 3.
216- *
217- * This program is distributed in the hope that it will be useful,
218- * but WITHOUT ANY WARRANTY; without even the implied warranty of
219- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
220- * GNU Lesser General Public License for more details.
221- *
222- * You should have received a copy of the GNU Lesser General Public License
223- * along with this program. If not, see <http://www.gnu.org/licenses/>.
224- *
225- * Authors:
226- * Renato Araujo Oliveira Filho <renato@canonical.com>
227- * Nick Dedekind <nick.dedekind@canonical.com>
228- */
229-
230-import QtQuick 2.0
231-
232-/*!
233- \qmltype MenuAction
234- \inqmlmodule Indicators 0.1
235- \brief Helper class to connect to a qmenumodel action
236-
237- Example:
238- \qml
239- BaseMenuItem {
240- id: menuItem
241-
242- Switch {
243- checked: menuAction.state
244- }
245-
246- Indicators.MenuAction {
247- id: menuAction
248- menu: menuItem.menu
249- }
250- }
251- \endqml
252-*/
253-
254-Item {
255- id: menuAction
256-
257- /*!
258- \preliminary
259- The dbus action group object
260- */
261- readonly property string name: menu ? menu.action : ""
262-
263- property QtObject menu: null
264-
265- readonly property var state: menu ? menu.actionState : undefined
266-
267- readonly property bool active: menu ? menu.sensitive : false
268-}
269
270=== modified file 'plugins/Unity/Indicators/qml/MenuItemFactory.qml'
271--- plugins/Unity/Indicators/qml/MenuItemFactory.qml 2013-08-20 19:50:07 +0000
272+++ plugins/Unity/Indicators/qml/MenuItemFactory.qml 2013-08-23 11:34:24 +0000
273@@ -20,6 +20,7 @@
274 import QtQuick 2.0
275 import Unity.Indicators 0.1 as Indicators
276 import Unity.Indicators.Network 0.1 as ICNetwork
277+import QMenuModel 0.1 as QMenuModel
278
279 Item {
280 id: menuFactory
281@@ -47,35 +48,151 @@
282 Component {
283 id: sliderMenu;
284 Indicators.SliderMenuItem {
285+ property QtObject menu: null
286+
287+ text: menu && menu.label ? menu.label : ""
288+ icon: menu ? menu.icon : ""
289+ minIcon: menu.ext.minIcon
290+ maxIcon: menu.ext.maxIcon
291+
292+ minimumValue: menu.ext.minValue ? menu.ext.minValue : 0.0
293+ maximumValue: {
294+ var maximum = menu.ext.maxValue ? menu.ext.maxValue : 1.0
295+ if (maximum <= minimumValue) {
296+ return minimumValue + 1;
297+ }
298+ return maximum;
299+ }
300+ value: menu ? menu.actionState : 0.0
301+ enabled: menu ? menu.sensitive : false
302+
303 Component.onCompleted: {
304 model.loadExtendedAttributes(modelIndex, {'min-value': 'double',
305 'max-value': 'double',
306 'min-icon': 'icon',
307 'max-icon': 'icon'});
308 }
309+
310+ // FIXME: The interval should be [0.0 - 1.0]. Unfortunately, when
311+ // reaching the boundaries (0.0 or 1.0), the value is converted
312+ // to an integer when automatically wrapped in a variant when
313+ // passed to QStateAction::updateState(…). The server chokes on
314+ // those values, complaining that they’re not of the right type…
315+ onChangeState: {
316+ if (value == Math.round(value)) {
317+ if (value >= maximumValue) {
318+ model.changeState(modelIndex, maximumValue - 0.000001);
319+ } else if (value <= minimumValue) {
320+ model.changeState(modelIndex, minimumValue + 0.000001);
321+ } else {
322+ model.changeState(modelIndex, value * 1.000001);
323+ }
324+ } else {
325+ model.changeState(modelIndex, value);
326+ }
327+ }
328 }
329 }
330- Component { id: buttonMenu; Indicators.ButtonMenuItem {} }
331+
332 Component { id: divMenu; Indicators.DivMenuItem {} }
333- Component { id: sectionMenu; Indicators.SectionMenuItem {} }
334- Component { id: progressMenu; Indicators.ProgressMenuItem {} }
335- Component { id: standardMenu; Indicators.StandardMenuItem {} }
336- Component { id: switchMenu; Indicators.SwitchMenuItem {} }
337+
338+ Component {
339+ id: buttonMenu;
340+ Indicators.ButtonMenuItem {
341+ property QtObject menu: null
342+
343+ text: menu && menu.label ? menu.label : ""
344+ enabled: menu ? menu.sensitive : false
345+
346+ onActivate: model.activate(modelIndex);
347+ }
348+ }
349+ Component {
350+ id: sectionMenu;
351+ Indicators.SectionMenuItem {
352+ property QtObject menu: null
353+
354+ text: menu && menu.label ? menu.label : ""
355+ }
356+ }
357+
358+ Component {
359+ id: progressMenu;
360+ Indicators.ProgressMenuItem {
361+ property QtObject menu: null
362+
363+ text: menu && menu.label ? menu.label : ""
364+ icon: menu ? menu.icon : ""
365+ value : menu ? menu.actionState : 0.0
366+ }
367+ }
368+
369+ Component {
370+ id: standardMenu;
371+ Indicators.StandardMenuItem {
372+ property QtObject menu: null
373+
374+ text: menu && menu.label ? menu.label : ""
375+ icon: menu ? menu.icon : ""
376+ checkable: menu ? (menu.isCheck || menu.isRadio) : false
377+ checked: checkable ? menu.isToggled : false
378+ enabled: menu ? menu.sensitive : false
379+
380+ onActivate: model.activate(modelIndex);
381+ }
382+ }
383+
384+ Component {
385+ id: switchMenu;
386+ Indicators.SwitchMenuItem {
387+ property QtObject menu: null
388+
389+ text: menu && menu.label ? menu.label : ""
390+ icon: menu ? menu.icon : ""
391+ checked: menu ? menu.isToggled : false
392+ enabled: menu ? menu.sensitive : false
393+
394+ onActivate: model.activate(modelIndex);
395+ }
396+ }
397+
398 Component {
399 id: wifiSection;
400- ICNetwork.WifiSection {
401+ Indicators.SectionMenuItem {
402+ property QtObject menu: null
403+
404+ text: menu && menu.label ? menu.label : ""
405+ busy: menu ? menu.ext.xCanonicalBusyAction : false
406+
407 Component.onCompleted: {
408 model.loadExtendedAttributes(modelIndex, {'x-canonical-busy-action': 'bool'});
409 }
410 }
411 }
412+
413 Component {
414 id: accessPoint;
415 ICNetwork.AccessPoint {
416+ property QtObject menu: null
417+// property var strenthAction: QMenuModel.UnityMenuAction {
418+// model: menuFactory.model ? menuFactory.model : null
419+// name: menu ? menu.ext.xCanonicalWifiApStrengthAction : ""
420+// }
421+
422+ text: menu && menu.label ? menu.label : ""
423+ icon: menu ? menu.icon : ""
424+ secure: menu ? menu.ext.xCanonicalWifiApIsSecure : false
425+ adHoc: menu ? menu.ext.xCanonicalWifiApIsAdhoc : false
426+ checked: menu ? menu.isToggled : false
427+// signalStrength: strenthAction.valid ? strenthAction.state : 0
428+ enabled: menu ? menu.sensitive : false
429+
430 Component.onCompleted: {
431 model.loadExtendedAttributes(modelIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
432- 'x-canonical-wifi-ap-is-secure': 'bool'});
433+ 'x-canonical-wifi-ap-is-secure': 'bool',
434+ 'x-canonical-wifi-ap-strength-action': 'string'});
435 }
436+ onActivate: model.activate(modelIndex);
437 }
438 }
439
440
441=== modified file 'plugins/Unity/Indicators/qml/ProgressMenuItem.qml'
442--- plugins/Unity/Indicators/qml/ProgressMenuItem.qml 2013-08-14 09:07:45 +0000
443+++ plugins/Unity/Indicators/qml/ProgressMenuItem.qml 2013-08-23 11:34:24 +0000
444@@ -23,10 +23,8 @@
445
446 FramedMenuItem {
447 id: menuItem
448- objectName: menuAction.name
449- enabled: menuAction.active
450
451- property int value : menuAction.state
452+ property int value : 0.0
453
454 control: Label {
455 id: progress
456@@ -37,9 +35,4 @@
457 fontSize: "medium"
458 color: "#e8e1d0"
459 }
460-
461- Indicators.MenuAction {
462- id: menuAction
463- menu: menuItem.menu
464- }
465 }
466
467=== modified file 'plugins/Unity/Indicators/qml/SectionMenuItem.qml'
468--- plugins/Unity/Indicators/qml/SectionMenuItem.qml 2013-08-14 09:07:45 +0000
469+++ plugins/Unity/Indicators/qml/SectionMenuItem.qml 2013-08-23 11:34:24 +0000
470@@ -22,15 +22,15 @@
471 import Ubuntu.Components.ListItems 0.1 as ListItem
472
473 BaseMenuItem {
474- property string label: menu && menu.label ? menu.label : ""
475+ id: menuItem
476+ property alias text: header.text
477 property bool busy: false
478
479- implicitHeight: label !== "" ? header.height : 0
480+ implicitHeight: text !== "" ? header.height : 0
481
482 ListItem.Header {
483 id: header
484
485- text: label
486 height: units.gu(4)
487 anchors {
488 left: parent.left
489
490=== modified file 'plugins/Unity/Indicators/qml/SliderMenuItem.qml'
491--- plugins/Unity/Indicators/qml/SliderMenuItem.qml 2013-08-14 09:07:45 +0000
492+++ plugins/Unity/Indicators/qml/SliderMenuItem.qml 2013-08-23 11:34:24 +0000
493@@ -24,17 +24,20 @@
494
495 FramedMenuItem {
496 id: menuItem
497- objectName: menuAction.name
498- enabled: menuAction.active
499
500 property alias minimumValue: slider.minimumValue
501 property alias maximumValue: slider.maximumValue
502- readonly property double value: menu ? menuAction.state : 0.0
503+ property double value: 0.0
504+
505+ property alias minIcon: leftImage.source
506+ property alias maxIcon: rightImage.source
507
508 property QtObject d: QtObject {
509 property bool enableValueConnection: true
510 }
511
512+ signal changeState(real value)
513+
514 onValueChanged: {
515 // TODO: look into adding a component to manage bi-directional bindings.
516 var oldEnable = d.enableValueConnection
517@@ -58,7 +61,6 @@
518 anchors.verticalCenter: row.verticalCenter
519 height: units.gu(4)
520 width: height
521- source: menu.ext.minIcon
522 }
523
524 Components.Slider {
525@@ -75,19 +77,8 @@
526 value = menuItem.value
527 }
528
529- // FIXME: The interval should be [0.0 - 1.0]. Unfortunately, when
530- // reaching the boundaries (0.0 or 1.0), the value is converted
531- // to an integer when automatically wrapped in a variant when
532- // passed to QStateAction::updateState(…). The server chokes on
533- // those values, complaining that they’re not of the right type…
534- minimumValue: menu.ext.minValue ? menu.ext.minValue * 1.000001 : 0.0000001
535- maximumValue: {
536- var maximum = menu.ext.maxValue ? menu.ext.maxValue * 1.000001 : 0.9999999
537- if (maximum <= minimumValue) {
538- return minimumValue + 1;
539- }
540- return maximum;
541- }
542+ minimumValue: 0.0
543+ maximumValue: 0.1
544
545 // FIXME - to be deprecated in Ubuntu.Components.
546 // Use this to disable the label, since there is not way to do it on the component.
547@@ -109,12 +100,6 @@
548 anchors.verticalCenter: row.verticalCenter
549 height: units.gu(4)
550 width: height
551- source: menu.ext.maxIcon
552 }
553 }
554-
555- Indicators.MenuAction {
556- id: menuAction
557- menu: menuItem.menu
558- }
559 }
560
561=== modified file 'plugins/Unity/Indicators/qml/StandardMenuItem.qml'
562--- plugins/Unity/Indicators/qml/StandardMenuItem.qml 2013-08-14 09:07:45 +0000
563+++ plugins/Unity/Indicators/qml/StandardMenuItem.qml 2013-08-23 11:34:24 +0000
564@@ -23,16 +23,16 @@
565
566 FramedMenuItem {
567 id: menuItem
568- objectName: menuAction.name
569- enabled: menuAction.active
570-
571- readonly property bool checkable: menu ? (menu.isCheck || menu.isRadio) : false
572- readonly property bool checked: checkable ? menu.isToggled : false
573+
574+ property bool checkable: false
575+ property bool checked: false
576+
577+ signal activate()
578
579 // FIXME : need a radio button from sdk
580 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1211866
581 onCheckableChanged: {
582- if (menu && checkable) {
583+ if (checkable) {
584 icon = checkComponent.createObject(menuItem);
585 }
586 }
587@@ -68,9 +68,4 @@
588 }
589 }
590 }
591-
592- Indicators.MenuAction {
593- id: menuAction
594- menu: menuItem.menu
595- }
596 }
597
598=== modified file 'plugins/Unity/Indicators/qml/SwitchMenuItem.qml'
599--- plugins/Unity/Indicators/qml/SwitchMenuItem.qml 2013-08-14 09:07:45 +0000
600+++ plugins/Unity/Indicators/qml/SwitchMenuItem.qml 2013-08-23 11:34:24 +0000
601@@ -24,10 +24,10 @@
602
603 FramedMenuItem {
604 id: menuItem
605- objectName: menuAction.name
606- enabled: menuAction.enabled
607-
608- readonly property bool checked: menu ? menu.isToggled : false
609+
610+ property bool checked: false
611+
612+ signal activate()
613
614 onCheckedChanged: {
615 // Can't rely on binding. Checked is assigned on click.
616@@ -50,9 +50,4 @@
617 menuItem.activate();
618 }
619 }
620-
621- Indicators.MenuAction {
622- id: menuAction
623- menu: menuItem.menu
624- }
625 }
626
627=== modified file 'plugins/Unity/Indicators/qml/qmldir'
628--- plugins/Unity/Indicators/qml/qmldir 2013-08-14 09:07:45 +0000
629+++ plugins/Unity/Indicators/qml/qmldir 2013-08-23 11:34:24 +0000
630@@ -11,7 +11,6 @@
631 IndicatorBase 0.1 IndicatorBase.qml
632 IndicatorPage 0.1 IndicatorPage.qml
633 IndicatorWidget 0.1 IndicatorWidget.qml
634-MenuAction 0.1 MenuAction.qml
635 MenuActionBinding 0.1 MenuActionBinding.qml
636 MenuItemFactory 0.1 MenuItemFactory.qml
637 ProgressMenuItem 0.1 ProgressMenuItem.qml

Subscribers

People subscribed via source and target branches