Module gwy :: Class ResourceEditor
[hide private]
[frames] | no frames]

Class ResourceEditor

source code

Instance Methods [hide private]
 
get_edited()
Gets the currently edited resource.
source code
 
queue_commit()
Queues commit of resource changes, marking the currently edited resource `dirty'.
source code
 
commit()
Commits pending resource changes, if there are any.
source code
 
setup()
Sets up particular resource editor.
source code
Method Details [hide private]

get_edited()

source code 

Gets the currently edited resource.

It is an error to call this method when no resource is being edited.

Returns:
The currently edited resource. (Resource)

queue_commit()

source code 

Queues commit of resource changes, marking the currently edited resource `dirty'.

Call this method in particular resource editor subclass whenever user changes some editor property.

To flush pending commit, call Resource.editor_commit(). To immediately commit a change, call this method and then Resource.editor_commit().

commit()

source code 

Commits pending resource changes, if there are any.

It calls apply_changes method first (if it exists), then saves resource to disk.

Changes are always immediately committed (if there are any pending): before the editor is destroyed, when a resource stops being edited, before a resource is deleted, before a resource is renamed. When a resource is newly created, it is immediately created on disk too.

Returns:
Always False (to be usable as GSourceFunc). (bool)

setup()

source code 

Sets up particular resource editor.

Helper method only intended for resource editor implementation. To be called in particular resource initialization methods.