summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
AgeCommit message (Collapse)Author
2017-12-26Introduce negate-toggle buttons to filter listsGravatar Berthold Stoeger
Introduce toggle buttons which mean "filter all dives except those fulfilling the selected criteria". The old code used to check for rowCount() == 0. This should never happen, because there is always a row "empty field". This check was moved into the preamble of the functions to seperate it from the actual logic. Fixes #435 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-26Turn filter list options into context menuGravatar Berthold Stoeger
Let the menu introduced in commit 5e86442bab680b79fbd3cd490091ab9f14252e94 pop up on right-click instead of button-click. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-26Remove Q_OBJECT macros and friend declaration from *Filter classesGravatar Berthold Stoeger
Since these classes do not possess any signals/slots, these macro are unnecessary. Likewise, the friend declaration in TagFilter is useless, since the corresponding fields are in the base class. Fallout of commit 1a4e7ad0dd29b9eeac2016933cb86bff260dadbb. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Small whitespace updatesGravatar Dirk Hohndel
We aren't really consistent. And I don't do this often enough. But based on a few things that I saw in a recent commit, I wanted to at least fix those. And then of course fixed everything in those two files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-24Add select-all, deselect-all and invert-selection options to filtersGravatar Berthold Stoeger
To every filter list add a menu button that allows selection of all, selection of none or inversion of selection. Implements #435. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Factor out *Filter code into FilterBase base classGravatar Berthold Stoeger
The TagFilter, BuddyFilter, SuitFilter and LocationFilter classes all did essentially the same thing. Therefore, factor out common code / objects into a base class FilterBase. The new base class stores a pointer to the filter model. It was felt that this is simpler than introducing virtual methods. The only thing the *Filter classes now do is setting a label and in one case a tooltip. Thus, in principle, they could be removed completely, but let's keep them for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-24Simplify update of gflow and gfhigh values in the codeGravatar Stefan Fuchs
The more complex handling is no longer needed because: - Keyboard tracking for gfhigh/low UI fields was switched off here: 030c094854aeab4aaade523d7126728d9ce98a5b - GFhigh was limited to 40 here: 53fffe0ce3696de33ce4657e20d295e4a43e0fd9 Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-23cleanup: remove unused includeGravatar Jan Mulder
And why this one? Well, while this include is renamed in Qt 5.10 and gives deprecated compile warnings. And as it unused anyway, just remove it. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-21Fix order of initilization list in MainTab constructor.Gravatar Berthold Stoeger
Besides being the right thing to do (code reflects reality), it silences a compiler warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-18Implement different zoom levels for dive photos tabGravatar Berthold Stoeger
This implements different zoom levels for the dive photos tab as suggested by Stefan Fuchs <sfuchs@gmx.de> in #898. The zoom level can be changed using a slider or CTRL+mousewheel. Zoom levels range from a third of the standard thumbnail size to thrice the standard thumbnail size. Thumbnails are cached in maximum resolution and scaled down on the fly. Because the profile widget took its pictures from the photo list model, an extra picture copy with a fixed size had to be introduced. The UI is still a bit crude. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-17Cleanup: mark parameter as unusedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-17Unify float calulations: use doubleGravatar Berthold Stoeger
Internal floating point (FP) calculations should be performed using double unless there is a very good reason. This avoids headaches with conversions. Indeed, the vast majority of FP calculations were already done using double. This patch adapts most remaining calculations. Not converted where things that were based on binary representations and variables which weren't used anyway. An analysis of all instances follows: core/plannernotes.c, l.404: This was a comparison between two floats. On the left side, first an integer was cast to float then multiplied with and integer and divided by a constant double. The right hand side was an integer cast to a float. Simply divide by 1000.0 first to convert to double and continue with calculations. On the right hand side, remove the cast, because the integer will be implicitely cast to double for comparison. This conversion actually emits less instructions, because no conversion to double and back is performed. core/planner.c, l.613: Same analysis as previous case. subsurface-desktop-main.cpp, l.155: A local variable representing the version OpenGL version. Turn this into integer logic. Not only does this avoid dreaded FP rounding issues, it also works correctly for minor version > 10 (not that such a thing is to be expected anytime soon). abstractpreferenceswidget.[h/cpp]: A widget where the position is described as a float. Turn into double. desktop-widgets/divelogexportdialog.cpp, l.313: total_weight is described as float. Use double arithmetics instead. This instance fixes a truncation warning emitted by gcc.
2017-12-13Reenable picture tab when dive trip is selectedGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-11Simplify mainwindow title logic: remove MainWindowTitleFormat enumGravatar Berthold Stoeger
The MainWindow::setTitle() function was passed an enum, which depended on whether existing_file is set or not. The check can be (and was!) done directly in setTitle(). Therefore, remove the whole enum. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-12Remove unused variable in on_actionCloudstorageopen_triggered()Gravatar Berthold Stoeger
This was an artifact of commit 136110784ebe2a188ca867bea3a7ff3037281a57 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-11Write profile images to correct directory in TeX exportGravatar Robert C. Helling
Before, we did not look at the path of the filename to export to but we should write the images there and not in pwd. Fixes #931 Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-11Remove second parameter (bool force) in set_filename()Gravatar Berthold Stoeger
The last force=false case was removed in commit 96d1cc570e31396039e4970d2bf75d5f00f1e550. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-10applying gps fixes: group repetitive code under a macroGravatar Salvador Cuñat
Title is self explanatory. [Dirk Hohndel: small edits to remove typo / improve readability] Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-10Do not prefer gps fixes just for being into dive timeGravatar Salvador Cuñat
ATM we were giving preference to a gps fix taken during dive time over another taken before dive start time (proven both in predefined SAME_GROUP 6 hours range). While this logic is right for a static boat or a shore dive - as it ensures a correct position - will fail for drift dives or dives where boat changes its position during dive time. Instead, will choose the gps fix closer to the dive start time. fixes issue #666 Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-04Use QDir::exists() instead of QDir::setCurrent() to check for existenceGravatar Berthold Stoeger
Don't change into a directory just to see if it exists. Remove unnecessary braces of one of the changed if statements. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-04Fix typo "LastIamgeDir"->"LastImageDir"Gravatar Berthold Stoeger
This fixes an actual bug, where the current image dir would only be remembered on closing the program. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-01On failed cloud save hide progress barGravatar Berthold Stoeger
The progressbar was not hidden on failed save to cloud. In return remove an unnecessary variable on loading from cloud. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-01Disable plan variation in recreational modeGravatar Rick Walsh
Calculating variations when in recreational mode doesn't make sense, and can prevent variations from being calculated when switching back to Buhlmann or VPM-B modes. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-12-01Actually compute variations in backgroundGravatar Robert C. Helling
This reenables the computation of plan variations but now in a separate thread. Once finieshed, a signal is sent to update the notes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-01desktop-widgets isn't built for mobileGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-01Dive picture widget: Allow pictures to use available space on resizeGravatar Stefan Fuchs
Small change to allow the dive pictures list to use the available space if one resizes the window or switches to different mainwindow view. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Dive picture drag&drop decrease size of pixmapsGravatar Stefan Fuchs
Decrease the size of the pixmaps during drag&drop to the final unzoomed size in the profile widget. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Use correct selection mode for dive picture viewGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Dive picture handling: Re enable multi select, improve mouse eventsGravatar Stefan Fuchs
Some improvements for the dive picture tab and dive pictures in profile: - Bugfix mouse event in profile: Only Left-click will open picture - Bugfix mouse events in picture tab: - Re-enable context menu (Windows bug mainly) - Re-enable multi select in a nice way - Only double-left-click will open picture Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-30Use better aliases for icons.Gravatar Martin Měřinský
Icon aliases were complete mess. Some icons had alias some didn't. Named with underscores vs. hyphens vs. camelCase. Lower vs. upper case. "ICON" prefix vs. suffix vs. nothing. With vs. without filename suffix. Some didn't make sence. Eg. mapwidget-marker-gray (I can see, it's grey, but what does it represent?) Some were duplicated, eg warning vs. warning-icon. Some were name after widget, which is wrong. Do not reinvent wheel. Use widely used naming scheme close to Freedesktop Icon Naming Specification. This will enable usage of common icons from current set in the future. Thus Subsurface will fit nicely to GUI. This changes icon aliases to one, easy grep-able style. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-30Use icons relative path.Gravatar Martin Měřinský
Icon paths are defined in one place only - application's embedded resources. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-12-01Fix views in mainwindowGravatar Stefan Fuchs
Divelist only view was broken. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Disable specific tabs when dive trip selectedGravatar Stefan Fuchs
Disable tabs for equipment, info, pictures and extra info if a dive trip is selected. Remember specific tab selection for dives and dive trip to recover selection when browsing dive list. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01In maintab fix change of text between "notes" and "trip notes"Gravatar Stefan Fuchs
Old code was not functional. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Don't use action tooltip to access recently used fileGravatar Berthold Stoeger
Currently, the path to the recently used file is stored in the tooltip of the corresponding recent file action. Instead, store the number of the recent file in the action. This allows for more flexibility concerning formating of the tooltips (think git repositories, etc.). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-01Dynamically generate recent files actionsGravatar Berthold Stoeger
Instead of using four recent files actions defined in mainwindow.ui, generate these actions dynamically depending on the macro NUM_RECENT_FILES. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-30Remove "#if !defined(SUBSURFACE_MOBILE)" in mainwindow.cppGravatar Berthold Stoeger
The file mainwindow.cpp is only compiled for desktop versions, so the condition is redundant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-30Move creation of QSession object into MainWindow::checkSurvey()Gravatar Berthold Stoeger
Instead of handing the QSession object down, simply create it in MainWindow::checkSurvey() Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-30implify recent file handling in mainwindow.cppGravatar Berthold Stoeger
The old code used to be unnecessarily complex: the recent files list was extended for each file and shrunk if a load failed. By adding a file to the recent file list only if the load succeeded, a whole method could be removed. Other changes: keep track of the recent files using a QStringList and clearly separate the actions: - Read recent files from settings [loadRecentFiles()] - Write recent files to settings [updateRecentFiles()] - Update the recent files actions in the menu [updateRecentFilesMenu()] - Add a file to the list of recent files [addRecentFile()] With this reorganization the code hopefully became more clear. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-29Revert "Use icons relative path."Gravatar Dirk Hohndel
This reverts commit b0d98f6e269be9560de1b9c140855c85fecf1dd1.
2017-11-29Revert "Use consistent aliases for all icons."Gravatar Dirk Hohndel
This reverts commit 92e9c6606f6ef3ad16d2e31f9f9a8f5fa14f2c1a.
2017-11-29Use consistent aliases for all icons.Gravatar Martin Měřinský
Icon aliases were inconsistent mess. Underscores vs. hyphens vs. camelCase. With vs. without filename suffix. Lower vs. upper case. "icon" suffix vs. prefix vs. nothing. Some were duplicated, eg warning vs. warning-icon. Some icons didn't have alias at all. This changes all icon aliases to one, easy grep-able style which complies to Freedesktop Icon Naming Specification (Guidelines). Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Use icons relative path.Gravatar Martin Měřinský
Icon paths are defined in one place only - application's embedded resources. Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-29Don't change visibility of depth and duration UI field when no diveGravatar Stefan Fuchs
After one selected a dive and then selects NO dive don't touch the visibility of UI fields for depth and duration. So if previously selected dive was a manually added dive, keep them visible. If it was no manually added dive keep them invisible. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-28Correctly handle dive notes in maintab.cppGravatar Stefan Fuchs
Remove duplicate and incorrect setPlainText call via macro for dive notes. Deal correctly with ASCII line breaks "\n" in dive notes with html markup (replace them with <br>). Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-28Rename string "tank bar" to "gas bar" in UIGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-28Fix typo connot > cannot.Gravatar Martin Měřinský
Signed-off-by: Martin Měřinský <mermar@centrum.cz>
2017-11-27locationinformation: don't update map location on typingGravatar Lubomir I. Ivanov
Currently when the user is typing new coordinates the marker on the map changes location right away. Disable that and add a 'flag' button that should be pressed instead. Also make the coordinates update when pressing Enter or when the text field loses focus. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-11-27After edit the cylinders of a dive copy the full samplesGravatar Stefan Fuchs
After editing the cylinder table (e.g. deleting a cylinder) and accepting the changes copy the whole dc samples for the dive edited. This is important because the sensor idx in the samples may have changed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Use MAX_CYLINDERS consistentlyGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>