diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datetime-service.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c index 63590c7..da4cd87 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1,7 +1,40 @@ +#include <config.h> +#include <libindicator/indicator-service.h> + +#include <glib/gi18n.h> + +#include "dbus-shared.h" + +static IndicatorService * service = NULL; +static GMainLoop * mainloop = NULL; + +static void +service_shutdown (IndicatorService * service, gpointer user_data) +{ + g_warning("Shutting down service!"); + g_main_loop_quit(mainloop); + return; +} + int main (int argc, char ** argv) { + g_type_init(); + + service = indicator_service_new_version(SERVICE_NAME, SERVICE_VERSION); + g_signal_connect(service, INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_shutdown), NULL); + + /* Setting up i18n and gettext. Apparently, we need + all of these. */ + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain (GETTEXT_PACKAGE); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_object_unref(G_OBJECT(service)); return 0; } |