aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
2014-03-30Exporting a World-MapGravatar Gehad
This patch adds the world map exporter. - add worldmap-save.c that writes the html to the file - use Google maps v3 API to put the place marks on the map - add worldmap-options.h to contain some settings for the JS which will make it easier for those to be changed - add save HTML action in the mainwindow user interface Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-28Toggle showing average depthGravatar Lakshman
Add additional check box in "preferences->graph" section that allows users to hide average depth on dive profile. By default this option is checked to show average depth. Fixes #475 Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Fix redundant spaces in info panelGravatar Lakshman
Remove redundant spaces from dive master and buddy list fields. Ticket also mentions about similar space behaviour in tag field, which I couldn't reproduce. Fixes #476 Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Profile2: hide the tooltip and ruler if we are printingGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Print: enable printing with the new profileGravatar Lubomir I. Ivanov
Some weird things happen if we use a local instance of the ProfileWidget2 class in printProfileDives(). Once we exit the printing dialog the profile crashes, which could hint of singleton issues. Instead we are going to use the already active instance of the class which we can retrieve from MainWindow. This should also be faster because the class is pretty heavy. In such a case the cleanup at the end of printProfileDives() is still relevant (removed in ac9a23ef3b69). First we resize the widget for printing purposes and then resize it back to the original values and re-plot the current selected dive in the dive list. Fixes #477, #478 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Profile2: add use of the isGrayscale flag when getting a colorGravatar Lubomir I. Ivanov
getColor() has a default argument for grayscale set to false. With this patch we pass it the local isGrayscale flag, which can only be set during printing. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Profile2: add some print related flagsGravatar Lubomir I. Ivanov
Some flags like printMode and isGrayscale are missing yet needed. The flag printMode is required so that we know *when* to hide certain elements such as the ruler and tool tip (e.g. not needed while printing). isGrayscale should be passed to all getColor() calls, so that the greyscale color table is respected. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Ruler: fix bad scaling for the text backgroundGravatar Lubomir I. Ivanov
The ruler text's white background scales badly. This patch adds the ItemIgnoresTransformations for the textItemBack object and matches the dimensions and position of the textItem object in front of it. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Repaint ruler when enable/disabling itGravatar Jan Mulder
Repaint ruler when enable/disabling it. Straightforward replot() added. Fixes #479 Signed-off-by: Jan Mulder <jlmulder@planet.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Remove printing when building for AndroidGravatar Anton Lundin
Qt for Android doesn't support printing. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Remove usermanual when building for AndroidGravatar Anton Lundin
Our usermanual is based on webkit, and thats not supported in Qt for Android. We should probably replace it with a Android native webview somehow. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-27Introduce NO_MARBLE define, make GlobeGPS a dummyGravatar Anton Lundin
Some users have requested a way to build subsurface without marble. This hides all traces in the ui and creates a GlobeGPS-dummy thats just a QLabel saying that marble is disabled, in case its shown somehow. The dummy is there so we can just ignore the fact that marble is disabled in the rest of the code. Fixes #394 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-25simplewidgets: Include stdint for cross compatabilityGravatar Alberto Corona
Not including stdint leaves 'int64_t when' without a type and undefined when compiling for Windows with mingw Signed-off-by: Alberto Corona <albcoron@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-25Redraw profile when manipulating cylindersGravatar Jan Mulder
Manipulating cylinders, especially changing the exact gas content (o2, he), changes the pp02, ppHe graphs. This patch simply replots the profile in case of cylinder change at time of saving. Signed-off-by: Jan Mulder <jlmulder@planet.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-23Don't crash if we try to save a empty planGravatar Anton Lundin
Just treat it as a cancel instead. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-23Enable parts of planner based on defineGravatar Anton Lundin
In bf205726 DEPTH/Switch at was disabled by commenting out that code. This puts it back behind ifdefs Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-23Divemaster and Buddy fields auto-completion are not savedGravatar Yosef Hamza
The added characters by auto-completion "for the last item" isn't saved when using Return to save it "works well with tab" Fixes #469 Signed-off-by: Yousef Hamza <jo.adama.93@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-21Fix system default font handlingGravatar Anton Lundin
We didn't care about system default fonts and sizes, we just used the Qt default font. Due to how QFont is constructed, there was need to split font and font size. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-21Make pp graphs visible at startup according to settingsGravatar Jan Mulder
Changeset a90818671 introduces a small inconvenience. The pp graphs at startup are not shown according to the visibility settings. Requiring to toggle the icons to show the desired pp graph. Trivial fix. Signed-off-by: Jan Mulder <jlmulder@planet.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-21Add current time and adjusted time to gui when adjusting dive's timestampGravatar Gehad
This patch adds the current dive time and the adjusted time to the time shift window. I added a function to dive.c to get the timestamp of the first selected dive. This will view the time of the first selected dive only even when multi dives are selected but it does change the times for multiple dives properly. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Make esc-key discard the new tag selectionGravatar Gehad
Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Removed Duplicate IncludesGravatar Hugle
Signed-off-by: Hugle <wulong@comp.nus.edu.sg> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Better handling of keyboard on the inline edition on equipmentGravatar Tomaz Canabrava
The handling of keyboard is broken on Qt inside QComboBoxes. I'm trying ( and losing ) to make it less broken. This patch makes the code work reasonably well if you press Key_down or Key_up after having displayed the filter popup, which is different from the combobox popup for some reason. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Remove a bit of space from the Axis and its labels.Gravatar Tomaz Canabrava
This should make the layout work better on smaller screens. Fixes #458 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Make ruler respect dive depth.Gravatar Tomaz Canabrava
The only place on the code that the y() position didn't accompanied the dive-depth was this one, so let's see if this patch fixes it. See #455 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Don't create then set, do both at the same time.Gravatar Tomaz Canabrava
When we create, then set the value of a variable, we are wasting cycles and making the code more verbose. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20QString starts empty, do not set "" as empty string.Gravatar Tomaz Canabrava
Let's not be evil by creating "" as empty strings inside of the code, really. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Do not copy strings when you don't need it.Gravatar Tomaz Canabrava
This patch removed the use of copy-constructors on the QString to use the const-references. Even knowing that the QString is a refcounted class, let's not get that bad habit. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Code CleanupGravatar Tomaz Canabrava
The offending code is line-by-line equal to the completion highlited method, so why make it duplicated? Call that method instead. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20Enable posibility to add dives to trip belowGravatar Anton Lundin
When I'm on a dive trip i usually download dives multiple times to start logging them while i still remember them. When i have already created a trip and downloads new dives they needs to be able to be added to the already existing trip, without relying on autogroup. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-19git object store: make it possible to work with checked-out git branchesGravatar Linus Torvalds
This makes the git object save logic also check out the changes in the working tree and index if the branch we save to is checked out. It used to be that we would just update the object store (and the branch ref, of course), but leave any checked-out state untouched. Note that if the working directory is dirty (ie you have made changes by hand and not committed them), the checkout will skip any dirty files and report it as a warning to the user. However, the save still succeeds (since the _real_ save goes to the backing store). NOTE NOTE NOTE! Both loading and saving very fundamentally work on the git object store level, and if you are working with a checked-out branch and make modifications to the working tree, saving will not touch those dirty files (so that you can try to recover your edits manually in the working tree), but it's worth pointing out that subsufrace loading state will totally ignore the working tree. So the only way to make subsurface *see* your changes is to commit them. Having edited state checked out in the working tree will only confuse you when subsurface first ignores it on reading, and then refuses to touch the checked-out state on writing. Put another way: working with a checked-out branch is now _possible_, but you need to be aware of the limitations. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-19Profile2: fix widths on some lines for Qt5Gravatar Lubomir I. Ivanov
Qt5 uses different widths for some of the poly. lines in the profile. Setting an explicit value fixes that. Tested-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-19Make Up/Down arrows work with tagsGravatar Gehad
When using Up/Down arrows to scroll the tag list it always selected the first item in the list and doesn't scroll. Fixes #468 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-19Saving edits requires to move focus firstGravatar Gehad
After editing values in cylinders or weights hitting save will not save the changes to save the edit one must move the focus to a different field first this is fixed by losing the focus before saving the changes Fixes #412 Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-18Profile2: use unsigned int for the divecomputer numberGravatar Lubomir I. Ivanov
display.h: dc_number is unsigned int, thus a couple of warnings may pop-out. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-18Clear PN2 PO2 PHE GasItemGravatar Hugle
After the dive log has been closed, the ProfileWidget2 does not clear the pn2 po2 and ph2 gas line. This patch cleared the three lines after dive log closed. Acked-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Hugle <wulong@comp.nus.edu.sg> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-17Translate using tr() to be Qt5-compatibleGravatar Anton Lundin
There are no utf8 in those strings, and we can translate them as everything else with tr() instead. QApplication::UnicodeUTF8-part is deprecated and removed in Qt5. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-17Make dc_number defined when using itGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-17Add forward declaration of QSettingsGravatar Anton Lundin
Its needed for Qt5 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-17Be more careful about dive computer selectionGravatar Linus Torvalds
The selection logic was a bit random: some places would return NULL if the dive computer index was out of range, others would return the primary dive computer, and actually moving between dive computers would just blindly increment and decrement the number. This always selects the primary computer if the index is out of bounds, and makes sure we stay in bound when switching beteen dive computers (but switching between dives can then turn an in-bound number into an out-of-bounds one) Fixes #464 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-17Silly change to a commentGravatar Dirk Hohndel
I had intended to amend the previous commit with this before pushing it out. This changes the comment that pointed out the bug that the previous commit fixed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-16New profile: fix event hiding logicGravatar Dirk Hohndel
Turns out we unconditionally set all events as visible when redrawing the dive - even with a comment that this should take into account if the event is visible. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15New profile: add event manipulation to context menuGravatar Dirk Hohndel
This got lost when we switched to the new profile. Remove event works. Hide events does call hide() on the DiveEventItem but for some reason it stays visible. I'll hope for one of the more experienced Qt people to fix that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15Don't put cylinder widget in edit mode if deletion of cylinder failedGravatar Dirk Hohndel
If the user tries to delete a cylinder that is in use and that action is rejected, the cylinder widget (and the whole dive) should not be put into edit mode. After all, nothing changed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15Correctly check if tank is in useGravatar Dirk Hohndel
We always checked if the tank was in use by the planner / dive editor - even if we were not in dive edit mode. With this patch, when not in dive edit mode, we check our cylinder "used" flag instead. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-15Bugfix: generalize pp graphs to allow for multi over-threshold periodsGravatar Jan Mulder
Especially in O2 decompression parts of a dive, the pp02 is typically very close to the threshold value (normally 1.60 bar). The old implementation of the pp profile graphs assumes that there is exacty 1 consecutive set of samples that needs to be in the "warning color". This results in an erroneous display of the mentioned graphs, connecting multiple episodes of too high pp with bogus lines in between. This fix generalizes the pp graph logic to allow for multiple segments of high pp, each to been drawn seperately in the "warning color". Signed-off-by: Jan Mulder <jlmulder@planet.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14Make "save changes" dialog modalGravatar Dirk Hohndel
This definitely seems to be a good candidate for a modal dialog. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14Convert other users of showError() to the new world orderGravatar Linus Torvalds
The "report_error()" interface is a lot simpler, although some of the C++ code uses QStrings which make them a bit annoying, especially for the varargs model. Still, even with the explicit conversion to UTF8 and "char *", the report_error() model is much nicer. This also just makes refreshDisplay() do the error reporting in the UI automatically, so a number of error paths don't even have to worry. And the multi-line model of error reporting means that it all automatically does the right thing, and reports errors for each file rather than just for the last file that failed to open. So this removes closer to a hundred lines of cruft, while being a simpler interface and doing better error reporting. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14show the error string in the GUI rather than stderrGravatar Linus Torvalds
This makes the error string just be an internal "membuffer", which the GUI can fetch and show when errors occur. The error string keeps accumulating until somebody retrieves it with "get_error_string()". This should make any write errors actually show up to the user. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-14propagate save errors further, don't mark divelist unchangedGravatar Linus Torvalds
This at least avoids marking the dive list as unchanged on a failed write, and propagates the error further up the stack. We still don't show the error string in the GUI, though. I'll start doing that next, I think. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>