subsurface/core
Berthold Stoeger 7067e33596 Undo: select dives after add, remove, merge, split dive commands
Select the proper dives after the add, remove, split and merge
dives commands on undo *and* redo. Generally, select the added
dives. For undo of add, remember the pre-addition selection.
For redo of remove, select the closest dive to the first removed
dive.

The biggest part of the commit is the signal-interface between
the dive commands and the dive-list model and dive-list view.
This is done in two steps:
1) To the DiveTripModel in batches of trips. The dive trip model
   transforms the dives into indices.
2) To the DiveListView. The DiveListView has to translate the
   DiveTripModel indexes to actual indexes via its QSortFilterProxy-
   model.

For code-reuse, derive all divelist-changing commands from a new base-class,
which has a flag that describes whether the divelist changed. The helper
functions which add and remove dives are made members of the base class and
set the flag is a selected dive is added or removed.

To properly detect when the current dive was deleted it
became necessary to turn the current dive from an index
to a pointer, because indices are not stable.

Unfortunately, in some cases an index was expected and these
places now have to transform the dive into an index. These
should be converted in due course.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-11 16:22:27 -07:00
..
settings Prefs: add bool preference cloud_auto_sync [1/3] 2018-10-09 10:03:21 -07:00
subsurface-qt Undo: select dives after add, remove, merge, split dive commands 2018-10-11 16:22:27 -07:00
android.cpp Make device enumeration use the device transport data 2018-08-27 22:10:38 -07:00
btdiscovery.cpp BT OSTC 3 should be reported as OSTC Plus 2018-10-09 21:04:23 -07:00
btdiscovery.h
checkcloudconnection.cpp prefs: git_local_only is not a preference 2018-09-10 16:26:49 -07:00
checkcloudconnection.h
cloudstorage.cpp core/settings ... : remove qPref* includes in qPref.h 2018-09-11 17:25:00 -07:00
cloudstorage.h prefs: cloud_new_password is not a preference 2018-09-10 16:26:49 -07:00
CMakeLists.txt Dive list: implement proper Qt-model semantics for DiveTripModel 2018-10-11 16:22:27 -07:00
cochran.c Core: remove dive->downloaded flag 2018-10-06 19:47:06 -07:00
cochran.h
color.cpp Cleanup: silence clang missing braces warning in core/color.cpp 2018-09-01 11:31:18 -07:00
color.h Cleanups to core/color.[c|hpp] 2018-07-18 02:09:15 +03:00
compressibility.r
configuredivecomputer.cpp
configuredivecomputer.h
configuredivecomputerthreads.cpp libdivecomputer: remove ifdefs for ancient versions 2018-10-08 23:06:09 +03:00
configuredivecomputerthreads.h
connectionlistmodel.cpp Substring match BT address 2018-10-09 21:04:23 -07:00
connectionlistmodel.h core: add indexOf member to ConnectionListModel 2018-08-11 11:14:22 -07:00
datatrak.c Parser: parse text-based files into arbitrary table 2018-09-28 15:06:00 -07:00
datatrak.h Cleanup: const-ify functions taking dives and divecomputers 2018-08-23 14:41:01 -07:00
deco.c Cleanup: const-ify functions taking pointers to events 2018-08-23 05:16:38 -07:00
deco.h Cleanup: const-ify functions taking pointers to events 2018-08-23 05:16:38 -07:00
device.c
device.h
devicedetails.cpp
devicedetails.h
display.h Make device enumeration use the device transport data 2018-08-27 22:10:38 -07:00
dive.c Undo: implement rudimentary support for undo of dive-merging 2018-10-11 16:22:27 -07:00
dive.h Undo: select dives after add, remove, merge, split dive commands 2018-10-11 16:22:27 -07:00
divecomputer.cpp core: remove SettingsObjectWrapper and update qPref calls 2018-08-15 16:11:39 -07:00
divecomputer.h
divelist.c Undo: select dives after add, remove, merge, split dive commands 2018-10-11 16:22:27 -07:00
divelist.h Undo: select dives after add, remove, merge, split dive commands 2018-10-11 16:22:27 -07:00
divelogexportlogic.cpp Statistics: only consider selected dives in HTML export statistics 2018-10-07 17:50:51 +03:00
divelogexportlogic.h
divesite-helper.cpp Translations: unify gettextFromC::tr() and QObject::tr() 2018-07-04 05:33:31 +08:00
divesite.c Leak fix: free taxonomy data in delete_dive_site() 2018-10-07 23:40:37 +03:00
divesite.h Dive sites: don't add dummy entries to LocationInformationModel 2018-10-09 21:00:44 -07:00
divesitehelpers.cpp
divesitehelpers.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
downloadfromdcthread.cpp QML UI: do not try to download from DC with empty vendor/product 2018-10-10 06:27:21 -07:00
downloadfromdcthread.h Cleanup: reinstate override modifiers 2018-09-29 15:23:25 -07:00
equipment.c Cleanup: user properly typed pointers 2018-08-23 05:21:08 -07:00
errorhelper.c
exif.cpp
exif.h
file.c Parser: parse text-based files into arbitrary table 2018-09-28 15:06:00 -07:00
file.h Parser: parse text-based files into arbitrary table 2018-09-28 15:06:00 -07:00
format.cpp
format.h
gas-model.c Cleanup: pass gasmix by value 2018-08-23 05:16:38 -07:00
gaspressures.c Cleanup: const-ify functions taking pointers to events 2018-08-23 05:16:38 -07:00
gaspressures.h
gettext.h
gettextfromc.cpp
gettextfromc.h
git-access.c prefs: git_local_only is not a preference 2018-09-10 16:26:49 -07:00
git-access.h prefs: git_local_only is not a preference 2018-09-10 16:26:49 -07:00
gpslocation.cpp cleanup: remove more GPS webservice code 2018-09-24 07:20:25 -07:00
gpslocation.h core: fix connect call 2018-09-24 07:20:25 -07:00
imagedownloader.cpp Dive media: Extract thumbnails from videos with ffmpeg 2018-07-28 15:31:25 -07:00
imagedownloader.h Dive media: Extract thumbnails from videos with ffmpeg 2018-07-28 15:31:25 -07:00
import-cobalt.c
import-csv.c Import: remove unnecessary processing of dives in DAN import 2018-10-04 07:37:28 +02:00
import-csv.h Parser: parse text-based files into arbitrary table 2018-09-28 15:06:00 -07:00
import-divinglog.c Cleanup: pass gasmix by value 2018-08-23 05:16:38 -07:00
import-shearwater.c
import-suunto.c
ios.cpp Make device enumeration use the device transport data 2018-08-27 22:10:38 -07:00
isocialnetworkintegration.cpp
isocialnetworkintegration.h
libdivecomputer.c libdivecomputer: remove ifdefs for ancient versions 2018-10-08 23:06:09 +03:00
libdivecomputer.h qt-ble: add 'get_name()' function to expose the BLE name to libdivecomputer 2018-10-08 00:10:29 +03:00
liquivision.c Core: remove dive->downloaded flag 2018-10-06 19:47:06 -07:00
load-git.c Undo: make diverse trip-related operations undo-able 2018-10-11 16:22:27 -07:00
macos.c macOS: always list 'FTDI' as a serial connection 2018-09-24 18:51:21 +02:00
membuffer.c
membuffer.h
metadata.cpp Metadata: rudimentary support for XMP metadataa in MP4-based videos 2018-09-25 14:59:14 -07:00
metadata.h Metadata: extract duration fom QuickTime/MP4-style containers 2018-07-14 08:32:30 +02:00
metrics.cpp
metrics.h
ostctools.c
parse-xml.c Allow XML sample times to have hh:mm:sec format 2018-09-26 12:13:20 -07:00
parse.c Undo: make diverse trip-related operations undo-able 2018-10-11 16:22:27 -07:00
parse.h Parser: move match() into core/parse-xml.c 2018-08-30 13:32:09 -07:00
planner.c Cleanup: const-ify functions taking pointers to events 2018-08-23 05:16:38 -07:00
planner.h Cleanup: pass gasmix by value 2018-08-23 05:16:38 -07:00
plannernotes.c Planner: fix display of "overlapping dives" message 2018-09-12 14:17:55 -07:00
pluginmanager.cpp
pluginmanager.h
pref.h Prefs: add bool preference cloud_auto_sync [1/3] 2018-10-09 10:03:21 -07:00
profile.c Undo: select dives after add, remove, merge, split dive commands 2018-10-11 16:22:27 -07:00
profile.h Cleanup: const-ify functions taking pointers to events 2018-08-23 05:16:38 -07:00
qt-ble.cpp qt-ble: add 'get_name()' function to expose the BLE name to libdivecomputer 2018-10-08 00:10:29 +03:00
qt-ble.h qt-ble: add 'get_name()' function to expose the BLE name to libdivecomputer 2018-10-08 00:10:29 +03:00
qt-gui.h core,tests: change qml register function 2018-09-11 17:22:58 -07:00
qt-init.cpp Set desktop file name to avoid a broken icon under KDE Wayland 2018-09-09 18:44:40 -07:00
qthelper.cpp core: remove QSettings from qthelper 2018-08-25 11:49:47 -07:00
qthelper.h For media file open dialog add different file filters 2018-07-15 09:38:12 -07:00
qtserialbluetooth.cpp qt-ble: add 'get_name()' function to expose the BLE name to libdivecomputer 2018-10-08 00:10:29 +03:00
save-git.c cleanup[3/6]: do not save the userid any more 2018-09-11 15:38:20 -07:00
save-html.c Cleanup: constify get_units() 2018-09-07 11:03:30 -07:00
save-html.h
save-xml.c Optional anonymization upon export 2018-09-13 08:16:54 -07:00
serial_ftdi.c ftdi: make the timeout be based on actual real time 2018-10-08 00:10:29 +03:00
sha1.c
sha1.h
ssrf.h
statistics.c Statistics: only consider selected dives in HTML export statistics 2018-10-07 17:50:51 +03:00
statistics.h Statistics: only consider selected dives in HTML export statistics 2018-10-07 17:50:51 +03:00
strndup.h
strtod.c
subsurface-string.h
subsurfacestartup.c qPref: add mobile_scale preference 2018-09-25 15:58:17 +02:00
subsurfacestartup.h
subsurfacesysinfo.cpp
subsurfacesysinfo.h
taxonomy.c
taxonomy.h
time.c
uemis-downloader.c Core: remove dive->downloaded flag 2018-10-06 19:47:06 -07:00
uemis.c
uemis.h
units.h
unix.c Make device enumeration use the device transport data 2018-08-27 22:10:38 -07:00
version.c
version.h
videoframeextractor.cpp Dive media: Extract thumbnails from videos with ffmpeg 2018-07-28 15:31:25 -07:00
videoframeextractor.h Dive media: Extract thumbnails from videos with ffmpeg 2018-07-28 15:31:25 -07:00
webservice.h
windows.c core/windows.c: write logs to the user path 2018-09-03 13:29:03 -07:00
windowtitleupdate.cpp Cleanup: Make WindowsTitleUpdate a global object 2018-07-30 13:55:23 -07:00
windowtitleupdate.h Cleanup: Make WindowsTitleUpdate a global object 2018-07-30 13:55:23 -07:00
worldmap-options.h
worldmap-save.c
worldmap-save.h
xmp_parser.cpp Metadata: rudimentary support for XMP metadataa in MP4-based videos 2018-09-25 14:59:14 -07:00
xmp_parser.h Metadata: rudimentary support for XMP metadataa in MP4-based videos 2018-09-25 14:59:14 -07:00