Commit graph

1242 commits

Author SHA1 Message Date
Lubomir I. Ivanov
fbcad20072 profilepgrahics.cpp: fix preceding limit check
ProfileGraphicsView::plot_depth_profile():
The iterator limit check (i < 7) should precede the indexing
(increments[i]).

Reported by the program cppcheck.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11 16:29:39 +01:00
Anton Lundin
022e2d0d9d Guard against dereferencing undef
Introduce some harness in ProfileGraphicsView::plot_one_event, so we
detect bad stuff and bail, instead of dereferencing undef pointers.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11 03:13:30 +01:00
Anton Lundin
82b86fe924 Fix potential null pointer dereference
If createTemporaryPlan was called on a empty diveplan.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11 03:13:30 +01:00
Anton Lundin
5b61409358 Use delete instead of free() in c++
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-11 03:13:30 +01:00
Lubomir I. Ivanov
643f404036 Divelogs.de: prevent undefined behaviour
prepare_dives_for_divelogs() did a silly thing, which I was
responsible for. When populating 'tempfile' we benefit
from QString, but then return a pointer to a local variable
(char *) without alocating it on the heap. This resulted
in undefined behavior, as we don't know the lifespan of that
local memory on the stack.

Patch fixes that by using strdup() and freeing the memory
when/if needed.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 22:35:13 +01:00
Dirk Hohndel
0e3a24c3c0 Reset libdivecomuter import canceled state
Once the process got cancelled once we never reset the flag.

Fixes #82

Initial-fix-by: Jef Driesen
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 08:09:42 +01:00
Dirk Hohndel
e5561d7668 Fix selection tracking bug
When trying to remember a newly manually created dive across the
sort_table() call I abused the dive->selected flag and didn't clear it out
afterwards (most likely thinking "hey, I'm calling selectDive() on this
anyway").

This caused the UI code to correctly mark the dive as selected, but when
it called down to the C code to keep the internal data structures in sync,
that code didn't update amount_selected as it thought this dive had
already been selected. And that caused other parts of the code to get
confused, which manifested for example in the failed upload to
divelogs.de.

So this clears out the flag after abusing it to remember a dive. Maybe we
should add a 'remembered' flag instead, but for now this fixes the issue.

Fixes #351

Initial-fix-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 06:25:30 +01:00
Lubomir I. Ivanov
c8eae30c6f Webservices: make the dialog title more generic
We use the same dialog for both the Subsurface WS and for the
divelogs.de one. Instead of the old title (which suggests download)
we can use a more generic one - "Webservice Connection"

This makes it easy for us to maintain a dialog that can both
upload and download data, while the dialog title is descriptive
enough.

Fixes #352

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 05:52:26 +01:00
Lubomir I. Ivanov
cf9748278f Planner: fix potential assert in clear()
If rowCount() is 0 we get an assert:
ASSERT: "last >= first" in file kernel/qabstractitemmodel.cpp...

To solve that we wrap the beginRemoveRows() call in a bnrach:
if (rowCount() > 0) {
...

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-10 05:22:01 +01:00
Anton Lundin
26a1904cf8 Remove some unused variables
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 22:47:28 +01:00
Anton Lundin
a3f3e85246 Use implicit zero initialize for the whole array.
Clang yelled about it, and it looks prettier. It also felt kinda strange
to explicit initialize the first element to zero and the rest to zero
implicit.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 22:47:12 +01:00
Anton Lundin
6ff345731b Fix another potential crash
Initialize diveplan.dp to NULL, so we know that we will bail in
drawProfile, when the initial settingsChanged is fired.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 21:40:12 +01:00
Sergey Starosek
a0eb9013b1 Re-enable login and password fields after upload
Give user the possibility to re-enter username and password
after unsuccessful upload due to wrong credentials.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 20:29:38 +01:00
Anton Lundin
35b0924335 Fix potential crash
Initialize stagingDive to NULL, so we know that we will bail in
createTemporaryPlan, when the initial settingsChanged is fired.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 20:11:12 +01:00
Sergey Starosek
5cb47c3de8 Fix tab order for webservices dialog
At least username and password have to follow each other.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:50:33 +01:00
Lubomir I. Ivanov
7c4b083c2b Divelogs.de: change the 'Apply' button to 'Done' for upload
Post downloading we have an 'Apply' button that can be clicked
to apply/merge the downloaded dives. When uploading we
rename the button to 'Done' and enable the button if the
upload was successful. The 'Cancel' button on the other hand
becomes disabled.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:40:52 +01:00
Lubomir I. Ivanov
8f29df6e5a Divelogs.de: use qDebug() instead of fprintf()
Use qDebug() instead of fprintf(stderr, ...) in
prepare_dives_for_divelogs().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 18:40:02 +01:00
Lubomir I. Ivanov
04b62a46e9 Divelogs.de: attempt to impletent 'Cancel' properly
The correct way to stop the upload/download is to use
reply->abort(). If the dialog closes, post exec()
we check if the reply 'isOpen' and abort and delete it.

Without this modification the program seems to crash
as the connection is still in action and it attempts
to read an already deleted file.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 17:42:06 +02:00
Lubomir I. Ivanov
e0acad42aa Divelogs.de: store the user/pass on upload
We store the user/pass for 'Apply' when downloading, but
we also want to store these values for 'Upload'.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:45:54 +02:00
Lubomir I. Ivanov
de8d532adb Divelogs.de: Improve the error handling post DLD creation
Only show a filename in the error report if such was previsly
set. We also add a string for translation, that is shown
in the main window.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:58 +02:00
Lubomir I. Ivanov
ca731cef89 Divelogs.de: Add a 'filename' field when uploading
The 'Content-Disposition' header, requires that we pass
'name' but also a 'filename' field.

Suggested-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:58 +02:00
Lubomir I. Ivanov
70fce6ce6b Divelogs.de: further improve reading the server reponse
We now check for the following entries:
<Login>succeeded</Login>
<FileCopy>failed</FileCopy>

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:57 +02:00
Lubomir I. Ivanov
5514499867 Divelogs.de: improve prepare_dives_for_divelogs()
prepare_dives_for_divelogs() is based on GTK / C code
where we used GLib methods to generate a temp zip file.
Qt has QTemporaryFile, but it seems there is some sort
of a problem when using with with zip_open
(ZIP_CREATE considered) or at least in this particular case.

To workaround that, we generate a random name ourself with qrand()
and simply pass it to zip_open (with ZIP_CREATE) and then return
the filename.

Also (!), there is memory corruption when trying to return
'tempfile'. This wasn't the case with the C compiler,
to my knowledge. Regardless of this fact the generated
zip does not look corrupt.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 16:23:57 +02:00
Lubomir I. Ivanov
231e02f97d Divelogs.de: parse response once the upload is finished
This is based on the GTK version.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 15:51:18 +02:00
Lubomir I. Ivanov
0905e4f0ab Divelogs.de: add code for zipping up all dives
prepare_dives_for_divelogs() comes from the GTK version, originally.
The upload seems to fail at this point with an error.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 15:51:17 +02:00
Lubomir I. Ivanov
5869712569 Divelogs.de: add a divelist context menu item for upload
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 15:51:17 +02:00
Lubomir I. Ivanov
be16ade038 Divelogs.de: allow import of downloaded dives
This patch adds commands to the dialog buttons, to apply
(and possibly show an error if 'parse_file' fails',
reject, or show help - which is a link to the 'divelogs.de'
website.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-09 15:51:17 +02:00
Anton Lundin
e6c51cc314 Implement a settingsChanged in DivePlannerWidget
This is so we can default to the GF's from the preferences. We need the
bail handler in createTemporaryPlan, because its triggered when we
change GF's, and if we don't have a stagingDive there, we will access a
NULL-pointer.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-09 07:51:40 +01:00
Anton Lundin
44848d5457 Keep track of user requested minimum depth
When got auto-rescaling of the depth scale, always reset the depth scale
to what the profile would suggest. This introduces a concept of user
requested minimum witch we will update and not scale down to lower than.

Reported-by: Henrik Brautaset Aronsen <henrik@synth.no>
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 16:20:40 +01:00
Anton Lundin
a145c2e61a Update the diffrent units when switching system
When switching between metric and imperial, we should also show that the
different units are switching too. This signals the greyed out
radio buttons to switch to the right system.

Fixes #347

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 16:18:00 +01:00
Anton Lundin
8c65173746 Rename the radio button to match label kgs->kg
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 16:17:52 +01:00
Anton Lundin
e39ec4e564 Fix units boxes in preference panel
The groupBox-es got renamed, and thus the unit-systems radio-buttons
was enabling/disabling the wrong buttons.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 16:17:43 +01:00
Anton Lundin
f96ea9cc9a If we have defined a gas, default to that one.
If we start to define a gas, we should use that one by default instead
of air.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:42:15 +01:00
Anton Lundin
01e3210725 Calculate gas consumption for planned dives
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:42:03 +01:00
Anton Lundin
caf4d85d0a Silence signed vs. unsigned compare warning
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:41:42 +01:00
Anton Lundin
1ec61e1288 Remove the air point at 0,0
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 09:41:31 +01:00
Dirk Hohndel
4beb53f27e Actually process the dives downloaded from divelogs.de
Silly mistake in commit 93b5c0cd14 ("Finish download from divelogs.de"):
parse_file() doesn't call process_dives() - the caller needs to do that.

Fixes #344

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 06:42:24 +01:00
Dirk Hohndel
50a1ed8d6e When the user cancels a download, reject already downloaded dives
This seems like the more logical behavior, anyway. Cancel means you didn't
want the result...

Fixes #341

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 06:33:46 +01:00
Dirk Hohndel
ad6fab9fb0 Remove pointless code
When removing the selected dives from their trips, it makes no sense to
check if the pointer was actually pointing at a valid dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-08 06:05:54 +01:00
Sergey Starosek
4623d7098b Build language list from Subsurface translations
On Windows platform translation/ folder contains Qt translation
files as well. This results in extra languages in preferences.
From now we filter these translations and choose only those matching
^subsurface_*.qm$

Fixes #339

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 12:06:33 -08:00
Dirk Hohndel
b144e64b9b Fix typo in color
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:13:55 -08:00
Sergey Starosek
482214703b Language chooser improvements
Show language instead of country, sort the list.
Show country in brackets to avoid ambiguity for locales like
de_DE and de_CH.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:09:05 -08:00
Anton Lundin
4c3f51291e Show CC-sp in bar, and not mbar
Fixes #257

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:09:05 -08:00
Anton Lundin
755ea74492 Add support to edit a planned dive
Left to do is to remove all the auto-added deco-points, aka the ones
that had entered==FALSE before we created a dive from the plan.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:09:05 -08:00
Anton Lundin
bb979260b0 Fix gas for start dp
It previously always started with o2 in air, now we start with 0 as its
the same default as in the cylinders too, which fixes a uninitialized
index there too.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:09:05 -08:00
Anton Lundin
90634b3814 Propagate gas and setpoint from previous point
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:09:05 -08:00
Anton Lundin
4696354f4b Adapt depth-scale to current way points
If the scale is too big or too small, adapt the scale automatically.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 08:02:34 -08:00
Anton Lundin
f9b7c5dfe9 Make units in cells consistant in CylindersModel
Now they all have units in the cells.

Fixes #259

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 07:39:12 -08:00
Martin Gysel
d9ca999a17 redraw profile (actually clean it) if no dive is selected
otherwise the previous selected dive is still visible in the profile
view. clicking on edit crashs subsurface: null pointer dereference in
editCurrentDive as it uses 'current_dive' which is null.

Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 07:27:46 -08:00
Sergey Starosek
bf88efae08 Fix profile legend strings
Use proper case and subscripts for gas names on profile legend.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 07:25:19 -08:00
Dirk Hohndel
f6ece43cff Renumber dialog should default to start at 1
Also make it somewhat larger and less crowded.

Fixes #338

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-07 06:49:52 -08:00
Thiago Macieira
53f38a2410 Set the menuRole property on certain menu entry QActions
Telling Qt that the "Preferences" menu entry is
QAction::PreferencesRole will make it be moved to the System menu on
Mac, for example.

Fixes #327

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 21:46:37 -08:00
Dirk Hohndel
df464fcef1 Stub out a mark dive invalid function
Not sure I'll be able to finish this for 4.0

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 17:40:59 -08:00
Dirk Hohndel
93b5c0cd14 Finish download from divelogs.de
This is far from perfect.
Avoid a weird warning when total = -1 is passed into the progress bar.
Enable the Accept button once the download completes.
Merge the downloaded dives into the existing dive list on Apply.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 17:13:03 -08:00
Dirk Hohndel
3a0f138023 Whitespace cleanup
That one slipped by me...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 17:09:08 -08:00
Tomaz Canabrava
61d5aac2e8 Do not change the current Directory
Qt has a really strange API for directories. when you create a QDir
and set's the currentDir on *that* QDir you created, it's for the
whole application and not just for that variable. Then when the
variable is out of scope, the directory doesn't change back - ugh.

The solution is not to call setCurrentDir on the newly created QDir (which
was quite good since it's also a code cleanup. )

[Dirk Hohndel: modified to undo the far less elegant fix I had made in an
               earlier commit]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 13:21:24 -08:00
Dirk Hohndel
e015effb47 Don't change working directory when looking for tranlations
And only replace 'bin' if there is a bin in the path...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 12:03:12 -08:00
Tomaz Canabrava
9b7b477d7c Added 'English' and 'Use System Default' options.
These complete the ability to select languages from the preferences panel.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 11:58:29 -08:00
Tomaz Canabrava
7436178fe0 Added a filter option to the Language Chooser
This patch adds a filter option to the Language Chooser.
if you choose filter, only the filtered options will appear.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 11:56:00 -08:00
Tomaz Canabrava
f20e07dcf1 Code Cleanup
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 09:54:36 -08:00
Tomaz Canabrava
8a116ba510 Settings for Display preferences didn't really set the preferences.
The code that should set the preferences was actually retrieving it,
this will correctly set it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 09:54:19 -08:00
Tomaz Canabrava
4e263bae98 Added a language preference to the Settings.
When the user first opens the application the default language is
selected; this can be changed to a hardcoded one by going to system
preferences and choosing the one you want.

Restart required.

Fixes #136

[Dirk Hohndel: whitespace fixes, removed qDebug() call, rephrased the
               message displayed prompting the user to restart.]
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 09:49:05 -08:00
Lubomir I. Ivanov
bfe5ccda1c Print: add a safe-guard if table print rows are too big
We do not support rows larger than a single page as the
PrintLayout algorithm will enter an infinite loop,
therefore we put a limit of 15 lines for the location text.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 09:35:09 -08:00
Dirk Hohndel
8f58faf431 Fix crash in table print crash
sizeof(array) is the total size in bytes, not the number of elements...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 09:30:39 -08:00
Lubomir I. Ivanov
5506fa4b38 Print: fix issues when printing a lot of dives in table print
This patch improves the algorithm when estimating where
to put the new page header in the table and how we move
larger dive rows on a new page. It now performs a couple of
'passes', where the first one processes the table and the
second one is used to compensate for the lost space.

Fixes #326

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 09:23:02 -08:00
Sergey Starosek
07e1e416cf Add icon and title for User Manual window
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-06 07:31:08 -08:00
Lubomir I. Ivanov
26d2cc0fef MainWindow: fix setTitle() calls
setTitle() works with an enum that can be fed different values,
and other we may have eventually. For example not only "app title",
or "app title: filename", but others, like dates, certain app status
and so on.

Patch fixes an issue where deleting a single dive in the divelist
resets the title to "Subsurface" only. clearUpEmpty() should only
call setTitle(MWTF_DEFAULT) if no file is currently open.

It also adds a safe-guard to revert back to MWTF_DEFAULT if
no file is open but setTitle is called with MWTF_FILENAME.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-05 08:04:55 -08:00
Lubomir I. Ivanov
94f85bbef9 Print: fix truncated table in "Table print" mode
The whole procedure here is quite confusing.
Once we have our model populated, we need to estimate where
to put page headers (each page has one) and to do that we
store a list of indexes, where a page would begin (pageIndexes).

But since a row can end up being chopped at the end of a page
we move it to a new page and this particular part was lacking
compensation for the moved row's height, when storing the *last*
pageIndex.

For N number of pages we are losing N - 1 dives, or such that
were previously transferred on a new page.

See #326

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-05 08:04:48 -08:00
Sergey Starosek
09a8a85bab Open external links in default browser
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-05 07:31:29 -08:00
Tomaz Canabrava
441838def0 Different Icon for a Bookmark Event.
This patch adds a different icon for a Bookmark Event, and it
also cleaned a lot of code. :)

See #300

[Dirk Hohndel: made the two icons slightly bigger]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 19:41:29 -08:00
Tomaz Canabrava
d3a56c137b Fixes positioning of the legend in View and Print modes.
This patch makes a better assumption of the location for the
legend in both View and Print modes. It also fixes a few oddities
that we used to have ( like hardcoded spacing ).

We are taking the scene().sceneRect() now into consideration to
better place it on canvas.

Fixes: #322

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 19:31:10 -08:00
Dirk Hohndel
20d924a16e Compile fix
Otherwise errno is undefined (at least for me on Linux).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 16:29:55 -08:00
Dirk Hohndel
421dceba1e Merge branch 'improve-subsurfaceweb' of git://github.com/thiagomacieira/subsurface 2013-12-04 16:21:44 -08:00
Anton Lundin
28b8d177c3 Cleanup some uninitialized variables
I can't really see any point in passing a local loop variable around,
and copying a uninitialized pointer. Better use local variables there
and let the compiler optimize them away if it feels for doing that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 15:57:53 -08:00
Anton Lundin
a0df62d913 Add some limits to the GF's
Sets the limit for GF's in the preferences panel to 1<=x<=150 and color
it read if gf > 100. Remove the % in the diveplanner view that was
rejected for the preferences view.
The 150 maximum is needed because QSpinBox defaults to maximum 99.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 15:49:55 -08:00
Lubomir I. Ivanov
662e642ac9 Webservices: fix QString argument for zip_open()
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-04 15:39:35 -08:00
Dirk Hohndel
b5d3476b0b Allow comma separated CSV files
The separator selector in the CSV import dialog was unused. This passes
the value into the xslt and adds ',' as possible value.

I'm sure this could be done much better (pass the actual character instead
of the index), but I couldn't get that to work and this does seem to do
the trick.

Also added a test dive to test this feature.

Fixes #321

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 15:27:09 -08:00
Dirk Hohndel
5fc50b2aab Improve labeling for partial pressure graphs
This backs off a little on what was added in commit c1102a38f3 ("More
gradient on the partial pressure graph.") - the numbers simply got too
busy. I also slightly changed the positioning of the numbers to be a
little more "natural looking".

Fixes #323

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 13:27:34 -08:00
Tomaz Canabrava
66716b5297 Make Gnome3 be bearable
The layout of Subsurface on Gnome 3 had a few flaws, since Qt and Gtk
are not really compatible. This implements a CSS that makes the use
of Gnome 3 more pleasant to the eyes.

Fixes #318

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 12:41:07 -08:00
Lubomir I. Ivanov
d7a19b318e Divelist: fix a crash when updating the preferences
Hitting apply in the preferences dialog causes a QList assert.
This led to DiveListView::reloadHeaderActions(), where
we have an out of range access.

Patch makes the column count match the header action count.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 10:43:54 -08:00
Lubomir I. Ivanov
fc06a69c43 PrintDialog: reset the progress bar each time the dialog opens
This requires us to expose the progressBar as a private
class member.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 15:52:21 +02:00
Lubomir I. Ivanov
e4f35fb51a Print: fix some forward declarations
In the PrintLayout constructor we receive a pointer
of PrintDialog, but the type is incomplete, as we only
forward declare it in the class header. If we decide
to eventually call a method from PrintDialog we also
need to include printdialog.h in printlayout.cpp.

The patch also fixes a similar issue in printdialog.h.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 15:47:33 +02:00
Lubomir I. Ivanov
95e00b0acd PrintLayout: emit progress from printTable()
printTable() now emits a 'signalProgress'
to the PrintDialog's progress bar, but it has 3 stages (loops):
- pupulate a model
- process all rows
- render the table in pages

This requires that we also separate the progress in 3 stages
of 33%.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 15:35:07 +02:00
Lubomir I. Ivanov
ac7126b84a PrintLayout: emit progress from printProfileDives()
printProfileDives() now emits a 'signalProgress' each
time a dive is done processing.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 15:16:20 +02:00
Lubomir I. Ivanov
08cf1be212 PrintLayout: add estimateTotalDives()
estimateTotalDives() is used to calculate the total dives
to be printed, it requires a 'struct dive' pointer
and a couple of 'int' pointers for the iterator 'i' and
'total' return.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 15:13:40 +02:00
Lubomir I. Ivanov
ecf483db46 PrintDialog: add a 'Close' button
The dialog was missing a 'Close' button so we add it.
Also change the mnemonic of the 'Preview' button, as it
was the same as the one for print 'Print'.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 14:14:04 +02:00
Lubomir I. Ivanov
c89d83611b PrintDialog: make the dialog slightly larger
I don't recall why but this dialog ended with a fixed size
(setFixedSize()), so it has to be re-adjusted each time a change
is made in there. We resize it to compensate for the addition
of the progress bar.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 13:55:30 +02:00
Lubomir I. Ivanov
d90cca5c4e PrintDialog: add separate Preview/Print buttons
We rename our old 'Print' button to 'Preview' (as it did just that),
and add a new one called 'Print' which does the direct printing,
by creating a QPrintDialog instance. Both buttons are located
on top of the dialog for now in a QHBoxLayout.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 13:51:34 +02:00
Lubomir I. Ivanov
576c3f559f PrintDialog: change a comment
The entire dialog is 'temporary' and should be replaced,
so we slightly modify the comment about the PrintOptions widget.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 13:46:08 +02:00
Lubomir I. Ivanov
eb1aa5a896 PrintDialog: add a progress bar in the dialog
This dialog will be eventually replaced by a better one, but
for now we can add a progress bar to it. Next step would be to
add separate Print/Preview buttons and emit progress bar updates
from the PrintLayout class.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-12-04 13:41:19 +02:00
Dirk Hohndel
06711732c9 Correct parameter names
It's very confusing when a parameter is called "minutes" but holds
seconds...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 20:55:00 -08:00
Dirk Hohndel
623be2e46f Fix bug in creating dive plan from dive
We don't want to add the last sample - the dive plan functions want to
figure out the path to the surface by themselves and get confused by this.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 20:52:28 -08:00
Tomaz Canabrava
9190c97a3c Attempt to fix the 'click goes to 0,0' thing on the globe.
This patch attempts to fix the 'click goes to 0,0' bug on the
globe. it moves a bit of code around and I particulary don't
like the way that we are dealing with 'EditMode', I think I'll
refactor that for 4.1. We are alredy dealing with a bunch
of states, maybe a State Machine will help on removing code-complexity.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 18:48:17 -08:00
Tomaz Canabrava
d128b74a8a Select the newly added dive after adding it.
Selects the newly added dive after adding it, it uses a
rather ugly hack that forced a unselected dive to be
marked as 'selected' so we can remember what was the
newly added dive, and select it after.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 18:48:17 -08:00
Anton Lundin
04bbfe2ab1 Disable calc_ndl_tts for print
NDL and TTS doesn't show up in the printed profiles, and it takes
significant time to calculate, so just don't do it.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 15:22:49 -08:00
Dirk Hohndel
25bfcf5f6d Don't call fixup_dive when editing a trip
When editing a trip the key for the notesBackup is NULL. Don't call
fixup_dive() on that...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 15:17:38 -08:00
Thiago Macieira
a1972bc343 Implement the network part of the support for divelogs.de
This implements support for:
 * uploading a zip file containing dives - untested
   (the zip file must have been prepared elsewhere)
 * downloading the dive list and the dive XML files

The networking part is finished, but it's missing the actual import of
the XML files sent by divelogs.de.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
bffb384c0f Make the text in the download status selectable
So I can copy any URLs it shows there in order to test elsewhere...

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
919c7045b7 Add support for timing the download out
The time out is 30 seconds from the start of the request or from the
last time we got any data from the server.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
ab1b314a84 Set the download reply pointer to NULL after dismissing it
QNetworkReply might emit signals after it's been told to go away. We
don't want to change the status after that.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
fa07f554e2 Properly reset the state of the download dialog before dismissing
Re-enable buttons that should be enabled by default, disable the others,
set the status to empty, make the progress bar go back to zero.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
481ddf43c6 Improve the status message in the download dialog
This also fixes a typo (untill -> until).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
be7bbb2a7d webservices: Move the static functions to the top of the file
Just my OCD asserting itself. It looks cleaner this way, if the static
functions aren't interleaved in the middle of the WebServices class.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
ff96bcb0fc Make the QNetworkAccessManager a singleton available to all
One of the rules of using QNetworkAccessManager is to share it among all
users, since sockets and other state can be shared. Looks like Marble
doesn't allow us to set it, though, and it creates multiple instances.
I'll prepare an upstream patch to fix that sometime.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:53:00 -08:00
Thiago Macieira
b38eac89e4 General fixes and improvements 2013-12-03 13:52:59 -08:00
Thiago Macieira
0ed95678ba Whitespace: fix indentation in subsurfacewebservices.* to use tabs
Signed-off-by: Thiago Macieira <thiago@macieira.org>
2013-12-03 13:52:59 -08:00
Henrik Brautaset Aronsen
b1febf17b1 Make sure the save/cancel message is always shown
An addition to the "Move dive notes edit message above the
scrollable widget" commit:  Make sure the save/cancel message is
always displayed on top, regardless of which tab is selected.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:01:16 -08:00
Henrik Brautaset Aronsen
9b51901f35 Text cleanup to amend lacking consistency
- Removed the "Visible:" header on the column selector.  It doesn't
  have to be there, and it's not in the similar equipment column selector
- PO2 --> pO₂ (and others)
- Use same initial case in the units selector in preferences

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:01:14 -08:00
Tomaz Canabrava
a75168dcc9 Add legend for the Partial Gass Pressure if active.
This patch adds legend for the partial gass pressures if the
graphs are active. when enabling / disabling the square
that represents the color of a gas will also appear / disappear.

Fixes: #272

[Dirk Hohndel: minor changes to layout and whitespace]

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 12:58:54 -08:00
Henrik Brautaset Aronsen
48cd4af851 Move dive notes edit message above the scrollable widget
The "Save" and "Cancel" buttons disappeared when scrolling to the
bottom of the notes widget.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 11:30:25 -08:00
Sergey Starosek
8189790815 More strings to be translated
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 11:14:41 -08:00
Tomaz Canabrava
80265e4b3f Fix ignoring empty selections on the globe and code cleanup.
If the 'mouseClicked' didn't get any dives at the click-geolocation,
ignore it and do not try to select an empty selection. this was
causing a lot of issues when map-navigation.

Also, good deal of code cleanup.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 11:07:59 -08:00
Dirk Hohndel
a529285e9e Make dive edit message box tex more concise
commit 3c064d5857 ("Make the message when editing a dive fit better")
kinda fixed the wrong problem. A better solution was suggested - just drop
the instructions regarding Cancel / Safe. It's quite obvious what to do
mow that the buttons are part of the message.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 15:48:01 -08:00
Dirk Hohndel
43630cabd6 Don't store translated standard weight system names
For the names that we have in our "default set" we need to store the
English name so Subsurface will "do the right thing" when opening the file
in a different locale.

With manually entered names in a local language there's not much we can
do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 12:41:23 -08:00
Anton Lundin
6294c6b14b Remove unused variable
Leftover from previous code that called get_gas_string

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 12:33:38 -08:00
Tomaz Canabrava
599ffdc2a9 Move code outside of for-loop.
This piece of code didn't need to be on the for-loop, so
let's remove it out of it.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 11:41:03 -08:00
Tomaz Canabrava
7481746d91 Huge speedup when selecting Dives from the Globe View.
The old code ( slow++ ) ignored that each new dive-selection
we recreated all information on the profile window, so this
version ( a lot more verbose, I know. ) will ignore all dives
that are being selected and will only send the 'dive was selected'
information in the last line of the algorithm, instead of calling
it for each dive on the list of 'to be selected' dives.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 11:40:39 -08:00
Dirk Hohndel
768cab66cc Third time's a charm: translating weight system description
Still trying to fix the same issue that I already tried to address in
commit e0b70b82ca ("Fix translation of weightsystem names") and before
in commit dc03b7e7d6 ("We need the correct context to translate event
names").

I missed the WeightModel. Hopefully this was indeed the real fix.

Fixes #312

(I know, I keep saying that)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 10:19:59 -08:00
Dirk Hohndel
3c064d5857 Make the message when editing a dive fit better
This should keep the message widget visible without horizontal scroll bar,
even on fairly small screens.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 09:55:18 -08:00
Tomaz Canabrava
7ce12f1e8b Removed The button box from mainwindow, buttons are now on the message.
The button box on the bottom of the window made it a bit cluttered
on small screens, this patch uses the window of the MessageWidget
to show the butons - this way less space is used and things are better
spaced on screen.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 09:55:04 -08:00
Tomaz Canabrava
d26f109fba Fixes Setting the dive-location via the map.
This patch adds a context menu to set the dive location
via the globe, being the dive with a coordinate or not.

It also fixes setting the dive location on edit mode.

Fixes: #315

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 09:44:55 -08:00
Lubomir I. Ivanov
bbc022ba18 MainWindow: store the window maximized state
We add the "maximized" entry for the settings group "MainWindow",
and store it on close, so that the window state is the same on
the next run. But then also, we only store the window size and resize
to that size if not maximized. This attempts to preserve a "restored"
window size.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 08:47:23 -08:00
Dirk Hohndel
e0b70b82ca Fix translation of weightsystem names
This is very much the same as in commit dc03b7e7d6 ("We need the correct
context to translate event names"). I didn't pay enough attention when
reading the bug report and missed that the weight system names were also
not correctly translated.

Fixes #312

(I hope this time for real)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 07:36:40 -08:00
Dirk Hohndel
502a514e91 Reflect air and water temperature changes in dive info
When editing air or water temperature, you are actually editing the
information in the active divecomputer structure. But the Dive Info shows
the summary data created from the temperature data in all dive computers.
For most people who will only ever have one divecomputer per dive this may
seem like an artificial distinction, but it's very important if you track
more than one computer.

So in order to have an edit reflected in what's shown, we must redo the
"summary creation" for data from the different divecomputers into the
summary fields of the dive.

Fixes #313

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-01 20:17:17 -08:00
Dirk Hohndel
dc03b7e7d6 We need the correct context to translate event names
Qt assumes that all strings are in the context of the class in which you
use them. So when we want to display the translated event names from
within the ProfileGraphicsView we need to make it explicit that these are
strings that come from the C part of the code.

Doing that showed another bug in the code where we foolishly compared the
translated text to a fixed string. Not smart.

Fixes #312

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-01 18:03:32 -08:00
Sergey Starosek
02c887e9ab More strings for translation
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 12:01:51 -08:00
Sergey Starosek
988ddb84a6 Add application icon to dialogs
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 12:01:32 -08:00
Thiago Macieira
b22f1da59e Fix all leak-at-exit from singletons in Subsurface
Subsurface creates a lot of singleton instances on demand, but nothing
ever deleted them. Since they are singletons, these memory allocations
are technically not leaks. However, they clutter the output in valgrind
and other memory analysers, hiding the real issues.

The solution is to delete these items at exit. For the models and for
gettextFromC, the solution is to use a QScopedPointer, which will delete
its payload when it gets destroyed. For the dialogs and other widgets,
we can't do that: they need to be deleted before QApplication exits, so
we just set the parent in all of them to the main window.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 09:28:42 -08:00
Thiago Macieira
bd7ded8894 Delete the graphics items for the ticks and labels in the ruler
Ruler::updateTicks() was creating them, but nothing deleted them.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 09:25:16 -08:00
Thiago Macieira
ba88a3358d Fix memory leak of the MinMaxAvgWidgetPrivate
Found by Dr. Memory, run by Lubomir:
Error #63: LEAK 24 direct bytes 0x344f42e8-0x344f4300 + 0 indirect bytes
 # 0 replace_operator_new                             [d:\drmemory_package\common\alloc_replace.c:2421]
 # 1 MinMaxAvgWidget::MinMaxAvgWidget()               [qt-ui/simplewidgets.cpp:64]

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 09:25:11 -08:00
Thiago Macieira
58d37e0200 Fix uninitialised variable read
Found by Dr. Memory, run by Lubomir:
Error #48: UNINITIALIZED READ: reading register al
 # 0 StarWidget::mouseReleaseEvent()                        [qt-ui/starwidget.cpp:29]

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 09:24:59 -08:00
Lubomir I. Ivanov
22e0323d6a Print: fix wrong Max. CNS / SAC columns
Swap the places of the CNS and SAC values in the profile tables.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 19:10:47 +02:00
Lubomir I. Ivanov
1ab915a7d9 Print: add an icon for the print dialog
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 18:56:25 +02:00
Lubomir I. Ivanov
f183da546b Print: adjustments to PrintDialog
- Hide the sizeing sliders from PrintOptions. we don't really
support any of those in PrintLayout and these are not that
useful and easy to implement, until some sort
of layouting/templating system is in place.
- Move the 'Print' button on top as a workaround, since if
it's bellow the print options it stays bellow an empty area
where the now hidden sizing sliders are.
- Resize the dialog to a smaller size

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 18:56:25 +02:00
Dirk Hohndel
a268311a0b Merge branch 'print' of github.com:neolit123/subsurface 2013-11-30 07:55:58 -08:00
Sergey Starosek
527ae08e76 More strings to be translated
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:53:26 -08:00
Sergey Starosek
66a2f404c4 Fix dialog margins and spacing
Make it consistent with other application dialogs.

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:53:12 -08:00
Miika Turkia
cded8eb198 Fix string in About dialog for translation
The translatable string in about dialog is truncated at the
VERSION_STRING. Thus it has to be given as argument to the tr function.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:47:37 -08:00
Miika Turkia
5a1a25a476 Fix a crash when no trip exists
When there are no trips at all, we have to skip the Yearly statistics
alltogether, including the header line (that should display all the
dives added together).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:46:17 -08:00
Lubomir I. Ivanov
d4766a8cce Print: yet another font adjustment for the profile table
We now only use a slightly large font for the "Dive #" entry.
All other font sizes remain at 9px.

Another change is that we now attempt to use 11px for
individual row height. This makes the table at least 12px bigger
(n_rows * increment), but does not cut letters like 'g',
which go slightly bellow the font baseline.

Perhaps this can be improved later by adjusting the font
and row sizes again.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 17:37:27 +02:00
Anton Lundin
f7efc07817 Remove use of uninitialized variable nr
nr was used but never initialized.
Also, the code removed used select_dive had likely just been forgotten to
be removed when the correct code using selectDive() was added a little
later in the function.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:36:13 -08:00
Lubomir I. Ivanov
526985d6e5 Print: fix missing vertical line at the last column
There was a line missing in the right-most column wrapping
the table for the profile print.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 17:35:55 +02:00
Anton Lundin
4eab1cce20 Remove unused variable
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:21:49 -08:00
Anton Lundin
047e1cf013 Reorder initializers to be more c++-strict
c++ have some idea about in what order things should be initialized.
This makes us comply with that order.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:21:24 -08:00
Henrik Brautaset Aronsen
10a43af066 Minor text cleanup
Use the same case for the first letter in the dive table column headers,
use '%' for both gases in the planner, and show "Start time" instead of
"Starttime".

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:19:48 -08:00
Henrik Brautaset Aronsen
51d298c8d5 Separate text labels for air and water temperatures
The "air / water Temperatures" label didn't look to good.

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:18:39 -08:00
Alexandre Belloni
1ea1c24292 QT-UI: fix some typos
Signed-off-by: Alexandre Belloni <alexandre.belloni@piout.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-11-30 07:16:08 -08:00
Lubomir I. Ivanov
d439d381ca Print: update the values for DM, buddy, suit, etc
We update the values for divemaster, buddy and etc...
Rating and visibility are currently displayed as "x / 5"
values.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 17:12:08 +02:00
Lubomir I. Ivanov
156815f041 Print: update printing for gas, CNS, SAC and weights
Following the new layout for the profile print, we separate
the used gas like so:
AL80 / EAN33 / ...

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 16:51:28 +02:00
Lubomir I. Ivanov
35f1f716a5 Print: add more table headings for Divemaster, Buddy, etc..
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2013-11-30 16:23:19 +02:00