Friday 25 July 2014

     GSoC'14(an awesome journey so far) is about to end and I'm wishing that I could relive all the moments again. This time I'm going to talk about my design implementation work. Around June ending, I completed my actually proposed project and it was time to work on incremental goals. I talked to Allan Day who is in gnome design team. I had mock-ups of new design and my mentor suggested to work on new design. Initially I hesitated a little as the new design was all about transforming the application into almost a new application. I didn't have much idea on design implementation so I felt that I might not be able to complete it and I talked to my mentor that if he could assign me something else instead of design implementation work and then he asked me that I could keep learning and working on it and at least I can work on initial changes. So finally I agreed and then sent a mail to Allan that I'm going to start working on design implementation and he reworked on few designs and gave it to me. Then as I was all confused, my mentor suggested me on where to start working on and all that. After that I started working on the design implementation. The good thing was that I didn't have to design anything on my own, it is all decided by designing team and I had to implement the design only.
    I started working on it around 25th June. I was all busy during first week making things clear and discussing about design and any potential changes in it with Allan and Giovanni(My mentor). After making things clear, I started my work after 3-4 days. I had some work so I was busy during 3-4 days and I couldn't do much during those days but after that I started working on it. I had some building issue initially and after solving it, the actual design implementation work was started. Initially, I used glade interface designer and dealt with GtkGrid and all alignment and spacing and other widgets in that interface designer itself. Then I started making changes in source code(javascript files). Designing can be implemented using JS code too instead of making changes to UI files. I found it easy to make changes and testing them by modifying JS files. I worked on it. Initially my goal was to somehow achieve that design working. I made enough changes in few files and implemented the functionalities. Throughout this process, I kept on asking so many doubts on IRC channels and my mentor and I kept on moving. Then finally I submitted my patch and pushed source code on github. Then from my mentor's review, I came to know that the app is working good but I totally messed up with model-view-controller structure and instead of following the convention to put design implementation code into UI files, I put it in JS files. Then he suggested few big changes to me which led to creation of a new file with my own copyright. Then I had all the source code in files and I need to shift it from one file to another to maintain MVC structure and shift designing part in UI files as much as I could.
    After working on it, I contacted design team that the design is ready and they suggested to add one switch functionality for current location. We were having doubts as to what to show till the app loads current location and all that. Then I thought something or say I misunderstood a little and added the switch with some functionality. Then I discussed it with my mentor and he said that they want the switch to work some other way and not the way I implemented. At that point, everything except that switch was completed and working fine. So I got another task which led to some more changes and then finally I made all the changes as I was suggested to make. I maintained MVC structure and out designs things in UI files.
    Right now, I've submitted a final patch with new design. There is some source code of old design that is yet to be removed. Some polishing is yet to be done. Everything will be done as soon as GUADEC(Gnome conference) will be over. I got an opportunity to attend it and I wish I could attend it but unfortunately due to some reasons I can't attend it. It is starting from 26th July. I feel like I'm going to miss loads of fun. I actually want to meet those people with whom, I've been working since last 4-5 months. Still it has been awesome time working with Gnome community till now.
   Here are few screenshot and comparison between new and old designs. I'm sure users are going to love the new design.


1> This is the way of showing all added cities by users in the old design. When user clicks on any location then the forecasting for that location is loaded.
world-view of old design

    This is how it'll be shown in new design and user has to click on location to see its forecasting and current location will be marked in the list.("New" button will be removed soon). To add a new location, user has to type city-name or keyword into search-location-entry shown at the top of the popover and as soon as user clicks on any location from the suggestions list it'll be loaded and added to list of recently viewed locations while in old design user has to click on new button then enter the name and then click add and then it'll be added to world view so click on it to see its forecasting(1 click in new design instead of 3 clicks in old design). There'll be maximum 5 locations in recently viewed locations list. There is a switch which will let you decide whether you want to fetch current location or not.
Cities will be shown in popover instead of big world-view in new design.



2> In old design, the forecasting is shown this way. To see forecasting for today and tomorrow, user has to click on side-button to see side-pane where today-tomorrow information is shown.
Old design

    In new design there are two buttons to see forecasting for today and tomorrow. There are 2 buttons for that. Even weekly forecasting is also shown in new design which is not available in old design.
New design


   There is one more screen in new design which will be loaded when user has selected not to load current location(stop geolocation service) and there is no recently added location. In this screen, user will enter keyword in search entry box and as soon as user will select any location from suggestions list, forecasting for that city will be loaded.("New" button will be removed soon)
New design


    Thanks to gnome design team for providing a really cool and light design. Thanks to Allan, Giovanni and people on IRC to help me throughout the process. I've learnt a lot by working on new design implementation part.

Monday 23 June 2014

    Finally this might be the last post about my project and after this my posts will be about working on incremental goals. I'm glad that till now I'm on my schedule and accomplished the things that I proposed to be done by me by this time. The project implementation is over and now it is time to get reviewed some gtk+ patches and style issues and land all the patches on master branch.

    I'll give one last overview of whatever I've done so far. The ultimate goal of my project was to expand the range of cities available in libgweather location entry suggestions. So that for any user input if the place exists and even if it is not in the Locations.xml database then also it is shown in the suggestions. That is done by forward geocoding. 
For example,  for "abc" input, there is no location in Locations.xml file but still it shows suggestions for places named "abc".

Invalid input

    The next step was to create a detached location using geocode place and make it addable. The locations that are shown in the suggestions should be selectable and should be addable to the application. For this, I added detached location support to location-entry.c and made it addable.
Here, in the next screenshot "Abc,Canada" is shown added to the application.

"Abc, Canada" location is added
    After this point, it seemed working fine and I made the first patch of my work. I faced few SegFaults in between my work and with the help of my mentor I solved them. After my mentor reviewed and tested my patch he suggested me few changes that I could not think that they also may cause SegFault but after that I merged those changes and landed up with new final patch. 

    During final testing I discovered one more thing that I was not able to delete one detached location that I added this way. After digging up and discussing with my mentor I came to know the loophole and I found that serialization and deserialization of detached locations was not consistent in weather-location.c file. So I fixed that bug and made a patch. So there are 2 patches that I made for libgweather which are ready to land and the only one hurdle left to be crossed is the issue with gtk+. Hope to see my changes in master branch as soon as possible.

    Finally thanks to my mentor to keep supporting me throughout the journey. Now it's time for midterm evaluation. Hope to keep doing well during the next half of the journey !

Monday 2 June 2014

    Hi, I'm again back with few updates. Finally, I've made some good progress and "The mission" is about to get over. I'm done with the implementation of getting the list of geocode places in the suggestions list. In this I'm facing a problem of showing the "Loading...." string, while the asynchronous task is processing, as the string seems to be hiding somewhere behind the input-text box. I've got nothing after digging up too much so now I'm thinking for another option or may be Giovanni(My mentor) can suggest something. Otherwise it is working fine.
   The second part that I was supposed to implement was to make those geocode places addable and for that I was supposed to find the nearest city from the  database using coordinates of the fetched geocode places. Then using that location I'm supposed to make a detached location and add it as selected location. For now I'm adding the nearest city to test it because creating detached location is not a big deal. In this the problem that I'm facing is if I click on the add button then it works perfectly but if I press enter key to add the location then it gives segmentation fault and I cant understand this strange behaviour till now.
     So this is it. And after this, I'll be working on few other things related to libgweather and Gnome-weather.

Wednesday 21 May 2014

Hola everyone!!!!
    Sorry for being late to post about my progress. I had few things to deal with but now I'll keep posting on here about my gsoc progress. So ya finally I made it to gsoc'14 and really thanks to my mentor for supporting me throughout the journey.
    Here is the link to abstract to my project: http://www.google-melange.com/gsoc/project/details/google/gsoc2014/srp201201051/5724160613416960
 
    I've started working on the part of fetching geocode places using forward geocoding. I've dealt with this asynchronous process using GSimpleAsynResult and as I worked on a bug in libgweather in which I was supposed to deal with asynchronous process, it was easy for me to implement it and I'm getting the list of the geocode places on the terminal for invalid user inputs(inputs for which there is no suggestion). For this I've implemented one no-suggestion signal in GtkEntryCompletion and using it I've implemented the above and the link to the video of this is below:
http://youtu.be/5dmS_gv7F7U