Infinity.AdoptedUndoGrouping¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new() | 
| end_group(allow_group_with_next) | |
| get_algorithm() | |
| get_redo_size() | |
| get_undo_size() | |
| set_algorithm(algorithm, user) | |
| start_group(allow_group_with_prev) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| algorithm | Infinity.AdoptedAlgorithm | r/w | The algorithm for which to group requests | 
| user | Infinity.AdoptedUser | r/w | The user for which to group requests | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| group-requests | This signal is emitted whenever the Infinity.AdoptedUndoGroupingneeds to decide whether to put two requests into the same undo group or not. | 
Class Details¶
- 
class Infinity.AdoptedUndoGrouping(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Infinity.AdoptedUndoGroupingClass- Infinity.AdoptedUndoGroupingis an opaque data type. You should only access it via the public API functions.- 
classmethod new()¶
- Returns: - A new - Infinity.AdoptedUndoGrouping, to be freed via- GObject.Object.unref().- Return type: - Infinity.AdoptedUndoGrouping- Creates a new - Infinity.AdoptedUndoGrouping. To start grouping requests, set a user whose requests to group via- Infinity.AdoptedUndoGrouping.set_algorithm(). Before doing so you might want to connect to- Infinity.AdoptedUndoGrouping- ::group-requests, so the user’s initial requests can be grouped correctly.
 - 
end_group(allow_group_with_next)¶
- Parameters: - allow_group_with_next ( - bool) – Whether subsequent requests are allow to be part of this group if- Infinity.AdoptedUndoGrouping- ::group-requestsallows.- When - Infinity.AdoptedUndoGrouping.start_group() was called before, then this function restores the normal behaviour of grouping requests.
 - 
get_algorithm()¶
- Returns: - self’s algorithm. - Return type: - Infinity.AdoptedAlgorithm- Returns the - Infinity.AdoptedAlgorithmfor self.
 - 
get_redo_size()¶
- Returns: - The number of requests in the current redo group. - Return type: - int- Returns the number of requests to redo so that a whole group is being redone. This takes into account that possibly not the whole group cannot be undone due to the - Infinity.AdoptedAlgorithm- :max-total-log-sizeconstraint.
 - 
get_undo_size()¶
- Returns: - The number of requests in the current undo group. - Return type: - int- Returns the number of requests to undo so that a whole group is being undone. This takes into account that possibly not the whole group cannot be undone due to the - Infinity.AdoptedAlgorithm- :max-total-log-sizeconstraint.
 - 
set_algorithm(algorithm, user)¶
- Parameters: - algorithm (Infinity.AdoptedAlgorithm) – TheInfinity.AdoptedAlgorithmfor the document to group requests, orNone.
- user (Infinity.AdoptedUser) – The user for which to group requests, orNone. Ignored if algorithm isNone.
 - Sets the algorithm and user to group requests for. This function will group all requests in user’s request log, and also each new request that is added to it’s log. Requests that cannot be undone anymore (because they are too old), will be correctly taken care off. 
- algorithm (
 - 
start_group(allow_group_with_prev)¶
- Parameters: - allow_group_with_prev ( - bool) – Whether the new group can be part of the previous group if- Infinity.AdoptedUndoGrouping- ::group-requestsallows.- Makes all requests issued after this call belong into the same group, i.e. they will be undone at once. This can make sense for example when the user copy+pastes something into the document which causes multiple requests to be generated. A call to - Infinity.AdoptedUndoGrouping.end_group() restores the normal behavior.
 - 
do_group_requests(first, second) virtual¶
- Parameters: - first (Infinity.AdoptedRequest) –
- second (Infinity.AdoptedRequest) –
 - Return type: 
- first (
 
- 
classmethod 
Signal Details¶
- 
Infinity.AdoptedUndoGrouping.signals.group_requests(adopted_undo_grouping, first, second)¶
- Signal Name: - group-requests- Flags: - Parameters: - adopted_undo_grouping (Infinity.AdoptedUndoGrouping) – The object which received the signal
- first (Infinity.AdoptedRequest) – The previous request.
- second (Infinity.AdoptedRequest) – The current request.
 - Return type: - This signal is emitted whenever the - Infinity.AdoptedUndoGroupingneeds to decide whether to put two requests into the same undo group or not. A signal handler should return- Trueif they belong into the same group or- Falseotherwise. Note however that the two requests may not immediately follow each other because other users may have issued requests inbetween. Check the vector times of the requests to find out, using- Infinity.AdoptedRequest.get_vector().
- adopted_undo_grouping (
Property Details¶
- 
Infinity.AdoptedUndoGrouping.props.algorithm¶
- Name: - algorithm- Type: - Infinity.AdoptedAlgorithm- Default Value: - None- Flags: - READABLE,- WRITABLE- The algorithm for which to group requests 
- 
Infinity.AdoptedUndoGrouping.props.user¶
- Name: - user- Type: - Infinity.AdoptedUser- Default Value: - None- Flags: - READABLE,- WRITABLE- The user for which to group requests