Merge lp:~macslow/unity8/fix-1305885 into lp:unity8

Proposed by Mirco Müller
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1068
Merged at revision: 1149
Proposed branch: lp:~macslow/unity8/fix-1305885
Merge into: lp:unity8
Diff against target: 36 lines (+8/-0)
2 files modified
qml/Notifications/Notification.qml (+3/-0)
qml/Notifications/NotificationMenuItemFactory.qml (+5/-0)
To merge this branch: bzr merge lp:~macslow/unity8/fix-1305885
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+227726@code.launchpad.net

Commit message

Allow ENTER/RETURN in a TextField to accept a snap-decision notification.

Description of the change

Allow ENTER/RETURN in a TextField to accept a snap-decision notification.

* Are there any related MPs required for this MP to build/function as expected? Please list.
No.

* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.

* Did you make sure that your branch does not contain spurious tags?
Yes.

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
Not applicable.

* If you changed the UI, has there been a design review?
Not applicable.

To post a comment you must log in.
lp:~macslow/unity8/fix-1305885 updated
1063. By Mirco Müller

Replaced findChild() with signal-based solution to allow the TextField's accept method to trigger the notifications accept-action.

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
Michael Zanetti (mzanetti) wrote :

See inline

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

Bump?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~macslow/unity8/fix-1305885 updated
1064. By Mirco Müller

Merged with trunk

1065. By Mirco Müller

Made code a bit tighter.

Revision history for this message
Mirco Müller (macslow) wrote :

Fixed mentioned issues.

lp:~macslow/unity8/fix-1305885 updated
1066. By Mirco Müller

Argl!

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

I think a test would make sense here... Could we add one?

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote :

code looks ok to me now.

Revision history for this message
Mirco Müller (macslow) wrote :

I'm adding a qml-test just now.

Revision history for this message
Mirco Müller (macslow) wrote :

Mocking the needed UnityMenuModel hint to trigger a snap-decision with a TextEntry isn't very straight forward for a qml-test currently. We need to look into this later.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Sorry, I just realized you're reaching out of context with the notification.accept() call.

Why not just adding the acceped() signal to NotificationMenuItemFactory.qml and then add the handler inside the NotificationMenuItemFactory {} in Notification.qml?

review: Needs Fixing
lp:~macslow/unity8/fix-1305885 updated
1067. By Mirco Müller

Avoid using accessing notification in MenuItemFactory.

1068. By Mirco Müller

Merged with trunk *sigh*

Revision history for this message
Mirco Müller (macslow) wrote :

Updated the branch with suggested fix.

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

ok. happy now :)

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yip yip

 * Did CI run pass? If not, please explain why.

no... unrelated failures

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Notifications/Notification.qml'
2--- qml/Notifications/Notification.qml 2014-07-17 09:37:51 +0000
3+++ qml/Notifications/Notification.qml 2014-08-08 11:04:22 +0000
4@@ -311,6 +311,9 @@
5 onLoaded: {
6 notification.fullscreen = Qt.binding(function() { return fullscreen; });
7 }
8+ onAccepted: {
9+ notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
10+ }
11 }
12 }
13 }
14
15=== modified file 'qml/Notifications/NotificationMenuItemFactory.qml'
16--- qml/Notifications/NotificationMenuItemFactory.qml 2014-07-22 12:13:02 +0000
17+++ qml/Notifications/NotificationMenuItemFactory.qml 2014-08-08 11:04:22 +0000
18@@ -30,6 +30,8 @@
19 property int maxHeight
20 readonly property bool fullscreen: menuData.type === "com.canonical.snapdecision.pinlock"
21
22+ signal accepted()
23+
24 property var _map: {
25 "com.canonical.snapdecision.textfield": textfield,
26 "com.canonical.snapdecision.pinlock" : pinLock,
27@@ -82,6 +84,9 @@
28 onTextChanged: {
29 menuModel.changeState(menuIndex, text);
30 }
31+ onAccepted: {
32+ menuFactory.accepted()
33+ }
34 }
35
36 Row {

Subscribers

People subscribed via source and target branches