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
=== modified file 'calendar.qml'
--- calendar.qml 2013-07-31 13:11:28 +0000
+++ calendar.qml 2013-08-02 05:23:27 +0000
@@ -15,58 +15,64 @@
15 id: pageStack15 id: pageStack
1616
17 Component.onCompleted: push(monthViewPage)17 Component.onCompleted: push(monthViewPage)
18 __showHeader: false
1918
20 Page {19 Page {
21 id: monthViewPage20 id: monthViewPage
2221
23 // Fix for UITK detecting any Flickable as a vertical flickable22 tools: ToolbarItems {
24 // This line can be removed after https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/internalizePropagated/+merge/16496323 ToolbarButton {
25 // was merged into the UITK.24 action: Action {
26 flickable: null25 iconSource: Qt.resolvedUrl("avatar.png")
2726 text: i18n.tr("To-do")
28 tools: ToolbarActions {27 onTriggered:; // FIXME
29 Action {28 }
30 iconSource: Qt.resolvedUrl("avatar.png")29 }
31 text: i18n.tr("To-do")30 ToolbarButton {
32 onTriggered:; // FIXME31 action: Action {
33 }32 objectName: "neweventbutton"
34 Action {33 iconSource: Qt.resolvedUrl("avatar.png")
35 objectName: "neweventbutton"34 text: i18n.tr("New Event")
36 iconSource: Qt.resolvedUrl("avatar.png")35 onTriggered: monthViewPage.newEvent()
37 text: i18n.tr("New Event")36 }
38 onTriggered: monthViewPage.newEvent()37 }
39 }38 ToolbarButton {
40 Action {39 action: Action {
41 objectName: "timelinebutton"40 objectName: "timelinebutton"
42 iconSource: Qt.resolvedUrl("avatar.png")41 iconSource: Qt.resolvedUrl("avatar.png")
43 text: i18n.tr("Timeline")42 text: i18n.tr("Timeline")
44 onTriggered: {43 onTriggered: {
45 if( eventView.eventViewType === "DiaryView.qml") {44 if( eventView.eventViewType === "DiaryView.qml") {
46 eventView.eventViewType = "TimeLineView.qml";45 eventView.eventViewType = "TimeLineView.qml";
47 text = i18n.tr("Diary")46 text = i18n.tr("Diary")
48 } else {47 } else {
49 eventView.eventViewType = "DiaryView.qml";48 eventView.eventViewType = "DiaryView.qml";
50 text = i18n.tr("Timeline")49 text = i18n.tr("Timeline")
51 }50 }
52 }51 }
53 }52 }
54 Action {53 }
55 iconSource: Qt.resolvedUrl("avatar.png");54 ToolbarButton {
56 text: i18n.tr("Today");55 action: Action {
57 onTriggered: {56 iconSource: Qt.resolvedUrl("avatar.png");
58 monthView.goToToday();57 text: i18n.tr("Today");
59 }58 onTriggered: {
60 }59 monthView.goToToday();
61 Action {60 }
62 iconSource: Qt.resolvedUrl("avatar.png")61 }
63 text: i18n.tr("Year view")62 }
64 onTriggered: pageStack.push(yearView);63 ToolbarButton {
65 }64 action: Action {
66 Action {65 iconSource: Qt.resolvedUrl("avatar.png")
67 iconSource: Qt.resolvedUrl("avatar.png")66 text: i18n.tr("Year view")
68 text: i18n.tr("Week view")67 onTriggered: pageStack.push(yearView);
69 onTriggered: pageStack.push(weekView);68 }
69 }
70 ToolbarButton {
71 action: Action {
72 iconSource: Qt.resolvedUrl("avatar.png")
73 text: i18n.tr("Week view")
74 onTriggered: pageStack.push(weekView);
75 }
70 }76 }
71 }77 }
7278
7379
=== modified file 'tests/autopilot/calendar_app/emulators/ubuntusdk.py'
--- tests/autopilot/calendar_app/emulators/ubuntusdk.py 2013-07-15 17:52:21 +0000
+++ tests/autopilot/calendar_app/emulators/ubuntusdk.py 2013-08-02 05:23:27 +0000
@@ -92,26 +92,26 @@
92 """Returns the toolbar in the main events view."""92 """Returns the toolbar in the main events view."""
93 return self.app.select_single("Toolbar")93 return self.app.select_single("Toolbar")
9494
95 def get_toolbar_buttons(self):
96 """Returns the list of buttons in the toolbar"""
97 toolbar = self.get_toolbar()
98 items = toolbar.select_single("ToolbarItems")
99 return items.select_many("ActionItem")
100
95 def get_toolbar_button(self, buttonLabel):101 def get_toolbar_button(self, buttonLabel):
96 """Returns the toolbar button at position index"""102 """Returns the toolbar button with a given label"""
97 toolbar = self.get_toolbar()103 # FIXME: this is not reliable as labels may be localized
98 if not toolbar.opened:104 buttons = self.get_toolbar_buttons()
99 self.open_toolbar()105 for button in buttons:
100 row = toolbar.select_single("QQuickRow")106 if button.text == buttonLabel:
101 loaderList = row.select_many("QQuickLoader")107 return button
102 for loader in loaderList:108 return None
103 buttonList = loader.select_many("Button")
104 for button in buttonList:
105 if button.text == buttonLabel:
106 return button
107109
108 def click_toolbar_button(self, buttonLabel):110 def click_toolbar_button(self, buttonLabel):
109 """Clicks the toolbar button with buttonLabel"""111 """Clicks the toolbar button with buttonLabel"""
110 #The toolbar button is assumed to be the following format112 toolbar = self.get_toolbar()
111 #ToolbarActions {113 if not toolbar.opened:
112 # Action {114 self.open_toolbar()
113 # objectName: "name"
114 # text: value
115 button = self.get_toolbar_button(buttonLabel)115 button = self.get_toolbar_button(buttonLabel)
116 self.autopilot.pointing_device.click_object(button)116 self.autopilot.pointing_device.click_object(button)
117117

Subscribers

People subscribed via source and target branches

to status/vote changes: