diff --git a/data/ConsoleKit.conf b/data/ConsoleKit.conf index 6c10476..216a0e9 100644 --- a/data/ConsoleKit.conf +++ b/data/ConsoleKit.conf @@ -80,6 +80,9 @@ send_member="CloseSession"/> + priv->seats) == 0) { + throw_error (context, CK_MANAGER_ERROR_NO_SEATS, _("User has no seats")); + return TRUE; + } + + g_variant_builder_init (&seat_builder, G_VARIANT_TYPE_ARRAY); + + g_hash_table_iter_init (&seat_iter, manager->priv->seats); + while (g_hash_table_iter_next (&seat_iter, &key, &value)) { + seat = g_variant_new("(so)", + console_kit_seat_get_name( CONSOLE_KIT_SEAT(value) ), + key); + + g_variant_builder_add_value (&seat_builder, seat); + } + + console_kit_manager_complete_list_seats (ckmanager, context, g_variant_builder_end (&seat_builder)); + return TRUE; +} + +static gboolean dbus_get_seats (ConsoleKitManager *ckmanager, GDBusMethodInvocation *context) { @@ -4134,6 +4172,7 @@ ck_manager_iface_init (ConsoleKitManagerIface *iface) iface->handle_stop = dbus_stop; iface->handle_suspend = dbus_suspend; iface->handle_close_session = dbus_close_session; + iface->handle_list_seats = dbus_list_seats; iface->handle_get_seats = dbus_get_seats; iface->handle_get_sessions = dbus_get_sessions; iface->handle_get_sessions_for_unix_user = dbus_get_sessions_for_unix_user; diff --git a/src/org.freedesktop.ConsoleKit.Manager.xml b/src/org.freedesktop.ConsoleKit.Manager.xml index a44880c..024a3e2 100644 --- a/src/org.freedesktop.ConsoleKit.Manager.xml +++ b/src/org.freedesktop.ConsoleKit.Manager.xml @@ -531,6 +531,24 @@ + + + + an array of seat names and IDs + + + + + Retrieves a list of all Seats + that are present on the system. + Like the logind method of the same name, this returns both the seat's name + (such as "seat0") and the D-Bus object path for the seat object that implements the + Seat interface. + + GetSeats() + + +