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 |
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 :: IsLockButton o => o -> IO LockButton
- noLockButton :: Maybe LockButton
- data LockButtonGetPermissionMethodInfo
- lockButtonGetPermission :: (HasCallStack, MonadIO m, IsLockButton a) => a -> m Permission
- lockButtonNew :: (HasCallStack, MonadIO m, IsPermission a) => Maybe a -> m LockButton
- data LockButtonSetPermissionMethodInfo
- lockButtonSetPermission :: (HasCallStack, MonadIO m, IsLockButton a, IsPermission b) => a -> Maybe b -> m ()
- data LockButtonPermissionPropertyInfo
- clearLockButtonPermission :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonPermission :: (IsLockButton o, IsPermission a) => a -> IO (GValueConstruct o)
- getLockButtonPermission :: (MonadIO m, IsLockButton o) => o -> m Permission
- lockButtonPermission :: AttrLabelProxy "permission"
- setLockButtonPermission :: (MonadIO m, IsLockButton o, IsPermission a) => o -> a -> m ()
- data LockButtonTextLockPropertyInfo
- clearLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTextLock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- lockButtonTextLock :: AttrLabelProxy "textLock"
- setLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- data LockButtonTextUnlockPropertyInfo
- clearLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTextUnlock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- lockButtonTextUnlock :: AttrLabelProxy "textUnlock"
- setLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- data LockButtonTooltipLockPropertyInfo
- clearLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTooltipLock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- lockButtonTooltipLock :: AttrLabelProxy "tooltipLock"
- setLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- data LockButtonTooltipNotAuthorizedPropertyInfo
- clearLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTooltipNotAuthorized :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- lockButtonTooltipNotAuthorized :: AttrLabelProxy "tooltipNotAuthorized"
- setLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
- data LockButtonTooltipUnlockPropertyInfo
- clearLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> m ()
- constructLockButtonTooltipUnlock :: IsLockButton o => Text -> IO (GValueConstruct o)
- getLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> m (Maybe Text)
- lockButtonTooltipUnlock :: AttrLabelProxy "tooltipUnlock"
- setLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m ()
Exported types
newtype LockButton Source #
GObject LockButton Source # | |
IsImplementorIface LockButton Source # | |
IsObject LockButton Source # | |
IsWidget LockButton Source # | |
IsContainer LockButton Source # | |
IsButton LockButton Source # | |
IsBin LockButton Source # | |
IsBuildable LockButton Source # | |
IsActivatable LockButton Source # | |
IsActionable LockButton Source # | |
IsLockButton LockButton Source # | |
((~) * info (ResolveLockButtonMethod t LockButton), MethodInfo * info LockButton p) => IsLabel t (LockButton -> p) Source # | |
((~) * info (ResolveLockButtonMethod t LockButton), MethodInfo * info LockButton p) => IsLabelProxy t (LockButton -> p) Source # | |
HasAttributeList * LockButton Source # | |
type AttributeList LockButton Source # | |
type SignalList LockButton Source # | |
class GObject o => IsLockButton o Source #
toLockButton :: IsLockButton o => o -> IO LockButton Source #
Methods
getPermission
data LockButtonGetPermissionMethodInfo Source #
((~) * signature (m Permission), MonadIO m, IsLockButton a) => MethodInfo * LockButtonGetPermissionMethodInfo a signature Source # | |
lockButtonGetPermission Source #
:: (HasCallStack, MonadIO m, IsLockButton a) | |
=> a |
|
-> m Permission | Returns: the |
Obtains the Permission
object that controls button
.
Since: 3.2
new
:: (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
data LockButtonSetPermissionMethodInfo Source #
((~) * signature (Maybe b -> m ()), MonadIO m, IsLockButton a, IsPermission b) => MethodInfo * LockButtonSetPermissionMethodInfo a signature Source # | |
lockButtonSetPermission Source #
:: (HasCallStack, MonadIO m, IsLockButton a, IsPermission b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the Permission
object that controls button
.
Since: 3.2
Properties
permission
data LockButtonPermissionPropertyInfo Source #
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 #
lockButtonPermission :: AttrLabelProxy "permission" Source #
setLockButtonPermission :: (MonadIO m, IsLockButton o, IsPermission a) => o -> a -> m () Source #
textLock
data LockButtonTextLockPropertyInfo Source #
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 #
lockButtonTextLock :: AttrLabelProxy "textLock" Source #
setLockButtonTextLock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
textUnlock
data LockButtonTextUnlockPropertyInfo Source #
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 #
lockButtonTextUnlock :: AttrLabelProxy "textUnlock" Source #
setLockButtonTextUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
tooltipLock
data LockButtonTooltipLockPropertyInfo Source #
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 #
lockButtonTooltipLock :: AttrLabelProxy "tooltipLock" Source #
setLockButtonTooltipLock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
tooltipNotAuthorized
data LockButtonTooltipNotAuthorizedPropertyInfo Source #
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 #
lockButtonTooltipNotAuthorized :: AttrLabelProxy "tooltipNotAuthorized" Source #
setLockButtonTooltipNotAuthorized :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #
tooltipUnlock
data LockButtonTooltipUnlockPropertyInfo Source #
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 #
lockButtonTooltipUnlock :: AttrLabelProxy "tooltipUnlock" Source #
setLockButtonTooltipUnlock :: (MonadIO m, IsLockButton o) => o -> Text -> m () Source #