First release of the GTG extension for Gnome-Shell

by bapt

Today I push my first release of the gnome-shell extension of GTG : Github repo

  • First implementation of the architecture :

I decided to rewrite the extension from the begining to provide a strong architecture.
For now the extension is composed by 3 files :

- extension.js this file will launch the “modules” of the extension.

- gtgsearchprovider.js represents the first module, it adds a search provider to gnome shell. This search provider will search in your gtg tasks and display results. In order to centralize features, this search is carried out by the overview.
- gtgdbus.js contains all the dbus-related things. Interfaces, proxy, usefull functions, etc…

For the future, I’ll add a file for each module and extension.js will just manage these modules (Launch, destruction, etc…)

  • Search provider for Gnome-Shell

As I explained before, this first release comes with a search provider. Just open the overview, type keywords to search in your tasks, and the extension will displays all results.
Of course, gtg must be launched.

You can see an example in this video :

  • How does it works ?

It’s quite simple. The extension contains the list of all the active tasks.
When a signal is emitted (TaskAdded, TaskModified, TaskDeleted) this list is updated :

this.addedSignal = GTGDBus.GTGProxy.connect(‘TaskAdded’,
function(sender, tid) { loadTasks(); });
this.modifiedSignal = GTGDBus.GTGProxy.connect(‘TaskModified’,
function(sender, tid) { loadTasks(); });
this.deletedTask = GTGDBus.GTGProxy.connect(‘TaskDeleted’,
function(sender, tid) { loadTasks(); });

Also, the extension watches the gtg state in DBus, if the interface vanishes, the list is emptied, if the interface appears, the list is updated :

GTGDBus.DBus.session.watch_name(“org.gnome.GTG”, false,
function() { running=true; loadTasks(); },
function() { running=false; loadTasks(); });

Now, the user can search with differents terms. The extension searches these terms in the list and displays results.

  • And after ?

After, I’ll begin the menu in the calendar widget and I’ll fix all bugs you found in the search provider :)