subsurface/desktop-widgets
Jan Mulder c995069e14 Desktop UI: allow user defined cylinder as default
Currently, it was only possible to use a hard-coded default
cylinder in the preferences. At the same time, the user is
allowed to add own cylinders to a dive (by just typing in
a new name and cylinder properties). These own cylinders
could not be selected in the preferences, requiring the
user to manually add this every dive.

Not sure the reason for all this was intentional, or just
an overlooked aspect in the implementation. It appeared
that the selection list in the UI was constructed before
any logbook was parsed, so at that moment, there are only
hard-coded cylinders.

The fix is simple. Refresh the UI of the preferences just
before it is shown. While opening the logbook, a new
list of cylinders, including the own cylinders is
constructed, so the UI is refreshed to that.

While a simple change, there is a use case that might be
considered strange. Open a logbook, choose new logbook,
and change the default cylinder preference to an own
(from the previously opened logbook). Do not add a dive
with the new (own) cylinder and save this logbook.
Reopen this new logbook, and see that the default
cylinder in the preferences is empty. This is logical,
as the list of own possible cylinders is constructed
from the (new) logbook, that has no dive with that
specific own cylinder. I consider this acceptable
behavior, as it can be also be used to copy own
cylinders to a new logbook.

Fixes: #821

Proposed-by: Davide DB <dbdavide@gmail.com>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-21 19:25:35 +01:00
..
css Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
plugins Initialize Facebook page only when dialog is shown 2017-11-10 10:04:28 -08:00
preferences Fix typo: successfull -> successful and succesfully -> successfully 2017-11-20 10:01:15 +01:00
statistics Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
tab-widgets In maintab disable correct label when dive trip selected 2017-11-16 11:34:12 -08:00
about.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
about.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
about.ui For About UI window layout, use SetFixedSize. 2017-03-07 21:45:05 -08:00
btdeviceselectiondialog.cpp Introduce mode field in Bluetooth device selection dialog 2017-11-16 14:26:51 +01:00
btdeviceselectiondialog.h Make Bluetooth naming consistent 2017-11-13 20:48:17 -08:00
btdeviceselectiondialog.ui Introduce mode field in Bluetooth device selection dialog 2017-11-16 14:26:51 +01:00
CMakeLists.txt map-widget: move the widget and its resources to 'map-widget' 2017-11-05 14:48:56 -08:00
configuredivecomputerdialog.cpp Make Bluetooth naming consistent 2017-11-13 20:48:17 -08:00
configuredivecomputerdialog.h Remove old duplicated code 2017-06-21 18:43:15 -07:00
configuredivecomputerdialog.ui Configure ostc4: Correct button sensitivity range 2017-08-01 13:39:35 -07:00
divecomponentselection.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
divecomputermanagementdialog.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divecomputermanagementdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divecomputermanagementdialog.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
divelistview.cpp Divelistview: use report_error to report and error 2017-10-26 15:53:47 +02:00
divelistview.h divelist: prevent a crash for missing column width 2017-10-03 15:43:03 -07:00
divelogexportdialog.cpp Correct, cleanup, translate and unify file filters 2017-11-04 14:27:00 +01:00
divelogexportdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divelogexportdialog.ui Export to TeX file initialized 2016-10-11 22:00:08 -07:00
divelogimportdialog.cpp Fix crash on manually added ZXU/DL7 file 2017-09-11 07:21:43 -07:00
divelogimportdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
divelogimportdialog.ui Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
divepicturewidget.cpp Fix some warnings 2017-05-06 11:12:28 -07:00
divepicturewidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
diveplanner.cpp Disable o2 break option if last stop is not at 6m/20ft 2017-11-04 14:51:02 +01:00
diveplanner.h Disable o2 break option if last stop is not at 6m/20ft 2017-11-04 14:51:02 +01:00
diveplanner.ui Move subsurface-core to core and qt-mobile to mobile-widgets 2016-04-04 22:33:58 -07:00
diveshareexportdialog.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
diveshareexportdialog.h Random whitespace cleanup 2017-05-27 11:07:20 -07:00
diveshareexportdialog.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
downloadfromdivecomputer.cpp Make Bluetooth naming consistent 2017-11-13 20:48:17 -08:00
downloadfromdivecomputer.h Fix memory leak in download-from-dive-computer widget 2017-11-11 21:01:42 +01:00
downloadfromdivecomputer.ui DC download: show info messages on Mac 2017-09-17 15:04:14 -07:00
filterwidget.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
groupedlineedit.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
groupedlineedit.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
kmessagewidget.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
kmessagewidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
listfilter.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
locationinformation.cpp map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
locationinformation.h LocationInformationWidget: make sure to clean out fields 2017-10-07 08:16:53 -07:00
locationInformation.ui Tab order for location information dialog 2017-10-07 21:53:28 +03:00
mainwindow.cpp Desktop UI: allow user defined cylinder as default 2017-11-21 19:25:35 +01:00
mainwindow.h Correct, cleanup, translate and unify file filters 2017-11-04 14:27:00 +01:00
mainwindow.ui mainwindow: rename "actionViewGlobe" to "actionViewMap" 2017-07-28 07:31:11 -07:00
mapwidget.cpp map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
mapwidget.h map-widget: allow real-time updates of edited markers 2017-11-09 12:40:25 -08:00
modeldelegates.cpp remove Marble from the source tree 2017-09-04 07:46:35 -07:00
modeldelegates.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
notificationwidget.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
notificationwidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
plannerDetails.ui Bring back style sheet HTML for planner output 2017-02-24 01:06:09 -08:00
plannerSettings.ui Planner and profile limit minimum GFlow to 10 and minimum GFhigh to 40 2017-11-13 11:53:55 +01:00
printdialog.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printdialog.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printer.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printer.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printoptions.cpp Correct, cleanup, translate and unify file filters 2017-11-04 14:27:00 +01:00
printoptions.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
printoptions.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
qtwaitingspinner.cpp Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
qtwaitingspinner.h Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
renumber.ui Renumber ui: make it obvious which dives get renumbered 2016-12-27 13:10:18 -08:00
searchbar.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
setpoint.ui Correct "set-point" -> "setpoint" and window title setpoint change 2017-03-04 12:04:20 -08:00
shiftimagetimes.ui Picture feature: Improve UI and translation of shift image times dialog 2017-04-30 12:44:58 -07:00
shifttimes.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
simplewidgets.cpp Correct, cleanup, translate and unify file filters 2017-11-04 14:27:00 +01:00
simplewidgets.h Picture feature: Improve UI and translation of shift image times... 2017-05-01 21:23:42 -07:00
starwidget.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
starwidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
subsurfacewebservices.cpp desktop UI: no longer attempt to manually show error notifications 2017-10-26 15:55:49 +02:00
subsurfacewebservices.h Make handling of booleans consistent on the C++-side of preferences 2017-11-20 20:56:13 +01:00
tableview.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
tableview.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
tableview.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00
tagwidget.cpp Show all autocompletes after entry of comma in tag list 2017-11-17 09:19:03 +01:00
tagwidget.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
templateedit.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
templateedit.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
templateedit.ui templateedit.ui: give the layout for "Border width" unique name 2017-03-12 09:19:03 -07:00
templatelayout.cpp Add a checkbox to turn off plan variations 2017-09-20 08:54:41 -07:00
templatelayout.h Creation of dive duration string and surface interval string 2017-05-26 15:50:52 -07:00
undocommands.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
undocommands.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
updatemanager.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
updatemanager.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
urldialog.ui Make the URL dialog contain QLineEdit 2017-01-12 14:06:54 -08:00
usermanual.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
usermanual.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
usersurvey.cpp Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
usersurvey.h Add SPDX header to desktop widgets 2017-04-29 13:32:55 -07:00
usersurvey.ui fix: User survey UI. 2017-03-06 06:40:00 -08:00
webservices.ui Move qt-ui to desktop-widgets 2015-10-30 10:36:49 -07:00