aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2019-12-26plannerShared: replace notes variables to plannerSharedGravatar jan Iversen
Replace display_runtime display_duration display_transitions verbatim_plan display_variations Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace variables to plannerSharedGravatar jan Iversen
Use plannerShared setter to update the variables in qPref. This will also signal the cylindermodel to calculate a new bestmix. variables: bottompo2 decopo2 bestmixend Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace o2narcotic from plannerModel to plannerSharedGravatar jan Iversen
Use plannerShared setter to update o2narcotic. This will also signal the cylindermodel to calculate a new bestmix. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace variables from plannerModel to plannerSharedGravatar jan Iversen
variables bottomsac decosac problemsolvingtime sacfactor are not set in diveplanner.cpp, but instead signals a slot in plannerModel. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace var plannerModel -> plannerShared convertedGravatar jan Iversen
variables min_switch_duration are not set in diveplanner.cpp, but instead signals a slot in plannerModel. and are read from plannerShared which includes a conversion change signals to slots in plannerShared change read from prefs. to plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace vars. qPrefDivePlanner -> plannerSharedGravatar jan Iversen
change local doo2breaks to plannerShared and update connect. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace variables from plannerModel to plannerSharedGravatar jan Iversen
variables drop_stone_mode, last_stop, switch_at_req_stop are not set in diveplanner.cpp, but instead signals a slot in plannerModel. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace vars. qPrefDivePlanner -> plannerSharedGravatar jan Iversen
change local setBailout to plannerShared and update connect. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-26desktop-widgets: replace variables from plannerModel to plannerSharedGravatar jan Iversen
planner_deco_mode is not set in diveplanner.cpp, but instead signals a slot in plannerModel. reserve_gas is not set in diveplanner.cpp, but instead signals a slot in plannerModel. change signals to slots in plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: final cleanupGravatar willemferguson
This commit does some final cleaning up to the code, mostly deleting white space and comments. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: add reset tabGravatar willemferguson
Add a separate preferences tab for resetting all preferences to their default values. One or two very small alterations to other sections of the preferences UI code. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: add dive log tabGravatar willemferguson
This adds a tab for dive log - related preferences. A suitable test programs is still required. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferenced UI: add dive download tabGravatar willemferguson
Add a preferences tab for dive download, allowing resetting the buttons representing download connections in the Download panel. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Pereferences UI: add media tabGravatar willemferguson
Remove the preference settings dealing with thumbnails (currently under General preferences and Profile preferences) and put them in a newly-created Media preference tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: create new equipment tabGravatar willemferguson
Remove the "Show unused cylinders" checkbox (Profile tab) and the "Set default cylinder" qTextEdit box (General tab) and put them in a separate and new Equipment tab. This sounds like a simple task but, as can be seen from the files changed, was actually a complex matter. Adapt the existing test programs (General and TechDetails) for creating a test program that tests parts of the Equipment tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: split network preferencesGravatar willemferguson
Split the Network Preferences page into two screens: 1) Network preferences 2) Cloud storage preferences Enable storing these preferences locally. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-24build-system: move plannerShared to backend-sharedGravatar jan Iversen
WARNING: multi directory commit, needed to secure it builds. move the core/plannerShared.* to backend-shared. update CMakeLists.txt to include backend-shared lib in link process. update ios project to reflect new directory Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24build-system: move exportfuncs to backend-sharedGravatar jan Iversen
WARNING: multi directory commit, needed to secure it builds. move the core/exportfuncs.* to backend-shared. update backend-shared/CMakeLists.txt to generate backend-shared lib update CMakeLists.txt to include backend-shared lib in link process. update ios project to reflect new directory Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24diveplanner: desktop, remove no longer used slotsGravatar jan Iversen
Remove PlannerSettingsWidget slots, that are directed to plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24diveplanner: desktop, connect signals direct to plannerSharedGravatar jan Iversen
Connect the signals for ascent/descent directly to plannerShared Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24desktop-widgets: use share meter/feet funcs. in diveplannerGravatar jan Iversen
change the settings variables using UNIT_FACTOR to use plannerShared instead. There are no changed functionality, it is simply removing calculations from the UI. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24build-system: clean desktop-widgets CMakeLists.txtGravatar jan Iversen
The CMakeLists.txt referenced mapwidget which is in another root directory (and also a seperate library) Remove mapwidget reference from CMakeLists.txt Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: divelogsDE: integrate shared backendGravatar jan Iversen
Use doUpload() from uploadDiveLogsDE Connect signals from uploadDiveLogsDE to do UI part. Clean slots to only contain UI. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: divelogsDE: delay handling until user select uploadGravatar jan Iversen
Do not prepare zip file, just because user selected the divelogs.de radiobutton Move prepareDives to startUpload (slot handling user clicking on upload button). Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: split UI and network in DivelogsDeWebServices (prepare)Gravatar jan Iversen
Clean prepareDivesForUpload() and uploadDives() so that uploadDives() only contain network handling no UI. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: use qPrefCloudStorage instead of QSettingsGravatar jan Iversen
Use qPrefCloudStorage for divelogde_user/password to secure same handling as other settings, as well as same handling as used in shared uploadDiveLogsDE class Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: remove code under RM_OBSOLETE_CODE ifdefGravatar jan Iversen
history, and it is disturbing in "diff". Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: use uploadDiveLogsDE::prepareDivesGravatar jan Iversen
Remove local implementation (prepare_dives_for_divelog) and call uploadDiveLogsDE::prepareDives, which are shared between mobile and desktop Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: diveDiveShareExportDialog add signal handlingGravatar jan Iversen
connect signals from uploadDiveShare and remove reply variable Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: use shared uploadDiveShare for diveshare.Gravatar jan Iversen
Remove shared code from DiveShareExportDialog::doUpload() and add call to uploadDiveShare::doUpload() Remark signal handling is not implemented. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-11desktop-widgets: use qPrefCloudStorage for diveshare.Gravatar jan Iversen
Diveshare upload in mobile is using qPrefCloudStorage, so change diveshareexportdialog as well, to keep consistency. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-10Dive list: access header via filter-modelGravatar Berthold Stoeger
The dive list accesses the filter model, therefore it makes sense to also get the header data from there, even if they are only forwarded from the source model. This makes control flow more logical and will allow us to remove the global DiveTripModel instance. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-10Dive list: clear dive data via the filter modelGravatar Berthold Stoeger
The UI talks to the filter model. Therefore route clearing of data through that model instead of accessing the source model directly. This will allow us to remove the DiveTripModel::instance() function and makes control flow less "jumpy". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-10Dive list: don't handle selection changes on filter-change in viewGravatar Berthold Stoeger
The selection changes upon completing the filter are handled by the core. Don't do this explicitly in the DiveListView. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Cleanup: remove WeightModel::changedGravatar Berthold Stoeger
Since changes to the weight model are not modal anymore, nobody queries the changed-flag. Remove it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Undo: make weight editing undoableGravatar Berthold Stoeger
Implement the EditWeight undo command. Since there is common code (storage of the old weight), this creates a common base class for RemoveWeight and EditWeight. The model calls directly into the undo command, which is somewhat unfortunate as it feels like a layering violation. It's the easy thing to do for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Desktop: refactor WSInfoDelegate logicGravatar Berthold Stoeger
The WSInfoDelegate (weight-system-info delegate) is used to display a combo box of known weightsystem-types and auto-fills the weight if the weightsystem-type is changed. This would overwrite the weight data of the displayed dive when the user hovers over the different entries. Moreover, it saves the original weight in case the user cancels the editing action. This is not viable when implementing undo of weightsystem changes, because hovering over entries should not produce individual undo commands. Instead, implement a special "temporary" row in the weightsystem model. On canceling of the edit actions, simply reload the weightsystem from the unmodified dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Cleanup: return value type from WeightModel::weightSystemAt()Gravatar Berthold Stoeger
There is only one caller of WeightModel::weightSystemAt() and that certainly does not need a pointer into the weightsystem-table of the current dive. Return a value type instead of a pointer. This allows us to mark WeightModel::weightSystemAt() as const and use it from WeightModel::data(). Slightly cleaner code. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Undo: make weight-deletion an undoable actionGravatar Berthold Stoeger
This one is a bit more complicated than weight adding, because the multiple-dive case is not well defined. If multiple dives are selected, this implementation will search for weights that are identical to the weight deleted in the currently shown dive. The position of the weight in the list is ignored. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Desktop: don't connect to remove() slot of model from TableModelGravatar Berthold Stoeger
When connecting a model to the TableModel class, it would connect clicking on an item to the remove() slot of the model. This breaks the program flow implied by the undo code: Ui --> Undo-Command --> Model --> UI Moreover, the naming of the remove() slot is illogical, because clicks can also have different effects, as for example in the cylinder-table. Therefore, move the connect() call from TableModel to the callers. In the case of TabDiveSite, move the remove() function from the model to the TabWidget, where it makes more sense. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Undo: make adding of weights an undoable actionGravatar Berthold Stoeger
Introduce an AddWeight undo command. This is modelled after the numerous dive-edit undo commands. The redo and undo actions are connected to the WeightModel via two new signals, weightAdded and weightRemoved. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-05Cleanup: remove displayed_dive from WeightModelGravatar Berthold Stoeger
The WeightModel always acted on the displayed dive. To support undo of weightsystem changes, operate on an arbitrary dive. This is in line with other models, where the updateDive() function resets the model to represent a certain dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove DiveListView::dontEmitDiveChangedSignal memberGravatar Berthold Stoeger
Should have been removed in 4928c4ae04. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove DiveListView::expandedRows member variableGravatar Berthold Stoeger
The QList served as backing store for backupExpandedRows() and restoreExpandedRows(). However, these always came in pairs in the same scope. There is no reason to store the expanded rows over a longer time. Therefore, return the expanded rows from backupExpandedRows() and take them as argument in restoreExpandedRows(). Morover replace the QList<int> by the much lighter std::vector<int>. We certainly don't need copy-on-write, reference-counting and immutability of iterators in this case. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove DiveListView::mouseClickSelection member variableGravatar Berthold Stoeger
That hasn't been used since 2013 (9cc04c1ca6). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove toggle parameter from DiveListView::selectDive()Gravatar Berthold Stoeger
This defaulted to false and no caller used anything different. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove DiveListView::remember/restoreSelection()Gravatar Berthold Stoeger
Calls of these functions were removed in the previous commits. Now, remove the functions themselves. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Selection: don't reset selection when resortingGravatar Berthold Stoeger
The old code saved, cleared and restored the selection. This is not necessary anymore, because on model reset the selection, which is stored in the core, is reset. Remove the unnecessary selection handling. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove unnecessary remember/restoreSelection() pairGravatar Berthold Stoeger
When accepting changes, the main tab refreshes the display in a remember/restoreSelection() pair. Since the display refresh doesn't lose selection, these calls can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04Cleanup: remove unpaired rememberSelection() callGravatar Berthold Stoeger
The old renumbering-dives code had to remember and restore the selection. This became unnecessary with the undo-code. The restore-call was removed, the remember-call left in. Remove it as well. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>