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
1=== modified file 'AgendaView.qml'
2--- AgendaView.qml 2014-06-17 22:24:41 +0000
3+++ AgendaView.qml 2014-07-17 13:35:28 +0000
4@@ -17,25 +17,10 @@
5 }
6
7 EventListModel {
8- id: eventModel
9+ id: eventListModel
10 startPeriod: currentDay.midnight();
11 endPeriod: currentDay.addDays(30).endOfDay()
12- filter: UnionFilter{
13- filters: [
14- DetailFieldFilter{
15- detail: Detail.ItemType
16- field: Type.FieldType
17- value: Type.Event
18- matchFlags: Filter.MatchExactly
19- },
20- DetailFieldFilter{
21- detail: Detail.ItemType
22- field: Type.FieldType
23- value: Type.EventOccurrence
24- matchFlags: Filter.MatchExactly
25- }
26- ]
27- }
28+ filter: eventModel.filter
29
30 sortOrders: [
31 SortOrder{
32@@ -49,22 +34,22 @@
33
34 ActivityIndicator {
35 visible: running
36- running: eventModel.isLoading
37+ running: eventListModel.isLoading
38 anchors.centerIn: parent
39 z:2
40 }
41
42 Label{
43 text: i18n.tr("No upcoming events")
44- visible: eventModel.itemCount == 0
45+ visible: eventModel.itemCount === 0
46 anchors.centerIn: parent
47 }
48
49 ListView{
50 id: eventList
51- model: eventModel
52+ model: eventListModel
53 anchors.fill: parent
54- visible: eventModel.itemCount > 0
55+ visible: eventListModel.itemCount > 0
56
57 delegate: listDelegate
58 }
59@@ -79,7 +64,7 @@
60
61 Item {
62 id: root
63- property var event: eventModel.items[index];
64+ property var event: eventListModel.items[index];
65
66 width: parent.width
67 height: container.height
68@@ -97,7 +82,7 @@
69 if( index == 0 ) {
70 headerContainer.visible = true;
71 } else {
72- var prevEvent = eventModel.items[index-1];
73+ var prevEvent = eventListModel.items[index-1];
74 if( prevEvent.startDateTime.midnight() < event.startDateTime.midnight()) {
75 headerContainer.visible = true;
76 }
77@@ -193,7 +178,7 @@
78 MouseArea{
79 anchors.fill: parent
80 onClicked: {
81- pageStack.push(Qt.resolvedUrl("EventDetails.qml"), {"event":event,"model":eventModel});
82+ pageStack.push(Qt.resolvedUrl("EventDetails.qml"), {"event":event,"model":eventListModel});
83 }
84 }
85 }
86
87=== added file 'CalendarChoicePopup.qml'
88--- CalendarChoicePopup.qml 1970-01-01 00:00:00 +0000
89+++ CalendarChoicePopup.qml 2014-07-17 13:35:28 +0000
90@@ -0,0 +1,115 @@
91+import QtQuick 2.0
92+import Ubuntu.Components 0.1
93+import Ubuntu.Components.Popups 0.1
94+import Ubuntu.Components.ListItems 0.1
95+import QtOrganizer 5.0
96+
97+Page {
98+ id: root
99+ title: i18n.tr("Calendars")
100+
101+ property var model;
102+
103+ signal collectionUpdated();
104+
105+ ToolbarItems {
106+ id: pickerModeToolbar
107+
108+ back: ToolbarButton {
109+ action: Action {
110+ text: i18n.tr("Back");
111+ iconName: "back"
112+ onTriggered: {
113+ pageStack.pop();
114+ }
115+ }
116+ }
117+
118+ ToolbarButton {
119+ action: Action {
120+ text: i18n.tr("Save");
121+ iconSource: Qt.resolvedUrl("save.svg");
122+ onTriggered: {
123+ root.collectionUpdated();
124+ pageStack.pop();
125+ }
126+ }
127+ }
128+ }
129+
130+ tools: pickerModeToolbar
131+
132+ ListView {
133+ id: calendarsList
134+
135+ anchors {
136+ top: parent.top
137+ bottom: parent.bottom
138+ left: parent.left
139+ right: parent.right
140+ topMargin: units.gu(2)
141+ leftMargin: units.gu(2)
142+ rightMargin: units.gu(2)
143+ }
144+
145+ model : root.model.getCollections();
146+ delegate: delegateComp
147+
148+ Component{
149+ id: delegateComp
150+ Empty{
151+ Row{
152+ width: parent.width
153+ height:checkBox.height + units.gu(2)
154+ spacing: units.gu(1)
155+
156+ UbuntuShape{
157+ width: parent.height
158+ height: parent.height - units.gu(2)
159+ color: modelData.color
160+ anchors.verticalCenter: parent.verticalCenter
161+ MouseArea{
162+ anchors.fill: parent
163+ onClicked: {
164+ //popup dialog
165+ var dialog = PopupUtils.open(Qt.resolvedUrl("ColorPickerDialog.qml"),root);
166+ dialog.accepted.connect(function(color) {
167+ var collection = root.model.collection(modelData.collectionId);
168+ collection.color = color;
169+ root.model.saveCollection(collection);
170+ })
171+ }
172+ }
173+ }
174+ Label{
175+ text: modelData.name
176+ fontSize: "medium"
177+ width: parent.width - (parent.height*2)
178+ anchors.verticalCenter: parent.verticalCenter
179+
180+ MouseArea{
181+ anchors.fill: parent
182+ onClicked: {
183+ checkBox.checked = !checkBox.checked
184+ modelData.setExtendedMetaData("collection-selected",checkBox.checked)
185+ var collection = root.model.collection(modelData.collectionId);
186+ root.model.saveCollection(collection);
187+ }
188+ }
189+ }
190+ CheckBox {
191+ id: checkBox
192+ checked: modelData.extendedMetaData("collection-selected")
193+ anchors.verticalCenter: parent.verticalCenter
194+ visible: !root.isInEditMode
195+ onCheckedChanged: {
196+ modelData.setExtendedMetaData("collection-selected",checkBox.checked)
197+ var collection = root.model.collection(modelData.collectionId);
198+ root.model.saveCollection(collection);
199+ }
200+ }
201+ }
202+ }
203+ }
204+ }
205+}
206
207=== added file 'ColorPickerDialog.qml'
208--- ColorPickerDialog.qml 1970-01-01 00:00:00 +0000
209+++ ColorPickerDialog.qml 2014-07-17 13:35:28 +0000
210@@ -0,0 +1,45 @@
211+import QtQuick 2.0
212+import Ubuntu.Components 0.1
213+import Ubuntu.Components.Popups 0.1
214+
215+Dialog {
216+ id: root
217+ title: i18n.tr("Select Color")
218+ height: units.gu(100)
219+
220+ signal accepted(var color)
221+ signal rejected()
222+
223+ contents: [
224+ Grid{
225+ height: units.gu(25)
226+ rows: 3
227+ columns: 5
228+ Repeater{
229+ model: ["#2C001E","#333333","#DD4814","#DF382C","#EFB73E","#19B6EE","#38B44A","#001F5C"];
230+ delegate:UbuntuShape{
231+ width: (parent.width/5)
232+ height: width
233+ color: modelData
234+
235+ MouseArea{
236+ anchors.fill: parent
237+ onClicked: {
238+ root.accepted(modelData)
239+ PopupUtils.close(root)
240+ }
241+ }
242+ }
243+ }
244+ },
245+ Button {
246+ objectName: "TimePickerCancelButton"
247+ text: i18n.tr("Cancel")
248+ onClicked: {
249+ root.rejected()
250+ PopupUtils.close(root)
251+ }
252+ width: (parent.width) / 2
253+ }
254+ ]
255+}
256
257=== modified file 'DayView.qml'
258--- DayView.qml 2014-07-02 17:37:22 +0000
259+++ DayView.qml 2014-07-17 13:35:28 +0000
260@@ -12,6 +12,7 @@
261 property bool isCurrentPage: false
262
263 Keys.forwardTo: [dayViewPath]
264+ flickable: null
265
266 Column {
267 id: column
268
269=== modified file 'EventListModel.qml'
270--- EventListModel.qml 2014-04-26 06:36:48 +0000
271+++ EventListModel.qml 2014-07-17 13:35:28 +0000
272@@ -33,6 +33,18 @@
273 }
274 }
275
276+ function getCollections(){
277+ var cals = [];
278+ var collections = eventModel.collections;
279+ for(var i = 0 ; i < collections.length ; ++i) {
280+ var cal = collections[i];
281+ if( cal.extendedMetaData("collection-type") === "Calendar" ) {
282+ cals.push(cal);
283+ }
284+ }
285+ return cals;
286+ }
287+
288 onStartPeriodChanged: {
289 isLoading = true
290 }
291
292=== modified file 'MonthComponent.qml'
293--- MonthComponent.qml 2014-05-24 07:00:58 +0000
294+++ MonthComponent.qml 2014-07-17 13:35:28 +0000
295@@ -36,7 +36,7 @@
296 id: mainModel
297 startPeriod: intern.monthStart.midnight();
298 endPeriod: intern.monthStart.addDays((monthGrid.weekCount*7)-1).endOfDay()
299-
300+ filter: eventModel.filter
301 onModelChanged: {
302 intern.eventStatus = Qt.binding(function() { return mainModel.containsItems(startPeriod,endPeriod,24*60*60)});
303 }
304
305=== modified file 'NewEvent.qml'
306--- NewEvent.qml 2014-07-17 13:27:55 +0000
307+++ NewEvent.qml 2014-07-17 13:35:28 +0000
308@@ -88,6 +88,10 @@
309 if( e.description ) {
310 messageEdit.text = e.description;
311 }
312+
313+ allDayEventCheckbox.checked = e.allDay;
314+ var index = 0;
315+
316 if( e.itemType === Type.Event ) {
317 if(e.attendees){
318 for( var j = 0 ; j < e.attendees.length ; ++j ) {
319@@ -97,7 +101,7 @@
320 }
321 }
322
323- var index = 0;
324+ index = 0;
325 if(e.recurrence ) {
326 var recurrenceRule = e.recurrence.recurrenceRules;
327 index = ( recurrenceRule.length > 0 ) ? recurrenceRule[0].frequency : 0;
328@@ -141,6 +145,15 @@
329 index = foundIndex != -1 ? foundIndex : 0;
330 }
331 reminderOption.selectedIndex = index;
332+
333+ index = 0;
334+ for(var i=0; i < calendarsOption.model.length; ++i){
335+ if(calendarsOption.model[i].collectionId === e.collectionId){
336+ index = i;
337+ break;
338+ }
339+ }
340+ calendarsOption.selectedIndex = index
341 }
342 function getWeekDaysIndex(daysOfWeek){
343 var index = 0;
344@@ -229,10 +242,15 @@
345 audibleReminder.secondsBeforeStart = reminderTime;
346 event.setDetail(audibleReminder);
347 }
348+
349+ event.collectionId = calendarsOption.model[calendarsOption.selectedIndex].collectionId;
350+
351 model.saveItem(event);
352+
353 pageStack.pop();
354 }
355 }
356+
357 function getDaysOfWeek(){
358 var daysOfWeek = [];
359 switch(recurrenceOption.selectedIndex){
360@@ -434,6 +452,37 @@
361 }
362 }
363
364+ Item{
365+ width: parent.width
366+ height: calendarsOption.height
367+ Label{
368+ id: calendarLabel
369+ text: i18n.tr("Calendar ");
370+ anchors.verticalCenter: parent.verticalCenter
371+ }
372+
373+ OptionSelector{
374+ id: calendarsOption
375+ anchors.right: parent.right
376+ width: parent.width - calendarLabel.width - units.gu(1)
377+ containerHeight: itemHeight * 4
378+ model: root.model.getCollections();
379+ delegate: OptionSelectorDelegate{
380+ text: modelData.name
381+
382+ UbuntuShape{
383+ id: calColor
384+ width: height
385+ height: parent.height - units.gu(2)
386+ color: modelData.color
387+ anchors.right: parent.right
388+ anchors.rightMargin: units.gu(1)
389+ anchors.verticalCenter: parent.verticalCenter
390+ }
391+ }
392+ }
393+ }
394+
395 Row {
396 width: parent.width
397 spacing: units.gu(1)
398
399=== modified file 'TimeLineBase.qml'
400--- TimeLineBase.qml 2014-06-25 00:37:43 +0000
401+++ TimeLineBase.qml 2014-07-17 13:35:28 +0000
402@@ -8,7 +8,6 @@
403 property var delegate;
404 property var day;
405 property int hourHeight: units.gu(10)
406-
407 property var model;
408
409 MouseArea {
410@@ -67,6 +66,8 @@
411 return;
412 }
413
414+ destroyAllChildren();
415+
416 var eventMap = {};
417 var allSchs = [];
418
419@@ -100,6 +101,7 @@
420 }
421 children[i].visible = false;
422 if( children[i].objectName !== "separator") {
423+ children[i].clicked.disconnect( bubbleOverLay.showEventDetails );
424 intern.unUsedEvents.push(children[i])
425 }
426 }
427@@ -127,7 +129,6 @@
428 eventBubble.x = x;
429 eventBubble.width = width;
430 eventBubble.event = event
431-
432 eventBubble.visible = true;
433 eventBubble.clicked.connect( bubbleOverLay.showEventDetails );
434 }
435
436=== modified file 'TimeLineBaseComponent.qml'
437--- TimeLineBaseComponent.qml 2014-06-21 03:37:43 +0000
438+++ TimeLineBaseComponent.qml 2014-07-17 13:35:28 +0000
439@@ -60,6 +60,7 @@
440 id: mainModel
441 startPeriod: startDay.midnight();
442 endPeriod: type == ViewType.ViewTypeWeek ? startPeriod.addDays(7).endOfDay(): startPeriod.endOfDay()
443+ filter: eventModel.filter
444 }
445
446 ActivityIndicator {
447
448=== modified file 'WeekView.qml'
449--- WeekView.qml 2014-07-01 20:26:51 +0000
450+++ WeekView.qml 2014-07-17 13:35:28 +0000
451@@ -16,6 +16,8 @@
452
453 Keys.forwardTo: [weekViewPath]
454
455+ flickable: null
456+
457 Column {
458 anchors.fill: parent
459 anchors.top: parent.top
460
461=== modified file 'calendar.qml'
462--- calendar.qml 2014-06-10 13:53:23 +0000
463+++ calendar.qml 2014-07-17 13:35:28 +0000
464@@ -1,13 +1,20 @@
465 import QtQuick 2.0
466 import Ubuntu.Components 0.1
467 import Ubuntu.Components.Popups 0.1
468+import QtOrganizer 5.0
469 import Ubuntu.SyncMonitor 0.1
470+
471 import "dateExt.js" as DateExt
472
473 MainView {
474 id: mainView
475 useDeprecatedToolbar: false
476
477+ // Work-around until this branch lands:
478+ // https://code.launchpad.net/~tpeeters/ubuntu-ui-toolkit/optIn-tabsDrawer/+merge/212496
479+ //property bool windowActive: typeof window != 'undefined'
480+ //onWindowActiveChanged: window.title = i18n.tr("Calendar")
481+
482 // Argument during startup
483 Arguments {
484 id: args;
485@@ -90,13 +97,66 @@
486 }
487 }
488
489+ Timer {
490+ id: applyFilterTimer
491+ interval: 200; running: false; repeat: false
492+ onTriggered: {
493+ eventModel.applyFilterFinal();
494+ }
495+ }
496+
497+ DetailFieldFilter{
498+ id: eventFilter
499+ detail: Detail.ItemType;
500+ field: Type.FieldType
501+ value: Type.Event
502+ matchFlags: Filter.MatchExactly
503+ }
504+
505+ DetailFieldFilter{
506+ id: eventOccurenceFilter
507+ detail: Detail.ItemType;
508+ field: Type.FieldType
509+ value: Type.EventOccurrence
510+ matchFlags: Filter.MatchExactly
511+ }
512+
513+ CollectionFilter{
514+ id: collectionFilter
515+ }
516+
517 EventListModel{
518 id: eventModel
519- //This model is just for newevent
520- //so we dont need any update
521- autoUpdate: false
522+
523+ autoUpdate: true
524+ startPeriod: tabs.currentDay
525+ endPeriod: tabs.currentDay
526+
527+ //FIXME: seems like union filter is not working when we use DetailFieldFilter and CollectionFilter
528+ //Currently only using collectionFilter
529+ filter: UnionFilter {
530+ filters: [ collectionFilter /*,eventFilter ,eventOccurenceFilter*/ ]
531+ }
532+
533+ function delayedApplyFilter() {
534+ applyFilterTimer.restart();
535+ }
536+
537+ function applyFilterFinal() {
538+ var collectionIds = [];
539+ var collections = eventModel.getCollections();
540+ for(var i=0; i < collections.length ; ++i) {
541+ var collection = collections[i]
542+ if(collection.extendedMetaData("collection-selected") === true) {
543+ collectionIds.push(collection.collectionId);
544+ }
545+ }
546+ collectionFilter.ids = collectionIds;
547+ }
548
549 Component.onCompleted: {
550+ delayedApplyFilter();
551+
552 if (args.values.eventid) {
553 var requestId = "";
554 eventModel.onItemsFetched.connect( function(id,fetchedItems) {
555@@ -247,6 +307,16 @@
556 }
557 }
558 }
559+ ToolbarButton{
560+ action:Action{
561+ iconName: "new-event"
562+ text: i18n.tr("Calendars");
563+ onTriggered: {
564+ pageStack.push(Qt.resolvedUrl("CalendarChoicePopup.qml"),{"model":eventModel});
565+ pageStack.currentPage.collectionUpdated.connect(eventModel.delayedApplyFilter);
566+ }
567+ }
568+ }
569 ToolbarButton {
570 objectName: "syncbutton"
571 visible: syncMonitor.enabledServices ? syncMonitor.serviceIsEnabled("calendar") : false

Subscribers

People subscribed via source and target branches

to status/vote changes: