Days Grid

Hey all,

This is for the progress on the calendar. So far, you have seen a zoomed in version of the header of the calendar. So let’s zoom it out a bit.

*insert drum rolls*

daysgrid

 

Using the same test subjects, ta-da, this is the whole of the week view🙂

Coming to the features of the, yet unfinished, days-grid.

  • It is a large scrollable window with a solid line after every hour and a dotted line between any two solid lines.
  • The time format can be switched between 12-hr and 24-hr format, it follows the system settings. A pic of the same:twelve
  • It would be used to show events that span for <24 hrs.

There is still a lot of working to be done on it, but this is the update so far🙂

P.S.-I won’t be making it to GUADEC😥 I would like to thank the travel committee for the generous sponsorship. Sorry for the trouble. I have emailed the same to the travel-committee.

Last two weeks, the final push starts for the week-view🙂

Week Header

Today, I would like to introduce to you all, the all new week-header😀

The week-header is the first half of the week-view which deals with events last greater than or equal to 24h. Basically, events that last for a whole day or multiple days.

First, the events are fetched and stored in a GList. This GList is sorted according to the following criteria’s

  • Multiday events should be placed before all-day events
  • In case of both events being similar events:
    • They are sorted according to the start day first
    • They are sorted according to the end day in case of a tie.

For placing the events themselves, we iterate from the first row and find a perfect fit for the event at hand and add it there. The result- A very neat placement of events. The whole process is like sand flowing inside a jar of golf balls and occupying where it can.

header3

If you noticed, this hides certain events and only shows 3 rows of events. If you further notice, you will see a button at the bottom left. Let’s click it and this happens:

header4

The header also has a feature of expand/collapse which shows/hides events🙂

The expand mode shows all the events and also introduces a scrollable window to see events further below the current events.
The collapse mode shows only three rows of events and shows label placeholders if there are any events hidden.

Hope you all liked it.🙂

Let me also remind you that the countdown has begun for this :

GUADEC

One month to go😀

Calendar Updates

Time of Coding!

Updates on my project as a Google Summer of Code Intern. As you all know, I’m working on the Gnome-Calendar to make the much-required week-view. Here is the proposed mock up for the same:

mockup

The week-view already had good amount of code written for it. So the basic files were already existing. My first task was to activate the already written week-view, which after a few changes in the main Application file, resulted in:

old

Which is pretty far from the mock up.

All of the previously written code for week-view was in a single class, but in my proposal, we divided it into multiple classes.

  • WeekHeader for displaying the week-names, dates and labels of month, week number(s) and year.
  • WeekGrid to display the time periods of the 7 days of the week.

The events would go to each class based on the duration they last.

The initial task was a major clean up of the previously written week-view code, which was a pretty difficult task, given it was 2 years old code, and LOT of things have changed. The code was a sight which one wouldn’t like to see.

The clean up done, it was time to set up new classes and templates.

So here’s how you do it for calendar

  1. Make the ui, c and header file.
  2. For making the calendar use the ui file
    1. Save the ui in the correct place, data/ui/
    2. Convert the file into binary, so that no one messes with it, by including it in the data/calendar.gresource.xml
    3. Include the file(or alias if you’ve set it to anything different) in the data/Makefile.am
  3. For making the calendar use the .c and .h files:
    1. Just include the files in the src/Makefile.am

From week-view, we will be using a separate folder to include the views, which is src/views/ So how do we include headers of files inside a subfolder? Simple enough if you know it- Add -I$(srcdir)/views to the CPPFlags of Makefile.

And there you have it newly introduced classes which are ready to use for coding and testing.

Next blog about the WeekHeader.

P.S.-My hackergotchi is here😀 , Thanks a lot danielgc for making it🙂

Bug Fix #2

Last blog of pre-GSoC coding. This is the story which dates back to the application period.

The month view of the calendar is a pretty important aspect of the calendar. The keyboard arrow keys allowed a user to switch between days in a specific month. But on reaching the end of the month, a user couldn’t go any further.

Comes, https://bugzilla.gnome.org/show_bug.cgi?id=763198

The fix to which was a simple change to the key_press()
https://github.com/GNOME/gnome-calendar/commit/a738acb462418ab757531bf6aba4ae8679be829d

The calendar, in the past, used a ‘gint’ variable for locating the present location of the selector. So, on going beyond a date in the calendar, it would go to an invalid cell, which would cause nothing to happen. After the patch for bug #763198, it would go to the next month but since it used the cell position, the selection dates for creating new events went bad.

Next comes, https://bugzilla.gnome.org/show_bug.cgi?id=763641

The simple fix-Make the ‘gint’ variables to ‘GDateTime’ variables to track the date rather than a ‘gint’ variable to track the cell position.

The difficulties- The month-view was heavily dependent on those two variables (start_date_cell and end_date_cell) On changing a variable on gint to GDateTime, a lot of changes had to be made.

The result was a huge patch which changed the code at every position of occurrence of tracking variables- https://github.com/GNOME/gnome-calendar/commit/a3cbaf1e8103da3007c980bd1663a2c7c6e191f1

Segment faults are hard!!!

Thanks to the awesome community, an apparent error in the code was pointed out, resulting in the reopening of the bug #763641.

After much trying and failing, comes feaneron! Who solved the error in a few quick patches.

After all this, what has improved-

  • User can navigate to the next and previous month by navigating to the end of the current month.
  • User can create events spanning across multiple months with just the keyboard

What can still be done: The patch was pretty biased towards a keyboard user, there were no additions made for a mouse user, which should and will be done soon.

Next Up: The long forgotten week-view rises!!

The Chessboard

alwaysinwonder

19 years ago:

‘Everything is like a pattern, Axalia. A repeated score of music.’

The salsa wrap gripped loosely in his firm fingers had grown cold from the winds after an autumnal shower, and the city smelled of wet soil, leaves and a slow evening.

Someone had kept the radio on, far away from the place they were sitting – and it had a strange, old tune playing that he couldn’t really place anywhere in his mind. But it was familiar, he had heard it before. On a day just like this one – after a long, monotonous rain.

Axalia’s clothes still clung to her body, making her look skinnier than she was. His own hair was damp, but there was a strange warmth exploding from his insides.

If only it had rained on and on.

She is rain, if I am summer.

Gerard took another bite of the wrap…

View original post 20,137 more words

Google Summer of Code – 2016 (Part – 1)

Come April 23rd 00:30 and it was the time of GSoC selection results. It was a long wait, but the result was totally worth it.

GOT SELECTED!!!!

It was quite a tense few minutes, with me searching the results by my name, I totally forgot my display name was “pandusonu”. But it was quite a moment of realization😀 Even more awesome to know that 9 people from my college were selected to.

Now going from the results moment to the GSoC itself.

I got selected for my proposal to make week-view in gnome-calendar. GNOME is the best open source community I know of. No sooner than I got a mail from Google, I got a mail from GNOME to participate in community bonding. I’m not sure if any other organization does that.

That was followed by making pages and editing pages in wiki.gnome.org where anybody can edit any page as long as they are in the trusted editors list. Such an amazing community :’)

My mentor is ‘feaneron’ who is amazing with more than 33k+ lines of code contribution to gnome-calendar. He also did GSoC ’15 working on gnome-nautilus, so he knows his way in GSoC just adding to my fotunes.

This has already become quite a post already, will continue with the next part of this blog. Will be updating about the progress in Community Bonding period in the next blog.
Watch out for links in he next blog😉

Bug Fix #1

This post is about how to submit bugs and fix them to improve the calendar.

I would like to speak about my very first bug fix which wouldn’t have been possible at all without the awesome GNOME community.

The bug link- https://bugzilla.gnome.org/show_bug.cgi?id=763160

It started out as a bug which was due to a simple vague extra click required before actually using the keyboard navigation key. It turned out the problem was a single like of code which was to be added in the property of the .ui file. More on the UI in later. But in short, just needed to add a property called “can_focus” to a window.

This bug was simple but more of introduction on how to submit patches.

To submit a patch:

First, checkout to a new branch using:

git checkout -b <name>

Fix the bug and add, commit by adding a proper commit message. All of which are regular git commands.
Next, the awesome “bz”. This basically submits your patch directly to the bugzilla page with a simple command:

git bz attach <bug number> <patch number>

After that, pat yourself on the back and wait for the moderators to check your code and commit it to the main branch.

Is all this fuss necessary? Maybe/maybe not, but when you get the awesome feel of “open sourcing”, which can’t possibly be explained in this and requires its own article to actually explain it, it’s totally worth it.

Hold tight for the next blog😀

To do after this blog: Article about Calendar UI and Open-Source feel.