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

Proposed by Kunal Parmar
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 247
Merged at revision: 354
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/CalManagement
Merge into: lp:ubuntu-calendar-app
Diff against target: 571 lines (+312/-31)
11 files modified
AgendaView.qml (+9/-24)
CalendarChoicePopup.qml (+115/-0)
ColorPickerDialog.qml (+45/-0)
DayView.qml (+1/-0)
EventListModel.qml (+12/-0)
MonthComponent.qml (+1/-1)
NewEvent.qml (+50/-1)
TimeLineBase.qml (+3/-2)
TimeLineBaseComponent.qml (+1/-0)
WeekView.qml (+2/-0)
calendar.qml (+73/-3)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/CalManagement
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
David Planella Needs Information
Renato Araujo Oliveira Filho (community) Approve
Review via email: mp+213355@code.launchpad.net

Commit message

Calendar management feature added, here is how it looks/works
http://www.youtube.com/watch?v=HZz0c_CnlYI&feature=youtu.be

Note: Following EDS changes are required to test it
https://code.launchpad.net/~renatofilho/qtorganizer5-eds/fix-1295180/+merge/212218

Description of the change

Calendar management feature added, here is how it looks/works
http://www.youtube.com/watch?v=HZz0c_CnlYI&feature=youtu.be

Note: Following EDS changes are required to test it
https://code.launchpad.net/~renatofilho/qtorganizer5-eds/fix-1295180/+merge/212218

To post a comment you must log in.
216. By Kunal Parmar

Removed unnecessary code

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: Needs Fixing (continuous-integration)
217. By Kunal Parmar

Dummy Commit

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 :

I don't understand why this fails in Jenkins. Will ask fginther to review.

Revision history for this message
Michael Hall (mhall119) wrote :

The links qtorganizer5-eds MP has been approved now

218. By Kunal Parmar

Merge from Trunk

219. By Kunal Parmar

Collection filter logic improved

220. By Kunal Parmar

Minor changes

221. By Kunal Parmar

Error removed

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: Approve (continuous-integration)
222. By Kunal Parmar

merge from trunk

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
Victor Thompson (vthompson) wrote :

I get the same failure on the device as Jenkins sees:

Traceback (most recent call last):
File "/home/phablet/autopilot/calendar_app/tests/test_calendar.py", line 94, in test_new_event
self.main_view.open_toolbar().click_button("todaybutton")
File "/usr/lib/python3/dist-packages/autopilot/logging.py", line 46, in inner
return f(instance, *args, **kwargs)
File "/usr/lib/python3/dist-packages/ubuntuuitoolkit/emulators.py", line 294, in click_button
'Button with objectName "{0}" not found.'.format(object_name))
ubuntuuitoolkit.emulators.ToolkitEmulatorException: Button with objectName "todaybutton" not found.

I also get this failure on the device:

======================================================================
ERROR: unittest.loader.ModuleImportFailure.calendar_app.tests.test_monthview
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/autopilot/run.py", line 420, in _filter_tests
test.debug()
File "/usr/lib/python3.4/unittest/case.py", line 627, in debug
getattr(self, self._testMethodName)()
File "/usr/lib/python3.4/unittest/loader.py", line 32, in testFailure
raise exception
ImportError: Failed to import test module: calendar_app.tests.test_monthview
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/loader.py", line 312, in _find_tests
module = self._get_module_from_name(name)
File "/usr/lib/python3.4/unittest/loader.py", line 290, in _get_module_from_name
__import__(name)
File "/home/phablet/autopilot/calendar_app/tests/test_monthview.py", line 20, in <module>
from dateutil.relativedelta import relativedelta
ImportError: No module named 'dateutil'

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> File "/home/phablet/autopilot/calendar_app/tests/test_monthview.py", line 20, in <module>
from dateutil.relativedelta import relativedelta
ImportError: No module named 'dateutil'

For this, I think you need to install dateutil python module.

>'Button with objectName "{0}" not found.'.format(object_name))
ubuntuuitoolkit.emulators.ToolkitEmulatorException: Button with objectName "todaybutton" not found.

I am not sure why its not able to find todayButton.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

BTW if you have some suggestion for colors in Calendar's Color, that we can use, please do, I will add those to color picker.

Revision history for this message
Victor Thompson (vthompson) wrote :

Thanks, yep, installing python-dateutil fixed the first issue.

I'll look a bit into the second issue.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Tested on mako, worked well. Only improvement I can see is maybe reducing the font size in the calendar list as they all seem too large to me and run into the tickbox.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

56 + for(var i=0; i < collections.length ; ++i) {
57 + var collection = collections[i]
58 + if(collection.extendedMetaData("collection-selected") === true) {
59 + collectionIds.push(collection.collectionId);
60 + }
61 + }

Should you save even if the collection is un-selected? In case of the user un-select the collection, and want to save that state?

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

> 56 + for(var i=0; i < collections.length ; ++i) {
> 57 + var collection = collections[i]
> 58 + if(collection.extendedMetaData("collection-
> selected") === true) {
> 59 +
> collectionIds.push(collection.collectionId);
> 60 + }
> 61 + }
>
> Should you save even if the collection is un-selected? In case of the user un-
> select the collection, and want to save that state?

Sorry, my bad. Now I understand you are creating the filter.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Just a opinion here:
53 + onTriggered: {
54 + var collectionIds = [];
55 + var collections = calendarsList.model;
56 + for(var i=0; i < collections.length ; ++i) {
57 + var collection = collections[i]
58 + if(collection.extendedMetaData("collection-selected") === true) {
59 + collectionIds.push(collection.collectionId);
60 + }
61 + }
62 +
63 + var calFilter = Qt.createQmlObject("import QtOrganizer 5.0; CollectionFilter{}", root, "CalendarChoice.qml");
64 + calFilter.ids = collectionIds;
65 + model.filter = calFilter;
66 + pageStack.pop();
67 + }

This will be more QML "friendly" :D if you do something like:

53 + onTriggered: {
54 + var collectionIds = []
55 + var collections = calendarsList.model;
56 + for(var i=0; i < collections.length ; ++i) {
57 + var collection = collections[i]
58 + if(collection.extendedMetaData("collection-selected") === true) {
59 + collectionIds.push(collection.collectionId);
60 + }
61 + }
65 + model.filter.ids = collectionIds;
66 + pageStack.pop();
67 + }

Should not be necessary to recreate the filter every time, you can use the old filter instead.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Where do you save the collection after the user select or unselect it?
This should be saved back in the model.

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
Nicholas Skaggs (nskaggs) wrote :

The reason the test is failing is because new events aren't saving properly. Try running the app and making a new event. It doesn't leave the new event screen, no matter how much I press 'save' :-)

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Just affirming trunk does not suffer from this issue. New events can be properly saved.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Tested on mako, worked well. Only improvement I can see is maybe reducing the
> font size in the calendar list as they all seem too large to me and run into
> the tickbox.

ok, will change font to meduim

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Where do you save the collection after the user select or unselect it?
> This should be saved back in the model.

If user change the color then I save collection like this

136 + var collection = root.model.collection(modelData.collectionId);
137 + collection.color = color;
138 + root.model.saveCollection(collection);
139 + })

But if user just select and unselect the collection for filtering event. I just do the following.

152 + onCheckedChanged: {
153 + modelData.setExtendedMetaData("collection-selected",checkBox.checked)
154 + }

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Ok, but if the user quit the app and open again? The selected
calendars will be different since you did not save the options.

On Wed, Apr 16, 2014 at 10:12 AM, Kunal Parmar <email address hidden> wrote:
>> Where do you save the collection after the user select or unselect it?
>> This should be saved back in the model.
>
> If user change the color then I save collection like this
>
> 136 + var collection = root.model.collection(modelData.collectionId);
> 137 + collection.color = color;
> 138 + root.model.saveCollection(collection);
> 139 + })
>
> But if user just select and unselect the collection for filtering event. I just do the following.
>
> 152 + onCheckedChanged: {
> 153 + modelData.setExtendedMetaData("collection-selected",checkBox.checked)
> 154 + }
> --
> https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/CalManagement/+merge/213355
> You are requested to review the proposed merge of lp:~pkunal-parmar/ubuntu-calendar-app/CalManagement into lp:ubuntu-calendar-app.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Ok, but if the user quit the app and open again? The selected
> calendars will be different since you did not save the options.

Ok, Then I will save collection when user select/unselect checkbox.
Thanks for pointing it out.

223. By Kunal Parmar

review

224. By Kunal Parmar

review comment addressed

225. By Kunal Parmar

Newevent fix

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

minor changes

227. By Kunal Parmar

Unnecessary changes removed

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
Albert Astals Cid (aacid) wrote :

The crash looks like qtpim related to me after doing some debugging. https://codereview.qt-project.org/#change,83696

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks good

review: Approve
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

I built a package including Albert's patch

https://launchpad.net/~popey/+archive/qtpim/+build/5916407

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Have you had a chance to test with the "fixed" qtpim from my ppa?

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Have you had a chance to test with the "fixed" qtpim from my ppa?

I tested, but I don't see any difference. I will try once again after system update.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Is this blocking on something else? Do we need to get Albert or upstream Qt involved?

Revision history for this message
David Planella (dpm) wrote :

Changing review as Needs Information as per the last comments

review: Needs Information
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

I have asked Albert if he can help us debug the crash which is easily reproducible with this branch:-

Grab this branch
Add this ppa https://launchpad.net/~popey/+archive/qtpim and update/upgrade
In system system-settings -> online accounts I have 2x google accounts (one personal, one work) which I enabled calendar sync on. (I have also tried with only one account active).
Start the calendar app with qmlscene calendar.qml
After a short while navigating around it crashes:-

(qmlscene:21334): GLib-GObject-CRITICAL **: g_object_unref: assertion
'G_IS_OBJECT (object)' failed
Segmentation fault (core dumped)

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

It crashes on Utopic image as well on device

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Albert ran this under valgrind and found it's still crashing in qtorganized-eds

==16142== Invalid write of size 8
==16142== at 0x230989DA: RequestData::cancel() (in /usr/lib/x86_64-linux-gnu/qt5/plugins/organizer/libqtorganizer_eds.so)
==16142== by 0x2308858A: QOrganizerEDSEngine::cancelRequest(QtOrganizer::QOrganizerAbstractRequest*) (in /usr/lib/x86_64-linux-gnu/qt5/plugins/organizer/libqtorganizer_eds.so)
==16142== by 0x1EC266FA: QtOrganizer::QOrganizerAbstractRequest::cancel() (in /usr/lib/x86_64-linux-gnu/libQt5Organizer.so.5.0.0)
==16142== by 0x21F3A322: ??? (in /usr/lib/x86_64-linux-gnu/qt5/qml/QtOrganizer/libdeclarative_organizer.so)
==16142== by 0x21F3AA53: ??? (in /usr/lib/x86_64-linux-gnu/qt5/qml/QtOrganizer/libdeclarative_organizer.so)
==16142== by 0x21F42DC4: ??? (in /usr/lib/x86_64-linux-gnu/qt5/qml/QtOrganizer/libdeclarative_organizer.so)
==16142== by 0x6ACF22D: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==16142== by 0x5B03C8B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
==16142== by 0x5B08E55: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)
==16142== by 0x6AA6C2C: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==16142== by 0x6AA8E06: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==16142== by 0x6AF3CD2: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==16142== Address 0x33ab75c8 is 56 bytes inside a block of size 96 free'd
==16142== at 0x4C2C2BC: operator delete(void*) (vg_replace_malloc.c:503)
==16142== by 0x23314374: ??? (in /usr/lib/libecal-1.2.so.16.0.0)
==16142== by 0x23319FA1: ??? (in /usr/lib/libecal-1.2.so.16.0.0)
==16142== by 0x1410EEF6: g_simple_async_result_complete (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4000.0)
==16142== by 0x1410EF78: complete_in_idle_cb_for_thread (in /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.4000.0)
==16142== by 0x831DCE4: g_main_context_dispatch (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
==16142== by 0x831E047: g_main_context_iterate.isra.24 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
==16142== by 0x831E0EB: g_main_context_iteration (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
==16142== by 0x6AF398B: QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==16142== by 0x23085FC6: QOrganizerEDSEngine::waitForRequestFinished(QtOrganizer::QOrganizerAbstractRequest*, int) (in /usr/lib/x86_64-linux-gnu/qt5/plugins/organizer/libqtorganizer_eds.so)
==16142== by 0x230989D9: RequestData::cancel() (in /usr/lib/x86_64-linux-gnu/qt5/plugins/organizer/libqtorganizer_eds.so)
==16142== by 0x2308858A: QOrganizerEDSEngine::cancelRequest(QtOrganizer::QOrganizerAbstractRequest*) (in /usr/lib/x86_64-linux-gnu/qt5/plugins/organizer/libqtorganizer_eds.so)

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

To reproduce

#plug phone in
bzr branch lp:~pkunal-parmar/ubuntu-calendar-app/CalManagement ./ubuntu-calendar-app
click-buddy --dir ubuntu-calendar-app/ --provision
# Setup google account(s) on device and enable calendar sync on them
# Let sync monitor do its thing
# Open calendar app
# Open Calendar management from the bottom toolbar.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :
Download full text (5.0 KiB)

I was unable to reproduce the same crash, using popey steps I go a different crash as you can see in the log bellow:

#1 0xb0d50a50 in ~QDeclarativeOrganizerModelPrivate (this=0x6c4ce0, __in_chrg=<optimized out>) at qdeclarativeorganizermodel.cpp:115
#2 cleanup (pointer=0x6c4ce0) at /usr/include/qt5/QtCore/qscopedpointer.h:62
#3 ~QScopedPointer (this=0x6c4c30, __in_chrg=<optimized out>) at /usr/include/qt5/QtCore/qscopedpointer.h:109
#4 QDeclarativeOrganizerModel::~QDeclarativeOrganizerModel (this=0x6c4c20, __in_chrg=<optimized out>) at qdeclarativeorganizermodel.cpp:209
#5 0xb0d311fc in ~QQmlElement (this=0x6c4c20, __in_chrg=<optimized out>) at /usr/include/qt5/QtQml/qqmlprivate.h:90
#6 QQmlPrivate::QQmlElement<QDeclarativeOrganizerModel>::~QQmlElement (this=0x6c4c20, __in_chrg=<optimized out>) at /usr/include/qt5/QtQml/qqmlprivate.h:90
#7 0xb6371da0 in QObjectPrivate::deleteChildren (this=this@entry=0x619110) at kernel/qobject.cpp:1841
#8 0xb6375fee in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:934
#9 0xb6ea4588 in QQuickItem::~QQuickItem (this=0x6190b0, __in_chrg=<optimized out>) at items/qquickitem.cpp:2038
#10 0xb6f098e2 in ~QQuickImplicitSizeItem (this=0x6190b0, __in_chrg=<optimized out>) at items/qquickimplicitsizeitem_p.h:51
#11 QQuickLoader::~QQuickLoader (this=0x6190b0, __in_chrg=<optimized out>) at items/qquickloader.cpp:311
#12 0xb6eb1950 in ~QQmlElement (this=0x6190b0, __in_chrg=<optimized out>) at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:90
#13 QQmlPrivate::QQmlElement<QQuickLoader>::~QQmlElement (this=0x6190b0, __in_chrg=<optimized out>) at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:90
#14 0xb6371da0 in QObjectPrivate::deleteChildren (this=this@entry=0x618e60) at kernel/qobject.cpp:1841
#15 0xb6375fee in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at kernel/qobject.cpp:934
#16 0xb6ea4588 in QQuickItem::~QQuickItem (this=0x618b58, __in_chrg=<optimized out>) at items/qquickitem.cpp:2038
#17 0xb6eb10cc in ~QQmlElement (this=0x618b58, __in_chrg=<optimized out>) at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:90
#18 QQmlPrivate::QQmlElement<QQuickItem>::~QQmlElement (this=0x618b58, __in_chrg=<optimized out>) at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:90
#19 0xb6d467f6 in QQmlDelegateModel::~QQmlDelegateModel (this=0x55d1b8, __in_chrg=<optimized out>) at types/qqmldelegatemodel.cpp:236
#20 0xb6d4686c in QQmlDelegateModel::~QQmlDelegateModel (this=0x55d1b8, __in_chrg=<optimized out>) at types/qqmldelegatemodel.cpp:250
#21 0xb6f02894 in QQuickPathView::~QQuickPathView (this=0x55c638, __in_chrg=<optimized out>) at items/qquickpathview.cpp:558
#22 0xb6eb1830 in ~QQmlElement (this=0x55c638, __in_chrg=<optimized out>) at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:90
#23 QQmlPrivate::QQmlElement<QQuickPathView>::~QQmlElement (this=0x55c638, __in_chrg=<optimized out>) at ../../include/QtQml/../../src/qml/qml/qqmlprivate.h:90
#24 0xb6371da0 in QObjectPrivate::deleteChildren (this=this@entry=0x554cf0) at kernel/qobject.cpp:1841
#25 0xb6375fee in QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at ke...

Read more...

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Build a fresh new version of qtpim git fixes the crash, I was unable to reproduce it after install the new version.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

But even after that I did some changes on EDS plugin that could cause the crash described on popey log.

The MR can be found here: https://code.launchpad.net/~renatofilho/qtorganizer5-eds/fix-engine-crash/+merge/219586

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Tested this branch with the following ppa enabled as requested by renato. https://launchpad.net/~canonical-qt5-edgers/+archive/qt5-proper/+packages

It all seems to work, I had no crashes. The only big issue is performance. With my personal and work calendars enabled the evolution-calendar-factory process was pegging at 100% a lot of the time when navigating from one screen to another.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

The way I tested that was:-

# plug phone in
adb shell touch /userdata/.writable_image
adb reboot
adb shell

# on phone
add-apt-repository ppa:canonical-qt5-edgers/qt5-proper
apt-get update
apt-get upgrade

CTRL+D
adb reboot

# Test

228. By Kunal Parmar

temp commit

229. By Kunal Parmar

merge from trunk

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

error resolved

231. By Kunal Parmar

error resolved

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

error resolved

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 :

#blocked on EDS crashes

233. By Kunal Parmar

temp commit

234. By Kunal Parmar

merge from trunk

235. By Kunal Parmar

review comment

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

merge from trunk

237. By Kunal Parmar

merge from trunk

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
Renato Araujo Oliveira Filho (renatofilho) wrote :

looks like we need some policy rules:

Fail to update collection An AppArmor policy prevents this sender from sending this message to this recipient, 0 matched rules; type="method_call", sender=":1.99" (uid=32011 pid=4871 comm="/usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene cale") interface="org.gnome.evolution.dataserver.Source.Writable" member="Write" error name="(unset)" requested_reply="0" destination=":1.38" (uid=32011 pid=2073 comm="/usr/lib/evolution/evolution-source-registry ")
Fail to update collection An AppArmor policy prevents this sender from sending this message to this recipient, 0 matched rules; type="method_call", sender=":1.99" (uid=32011 pid=4871 comm="/usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene cale") interface="org.gnome.evolution.dataserver.Source.Writable" member="Write" error name="(unset)" requested_reply="0" destination=":1.38" (uid=32011 pid=2073 comm="/usr/lib/evolution/evolution-source-registry ")

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

There are a number of apparmor rules for the calendar already-- can you paste the output of 'grep DEN /var/log/syslog' at the time of the denial?

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Jun 3 17:55:12 ubuntu-phablet dbus[1547]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gnome/evolution/dataserver/SourceManager/Source_12" interface="org.gnome.evolution.dataserver.Source.Writable" member="Write" mask="send" name=":1.42" pid=17983 profile="com.ubuntu.calendar_calendar_0.4.237" peer_pid=2557 peer_profile="unconfined"
Jun 3 17:55:12 ubuntu-phablet dbus[1547]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gnome/evolution/dataserver/SourceManager/Source_8" interface="org.gnome.evolution.dataserver.Source.Writable" member="Write" mask="send" name=":1.42" pid=17983 profile="com.ubuntu.calendar_calendar_0.4.237" peer_pid=2557 peer_profile="unconfined"
Jun 3 17:55:17 ubuntu-phablet dbus[1547]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gnome/evolution/dataserver/SourceManager/Source_8" interface="org.gnome.evolution.dataserver.Source.Writable" member="Write" mask="send" name=":1.42" pid=17983 profile="com.ubuntu.calendar_calendar_0.4.237" peer_pid=2557 peer_profile="unconfined"
Jun 3 17:55:17 ubuntu-phablet dbus[1547]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gnome/evolution/dataserver/SourceManager/Source_12" interface="org.gnome.evolution.dataserver.Source.Writable" member="Write" mask="send" name=":1.42" pid=17983 profile="com.ubuntu.calendar_calendar_0.4.237" peer_pid=2557 peer_profile="unconfined"

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

In /var/lib/apparmor/profiles/click_com.ubuntu.calendar_calendar_0.4.237 can you add:
dbus (receive, send)
     bus=session
     path=/org/gnome/evolution/dataserver/SourceManager/**,

then do:
$ sudo apparmor_parser -r /var/lib/apparmor/profiles/click_com.ubuntu.calendar_calendar_0.4.237

and try again?

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

> In /var/lib/apparmor/profiles/click_com.ubuntu.calendar_calendar_0.4.237 can
> you add:
> dbus (receive, send)
> bus=session
> path=/org/gnome/evolution/dataserver/SourceManager/**,
>
> then do:
> $ sudo apparmor_parser -r
> /var/lib/apparmor/profiles/click_com.ubuntu.calendar_calendar_0.4.237
>
> and try again?

Works.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I'll update apparmor-easyprof-ubuntu for this additional access. It will be in 1.2.4.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I've updated apparmor-easyprof-ubuntu for this additional access. It will be in 1.2.4, which I just uploaded.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Triggered a rebuild of this. Curious where this stands.

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: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Needs to be rebased with trunk :-)

Text conflict in AgendaView.qml
Text conflict in EventBubble.qml
Text conflict in TimeLineBase.qml
Text conflict in calendar.qml
4 conflicts encountered.
bzr: ERROR: Conflicts from merge

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Kunal, can you please merge from trunk and we'll get this landed. Thanks!

We are no longer blocked on apparmor I believe as 1.2.4 of apparmor-easyprof-ubuntu landed on the phone now.

#unblocked

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Kunal, can you please merge from trunk and we'll get this landed. Thanks!
>
> We are no longer blocked on apparmor I believe as 1.2.4 of apparmor-easyprof-
> ubuntu landed on the phone now.
>
> #unblocked

ok, Glad to know that we can now land this

238. By Kunal Parmar

merge from trunk

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

merge issue resolved

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

I updated the code, but on device i still see some hangup and freeze after changing calendar filters. Not able to test on desktop. I am on release 87 on device.

Please test and see if you also faces same issue.

And also we need icon for calendars.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

Works fine on desktop for me, but the UI is freezing, I did not find any problem in eds code.

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 :

> Works fine on desktop for me, but the UI is freezing, I did not find any
> problem in eds code.

Mine is trusty, so I guess i don't have required patches. I think I see the same freezing on phone. but I am not sure as well for what is causing the freeze.

I will check more.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

I think this is probably down to renato running utopic, and you being on trusty. Can you try in the emulator - which will be utopic - Kunal?

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

This patch fix the problem: http://paste.ubuntu.com/7742247/

This patch will wait for some interval before reload all events, this optimize the app since you are saving all collections individually and you receive the collections changed event for each saved collection. With this patch the reload function will run only once.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

I strongly suggest this patch for the calendar dialogs: http://paste.ubuntu.com/7742257/

The current implementation is confusing, the edit mode is a dead end since the toolbar disappear and I can not save the changes.

This patch will remove the edit mode and allow the user to change the color by clicking in the color square.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Is this now able to proceed with the patch from Renato?

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Is this now able to proceed with the patch from Renato?

Hi, my pc broke down. I was not able to test. hopefully I might recover my pc soon and will update about it.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Thanks for letting us know Kunal! Good luck with the PC!

240. By Kunal Parmar

Timer approach

241. By Kunal Parmar

commented out code removed

242. By Kunal Parmar

merge from trunk

243. By Kunal Parmar

review comment

244. By Kunal Parmar

added comment

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

removed redudant code

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

I modified the code, now after changing the filter, calendar does not freeze.

But It looks like when I am trying to create UnionFilter with DetailFieldFilter and CollectionFilter,
CollectionFilter does not work.

3 + filter: UnionFilter {
524 + filters: [ collectionFilter /*,eventFilter ,eventOccurenceFilter*/ ]
525 + }

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

merge from trunk

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

merge from trunk

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
Renato Araujo Oliveira Filho (renatofilho) wrote :

> I modified the code, now after changing the filter, calendar does not freeze.

What exactly do you want with these filters, they does not look correct for me:

Union filter will list events that matches with all filters and you are using a filter that conflict with each other.

        DetailFieldFilter{
            id: eventFilter
            detail: Detail.ItemType;
            field: Type.FieldType
            value: Type.Event
            matchFlags: Filter.MatchExactly
        }

        DetailFieldFilter{
            id: eventOccurenceFilter
            detail: Detail.ItemType;
            field: Type.FieldType
            value: Type.EventOccurrence
            matchFlags: Filter.MatchExactly
        }

A event can only be one type Type.EventOccurrence or Type.Event.

Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

if you want to filter a event that is a EventOccurrence or a Event you should try Intersection filter.

Probably you will need a combination of Union and Intersection filters.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Hello,

It looks like I don't understand UnionFilter, what I want is all event that are either event or event occurrence and also belongs to collection which are selected by filter.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

i understand now,

i tried to correct it here

https://code.launchpad.net/~pkunal-parmar/ubuntu-calendar-app/Filter-correction/+merge/227272

can you have a look ?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AgendaView.qml'
--- AgendaView.qml 2014-06-17 22:24:41 +0000
+++ AgendaView.qml 2014-07-17 13:35:28 +0000
@@ -17,25 +17,10 @@
17 }17 }
1818
19 EventListModel {19 EventListModel {
20 id: eventModel20 id: eventListModel
21 startPeriod: currentDay.midnight();21 startPeriod: currentDay.midnight();
22 endPeriod: currentDay.addDays(30).endOfDay()22 endPeriod: currentDay.addDays(30).endOfDay()
23 filter: UnionFilter{23 filter: eventModel.filter
24 filters: [
25 DetailFieldFilter{
26 detail: Detail.ItemType
27 field: Type.FieldType
28 value: Type.Event
29 matchFlags: Filter.MatchExactly
30 },
31 DetailFieldFilter{
32 detail: Detail.ItemType
33 field: Type.FieldType
34 value: Type.EventOccurrence
35 matchFlags: Filter.MatchExactly
36 }
37 ]
38 }
3924
40 sortOrders: [25 sortOrders: [
41 SortOrder{26 SortOrder{
@@ -49,22 +34,22 @@
4934
50 ActivityIndicator {35 ActivityIndicator {
51 visible: running36 visible: running
52 running: eventModel.isLoading37 running: eventListModel.isLoading
53 anchors.centerIn: parent38 anchors.centerIn: parent
54 z:239 z:2
55 }40 }
5641
57 Label{42 Label{
58 text: i18n.tr("No upcoming events")43 text: i18n.tr("No upcoming events")
59 visible: eventModel.itemCount == 044 visible: eventModel.itemCount === 0
60 anchors.centerIn: parent45 anchors.centerIn: parent
61 }46 }
6247
63 ListView{48 ListView{
64 id: eventList49 id: eventList
65 model: eventModel50 model: eventListModel
66 anchors.fill: parent51 anchors.fill: parent
67 visible: eventModel.itemCount > 052 visible: eventListModel.itemCount > 0
6853
69 delegate: listDelegate54 delegate: listDelegate
70 }55 }
@@ -79,7 +64,7 @@
7964
80 Item {65 Item {
81 id: root66 id: root
82 property var event: eventModel.items[index];67 property var event: eventListModel.items[index];
8368
84 width: parent.width69 width: parent.width
85 height: container.height70 height: container.height
@@ -97,7 +82,7 @@
97 if( index == 0 ) {82 if( index == 0 ) {
98 headerContainer.visible = true;83 headerContainer.visible = true;
99 } else {84 } else {
100 var prevEvent = eventModel.items[index-1];85 var prevEvent = eventListModel.items[index-1];
101 if( prevEvent.startDateTime.midnight() < event.startDateTime.midnight()) {86 if( prevEvent.startDateTime.midnight() < event.startDateTime.midnight()) {
102 headerContainer.visible = true;87 headerContainer.visible = true;
103 }88 }
@@ -193,7 +178,7 @@
193 MouseArea{178 MouseArea{
194 anchors.fill: parent179 anchors.fill: parent
195 onClicked: {180 onClicked: {
196 pageStack.push(Qt.resolvedUrl("EventDetails.qml"), {"event":event,"model":eventModel});181 pageStack.push(Qt.resolvedUrl("EventDetails.qml"), {"event":event,"model":eventListModel});
197 }182 }
198 }183 }
199 }184 }
200185
=== added file 'CalendarChoicePopup.qml'
--- CalendarChoicePopup.qml 1970-01-01 00:00:00 +0000
+++ CalendarChoicePopup.qml 2014-07-17 13:35:28 +0000
@@ -0,0 +1,115 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4import Ubuntu.Components.ListItems 0.1
5import QtOrganizer 5.0
6
7Page {
8 id: root
9 title: i18n.tr("Calendars")
10
11 property var model;
12
13 signal collectionUpdated();
14
15 ToolbarItems {
16 id: pickerModeToolbar
17
18 back: ToolbarButton {
19 action: Action {
20 text: i18n.tr("Back");
21 iconName: "back"
22 onTriggered: {
23 pageStack.pop();
24 }
25 }
26 }
27
28 ToolbarButton {
29 action: Action {
30 text: i18n.tr("Save");
31 iconSource: Qt.resolvedUrl("save.svg");
32 onTriggered: {
33 root.collectionUpdated();
34 pageStack.pop();
35 }
36 }
37 }
38 }
39
40 tools: pickerModeToolbar
41
42 ListView {
43 id: calendarsList
44
45 anchors {
46 top: parent.top
47 bottom: parent.bottom
48 left: parent.left
49 right: parent.right
50 topMargin: units.gu(2)
51 leftMargin: units.gu(2)
52 rightMargin: units.gu(2)
53 }
54
55 model : root.model.getCollections();
56 delegate: delegateComp
57
58 Component{
59 id: delegateComp
60 Empty{
61 Row{
62 width: parent.width
63 height:checkBox.height + units.gu(2)
64 spacing: units.gu(1)
65
66 UbuntuShape{
67 width: parent.height
68 height: parent.height - units.gu(2)
69 color: modelData.color
70 anchors.verticalCenter: parent.verticalCenter
71 MouseArea{
72 anchors.fill: parent
73 onClicked: {
74 //popup dialog
75 var dialog = PopupUtils.open(Qt.resolvedUrl("ColorPickerDialog.qml"),root);
76 dialog.accepted.connect(function(color) {
77 var collection = root.model.collection(modelData.collectionId);
78 collection.color = color;
79 root.model.saveCollection(collection);
80 })
81 }
82 }
83 }
84 Label{
85 text: modelData.name
86 fontSize: "medium"
87 width: parent.width - (parent.height*2)
88 anchors.verticalCenter: parent.verticalCenter
89
90 MouseArea{
91 anchors.fill: parent
92 onClicked: {
93 checkBox.checked = !checkBox.checked
94 modelData.setExtendedMetaData("collection-selected",checkBox.checked)
95 var collection = root.model.collection(modelData.collectionId);
96 root.model.saveCollection(collection);
97 }
98 }
99 }
100 CheckBox {
101 id: checkBox
102 checked: modelData.extendedMetaData("collection-selected")
103 anchors.verticalCenter: parent.verticalCenter
104 visible: !root.isInEditMode
105 onCheckedChanged: {
106 modelData.setExtendedMetaData("collection-selected",checkBox.checked)
107 var collection = root.model.collection(modelData.collectionId);
108 root.model.saveCollection(collection);
109 }
110 }
111 }
112 }
113 }
114 }
115}
0116
=== added file 'ColorPickerDialog.qml'
--- ColorPickerDialog.qml 1970-01-01 00:00:00 +0000
+++ ColorPickerDialog.qml 2014-07-17 13:35:28 +0000
@@ -0,0 +1,45 @@
1import QtQuick 2.0
2import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.1
4
5Dialog {
6 id: root
7 title: i18n.tr("Select Color")
8 height: units.gu(100)
9
10 signal accepted(var color)
11 signal rejected()
12
13 contents: [
14 Grid{
15 height: units.gu(25)
16 rows: 3
17 columns: 5
18 Repeater{
19 model: ["#2C001E","#333333","#DD4814","#DF382C","#EFB73E","#19B6EE","#38B44A","#001F5C"];
20 delegate:UbuntuShape{
21 width: (parent.width/5)
22 height: width
23 color: modelData
24
25 MouseArea{
26 anchors.fill: parent
27 onClicked: {
28 root.accepted(modelData)
29 PopupUtils.close(root)
30 }
31 }
32 }
33 }
34 },
35 Button {
36 objectName: "TimePickerCancelButton"
37 text: i18n.tr("Cancel")
38 onClicked: {
39 root.rejected()
40 PopupUtils.close(root)
41 }
42 width: (parent.width) / 2
43 }
44 ]
45}
046
=== modified file 'DayView.qml'
--- DayView.qml 2014-07-02 17:37:22 +0000
+++ DayView.qml 2014-07-17 13:35:28 +0000
@@ -12,6 +12,7 @@
12 property bool isCurrentPage: false12 property bool isCurrentPage: false
1313
14 Keys.forwardTo: [dayViewPath]14 Keys.forwardTo: [dayViewPath]
15 flickable: null
1516
16 Column {17 Column {
17 id: column18 id: column
1819
=== modified file 'EventListModel.qml'
--- EventListModel.qml 2014-04-26 06:36:48 +0000
+++ EventListModel.qml 2014-07-17 13:35:28 +0000
@@ -33,6 +33,18 @@
33 }33 }
34 }34 }
3535
36 function getCollections(){
37 var cals = [];
38 var collections = eventModel.collections;
39 for(var i = 0 ; i < collections.length ; ++i) {
40 var cal = collections[i];
41 if( cal.extendedMetaData("collection-type") === "Calendar" ) {
42 cals.push(cal);
43 }
44 }
45 return cals;
46 }
47
36 onStartPeriodChanged: {48 onStartPeriodChanged: {
37 isLoading = true49 isLoading = true
38 }50 }
3951
=== modified file 'MonthComponent.qml'
--- MonthComponent.qml 2014-05-24 07:00:58 +0000
+++ MonthComponent.qml 2014-07-17 13:35:28 +0000
@@ -36,7 +36,7 @@
36 id: mainModel36 id: mainModel
37 startPeriod: intern.monthStart.midnight();37 startPeriod: intern.monthStart.midnight();
38 endPeriod: intern.monthStart.addDays((monthGrid.weekCount*7)-1).endOfDay()38 endPeriod: intern.monthStart.addDays((monthGrid.weekCount*7)-1).endOfDay()
3939 filter: eventModel.filter
40 onModelChanged: {40 onModelChanged: {
41 intern.eventStatus = Qt.binding(function() { return mainModel.containsItems(startPeriod,endPeriod,24*60*60)});41 intern.eventStatus = Qt.binding(function() { return mainModel.containsItems(startPeriod,endPeriod,24*60*60)});
42 }42 }
4343
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2014-07-17 13:27:55 +0000
+++ NewEvent.qml 2014-07-17 13:35:28 +0000
@@ -88,6 +88,10 @@
88 if( e.description ) {88 if( e.description ) {
89 messageEdit.text = e.description;89 messageEdit.text = e.description;
90 }90 }
91
92 allDayEventCheckbox.checked = e.allDay;
93 var index = 0;
94
91 if( e.itemType === Type.Event ) {95 if( e.itemType === Type.Event ) {
92 if(e.attendees){96 if(e.attendees){
93 for( var j = 0 ; j < e.attendees.length ; ++j ) {97 for( var j = 0 ; j < e.attendees.length ; ++j ) {
@@ -97,7 +101,7 @@
97 }101 }
98 }102 }
99103
100 var index = 0;104 index = 0;
101 if(e.recurrence ) {105 if(e.recurrence ) {
102 var recurrenceRule = e.recurrence.recurrenceRules;106 var recurrenceRule = e.recurrence.recurrenceRules;
103 index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0;107 index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0;
@@ -141,6 +145,15 @@
141 index = foundIndex != -1 ? foundIndex : 0;145 index = foundIndex != -1 ? foundIndex : 0;
142 }146 }
143 reminderOption.selectedIndex = index;147 reminderOption.selectedIndex = index;
148
149 index = 0;
150 for(var i=0; i < calendarsOption.model.length; ++i){
151 if(calendarsOption.model[i].collectionId === e.collectionId){
152 index = i;
153 break;
154 }
155 }
156 calendarsOption.selectedIndex = index
144 }157 }
145 function getWeekDaysIndex(daysOfWeek){158 function getWeekDaysIndex(daysOfWeek){
146 var index = 0;159 var index = 0;
@@ -229,10 +242,15 @@
229 audibleReminder.secondsBeforeStart = reminderTime;242 audibleReminder.secondsBeforeStart = reminderTime;
230 event.setDetail(audibleReminder);243 event.setDetail(audibleReminder);
231 }244 }
245
246 event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;
247
232 model.saveItem(event);248 model.saveItem(event);
249
233 pageStack.pop();250 pageStack.pop();
234 }251 }
235 }252 }
253
236 function getDaysOfWeek(){254 function getDaysOfWeek(){
237 var daysOfWeek = [];255 var daysOfWeek = [];
238 switch(recurrenceOption.selectedIndex){256 switch(recurrenceOption.selectedIndex){
@@ -434,6 +452,37 @@
434 }452 }
435 }453 }
436454
455 Item{
456 width: parent.width
457 height: calendarsOption.height
458 Label{
459 id: calendarLabel
460 text: i18n.tr("Calendar ");
461 anchors.verticalCenter: parent.verticalCenter
462 }
463
464 OptionSelector{
465 id: calendarsOption
466 anchors.right: parent.right
467 width: parent.width - calendarLabel.width - units.gu(1)
468 containerHeight: itemHeight * 4
469 model: root.model.getCollections();
470 delegate: OptionSelectorDelegate{
471 text: modelData.name
472
473 UbuntuShape{
474 id: calColor
475 width: height
476 height: parent.height - units.gu(2)
477 color: modelData.color
478 anchors.right: parent.right
479 anchors.rightMargin: units.gu(1)
480 anchors.verticalCenter: parent.verticalCenter
481 }
482 }
483 }
484 }
485
437 Row {486 Row {
438 width: parent.width487 width: parent.width
439 spacing: units.gu(1)488 spacing: units.gu(1)
440489
=== modified file 'TimeLineBase.qml'
--- TimeLineBase.qml 2014-06-25 00:37:43 +0000
+++ TimeLineBase.qml 2014-07-17 13:35:28 +0000
@@ -8,7 +8,6 @@
8 property var delegate;8 property var delegate;
9 property var day;9 property var day;
10 property int hourHeight: units.gu(10)10 property int hourHeight: units.gu(10)
11
12 property var model;11 property var model;
1312
14 MouseArea {13 MouseArea {
@@ -67,6 +66,8 @@
67 return;66 return;
68 }67 }
6968
69 destroyAllChildren();
70
70 var eventMap = {};71 var eventMap = {};
71 var allSchs = [];72 var allSchs = [];
7273
@@ -100,6 +101,7 @@
100 }101 }
101 children[i].visible = false;102 children[i].visible = false;
102 if( children[i].objectName !== "separator") {103 if( children[i].objectName !== "separator") {
104 children[i].clicked.disconnect( bubbleOverLay.showEventDetails );
103 intern.unUsedEvents.push(children[i])105 intern.unUsedEvents.push(children[i])
104 }106 }
105 }107 }
@@ -127,7 +129,6 @@
127 eventBubble.x = x;129 eventBubble.x = x;
128 eventBubble.width = width;130 eventBubble.width = width;
129 eventBubble.event = event131 eventBubble.event = event
130
131 eventBubble.visible = true;132 eventBubble.visible = true;
132 eventBubble.clicked.connect( bubbleOverLay.showEventDetails );133 eventBubble.clicked.connect( bubbleOverLay.showEventDetails );
133 }134 }
134135
=== modified file 'TimeLineBaseComponent.qml'
--- TimeLineBaseComponent.qml 2014-06-21 03:37:43 +0000
+++ TimeLineBaseComponent.qml 2014-07-17 13:35:28 +0000
@@ -60,6 +60,7 @@
60 id: mainModel60 id: mainModel
61 startPeriod: startDay.midnight();61 startPeriod: startDay.midnight();
62 endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()62 endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()
63 filter: eventModel.filter
63 }64 }
6465
65 ActivityIndicator {66 ActivityIndicator {
6667
=== modified file 'WeekView.qml'
--- WeekView.qml 2014-07-01 20:26:51 +0000
+++ WeekView.qml 2014-07-17 13:35:28 +0000
@@ -16,6 +16,8 @@
1616
17 Keys.forwardTo: [weekViewPath]17 Keys.forwardTo: [weekViewPath]
1818
19 flickable: null
20
19 Column {21 Column {
20 anchors.fill: parent22 anchors.fill: parent
21 anchors.top: parent.top23 anchors.top: parent.top
2224
=== modified file 'calendar.qml'
--- calendar.qml 2014-06-10 13:53:23 +0000
+++ calendar.qml 2014-07-17 13:35:28 +0000
@@ -1,13 +1,20 @@
1import QtQuick 2.01import QtQuick 2.0
2import Ubuntu.Components 0.12import Ubuntu.Components 0.1
3import Ubuntu.Components.Popups 0.13import Ubuntu.Components.Popups 0.1
4import QtOrganizer 5.0
4import Ubuntu.SyncMonitor 0.15import Ubuntu.SyncMonitor 0.1
6
5import "dateExt.js" as DateExt7import "dateExt.js" as DateExt
68
7MainView {9MainView {
8 id: mainView10 id: mainView
9 useDeprecatedToolbar: false11 useDeprecatedToolbar: false
1012
13 // Work-around until this branch lands:
14 // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
15 //property bool windowActive: typeof window != 'undefined'
16 //onWindowActiveChanged: window.title = i18n.tr("Calendar")
17
11 // Argument during startup18 // Argument during startup
12 Arguments {19 Arguments {
13 id: args;20 id: args;
@@ -90,13 +97,66 @@
90 }97 }
91 }98 }
9299
100 Timer {
101 id: applyFilterTimer
102 interval: 200; running: false; repeat: false
103 onTriggered: {
104 eventModel.applyFilterFinal();
105 }
106 }
107
108 DetailFieldFilter{
109 id: eventFilter
110 detail: Detail.ItemType;
111 field: Type.FieldType
112 value: Type.Event
113 matchFlags: Filter.MatchExactly
114 }
115
116 DetailFieldFilter{
117 id: eventOccurenceFilter
118 detail: Detail.ItemType;
119 field: Type.FieldType
120 value: Type.EventOccurrence
121 matchFlags: Filter.MatchExactly
122 }
123
124 CollectionFilter{
125 id: collectionFilter
126 }
127
93 EventListModel{128 EventListModel{
94 id: eventModel129 id: eventModel
95 //This model is just for newevent130
96 //so we dont need any update131 autoUpdate: true
97 autoUpdate: false132 startPeriod: tabs.currentDay
133 endPeriod: tabs.currentDay
134
135 //FIXME: seems like union filter is not working when we use DetailFieldFilter and CollectionFilter
136 //Currently only using collectionFilter
137 filter: UnionFilter {
138 filters: [ collectionFilter /*,eventFilter ,eventOccurenceFilter*/ ]
139 }
140
141 function delayedApplyFilter() {
142 applyFilterTimer.restart();
143 }
144
145 function applyFilterFinal() {
146 var collectionIds = [];
147 var collections = eventModel.getCollections();
148 for(var i=0; i < collections.length ; ++i) {
149 var collection = collections[i]
150 if(collection.extendedMetaData("collection-selected") === true) {
151 collectionIds.push(collection.collectionId);
152 }
153 }
154 collectionFilter.ids = collectionIds;
155 }
98156
99 Component.onCompleted: {157 Component.onCompleted: {
158 delayedApplyFilter();
159
100 if (args.values.eventid) {160 if (args.values.eventid) {
101 var requestId = "";161 var requestId = "";
102 eventModel.onItemsFetched.connect( function(id,fetchedItems) {162 eventModel.onItemsFetched.connect( function(id,fetchedItems) {
@@ -247,6 +307,16 @@
247 }307 }
248 }308 }
249 }309 }
310 ToolbarButton{
311 action:Action{
312 iconName: "new-event"
313 text: i18n.tr("Calendars");
314 onTriggered: {
315 pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model":eventModel});
316 pageStack.currentPage.collectionUpdated.connect(eventModel.delayedApplyFilter);
317 }
318 }
319 }
250 ToolbarButton {320 ToolbarButton {
251 objectName: "syncbutton"321 objectName: "syncbutton"
252 visible: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("calendar") : false322 visible: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("calendar") : false

Subscribers

People subscribed via source and target branches

to status/vote changes: