Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GI.Gtk.Objects.LockButton
Contents
Description
GtkLockButton 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 Permission
object. Concrete implementations of Permission
may use
PolicyKit or some other authorization framework. To obtain a PolicyKit-based
Permission
, use polkit_permission_new()
.
If the user is not currently allowed to perform the action, but can obtain the permission, the widget looks like this:
and 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:
and 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 LockButton
:text-lock
, LockButton
:text-unlock
,
LockButton
:tooltip-lock
, LockButton
:tooltip-unlock
and
LockButton
:tooltip-not-authorized
properties.
- newtype LockButton = LockButton (ManagedPtr LockButton)
- class GObject o => IsLockButton o
- toLockButton :: (MonadIO m, IsLockButton o) => o -> m LockButton
- noLockButton :: Maybe LockButton
- lockButtonGetPermission :: (HasCallStack, MonadIO m, IsLockButton a) => a -> m Permission
- lockButtonNew :: (HasCallStack, MonadIO m, IsPermission a) => Maybe a -> m LockButton
- lockButtonSetPermission :: (HasCallStack, MonadIO m, IsLockButton a, IsPermission b) => a -> Maybe b -> m ()
- clearLockButtonPermission :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonPermission :: (IsLockButton o, IsPermission a) => a -> IO (GValueConstruct o)
- getLockButtonPermission :: (MonadIO m, IsLockButton o) => o -> m Permission
- setLockButtonPermission :: (MonadIO m, IsLockButton o, IsPermission a) => o -> a -> m ()
- clearLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTextLock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- setLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- clearLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTextUnlock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- setLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- clearLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTooltipLock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- setLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- clearLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTooltipNotAuthorized :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- setLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- clearLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTooltipUnlock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- setLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
Exported types
newtype LockButton Source #
Constructors
LockButton (ManagedPtr LockButton) |
Instances
class GObject o => IsLockButton o Source #
Instances
toLockButton :: (MonadIO m, IsLockButton o) => o -> m LockButton Source #
Methods
getPermission
lockButtonGetPermission Source #
Arguments
:: (HasCallStack, MonadIO m, IsLockButton a) | |
=> a |
|
-> m Permission | Returns: the |
Obtains the Permission
object that controls button
.
Since: 3.2
new
Arguments
:: (HasCallStack, MonadIO m, IsPermission a) | |
=> Maybe a |
|
-> m LockButton | Returns: a new |
Creates a new lock button which reflects the permission
.
Since: 3.2
setPermission
lockButtonSetPermission Source #
Arguments
:: (HasCallStack, MonadIO m, IsLockButton a, IsPermission b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the Permission
object that controls button
.
Since: 3.2
Properties
permission
clearLockButtonPermission :: (MonadIO m, IsLockButton o) => o -> m () Source #
constructLockButtonPermission :: (IsLockButton o, IsPermission a) => a -> IO (GValueConstruct o) Source #
getLockButtonPermission :: (MonadIO m, IsLockButton o) => o -> m Permission Source #
setLockButtonPermission :: (MonadIO m, IsLockButton o, IsPermission a) => o -> a -> m () Source #
textLock
clearLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> m () Source #
constructLockButtonTextLock :: IsLockButton o => Text -> IO (GValueConstruct o) Source #
getLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text) Source #
setLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
textUnlock
clearLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> m () Source #
constructLockButtonTextUnlock :: IsLockButton o => Text -> IO (GValueConstruct o) Source #
getLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text) Source #
setLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
tooltipLock
clearLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> m () Source #
constructLockButtonTooltipLock :: IsLockButton o => Text -> IO (GValueConstruct o) Source #
getLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text) Source #
setLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
tooltipNotAuthorized
clearLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> m () Source #
constructLockButtonTooltipNotAuthorized :: IsLockButton o => Text -> IO (GValueConstruct o) Source #
getLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text) Source #
setLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
tooltipUnlock
clearLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> m () Source #
constructLockButtonTooltipUnlock :: IsLockButton o => Text -> IO (GValueConstruct o) Source #
getLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text) Source #
setLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #