We have moved to a new Sailfish OS Forum. Please start new discussions there.
37

Wiki: How to enable agenda view in Jolla calendar

asked 2014-07-15 19:05:47 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-07-20 20:54:58 +0200

Manatus gravatar image

Note: Agenda view seems fully functional. For all we know it has been disabled on purpose, eg. there may be bugs.

You can use text editors such as TinyEdit, vim or nano to edit qml files. Instructions how to use TinyEdit can be found here.


Enable agenda view

As devel-su you can enable agenda view by uncommenting following part in

/usr/share/jolla-calendar/pages/MonthPage.qml

/* Disabled for now
MenuItem {
    //% "Show agenda"
    text: qsTrId("calendar-me-show_agenda")
    onClicked: pageStack.push("AgendaPage.qml", {date: datePicker.date})
}
*/

To uncomment the code remove the two lines with /* and */.

Restart the calendar if it was already running. After this you can select the agenda view from the pulley of the calendar monthly view.


Current day fix

Here is Nieldk's fix to the bug where agenda view incorrectly defaults to any selected day in monthly view. This is a problem because you cannot scroll further back than the selected day in agenda view.

In above code, change

onClicked: pageStack.push("AgendaPage.qml", {date: datePicker.date})

to

onClicked: pageStack.push("AgendaPage.qml", {date: datePicker.date = new Date()})

Then it will always show the schedule from current date. (Except when the day changes in real time. See known bugs in the end of this article.)


Range of days shown in agenda view

By default agenda page shows events of next seven days. You can increase the range of days in

/usr/share/jolla-calendar/pages/AgendaPage.qml

model: AgendaModel {
    startDate: root.date 
    endDate: QtDate.addDays(root.Date, 7)
}

Change number 7 to whatever you like.


Known bugs

  • If you leave the agenda view open, it does not automatically update to a next day when the day changes.
edit retag flag offensive close delete

Comments

May seem stupid, but: How do I open the MonthPage.qml file? What app do I need to edit it as devel-su? Tried TinyEdit but could not save file...

dmelamet ( 2014-07-16 21:07:27 +0200 )edit

Nano or Vim text editors.

Nano is easier, but breaks line endings very easily. With nano you have to remember to check every line you have touched that the line endings have not cut the lines in half.

Vim is generally trickier to use if you come from Windows as you can play havoc on contents just by accidentally pressing buttons before going to edit mode (for instance 'dd' deletes whole line in command mode). Google "vim cheat sheet" for instructions how to use it.

Short briefing: Go to edit mode by pressing 'i'. Do the edits. 'Esc' to get out of edit mode and to command mode again, and then ':wq'. If you are afraid you messed the file, type ':q!' and start again.

Remember to take backup of the original file first...

As devel-su

pkcon install vim-enhanced

or

pkcon install nano

then

cd /usr/share/jolla-calendar/pages/

cp MonthPage.qml MonthPage.qml.backup

vim MonthPage.qml

or

nano MonthPage.qml

And do and save the edits.

Manatus ( 2014-07-17 00:04:16 +0200 )edit

Thank you for this little hack. I may have found a bug:

I have a contact with a birthday coming up. The birthday is tomorrow but the agenda view shows it as "Today". (I made the changes to both the "MonthPage.qml" and "AgendaPage.qml" files.)

For your information. :)

drcouzelis ( 2014-08-13 20:13:26 +0200 )edit
1

Thanks. I tested birthdays now. I set a birthday for one contact for tomorrow but it shows correctly under 'Tomorrow' headline in agenda view for me. The issue may depend on some other condition too.

Manatus ( 2014-08-14 08:30:47 +0200 )edit
1

Thank you very much for agenda to have a quick overview about the next days events. It works very well. One question: The daylabels in agenda are today, tomorrow, twice weekday-name and then only date. Is it possible to display weekday-name and date?

silta ( 2014-09-25 20:48:00 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2016-02-14 22:06:32 +0200

piero gravatar image

Just a friendly warning. Trying to make agenda view default by editing calendar.qml breaks Calendar, and it won't start anymore even after reverting changes from QML file. System needs to be restarted to unbreak it.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
20 followers

Stats

Asked: 2014-07-15 19:05:47 +0200

Seen: 2,248 times

Last updated: Feb 14 '16