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 🙂

Advertisements

4 thoughts on “Calendar Updates

    1. My current project is implementation of week-view. Presently, the calendar has month and year view only. There are talks about agenda view after this. So, it will be quite some time before day-view becomes available.

      Like

      1. ElectricPrism says:

        Thank you so much, I saw the week view in my news feed today and people will be pleased I’m sure – I’ve read a lot of comments noting that UX necessity, I’m sure it adds tremendous value to all of us. 🙂

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s