Panel.SaveDelegate¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
A |
||
r/w/en |
Icon Name |
||
r/w/en |
If the delegate contents are ephemeral until saved |
||
r/w/en |
The progress of the save operation |
||
r/w/en |
The subtitle of the document or documents to save |
||
r/w/en |
The title of the document or documents to save |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted when the save delegate should close the widget it is related to. |
|
This signal is emitted when the user has requested that the delegate discard the changes instead of saving them. |
|
This signal can be used when subclassing |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Panel.SaveDelegate(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a newly created
Panel.SaveDelegate
- Return type:
Create a new
Panel.SaveDelegate
.
- close()¶
- discard()¶
- get_icon()¶
- get_icon_name()¶
-
Gets the icon name for the save delegate.
- get_subtitle()¶
-
Gets the subtitle for the save delegate.
- get_title()¶
-
Gets the title for the save delegate.
- save_async(cancellable, callback, *user_data)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) –callback (
Gio.AsyncReadyCallback
orNone
) –
- save_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) –- Raises:
- Return type:
- do_close() virtual¶
- do_discard() virtual¶
- do_save_async(cancellable, callback, *user_data) virtual¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) –callback (
Gio.AsyncReadyCallback
orNone
) –
- do_save_finish(result) virtual¶
- Parameters:
result (
Gio.AsyncResult
) –- Return type:
Signal Details¶
- Panel.SaveDelegate.signals.close(save_delegate)¶
- Signal Name:
close
- Flags:
- Parameters:
save_delegate (
Panel.SaveDelegate
) – The object which received the signal
This signal is emitted when the save delegate should close the widget it is related to. This can happen after saving as part of a close request and it is now save for the delegate to close.
Implementations are encouraged to connect to this signal (or implement the virtual method) and call
Panel.Widget.force_close
().
- Panel.SaveDelegate.signals.discard(save_delegate)¶
- Signal Name:
discard
- Flags:
- Parameters:
save_delegate (
Panel.SaveDelegate
) – The object which received the signal
This signal is emitted when the user has requested that the delegate discard the changes instead of saving them.
Implementations are encouraged to connect to this signal (or implement the virtual method) and revert the document to the last saved state and/or close the document.
- Panel.SaveDelegate.signals.save(save_delegate, task)¶
- Signal Name:
save
- Flags:
- Parameters:
save_delegate (
Panel.SaveDelegate
) – The object which received the signal
- Returns:
True
if the operation was handled.- Return type:
This signal can be used when subclassing
Panel.SaveDelegate
is not possible or cumbersome. The default implementation ofPanel.SaveDelegate.do_save_async
() will emit this signal to allow the consumer to implement asynchronous save in a flexible manner.The caller is expected to complete task with a boolean when the save operation has completed.
Property Details¶
- Panel.SaveDelegate.props.icon¶
- Name:
icon
- Type:
- Default Value:
- Flags:
The “icon” property contains a
Gio.Icon
that describes the save operation. Generally, this should be the symbolic icon of the document class you are saving.Alternatively, you can use
Panel.SaveDelegate
:icon-name
for a named icon.
- Panel.SaveDelegate.props.icon_name¶
- Name:
icon-name
- Type:
- Default Value:
- Flags:
The “icon-name” property contains the name of an icon to use when showing information about the save operation in UI such as a save dialog.
You can also use
Panel.SaveDelegate
:icon
to set aGio.Icon
instead of an icon name.
- Panel.SaveDelegate.props.is_draft¶
- Name:
is-draft
- Type:
- Default Value:
- Flags:
The “is-draft” property indicates that the document represented by the delegate is a draft and might be lost of not saved.
- Panel.SaveDelegate.props.progress¶
- Name:
progress
- Type:
- Default Value:
0.0
- Flags:
The “progress” property contains progress between 0.0 and 1.0 and should be updated by the delegate implementation as saving progresses.
- Panel.SaveDelegate.props.subtitle¶
- Name:
subtitle
- Type:
- Default Value:
- Flags:
The “subtitle” property contains additional information that may not make sense to put in the title. This might include the directory that the file will be saved within.