Package: gtk

Class gtk-lock-button

Superclasses

Documented Subclasses

None

Direct Slots

permission
The permission property of type g-permission (Read / Write)
The permission controlling this button.
text-lock
The text-lock property of type :string (Read / Write / Construct)
The text to display when prompting the user to lock.
Default value: "Lock"
text-unlock
The text-unlock property of type :string (Read / Write / Construct)
The text to display when prompting the user to unlock.
Default value: "Unlock"
tooltip-lock
The tooltip-lock property of type :string (Read / Write / Construct)
The tooltip to display when prompting the user to lock.
Default value: "Dialog is unlocked.n Click to prevent further changes"
tooltip-not-authorized
The tooltip-not-authorized property of type :string (Read / Write / Construct)
The tooltip to display when prompting the user cannot obtain authorization.
Default value: "System policy prevents changes.nContact your system administrator"
tooltip-unlock
The tooltip-unlock property of type :string (Read / Write / Construct)
The tooltip to display when prompting the user to unlock.
Default value: "Dialog is locked.nClick to make changes"

Details

The gtk-lock-button widget is a widget that can be used in control panels or preference dialogs to allow users to obtain and revoke authorizations needed to operate the controls. The required authorization is represented by a g-permission object. Concrete implementations of the g-permission may use PolicyKit or some other authorization framework. To obtain a PolicyKit-based g-permission object, use the polkit_permission_new() function.

If the user is not currently allowed to perform the action, but can obtain the permission, the widget looks like this:



The user can click the button to request the permission. Depending on the platform, this may pop up an authentication dialog or ask the user to authenticate in some other way. Once the user has obtained the permission, the widget changes to this:



The permission can be dropped again by clicking the button. If the user is not able to obtain the permission at all, the widget looks like this:



If the user has the permission and cannot drop it, the button is hidden.

The text (and tooltips) that are shown in the various cases can be adjusted with the text-lock, text-unlock, tooltip-lock, tooltip-unlock and tooltip-not-authorized properties.
 

Slot Access Functions

Inherited Slot Access Functions

See also

2021-12-23