aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
AgeCommit message (Collapse)Author
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>
2014-08-02In recent files use native directory separatorsGravatar Robert C. Helling
Qt internally always uses / as directory separator. #651 shows that in the recent files menu, under windows we can have double entries with both versions of the separator. This patch should normalize the menu entires to use the native separator (i.e. \ on Windows). (Untested due to lack of Windows computer). See #651 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-31Keep edited profile after editing a manually added diveGravatar Dirk Hohndel
This is yet another unintended side effect of the UI restructure changes. I stared at this code for so long - I can't believe I kept missing this. Fixes #668 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-31Give Subsurface a distinct User Agent stringGravatar Dirk Hohndel
When accessing websites (divelogs.de, subsurface website) we shouldn't pretend to be Mozilla 5. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-31When exporting to XML and no extension given, default to .ssrfGravatar Dirk Hohndel
See #646 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Mark divelist changed after removing a pictureGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Add a new 'show' Animation, and use it on the close button.Gravatar Tomaz Canabrava
The error with 'ungrabMouse' warning that we got was because we were removing an item that had the mouse grab instead of waiting a few milisseconds so it won't be the mouse grabber anymore. So I'v used the Animations::hide() to get rid of it, and since it worked well, I'v also added a Animations::show() method to display it in a good fade-in way. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Implement the functionality of remove_picture.Gravatar Tomaz Canabrava
Added the remove_picture functionality, with code shamelessy stolen from remove_event, and hoock it up with the interface. Fixes #650 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Instead of holding the index, hold the URL.Gravatar Tomaz Canabrava
Since the idea is to remove the picture in the future, we need to not hold the row on the model, as when we delete one, the other pictures will change the row. but the QUrl is unique. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Added a button to hide a picture from the dive.Gravatar Tomaz Canabrava
This patch hides a picture from the dive, it should actually remove it, but because I didn't found a quick way to remove a picture from the dive yet, it just hides it. To remove a picture from the dive, the DivePictureItem has to remember the QUrl of the original file, to remove that from the model, and currently it only has the QPixmap. this can be for 4.2.1 or we can postpone 4.2 a tiny bit since this is a important feature. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Planner / Add dive: hide handler after removing itGravatar Dirk Hohndel
Otherwise users can still interact with it. Fixes #648 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-30Maintab: fix trip location / notes editingGravatar Dirk Hohndel
Reusing the displayed_dive for this caused all kind of odd problems that were hard to reproduce, because the behavior depended on what was in the corresponding fields of the current_dive. Worse: the GPS location handling prevented us from reliably removing the location of a trip. The solution isn't ideal and certainly isn't elegant. Maybe we simply shouldn't reuse the widget here. But I think what I have now works - I tried hard to make it break again and couldn't. Fixes #659 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Do not show the heartrate info unconditionally.Gravatar Tomaz Canabrava
use the preferences instead. Fixes #664 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Make the Axis set the changed flag when a new line is setGravatar Tomaz Canabrava
This was preventing the recalculation of the ticks, making the line static when we enabled or disabled the PP graphs. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Change the Ruler text values when metric system changes.Gravatar Tomaz Canabrava
"ups", as I did this in Metric system I forgot to update to imperial when the user selected it. Fixes #665 Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Retain the start time when creating plan from diveGravatar Dirk Hohndel
We need to make sure that the start time is set before we start adding points. Fixes #661 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Fix time zone conversionsGravatar Dirk Hohndel
I know I tested this - no idea how I missed this. Anyway, this was of course utterly bogus. Whenever we get a time from a time_t into a Qt Date or Time datastructure, we need to adjust it by the timezone offset as otherwise Qt will assume it's in local time and helpfully change it to the wrong values for us. See #655 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Remove unused variableGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Another string to translateGravatar Sergey Starosek
[Dirk Hohndel: took only one of the two parts and adjusted commit message accordingly] Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29C++ Correctness and code cleanup.Gravatar Tomaz Canabrava
Use const-reference where we can gain a bit of speed from that and clear an else { if {}} by using else if. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Don't mess with the selection when closing a fileGravatar Dirk Hohndel
Our core structures are kept consistent by calling delete_single_dive() and there is no reason at all to even touch the UI selection as this all goes away with cleanUpEmpty() Fixes #660 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-26Add dive: initialize start time of diveGravatar Dirk Hohndel
commit f29f41ae9ea8 ("Planner: fix start time handling") broke the start time handling for Add dive. While in actual planner mode we set the start time for the plan, we did not do this when simply adding a dive. The moment the time / date was changed (which admittedly in real life a user would most likely do) all was well, but if the user just accepted the "now + 1h" default, things went badly wrong. Fixes #658 See #655 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-25PrintLayout: fix a potential bug in the recent table print updateGravatar Lubomir I. Ivanov
There is a weird QPicture dependency; we need to offset a page by headingRowHeightD2, which is half the heading height. The same doesn't make sense if we are rendering the table widget directly to the printer-painter. Moving the offset inside 'pageIndexes' is less desirable. The bug itself manifests when a top margin is set on Win32, while on Linux it's more obvious. On new page start, a fixed height from the last dive on the previous page becomes visible even if the math seems correct. Offsetting both the page index and the vertical position at which the QPicture is placed fixes that. If 'table.render(&painter...)' is used the bug also goes away and our 'pageIndexes' start to make sense again, but we want to use QPicture so that the table is in vector. I don't have a good explanation why this happens! Tested on Ubuntu 12.04 and Win7. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-25PrintDialog: make "print only selected" the default optionGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: vectorize the table printGravatar Lubomir I. Ivanov
Use QPicture to do that. QPainter::drawPicture() requires offsetting the target QPoint's Y value by two times the headingRow height. This can be improved the hardcodding the offset when the 'pageIndexes' are calculated, but is a bit complicated. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: reduce the scope of 'pic' and 'picPainter'Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: modify the profile font size based on the #dives per pageGravatar Lubomir I. Ivanov
For the profile print, the number of dives per page is: divesPerRow * divesPerColumn If we have more 3, 0.6 seems optimal, while for less we can pretty much use the default scale of 1.0. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: draw the profile to a QImage only on LinuxGravatar Lubomir I. Ivanov
The QImage fix for the recently reported "huge-vector-lines-in-PDF-printouts" bug is only needed on Linux. For Win32 and OSx we can render to vector. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: fix the ProfilePrintModel fontGravatar Lubomir I. Ivanov
Fixing the font size is required, because we don't really support a dynamic row height, as the row height is set in the class constructor. 7 seems optimal for all print modes. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: disable the QPainter scalingGravatar Lubomir I. Ivanov
This is wrong because we don't really need to scale. We already have the estimated page dimentions in pixels, so taking the quotient of the printer DPI and screen DPI and then scaling (probably up) our rendered widgets via the QPainter introduces blur (due to the oversampling), and a performance penalty. By rendering at the exact dimensions we ensure that the widgets are crisp at a 100% printout. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24PrintLayout: a whitespace fixGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24Printing: add 1 dive per page optionGravatar Lubomir I. Ivanov
With this option there is an exception, which makes the notes section of the profile table occupy half the page. This way dive plans can reasonably be printed. Fixes #636 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24Planner: fix start time handlingGravatar Dirk Hohndel
We setup the startTime for the dive plan in too many places... but never actually copied it into the planned dive. Fixes #640 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24Sort dive table after adding a diveGravatar Dirk Hohndel
The dive might not be the newest dive in the dive list. Fixes #637 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24Translate progressbar textGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24Align progressbar text to center of the widgetGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-24Update strings for translationsGravatar Dirk Hohndel
Including a tiny change for one of the new strings to be consistent with the capitalization rules we recently established. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Planner: fix an enduring assert on startupGravatar Lubomir I. Ivanov
qt 5.3, win7 64bit. beginRemoveRows() asserts in removeSelectedPoints() because rowCount() - 1, becomes less than firstRow. This needs a check in removeSelectedPoints() if the number of passed rows is zero. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Only repopulate the dive info once ( we were repopulating 4 times )Gravatar Tomaz Canabrava
This makes the screen repopulate itself after a dive change only one time instead of the old 4. we were repopulateing when we removed the actual selection to reset the old selection previously stored, sigh. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Only use HTML if the text has a <table>Gravatar Tomaz Canabrava
The text we generate for the diveplan has a table inside, and we must use HTML only for the dive plan. so I treat all text as HTML, look for a table item, if it doesn't have, I treat it as Simple text and set it on the notes. Works and makes linus loves me again. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Code cleanup: HeartRate item was doing insane thingsGravatar Tomaz Canabrava
This simplifies so much of the code that we were using to control the visibility of the HeartRate. now things are much saner. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Animation speed is a value, not a booleanGravatar Tomaz Canabrava
This breaks compatibility with old preferences, but it's a single key and not that very important so I don't think it's a bigger issue I've renamed prefs.animation to prefs.animation_speed to denote that it's a value, and not a state. Also, fixed the places that were treating it as a state (on/off) to treat it like a correct value. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Don't plot pictures in Print modeGravatar Tomaz Canabrava
The pictures were being plotted in print mode, the main reason for this was that when we entered print mode and had already a picture plotted, the method would return before removing them from the screen. This fixes it. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Set visibility in a saner wayGravatar Tomaz Canabrava
for some reason we did a if(true) setValue(true) else serValue(false) now we just use the value to set the value. =p Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Break really long line.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23Whitespace fixes.Gravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-19De-duplicate planner default settingsGravatar Anton Lundin
All other default settings we get from subsurfacestartup.c's initialization of the prefs struct. The planner had its defaults there and in the retrieve of the settings from QSettings. This changes so the defaults for planner settings will be read from the defaults prefs struct as all other settings. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-18get_gas_at_time needs to always give us a valid gasv4.1.91Gravatar Dirk Hohndel
Before this function was changed it was really supposed to just change a gas that was passed in in case there was an event that changed the mix - but with the new name the caller will assume that they get a valid gasmix. And promptly we had one caller that didn't initialize gas to be based on the first cylinder before calling get_gas_at_time(). Instead of adding yet one more spot that knows about the oddity of the old API I simply changed get_gas_at_time() to do what it name appears to imply and fixed the other callers not to bother to initialize the gasmix. Fixes #647 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-18Add missing application iconGravatar Sergey Starosek
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>