This patch improves on the error reporting for the dive computer
configuration dialog to use config->lastError.
The previous code was using a different argument in each function,
which lacked uniformity.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
To avoid confusion, this code update makes the status text empty whenever
there is an error message. This makes the error message more prominent.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Changes the layout of the ConfigureDiveComputer dialog to use a
list of supported computers on the left, with a stacked widget
showing the configurable details.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This patch implements the first step towards OSTC 3 firmware update.
Its not much, just file selection, but I will build up on it from there.
Implements a thread to initiate firmware updates. Currently, this is
for the OSTC 3.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Implements support for reading, writing and backup/restore of set point
settings for the OSTC 3.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Implements reading, writing and backup/restore of OSTC 3 Dil Values
(setting 0x15 to 0x19)
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Implements writing OSTC3 gas settings to the device.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Implements the reading of OSTC3 Gas Settings. These are settings
0x10 to 0x14
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Moves non gui classes (configuredivecomputer, configuredivecomputerthreads
and devicedetails) from qt-ui to the top level folder.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
I've moved the .pro file fixes to where it happened, so the rest of the
changes need explanation now. -Thiago
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
I am adding more OSTC 3 settings as I go along. Here, I have
added dive mode and saturation.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Changes the dive computer configuration dialog to use a
tabbed interface. This will make it easier to add new
dive computer models to the interface.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Adds support for more OSTC 3 Settings to the reading, writing,
backup and restore functions. These settings are: last deco,
units, sampling rate, salinity, dive mode colour and compass
gain.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
The ConfigureDiveComputer class now has functions for complete
XML backup and restore. These dump the loaded settings on a
dive computer to an XML file, and there is an option to
restore them.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This patch enables XML backup. We can now save the settings
to an XML file. Currently this backs up just the basic stuff
such as custom text, language and brightness.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
After splitting dive computer configuration classes, the date/time
setting had not been ported. This adds the same to the classes.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
This patch polishes up on all classes added for dive computer
configuration to give a clean workflow. The classes can now
write and read data from the OSTC 3.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
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>
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>
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>
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>
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>
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>
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>
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>
This splits the code in configuredivecomputer.cpp into multiple files.
The read and write threads are moved to configuredivecomputerthreads.h/cpp,
and the device details class is moved to devicedetails.h/.cpp
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Adds a setting to control the device's brightness. Currently I
have only the OSTC 3. Will add more afterwards.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Improves the writing of device name to the dive computer. The
code has been updated to use a switch statement.
This will make it easier to add new devices in the future.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Improves writing of date and time to the dive computer. This
has been tested using the Heinrichs Weikamp OSTC-3.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Following suggestions on the mailing list, this changes the
method used to detect the dive computer family. Detection is
now done using: dc_device_get_type.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Adds a class to write settings to dive computer, and modifies
the existing ones to integrate it.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Added classes for reading data from dive computer. This is
at the basic level and I will expand it as I go along.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Using code from 'downloadfromdivecomputer' class, this code
loads the vendors and products to the respective comboboxes.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Create a dialog for reading and writing settings to and
from dive computers, with a menu entry in MainWindow to
open the dialog.
I will build up on this dialog and change it as needed.
Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
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>
This reverts commit 6fdbf2069d.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Revert "Don't add a close button to KMessageWidget"
This reverts commit 75c9bcd726.
Revert "Remove unused variable"
This reverts commit 9edee3477a.
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>
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>
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>
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>
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#656Fixes#396
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
"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>
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>
[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>
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>
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>
commit f29f41ae9e ("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>
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>