summaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2014-08-11Rename dive gas function and defines for clarityGravatar Anton Lundin
This renames the dive gas functions to not talk about just nitrox, and to instead talk about gas. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11Rename the model column from NITROX to GASGravatar Anton Lundin
The column isn't just about NITROX, there might be air and trimix in there too. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11Rename list column from O2% to GasGravatar Anton Lundin
In the dive list, calling the column O2% is kinda wrong, because in at least my dive list there are both air and trimix showing up, so this renames that column to Gas. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11HTML: export Translated strings to JSON files.Gravatar Gehad elrobey
First step towards multilingual export. Use the existing translation API to translate and save words to JSON file. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11HTML: Don't export total statistics value if not chosenGravatar Gehad elrobey
Don't export total row in yearly statistics unless exporting the statistics is checked Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11HTML: Remember General Export Settings.Gravatar Gehad elrobey
Set Default values and remember user selected general HTML export settings. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11HTML: Add total row to yearly statistics table.Gravatar Gehad elrobey
Add new row to the yearly statistics table containing the total. Total values are calculated to some columns only, it doesn't make any sense to add the total value to other columns (Temperature cols for example). Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-11HTML: Make export statistics optional.Gravatar Gehad elrobey
Make exporting statistics to the HTML page optional. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08Better User Agent for SubsurfaceGravatar Dirk Hohndel
This one is less verbose and very easy to parse. It's guaranteed to have five components, separated by ':' with no other ':' in the string: Subsurface:<version>:<PrettyOSName>:<appCpuArch[/osCpuArch]>:<UILang> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08Revert "Don't translate components of the version"Gravatar Dirk Hohndel
This reverts commit 6fdbf2069df4f238d7966fef67a31cee5c5eddbb. That was actually the wrong thing to do, now that I think about it. Instead we should show the translated version on screen and send a compact, easy to parse variation of this as the User-Agent header. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08Fix possible crash attempting network connectionGravatar Dirk Hohndel
If we didn't get back a JSON encoded string (i.e., if the response contained no '"') we would access a QList past its boundary. I'm somewhat hopeful that this is a last second fix for an annoying bug I've been trying to figure out for a while. See #514 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-08Don't translate components of the versionGravatar Dirk Hohndel
When transmitting the Subsurface version string we always want to use the English terms, not the localized terms. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-07Move the Trash bin to the topRight on the picturesGravatar Tomaz Canabrava
It was too easy to remove a picture by mistake, not anymore. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-07Reload the dive list after accepting changesGravatar Dirk Hohndel
So far we only did it when we added a dive or modified a manually added dive. But the reality is that an edit of any dive could cause changes that require the dive list to be reloaded. Fixes #698 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Delete pictures from the Widget by pressing deleteGravatar Tomaz Canabrava
Select the picture, press delete, profit. [Dirk Hohndel: removed the stray hunk that snuck into this patch] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Show the cross hair only when planning or adding a diveGravatar Dirk Hohndel
In normal profile mode it's rather redundant and clatters the profile. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Remove unused static functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Fix order of initialization warningGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Make gas use statistics be coherent and more completeGravatar Linus Torvalds
The gas use logic in the dive statistics page is confused. The SAC case had a special case for "unknown", but only for the first gas. Other gases had the normal empty case. Also, the logic was really odd - if you had gases that weren't used (or pressures not known) intermixed with gases you *did* have pressure for, the statistics got really confused. The list of gases showed all gases that we know about during the dive, but then the gas use and SAC-rate lists wouldn't necessarily match, because the loops that computed those stopped after the first gas that didn't have any pressure change. To make things worse, the first cylinder was special-cased again, so it all lined up for the single-cylinder case. This makes all the cylinders act the same way, leaving unknown gas use (and thus SAC) just empty for that gas. It also fixes the SAC calculation case where we don't have real samples, and the profile is a fake profile - possibly with gas changes in between the fake points. We now make the SAC calculations match what we show - which is admittedly not at all necessarily what the dive was, but at least we're consistent. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Don't make the preferences dialog so hugeGravatar Dirk Hohndel
Let Qt figure out a good size instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Don't show a SAC of 0.0l/min (or cuft/min)Gravatar Dirk Hohndel
When we have no data about the gas consumption it makes no sense to show a SAC of 0. Instead we should show either "unknown" or nothing. Fixes #693 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Don't list gases that weren't used in profile printGravatar Dirk Hohndel
If the divecomputer adds additional, unused cylinders to the dive, they would be listed in the profile based printouts. Given that the field is named "Gas used" that seems wrong. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-06Don't zoom the profile when the left button is pressedGravatar Robert C. Helling
This prevents zooming out to more than max in the planner. Using a Mac MagicMouse it happens at times that the finger slides on the mouse while dragging a waypoint which can result in zooming out further than max. Fixes #695 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Data validationGravatar Dirk Hohndel
Instead of refusing cylinder pressure data let's just mark it as red when the values don't seem to make sense. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Make the cross hair less obnoxious on MacGravatar Dirk Hohndel
While on Linux it was drawn as fine 1px line, on Mac it came out rather fat and obnoxious by default. With this it's always set to a very thin line. This still needs more work, but let's leave it where it is for Beta 5. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Add lines that follow the mouse helping see time and depth.Gravatar Tomaz Canabrava
This was missing from the conversion from the oldPlanner to the new one, and it also works ok on the profile. One thing is missing is the Labels on the bottom / left saying which position it is, but it's already userful. Fixes #674 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Hide Depth ColumnGravatar Tomaz Canabrava
We were showing everything, always. Fixes #639 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Print: rename the variable 'isHeading' to 'newHeading'Gravatar Lubomir I. Ivanov
This better describes what the variable (flag) does. It's used to inform the loop that the last row goes our of the page limit and that we need to place a new heading on a new page. In that context 'newHeading' is more meaningful. The name 'isHeading' is confusing for (i == 0), since it remains 'false' yet the 0 index row is actually a heading. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Print: add a safe guard for row heights in the table printGravatar Lubomir I. Ivanov
If a row height is more than the available height on a page (minus the height of a heading row) we have to skip this row (dive). The current profile print simply does not support that and it does not make much sense. For that to happen either the page will have to be tiny or the user must have entered a very long text for "buddy", "dive master", "location" or there must be some sort of a very-large-font-while-printing type of a problem. Technically, rows spanning on multiple pages is doable, but probably not worth the effort. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Picture handling: cleaning up the messGravatar Dirk Hohndel
We had pointers to data structures on the stack which we frequently reallocated. These data structure contain basically a filename and an offset. We then create a hash of the pointers to those datastructures with the filename being the key. And then we passed those pointers around through a Qt model(!!!) only in order to then later look up by filename what the offset might be. I am at a loss for words for the lunacy behind this design. How about we just remember the offsets and pass the integers around? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Picture handling: hide the pictures before deletingGravatar Dirk Hohndel
Because of the way deleteLater() is implemented, the pictures need to be hidden, otherwise they might stay around at the wrong time (e.g., when printing). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Profile: Don't disconnect too many signalsGravatar Dirk Hohndel
If we disconnect the picture releated signals then in dive add and dive plan mode the pictures from the last shown dive could appear on the profile. That's not cool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Printing: only give up if no size is availableGravatar Dirk Hohndel
Checking for available printers appears to sometimes fail, even if there is a valid PDF or PS printer. Instead we bail if we can't get a valid size for the printer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Don't recalculate plan automatically with low GFHighGravatar Dirk Hohndel
While it's nice to have immediate response to gradient factor changes, there is an oddity that very low GFHigh values can cause infinite decompression if the last stop is at 6m. Robert fixed this and now errors out of deco after 48 hours, but if the user simply wants to edit their GFHigh from (for example) 75 to 70 and deletes the '5', we really don't want to trigger a recalculation for GFHigh of 7... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-05Web: use subsurface_fopen() for non-ASCII paths on Win32Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Correctly remove the Close button from most message widgetsGravatar Dirk Hohndel
The only time we want the close button is when showing an error at the bottom of the main window. In the other cases (maintab, globe) we need to explicitly hide it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Revert two incorrect commitsGravatar Dirk Hohndel
Revert "Don't add a close button to KMessageWidget" This reverts commit 75c9bcd72668f5b5524e29291cce2a908fddcdaa. Revert "Remove unused variable" This reverts commit 9edee3477a1fa3945717512e591f30af9c3ca468. I was fixing the wrong problem... instead of removing the handling of the Close button I should have figured out why the close button was incorrectly shown in the first place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Don't use tmpfile()Gravatar Dirk Hohndel
It appears that at least on Win7-64 Windows tries to create the temporary file in C:\ and fails because of insufficient permissions. How stupid is that. Instead we roll our own tempfiles, based on the already existing tempfile name that is passed in. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Do not recreate all the dive just because a picture was added.Gravatar Tomaz Canabrava
If we add a picture to the dive, this will not change anything else, so there's no need to recalculate the profile_plot info. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04HTML: export yearly statistics to JSON files.Gravatar Gehad elrobey
Save Yearly statistics as JSON data to the stats_files. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Fix the layout on the Print DialogGravatar Tomaz Canabrava
The layout was a hardcoded position without layouts, that would only work on english language since other languages can have bigger strings than the current ones. Also removed the 'setFixedSize' stuff and let the widget find it's best size for itself. Fixes #656 Fixes #396 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Fix unresizable DiveListGravatar Tomaz Canabrava
The issue with the dive list was actually the Planner Settings widget that was in the same space as the dive list but hidden, but since it had a minimum width we couldn't resize the dive list to be below the planner settings minimum. Fixed by inserting the contents of the Planner Settings into a QScroll Area. Fixes #679 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Disable the Toolbox when in edit mode.Gravatar Tomaz Canabrava
Some of the toolbox icons will trigger a recalculation of the dive, triggering then a replot, that will copy the dive to the displayed_dive again, but in the case of a edit this would discard the edition ( that would still be shown on the UI ) leaving the dive in an unconsistent state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Print: display an error message if no printers are foundGravatar Lubomir I. Ivanov
When pressing Print or Preview from the PrintDialog, we need to first check if there are printers installed. If not we abort and show an error message. This is needed because if no printers are installed, things like the reported page height could be zero and the profile and table print code in PrintLayout will break. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Print: enable the vector table print only for Qt5.0 and newerGravatar Lubomir I. Ivanov
In #671 a user reported that the table print outputs a blank page if there are dives for one page or less to be printed. This doesn't really makes any sense. A possible bug in Qt4's QPicture is suspected, so we only enable the vector print for Qt 5.0 and newer versions. See #671 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-04Planner: show mean depthGravatar Dirk Hohndel
Almost invisible, mostly looking like an odd bug in the profile code, there was a tiny red line at depth 0 in the planned profile. Turns out that was the missing mean depth. We didn't populate enough data in the dive computer of the dive we generated from the plan (and the length of the depth line was incorrectly determined by the duration of the dive instead of the duration stored in the dive computer). Fixes #570 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-03Update altitude properly when changing unit systemsGravatar Robert C. Helling
We need to change the displayed numeric value of the altitutde and not just the unit suffix when changing unit systems. Fixes #681 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-03Try to fix divelogs upload on WindowsGravatar Miika Turkia
zip_open needs correct directory separators. QFile::encodeName does not do this conversion, so we must call it explicitly. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-02Update pictures when entering/exiting plannerGravatar Robert C. Helling
This fixes the problem I pointed out im my comment to #667 and hopefully also the original problem although I cannot confirm since i cannot reproduce the problem in the first place. See #677 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-02Enforce end pressures to be not above starting pressures.Gravatar Robert C. Helling
We don't blow into our cylinders under water. Negative pressures should be allowed as they might arise from dive planning without taking care of gas consumption. fixes #644 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>