| Top |
PolKitGnomeContextPolKitGnomeContext — Convenience functions for using PolicyKit from GTK+ and GNOME applications. |
| #define | POLKIT_GNOME_CONTEXT_ERROR |
| enum | PolKitGnomeContextError |
| PolKitGnomeContextPrivate | |
| struct | PolKitGnomeContext |
This class provides convenience functions for using PolicyKit from GTK+ and GNOME applications including setting up main loop integration and system bus connections. Rather than using callbacks, GObject signals are provided when external factors change (e.g. the PolicyKit.conf configuration file changes or ConsoleKit reports activity changes).
Actual usage of PolicyKit is still through the main PolicyKit API through the public pk_context and pk_tracker variables.
This class is implemented as a singleton meaning that several callers will share the underlying PolKitContext and PolKitTracker objects. Do not use any of the life cycle methods of these objects; only use them to gather information.
PolKitGnomeContext *
polkit_gnome_context_get (GError **error);
Returns a PolKitGnomeContext object. The context is a global singleton that may be shared with other callers of this function.
This operation can fail if the system message bus is not available.
When done with using this object, call g_object_unref(). This is
such that resources can be freed when all callers have unreffed it.
#define POLKIT_GNOME_CONTEXT_ERROR polkit_gnome_context_error_quark ()
Error domain for using the GNOME PolicyKit context. Errors in this domain will be from the PolKitGnomeContextError enumeration. See GError for information on error domains.
“config-changed” signalvoid user_function (PolKitGnomeContext *context, gpointer user_data)
The ::config-changed signal is emitted when PolicyKit configuration (e.g. /etc/PolicyKit/PolicyKit.conf or .policy files) changes content.
As this is one contributing factor to what answer PolicyKit will return, the caller should act on this signal and query PolicyKit for any actions it cares about.
Flags: Run Last
“console-kit-db-changed” signalvoid user_function (PolKitGnomeContext *context, gpointer user_data)
The ::console-kit-db-changed signal is emitted when ConsoleKit configuration changes; e.g. when a session becomes active or inactive.
As this is one contributing factor to what answer PolicyKit will return, the caller should act on this signal and query PolicyKit for any actions it cares about.
Flags: Run Last