RGtk2 (version 2.20.31)

GMountOperation: GMountOperation

Description

Object used for authentication and user interaction

Arguments

Hierarchy

GFlags
   +----GAskPasswordFlags
GEnum
   +----GPasswordSave
GObject
   +----GMountOperation
GEnum
   +----GMountOperationResult

Detailed Description

GMountOperation provides a mechanism for interacting with the user. It can be used for authenticating mountable operations, such as loop mounting files, hard drive partitions or server locations. It can also be used to ask the user questions or show a list of applications preventing unmount or eject operations from completing. Note that GMountOperation is used for more than just GMount objects – for example it is also used in gDriveStart and gDriveStop. Users should instantiate a subclass of this that implements all the various callbacks to show the required dialogs, such as GtkMountOperation. If no user interaction is desired (for example when automounting filesystems at login time), usually NULL can be passed, see each method taking a GMountOperation for details.

Structures

Convenient Construction

gMountOperation is the equivalent of gMountOperationNew.

Enums and Flags

GAskPasswordFlags
GAskPasswordFlags are used to request specific information from the user, or to notify the user of their choices in an authentication situation.
need-password
operation requires a password.
need-username
operation requires a username.
need-domain
operation requires a domain.
saving-supported
operation supports saving settings.
anonymous-supported
operation supports anonymous users.
GPasswordSave
GPasswordSave is used to indicate the lifespan of a saved password. Gvfs stores passwords in the Gnome keyring when this flag allows it to, and later retrieves it again from there.
never
never save a password.
for-session
save a password for the session.
permanently
save a password permanently.
GMountOperationResult
GMountOperationResult is returned as a result when a request for information is send by the mounting operation.
handled
The request was fulfilled and the user specified data is now available
aborted
The user requested the mount operation to be aborted
unhandled
The request was unhandled (i.e. not implemented)

Signals

aborted(user.data)
Emitted by the backend when e.g. a device becomes unavailable while a mount operation is in progress. Implementations of GMountOperation should handle this signal by dismissing open password dialogs. Since 2.20
ask-password(op, message, default.user, default.domain, flags, user.data)
Emitted when a mount operation asks the user for a password. If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.
op
a GMountOperation requesting a password.
message
string containing a message to display to the user.
default.user
string containing the default user name.
default.domain
string containing the default domain.
flags
a set of GAskPasswordFlags.
user.data
user data set when the signal handler was connected.
ask-question(op, message, choices, user.data)
Emitted when asking the user a question and gives a list of choices for the user to choose from. If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog.
op
a GMountOperation asking a question.
message
string containing a message to display to the user.
choices
a list of strings for each possible choice.
user.data
user data set when the signal handler was connected.
reply(op, result, user.data)
Emitted when the user has replied to the mount operation.
op
a GMountOperation.
result
a GMountOperationResult indicating how the request was handled
user.data
user data set when the signal handler was connected.
show-processes(op, message, processes, choices, user.data)
Emitted when one or more processes are blocking an operation e.g. unmounting/ejecting a GMount or stopping a GDrive. Note that this signal may be emitted several times to update the list of blocking processes as processes close files. The application should only respond with gMountOperationReply to the latest signal (setting "choice" to the choice the user made). If the message contains a line break, the first line should be presented as a heading. For example, it may be used as the primary text in a GtkMessageDialog. Since 2.22
op
a GMountOperation.
message
string containing a message to display to the user.
processes
a list of GPid for processes blocking the operation.
choices
a list of strings for each possible choice.
user.data
user data set when the signal handler was connected.

Properties

anonymous [logical : Read / Write]
Whether to use an anonymous user when authenticating. Default value: FALSE
choice [integer : Read / Write]
The index of the user's choice when a question is asked during the mount operation. See the "ask-question" signal. Allowed values: >= 0 Default value: 0
domain [character : * : Read / Write]
The domain to use for the mount operation. Default value: NULL
password [character : * : Read / Write]
The password that is used for authentication when carrying out the mount operation. Default value: NULL
password-save [GPasswordSave : Read / Write]
Determines if and how the password information should be saved. Default value: G_PASSWORD_SAVE_NEVER
username [character : * : Read / Write]
The user name that is used for authentication when carrying out the mount operation. Default value: NULL

References

http://library.gnome.org/devel//gio/GMountOperation.html