Merge lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Resize into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 420
Merged at revision: 426
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Resize
Merge into: lp:ubuntu-calendar-app
Diff against target: 83 lines (+23/-10)
2 files modified
EventBubble.qml (+17/-0)
TimeLineBase.qml (+6/-10)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Resize
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Mihir Soni Approve
Review via email: mp+232660@code.launchpad.net

Commit message

Resolves Bug #1360325

Resizing event bubble when calendar resizes.

Description of the change

Resolves Bug #1360325

Resizing event bubble when calendar resizes.

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: Approve (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me kunal.

Thanks for MR

review: Approve
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 :

Not sure if this is related with Jenkins failure,

Fail to connect with sync monitor: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name com.canonical.SyncMonitor was not provided by any .service files")
}}}
/tmp/hudson7719098133570284605.sh: line 83: 26977 Terminated qmlscene /tmp/main.qml
+ autopilot_result=1
+ set -e

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
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
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

What's going on here? It doesn't look like it even creates an event at all..

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/calendar_app/tests/test_new_event.py", line 99, in test_add_new_event_with_default_values
    day_view, test_event = self._add_event()
  File "/usr/lib/python2.7/dist-packages/calendar_app/tests/test_new_event.py", line 63, in _add_event
    start_num_events = len(day_view.get_events())
  File "/usr/lib/python2.7/dist-packages/autopilot/logging.py", line 46, in inner
    return f(instance, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/calendar_app/emulators.py", line 258, in get_events
    events.append(event.get_information())
  File "/usr/lib/python2.7/dist-packages/calendar_app/emulators.py", line 380, in get_information
    start_time, end_time = self._get_start_and_end_time()
  File "/usr/lib/python2.7/dist-packages/calendar_app/emulators.py", line 386, in _get_start_and_end_time
    start_time, end_time = time_label.text.split(' - ')
ValueError: need more than 1 value to unpack

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'EventBubble.qml'
2--- EventBubble.qml 2014-08-18 16:48:54 +0000
3+++ EventBubble.qml 2014-08-29 00:50:44 +0000
4@@ -28,6 +28,9 @@
5 property int wideType: 1;
6 property int narrowType: 2;
7
8+ property int depthInRow: 0;
9+ property int sizeOfRow:0
10+
11 property Flickable flickable;
12
13 readonly property int minimumHeight: timeLabel.height + /*top-bottom margin*/ units.gu(2)
14@@ -41,7 +44,21 @@
15 gradientColor: "#F5F5F5"
16 }
17
18+ function resize() {
19+ var offset = parent.width/sizeOfRow;
20+ x = (depthInRow) * offset;
21+ width = parent.width - x;
22+ }
23+
24+ Connections{
25+ target: parent
26+ onWidthChanged:{
27+ resize();
28+ }
29+ }
30+
31 onEventChanged: {
32+ resize();
33 setDetails();
34 }
35
36
37=== modified file 'TimeLineBase.qml'
38--- TimeLineBase.qml 2014-08-22 22:44:25 +0000
39+++ TimeLineBase.qml 2014-08-29 00:50:44 +0000
40@@ -66,20 +66,16 @@
41 }
42 }
43
44- function layoutEvents(array, depth) {
45- var width = bubbleOverLay.width;
46- var offset = width/(depth+1);
47+ function layoutEvents(array, depth) {
48 for(var i=0; i < array.length ; ++i) {
49 var schedule = array[i];
50- var x = (schedule.depth) * offset
51- var w = width - x;
52 var event = intern.eventMap[schedule.id];
53- bubbleOverLay.createEvent(event , x, w);
54+ bubbleOverLay.createEvent(event , schedule.depth, depth +1);
55 }
56 }
57
58 function createEvents() {
59- if(!bubbleOverLay || bubbleOverLay == undefined) {
60+ if(!bubbleOverLay || bubbleOverLay == undefined || model === undefined) {
61 return;
62 }
63
64@@ -152,7 +148,7 @@
65 return unUsedBubble;
66 }
67
68- function createEvent( event, x, width ) {
69+ function createEvent( event, depth, sizeOfRow ) {
70 var eventBubble;
71 if( isHashEmpty(intern.unUsedEvents) ) {
72 eventBubble = delegate.createObject(bubbleOverLay);
73@@ -171,8 +167,8 @@
74 eventBubble.height = (height > eventBubble.minimumHeight) ? height:eventBubble.minimumHeight ;
75
76 eventBubble.model = bubbleOverLay.model
77- eventBubble.x = x;
78- eventBubble.width = width;
79+ eventBubble.depthInRow = depth;
80+ eventBubble.sizeOfRow = sizeOfRow;
81 eventBubble.event = event
82 eventBubble.visible = true;
83 eventBubble.clicked.connect( bubbleOverLay.showEventDetails );

Subscribers

People subscribed via source and target branches

to status/vote changes: