GSOC with gnome-clocks – Final Report

Well people, the summer is sadly long gone, at least for me, and my summer of coding is approaching its end as well. I must say, that I am very thankful to Google for this opportunity to work in concert with my preferred desktop environment, which is still GNOME. I am glad, that I have seized this frame to finally move myself toward the first contribution to the GNOME project. I really enjoy this time and it’s a great pleasure for me, may be due my awesome mentor Paolo Borelli, I luckily have chosen for me. Thank you. 🙂 Moreover, during this period I have improved my knowledge in different areas and gained a lot of experience.

About the project results: as were reported many times geolocation support has managed to land in last minute to the 3.10 release, which is for sure great!
Moreover, there is even a not yet documented option for our users to toggle the geolocation service:

$ echo "Turn off geolocation support"
$ gsettings set org.gnome.clocks geolocation 'false'
$ echo "Turn on again"
$ gsettings set org.gnome.clocks geolocation 'true'

There is an experimental city images support in gnome-clocks available in the wip/cityimages branch try it out.
Screenshot from 2013-09-21 18:53:33 A youtube video is also available: city images – preview. The video illustrates the functionality of the implemented image providers: flickr image provider requests the corresponding images from the gnome-clocks flickr group, and downloads them for you, so the next time you launch the application they appear instantaneously. The capabilities of the local image provider are also demonstrated: It means, that you always have a possibility to overwrite the suggested image by the flickr provider with your own, you would like to see in gnome-clocks. Therefore you just need to put the corresponding image file into the folder:

~/.local/share/gnome-clocks/city-images/

Be aware of the following name convention for the image files. They should be named like: “berlin-germany-day.jpg” At the moment you can have two images for each location; one for a day and one for a night, the latter having the suffix “…-night.jpg” in its file name.

More information about gnome-clocks enhancements are available on the project page. Take care 🙂

Aaaah, and one more thank you for my sponsored travel to the GUADEC this year, it was just amazing 🙂
sponsored-badge-simple

Maintenance of the Project’s Page

After a few reminders I have finally managed to update during the last week my Summer of code page for the so lovely Clocks project. Now, it contains a lot of more contents instead of many promising “todo” statements. Since then I try to keep it up to date by including exemplary new code snippets or by informing you about ongoing activities. So I hope that, besides me, you can also find it useful for you. 🙂

Vala support for the Libgweather

The recent version of libgweather library from git master comes with the Vala bindings support. At least the Clocks App (gnome-clocks) will heavily rely on this bindings support and therefore we are very thankful to Giovanni Campagna for his fruitful cooperation and good and friendly support.

Please note additionally, that the new version of libgweather will deprecate some function calls. To obtain a new instance of the Location object the function “gweather_location_get_world” should be used instead of “gweather_location_new_world”. “gweather_location_new_world” is deprecated and should be omitted in the newly written code. There are many more, so for more details please refer to the official documentation.

In favour of this good announcement I would like to share with you a small sample code written in Vala, in which some capabilities of the libgweather library are briefly demonstrated: This example reveals how to obtain a timezone name for almost all corresponding major cities.
libgweather
Sample app:

public class LocationInfo {
    private Gtk.Window window;
    private Gtk.Box box;
    private GWeather.LocationEntry location_entry;
    private Gtk.Label city_label;
    private Gtk.Label timezone_label;

    public LocationInfo () {
        Gtk.Builder builder = new Gtk.Builder ();

        try {
            builder.add_from_file ("window.ui");
        } catch (Error e) {}

        this.window = builder.get_object ("window") as Gtk.Window;

        this.window.title = "libgweather testing";
        this.window.border_width = 10;
        this.window.window_position = Gtk.WindowPosition.CENTER;
        this.window.destroy.connect (Gtk.main_quit);

        this.box = builder.get_object ("box") as Gtk.Box;
        this.location_entry =
          new GWeather.LocationEntry (GWeather.Location.get_world ());
        this.location_entry.set_activates_default (true);
        this.location_entry.changed.connect (this.location_defined);
        this.box.pack_start (location_entry);

        this.city_label = builder.get_object ("city") as Gtk.Label;
        this.timezone_label = builder.get_object ("time_zone") as Gtk.Label;
    }

    public void show () {
        this.window.show_all ();
    }

    private void location_defined () {
        GWeather.Location? l = null;
        GWeather.Timezone? t = null;

        if (this.location_entry.get_text () != "") {
            l = this.location_entry.get_location ();
        }

		if (l != null) {
			t = l.get_timezone ();

			this.city_label.set_text (l.get_city_name ());

			if (t != null)
				this.timezone_label.set_text (t.get_tzid ());
			else
				this.timezone_label.set_text ("Unknown");
		}
		else {
			this.city_label.set_text ("");
			this.timezone_label.set_text ("");
		}
	}

    public static void main (string[] args)	{
        Gtk.init (ref args);

        var location_info = new LocationInfo ();
        location_info.show ();
	
		Gtk.main ();
	}
}

The code can be compiled with the following Makefile:

all:
	valac --pkg gtk+-3.0 --target-glib=2.38 gweather-sample.vala \
		--pkg gweather-3.0 -X -DGWEATHER_I_KNOW_THIS_IS_UNSTABLE

The source code can be found here: libgweather-vala.tar.gz.

Impressions after the GUADEC 2013 in Brno

Right before the conference I should admit that I was very sceptical, not only because it was my first computer science related conference at all, and thus as well the first attempt to join and meet the entire GNOME community. I was not sure about the accommodation and if I will enjoy my stay there and I personally could not justify for me the chosen location. But as I came there, it quickly turned out that all my concerns were about nothing. The Taufer dormitory, where the most of us stayed during the conference was a peaceful place, not at all what I used to imaging in my head, incorporating all my previous experience, when I hear the word “dormitory”.

The city itself and the downtown is just amazing, there are just a lot of to observe. Just to go for a walk was a pleasure for me there.

I do not really know how it could happen to me but I am also a picky vegetarian, so normally I tend to lose weight heavily once I am on holiday, somewhere in italy or spain. Therefore this time I was really prepared and about one third of my luggage was filled with fast food which I took back to home. I am still trying to figure out, why the meal there was so tasty, was it so, because it was so cheap and people were so friendly or they really know how to cook, maybe both. 🙂 To be honest, I still have no idea… During my stay in Brno I as well tasted different sorts of beer and enjoyed local drinks. SAMSUNG CSC

The conference took place in a modern building and moreover was very well organized. Each conference day was accompanied by an entertainment. One of them was a guided tour around Brno and a football game.

The given talks were very exciting. Moreover these talks were also recorded, so you can use an opportunity to grab them and follow them yourself. I also missed some of them, so I plan to watch them online.

There are some selected pictures of a guided tour:
SAMSUNG CSCWe had a wise guide, by all means. 🙂 There are rumors, that he is one of the best.
SAMSUNG CSC
There are of course some pictures of the football game, I would like to share with you:
SAMSUNG CSC
If it’s still not hot for you, it should be mentioned, that is was about 30 degrees outside. So I allow me to say that it definitely was one of the hottest events in Brno. 🙂
SAMSUNG CSC
Additionally there is also a short video of that amazing football game. 🙂 And yes, it ends with a GOAAAL!!!

The way back home was a real adventure. Maybe because I wanted to stay there for a couple of days longer, and this was in the air. To summarize shortly, nine of ten things which was initially planned, to get home in safety, went wrong. On the following picture It looks like that I have missed my plane.
SAMSUNG CSC
But luckily for me, I have not missed the plane, and it was one of a few things which worked as expected, and thus at the end of the day, I landed with a smile on my face, so probably I was happy. 🙂

To sum up, without over pushing: The GUADEC is a must for everyone and in this conference that plank were raised very high, so to organize the next GUADEC will be a very tough task! Give five😀
sponsored-badge-simple

How to fix a keyboard indicator (in GNOME 3.8)

Recently and occasionally I have discovered a tiny issue, which I was forced to observe, every time I was looking at my desktop. This has happen after I have decided to add a keyboard layout for russian language, which was based on german phonetics. So this is what I ended with:

Quickly I have got slightly frustrated, because I started to mix up things a little bit, so I started to look at gnome’s source code, especially searching for a xml database in gnome-control-center and gnome-desktop, and gave up it this idea, as I was not able to find anything particular useful and started to ask around in the IRC channels. Lucky, as people sometimes say that any initiative can be hardly punished, I have got a response from Rui Matos, one of the GNOME developers working on gnome-desktop. He pointed me out to the right direction:

rtcm, I mean, how this names “de1” and “de2” or “ru” are generated, where can I find the corresponding code?
ibqn: the code is in the gnome-desktop module, but it’s just simply getting what’s defined in xkeyboard-config’s data, see http://cgit.freedesktop.org/xkeyboard-config/tree/rules/base.xml.in#n3223
rtcm, so why is it called “de2” and not “ru” instead? looks like a bug
ibqn: those labels are the elements, if you believe that specific layout should have ‘ru’ as its short description, file a bug (preferably with a patch) in freedesktop’s bugzilla
rtcm, thank you for making it clear to me.
ibqn: no prob, I hope I helped 🙂

The following procedure was almost straightforward, I simply cloned their git repository, modified the corresponding file, I believe should be right, committed it locally and finally created a trivial one liner patch:

From 2cbb166e05eae603a2e640eeb3558942a89ecd7e Mon Sep 17 00:00:00 2001
From: Evgeny Bobkin <evgen.ibqn@gmail.com>
Date: Thu, 16 May 2013 14:15:26 +0200
Subject: [PATCH] Fix keyboard indicator for russian (germany, phonetic)

---
 rules/base.xml.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rules/base.xml.in b/rules/base.xml.in
index 5996738..2735723 100644
--- a/rules/base.xml.in
+++ b/rules/base.xml.in
@@ -3223,6 +3223,8 @@
         <variant>
           <configItem>
             <name>ru</name>
+            <!-- Keyboard indicator for Russian layouts -->
+            <_shortDescription>ru</_shortDescription>
             <_description>Russian (Germany, phonetic)</_description>
             <languageList>
               <iso639Id>rus</iso639Id>
-- 
1.8.1.5

As a gentoo user I also have the ability to test every particular package and change its source code without risking or being afraid of irreparably breaking my system, because, due to this modifications, all broken libraries can be easily tracked down and fixed by recreating their reverse dependencies (with revdep-rebuild for example). Therefore I have copied the xkeyboard-config ebuild to my local overlay and included the created patch to it, so I was able to test it and thus fixed the issue. Afterwards, I have filed a bug report and shortly this patch was included upstream. One more success story.

So, what can you do if you have no ability to apply the patch or use the latest version, or even if you want to fix the similar issue locally on your computer? There is also an easy way: you should try to modify the base.xml file accordingly, probably located here:

$ vim /usr/share/X11/xkb/rules/base.xml

And in the case of a new issue, please also open a bug report (with an attached patch to it), so that other people can also profit from your work done.
Enjoy!!!

PS: By the way my stand alone research was not that vain as I have described above, I finally found after years of looking for it, the source code of the Cyrillic (Transliterated) input method plugin, you observe every time when you right-click the mouse pointing on the text field (or entry box), followed by selecting the bottom menu item “Input Methods”

GNOME 3.8 is underway

During the sources of the one of the most beautiful graphical desktop environments are landing on the official gnome server, I would like to forward the message to everyone that GNOME 3.8 is going to be released officially in the coming weeks.gnome 3.6 desktop It will have for sure a lot of new and great features, which increase the pleasure of computer usage. One the features I have discovered already is the integrated MTP support (via libmtp) in gvfs. It allows you in nautilus an out of the box connection, transfer and managing of you files with new Android devices, like tabs and smartphones, respectively. Enjoy!!!