projecthamster/hamster — pull request #161 by miguel-guedes (2014-05-25 18:35:10+00:00)
Title: Changes to frontend -- v1.04

Changes to frontend

1) Do not allow multiple instances of the graphical client. This is done by opening a file in the system's temporary directory and locking it in exclusive mode.

When `hamster-cli` is invoked but an instance of the frontend is found to be running its main window is displayed instead of a new instance being instantiated.

2) The persistent dbus service `org.gnome.Hamster.WindowServer` was removed in favour of a dbus service created only whilst the hamster frontend is running. The name of this new service is `org.gnome.Hamster.Frontend`.

This new service exposes the same methods as `WindowServer` did albeit under different names. The interface allows the windows 'overview', 'preferences', 'statistics' and 'about' to be easily displayed as well as the frontend's main window, a feature that was sorely missing.

As before, it is possible to display any of the windows using the CLI.

The new methods exposed by the dbus service are:

void org.gnome.Hamster.Frontend.show_about_window()
void org.gnome.Hamster.Frontend.show_overview_window()
void org.gnome.Hamster.Frontend.show_preferences_window()
void org.gnome.Hamster.Frontend.show_statistics_window()
void org.gnome.Hamster.Frontend.show_main_window()
void org.gnome.Hamster.Frontend.toggle_main_window()

Note: changes to code were kept to a minimum to preserve current design, structure, symbol naming and logic as much as possible.