terça-feira, 11 de março de 2014

The latest fixes in my project

1) The "Cogl-WARNING **: X Error: 

I believe that I have managed to solve the "Cogl-WARNING **: Error's X problem
I mentioned it in my last post. I was a annoying error that was turning the map a black screen image every time I was trying to open the map again.
Apparently, when you created a map and it was adding to vbox_map, it overwrote the map previously placed there (does that make sense? I don't have the knowledge to affirm it).
I've tried, in a shot in the dark, remove the map vbox_map when I close the dialog and apparently it solved the problem.

Click on image to see it bigger :-)

Now, I can open the map several times and this error doesn't is shown anymore :-)

2) Workview Filter now is filtering location in the right way

Workview is made to filter locations just if the user choose it. The problem was that filter was disappearing with all tasks from screen.
Here, when the filter is applied AND workview is activated, the locations are filtered according with distance.

If the workview is not activated, there's no filter.

When user unnaply filter, the workview could be activated or not, the filter doesn't work. 

3) Walking to the end of my project
Now, I have to do the last part: add a column with tasks, filtered by distance, according with the choose's user.
Let's go!

quarta-feira, 5 de março de 2014

I think you should try OPW

Today I will not talk about my project, but I'll talk about the internship program that gave me the project that I'm doing , the OPW.

But ...
What is the OPW ?
Outreach Program for Women ( OPW ) is a program whose goal is to promote diversity in the free software world . This is an internship program organized by the GNOME Foundation to involve women ( cis and trans ) in the world of free Softaware and Open Software . There are several free softwares organizations participating . Each of them have a great community of which you can participate , learn a lot , help and be helped . And not only during the internship period , but always . The cool thing is that you don't need  be a student :-) You just want to participate .

Are you wondering how can you participate ?
See the available projects , then go to the channel of the chosen project , talk to the mentors and they will tell you to apply a patch to the project which you have interest. They show the bugs available and you will have to solve one of them, making a significant contribution .

Let me tell you about dates
February 24
application period opens

February 24 - March 19
applicants need to get in touch with at least one project and make a contribution to it

March 19
application deadline at 7pm UTC

April 21
accepted participants announced on this page at 7pm UTC

May 19 - August 18
internship period

You can get more information on the followings links
http://gnome.org/opw/  and   https://wiki.gnome.org/OutreachProgramForWomen

It's a great opportunity, so let's participate! And let's start the next round!

domingo, 23 de fevereiro de 2014

We keep going!

Wow, a lot of time since my last post!
I entered in a more complicated part of my project and I was late. I wasn't having time for nothing.
I worked hard for try to come back to schedule and I'm there again. No delays. The good news is that I have more things to show to you now..
A lot of small improves in my code were done.

The lastest modifications that I did are (the more recent to more old):

1) user can set if he/she wants to use a filter for tasks

2) a refactoring in my code, to try to put a order over there.

 I spent 10 hour in it, but it worth it! Now, the code is more organized and clear :-)
With this, I finally resolve the Clutter Actor problem, with a big and simple help from #clutter.  The guy from #clutter said that probably is about ChamplainView, that already has a parent when I'm adding it to my stage or embed already has a parent when I add it to vbox_map. When I organized everything, I verified that sometimes, maybe I could be adding my ChamplainView to my stage when it already has a parent. This errors was gone. \o/

3) now we have a sidebar showing all tags, and user can filter task by clicking in tasks :-)

4) better than this, now the user can edit a tag, and more yet: the user can insert a location in a tag.

5) user can relate one or more tags to a location and edit the location's name

The sad part is I'm having problem with the "Cogl-WARNING **: X Error received while making drawable 0x02400009 " . It makes the map turn in a black image.

I don't know how to fix it, yet. I'm talking with people from #clutter and #gnome-hackers to try to find out why it's happening. I'm also studying the Cogl Reference Manual to understand more about it. It's in my to do list fix it until the end of my project :-)

That's it for now. If you have any question or would like to comment, please, do it! :-)
See ya!

segunda-feira, 27 de janeiro de 2014

Now I have something really consistent!!

A few days ago I was feeling a little discouraged: I worked in the code and was thinking that nothing was going on. But I continued to develop and suddenly things got very close to what was planned for the midterm delivery! I'm still in the middle of the way, but very happy with the outcome so far. So, I'm very motivated again! Enough talk about me and let's talk about what has been done.

What I did in the last days

Creating function to load / dump locations info
I was studying the files from GTG trying to understand how and where it saved user data. My goal was to save the locations that the user marked in the map. I tried to make a parser, but Parin told me to use an existing file in GTG to deal with save and load, more specifically two functions : _store_pickled_file and _load_pickled_file , which store locations (by converting object into a byte) and allow load this locations (by a byte being converteded in a object). It uses pickle - Python Object Seralization and it turns much more easy to manipulate the data. Thus, the ground is prepared for the next step, which is to add location to a task, and save them to be shown each time a task is opened .

Add / Remove location to/from the task
To develop this feature , the idea was to use the id of each location , which is unique, and get to identify them and save them in a file on disk. Thus, for each location entered, I should keep: name, latitude and longitude.
That gave me some problems: - The first task I add locations works ok, but the second, when a location is added to it, overwrites the first task's name and shows it's location plus previous tasks locations. It was wrong!

    Print with the bad bad behaviour >:/

To fix this,  I create a method to clean-up, and the list of locations and id of the task are setted as a empty list and a empty string, respectively.

    Different tasks and different locations being shown on it

Save the last location 
The purpose is save the user's last location. Thus, when the user is offline, the map could be oppened with latest user's location, facilitating the visualization.

    You are offline and that's your last location

Treat the user location differently than other markers
Here I had to deal with the initial location of the user in a different way from other locations, preventing this initial location to be deleted. The color of this initial location is red, to highlight on the map, and has a different logic: it is set only when the user is online. When the user is offline, it is shown in map. In the future I intend to change that label to something more beautiful.

Treat release button event instead of button press event
This change was made because of the following problem: when the user was setting a marker somewhere, the cursor was changing to drag cursor when it should remain the same hand-opened cursor.
LibChamplain does not handle the button-release-event when button-press-event
is being treated by geolocalized-tasks, keeping the cursor as a closed hand. If we treat the button-release-event, the behavior is according to what we expect.

Show the location description to its name
The last thing I did. I studied the code of gnome-maps and realized that it uses Gnome Geocode Reverse
to get the location name directly from the map. This is very powerful and very cool. You can set a location directly, and it returns the name of the place for you.
I was doing it synchronously, with geocode_reverse-code(). Parin warned me that this could be annoying for a user with slower internet connection and asked me to do this asynchronously (geocode_reverse-code-async).

    It's legen...

    ....wait for it...

    ...dary!  ;-)

And final result in a gif

That's it for now. I'm working in the next steps of my planning. If you have any question, something to correct, ask to me, or comment :-)
See you in next post.

quinta-feira, 16 de janeiro de 2014

Technical problem solved!

The problem
I was having a technical problem that was unsolvable to me. It's  about the context menu, that should be hidden on clicking/right-clicking somewhere else.

Parin told to me to insert some debbugs in the code to try to understand what was happening there.
To resolve it, the ideia was :
to prevent that more then one context menu were created every right mouse click, I have to ensure that the context menu will be closed if another instance of it is opened, in other words, I have to ensure that just one instance of the context menu is open each time it will called.
Thus,  the verification I'm doing is:

            if (self.context is not None):
                self.context = None

With it, I verify if the context is the only one; if it is not, the context menu is removed and the context is assigned with None.

      Gif to show how it is working well :-)

Parin told me also that a UI file should be used for large UIs and I should create a menu inside my code and add the options right there. Then, I insert the content of UI file in my code.

My branch on github is it, in case you wanna see my progress: https://github.com/elianerpereira/gtg/tree/geolocalized-tasks/GTG/plugins/geolocalized_tasks

If you have any question, let me know.

See you in next post!

domingo, 12 de janeiro de 2014

Welcome 2014, a lot of work to do!

**This post should have been posted last week, but shamefully, it was among the drafts, my mistake :-( **
I had a little vacation since 12/23/2014 until 01/01/2014 and it was so nice, I've been in Portugal and felt a little close to Brazil, my country :-)

Until now
While I was at the hotel, I was making small adjustments to the plugin, but without internet access, and a use case in which I had not thought about happened: what about the user is without internet access? That was my case and when I ran the program, it returned many errors.
My solution was not make the map available if the user is offiline. Thus, the program becomes more robust. I presented this solution to Parin and he suggested me that I should make the map avaible when the user is offline. And show the last user location. Parin also suggested me to take a look on the ChamplainFileCache, which I had relative performance. I take a look on gnome-maps's code and decide to use ChamplainMapSourceFactory. For now, when the user is offline, a map is shown, but  not the last user's location, yet. I spent a lot of time, searching and reading  to understand what must be done.

- Now the plugin allows the user to insert and remove markers.\o/
- I also made some fixes to install GTG properly.

To do soon
- Another suggestion from Parin: standardize the cursor to be a drag cursor and only turn the curser in a arrow when the user uses the mouse's right  button, to hold on the map or to make markers on the map.  
- Finish the problem to show the last location for the user when he is without internet acess.
- Integrate direct "tagging" with map's position (add a tag on a existing task)

See you in the next post!