16 Commits

Author SHA1 Message Date
Blottiere Paul
51d156d349 Update doc 2017-11-16 08:01:07 +00:00
Matthias Kuhn
37e9272f3d Fix API typo 2017-10-29 13:31:17 +01:00
Matthias Kuhn
0c321fb5b0 Decouple transaction handling from QgsProject 2017-10-29 13:31:17 +01:00
Blottiere Paul
4923a3f3e8 Rename signal in dirtied 2017-10-25 15:29:13 +01:00
Blottiere Paul
32ff78b377 [FEATURE] Add a flag to dirty edit buffer when using executeSql in transactions 2017-10-25 15:29:13 +01:00
Vincent Mora
f63c302420 [FEATURE] Add undo and redo on transaction groups (#4765)
* [FEATURE] adds undo/redo for transaction groups

[needs-docs] the undo/redo now works with transcation groups. Just check
that there is no restriction in the transaction groups doc concerning
undo.

related to #14799

The undo/redo is implemented using SAVEPOINT.

The QgsTransaction interface has been enlarged to allow savepoints
creation and management. The savepoint is destroyed on
rollbackToSavepoint to have the same behavior has the sql ROLLBACK TO
SAVEPPOINT.

To avoid the creation of a savepoint for each feature modified in bulk
editing (e.g. paste, field calculator) the logic is a bit complicated: the
savepoint is created on QgsVectorLayer::editCommandStarted and the first
actual undo command (QgsVectorLayerUndoPassthroughCommand) is
responsible for the re-creation of the savepoint in case of undo-redo.
Since the behavior must be different in case edition doesn't take place
inside an edit command, a member function has been added to
QgsVectorLayer to expose the mEditCommandActive state.

Another (commented) tricky bit is the modification of the database
structure on add/delete attributes. On undo, the attribute is removed
before the rollback to savepoint, i.e. there is a useless ALTER TABLE
issued to restore the structure just before restoring it with the
ROLLBACK TO SAVEPOINT. This is necessary to make the provider
aware of the change of structure. It could be nicer/cleaner to have a way
to reload providers metadata.

The editPaste function has also been modified to use addFeatures instead of
addFeature (plural/singular), this is at the expense of an additional "cpy"
of the clipboard in memory, but it should improve perf with postgis provider.

* fixup operator aliases
2017-09-15 14:55:43 +02:00
Matthias Kuhn
931bf32a9f Doxymentation for QgsTransaction 2017-05-05 15:39:29 +02:00
Denis Rouzaud
93971d5ed3 [sip] align pointer and reference in blacklisted files
this will facilitate sip diff checking
2017-05-01 17:49:43 +02:00
Juergen E. Fischer
a90be95f7b sip sync 2016-02-14 03:50:49 +01:00
Matthias Kuhn
9b51007071 Add transaction groups 2016-01-15 12:18:44 +01:00
Matthias Kuhn
e76949b2a0 More sip bindings 2015-12-01 11:45:44 +01:00
Matthias Kuhn
bb9eb79021 More missing sip bindings
Ouch
2015-12-01 10:27:46 +01:00
Matthias Kuhn
95d227176b Add missing sip bindings 2015-12-01 09:20:00 +01:00
Matthias Kuhn
55db2abc5c Fix sip bindings for QgsTransaction 2015-06-01 16:06:15 +02:00
Juergen E. Fischer
abd4a04399 sip update 2015-02-03 02:21:52 +01:00
Sandro Mani
40ad3b0993 [FEATURE]: Transactional editing for postgres layers (other datasources possible in the future). Funded by City of Uster 2015-01-19 15:22:20 +01:00