diff options
author | Ted Gould <ted@canonical.com> | 2009-02-09 10:32:56 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-02-09 10:32:56 -0600 |
commit | d7d703649e0ff4e505c3637582e89f1b07e58263 (patch) | |
tree | 3785f6144ad234142a3b650d1aa30c91dae2c9e9 /libindicate/server.c | |
parent | b9558054100c8e66cead50a49036bf83e7e0e2f9 (diff) | |
parent | d42c9b5ee091596357efe8e1f29d0c16173dc068 (diff) | |
download | libayatana-indicator-d7d703649e0ff4e505c3637582e89f1b07e58263.tar.gz libayatana-indicator-d7d703649e0ff4e505c3637582e89f1b07e58263.tar.bz2 libayatana-indicator-d7d703649e0ff4e505c3637582e89f1b07e58263.zip |
Server hide function from Niel
Diffstat (limited to 'libindicate/server.c')
-rw-r--r-- | libindicate/server.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libindicate/server.c b/libindicate/server.c index f5bd0bb..84f7562 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -40,6 +40,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; typedef struct _IndicateServerPrivate IndicateServerPrivate; struct _IndicateServerPrivate { + DBusGConnection *connection; gchar * path; GSList * indicators; gboolean visible; @@ -265,6 +266,8 @@ indicate_server_show (IndicateServer * server) connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + priv->connection = connection; + dbus_g_connection_register_g_object(connection, priv->path, G_OBJECT(server)); @@ -275,6 +278,25 @@ indicate_server_show (IndicateServer * server) return; } +void +indicate_server_hide (IndicateServer * server) +{ + g_return_if_fail(INDICATE_IS_SERVER(server)); + IndicateServerPrivate * priv = INDICATE_SERVER_GET_PRIVATE(server); + + if (priv->visible) + return; + + priv->visible = FALSE; + + g_signal_emit(server, signals[SERVER_HIDE], 0, "", TRUE); + + dbus_g_connection_unref (priv->connection); + priv->connection = NULL; + + return; +} + static guint get_next_id (IndicateServer * server) { |