Merge lp:~osomon/ubuntu-calendar-app/fix-deprecation-warnings into lp:ubuntu-calendar-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Kunal Parmar
Approved revision: 85
Merged at revision: 81
Proposed branch: lp:~osomon/ubuntu-calendar-app/fix-deprecation-warnings
Merge into: lp:ubuntu-calendar-app
Diff against target: 162 lines (+70/-64)
2 files modified
calendar.qml (+54/-48)
tests/autopilot/calendar_app/emulators/ubuntusdk.py (+16/-16)
To merge this branch: bzr merge lp:~osomon/ubuntu-calendar-app/fix-deprecation-warnings
Reviewer Review Type Date Requested Status
Kunal Parmar Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+178082@code.launchpad.net

Commit message

Remove unnecessary code, and update deprecated code to use newer APIs.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Looks good,
I added one more toolbar button with WeekView branch, I think it will cause some conflict, so lets wait it its merged completely.

83. By Olivier Tilloy

Merge the latest changes from trunk.

84. By Olivier Tilloy

Make the newly added Action a ToolbarButton.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
85. By Olivier Tilloy

Update autopilot tests to detect correctly the new toolbar buttons.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

looks good now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'calendar.qml'
2--- calendar.qml 2013-07-31 13:11:28 +0000
3+++ calendar.qml 2013-08-02 05:23:27 +0000
4@@ -15,58 +15,64 @@
5 id: pageStack
6
7 Component.onCompleted: push(monthViewPage)
8- __showHeader: false
9
10 Page {
11 id: monthViewPage
12
13- // Fix for UITK detecting any Flickable as a vertical flickable
14- // This line can be removed after https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/internalizePropagated/+merge/164963
15- // was merged into the UITK.
16- flickable: null
17-
18- tools: ToolbarActions {
19- Action {
20- iconSource: Qt.resolvedUrl("avatar.png")
21- text: i18n.tr("To-do")
22- onTriggered:; // FIXME
23- }
24- Action {
25- objectName: "neweventbutton"
26- iconSource: Qt.resolvedUrl("avatar.png")
27- text: i18n.tr("New Event")
28- onTriggered: monthViewPage.newEvent()
29- }
30- Action {
31- objectName: "timelinebutton"
32- iconSource: Qt.resolvedUrl("avatar.png")
33- text: i18n.tr("Timeline")
34- onTriggered: {
35- if( eventView.eventViewType === "DiaryView.qml") {
36- eventView.eventViewType = "TimeLineView.qml";
37- text = i18n.tr("Diary")
38- } else {
39- eventView.eventViewType = "DiaryView.qml";
40- text = i18n.tr("Timeline")
41- }
42- }
43- }
44- Action {
45- iconSource: Qt.resolvedUrl("avatar.png");
46- text: i18n.tr("Today");
47- onTriggered: {
48- monthView.goToToday();
49- }
50- }
51- Action {
52- iconSource: Qt.resolvedUrl("avatar.png")
53- text: i18n.tr("Year view")
54- onTriggered: pageStack.push(yearView);
55- }
56- Action {
57- iconSource: Qt.resolvedUrl("avatar.png")
58- text: i18n.tr("Week view")
59- onTriggered: pageStack.push(weekView);
60+ tools: ToolbarItems {
61+ ToolbarButton {
62+ action: Action {
63+ iconSource: Qt.resolvedUrl("avatar.png")
64+ text: i18n.tr("To-do")
65+ onTriggered:; // FIXME
66+ }
67+ }
68+ ToolbarButton {
69+ action: Action {
70+ objectName: "neweventbutton"
71+ iconSource: Qt.resolvedUrl("avatar.png")
72+ text: i18n.tr("New Event")
73+ onTriggered: monthViewPage.newEvent()
74+ }
75+ }
76+ ToolbarButton {
77+ action: Action {
78+ objectName: "timelinebutton"
79+ iconSource: Qt.resolvedUrl("avatar.png")
80+ text: i18n.tr("Timeline")
81+ onTriggered: {
82+ if( eventView.eventViewType === "DiaryView.qml") {
83+ eventView.eventViewType = "TimeLineView.qml";
84+ text = i18n.tr("Diary")
85+ } else {
86+ eventView.eventViewType = "DiaryView.qml";
87+ text = i18n.tr("Timeline")
88+ }
89+ }
90+ }
91+ }
92+ ToolbarButton {
93+ action: Action {
94+ iconSource: Qt.resolvedUrl("avatar.png");
95+ text: i18n.tr("Today");
96+ onTriggered: {
97+ monthView.goToToday();
98+ }
99+ }
100+ }
101+ ToolbarButton {
102+ action: Action {
103+ iconSource: Qt.resolvedUrl("avatar.png")
104+ text: i18n.tr("Year view")
105+ onTriggered: pageStack.push(yearView);
106+ }
107+ }
108+ ToolbarButton {
109+ action: Action {
110+ iconSource: Qt.resolvedUrl("avatar.png")
111+ text: i18n.tr("Week view")
112+ onTriggered: pageStack.push(weekView);
113+ }
114 }
115 }
116
117
118=== modified file 'tests/autopilot/calendar_app/emulators/ubuntusdk.py'
119--- tests/autopilot/calendar_app/emulators/ubuntusdk.py 2013-07-15 17:52:21 +0000
120+++ tests/autopilot/calendar_app/emulators/ubuntusdk.py 2013-08-02 05:23:27 +0000
121@@ -92,26 +92,26 @@
122 """Returns the toolbar in the main events view."""
123 return self.app.select_single("Toolbar")
124
125+ def get_toolbar_buttons(self):
126+ """Returns the list of buttons in the toolbar"""
127+ toolbar = self.get_toolbar()
128+ items = toolbar.select_single("ToolbarItems")
129+ return items.select_many("ActionItem")
130+
131 def get_toolbar_button(self, buttonLabel):
132- """Returns the toolbar button at position index"""
133- toolbar = self.get_toolbar()
134- if not toolbar.opened:
135- self.open_toolbar()
136- row = toolbar.select_single("QQuickRow")
137- loaderList = row.select_many("QQuickLoader")
138- for loader in loaderList:
139- buttonList = loader.select_many("Button")
140- for button in buttonList:
141- if button.text == buttonLabel:
142- return button
143+ """Returns the toolbar button with a given label"""
144+ # FIXME: this is not reliable as labels may be localized
145+ buttons = self.get_toolbar_buttons()
146+ for button in buttons:
147+ if button.text == buttonLabel:
148+ return button
149+ return None
150
151 def click_toolbar_button(self, buttonLabel):
152 """Clicks the toolbar button with buttonLabel"""
153- #The toolbar button is assumed to be the following format
154- #ToolbarActions {
155- # Action {
156- # objectName: "name"
157- # text: value
158+ toolbar = self.get_toolbar()
159+ if not toolbar.opened:
160+ self.open_toolbar()
161 button = self.get_toolbar_button(buttonLabel)
162 self.autopilot.pointing_device.click_object(button)
163

Subscribers

People subscribed via source and target branches

to status/vote changes: