Commit graph

3609 commits

Author SHA1 Message Date
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
Willem Ferguson
07c63c511b subsurface user manual update
References to literature on gradient factors changed (see dive profile
section, also preferences section)

Section on preference settings added.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-04 12:22:06 -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
Willem Ferguson
7c8e95e1b5 Update to user manual
Made changes to dive profile section.

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:13:01 -08:00
Lubomir I. Ivanov
1f7f5e18e2 qmake: use real tabs for all .pri files
subsurface.pro already useses that.

For consistency with the app, we use swap 4 spaces with
a tab character for indentation.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:03:46 -08:00
Lubomir I. Ivanov
639f12cc42 qmake: fix a 'GIT_DIR' issue
"'GIT_DIR' is not recognized as an internal or external command",
is reported if qmake is runned on Win32.

To solve that we set a explicit syntax for Win32 that uses "Set.."

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:03:29 -08:00
Lubomir I. Ivanov
8003377622 qmake: Fix unescaped backslashes issues
We need to espace the backslash with '\\' on win32.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 13:03:09 -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
Dirk Hohndel
a7bdf39339 Update source strings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 11:31:13 -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
49cb75ee09 Fill pt_BR translation from pt_PT
Manually done by only replacing unfinished translations (and one where an
English term was used as translation).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 09:13:48 -08:00
Dirk Hohndel
790b19b8fb More translation updates
As always, I am not the author, just pulling into Subsurface.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-03 08:57:49 -08:00
Dirk Hohndel
917b47b79c Parse localized GPS string
Let's ALWAYS support the somewhat "international standard" N/S/W/E
characters, but ALSO support localized versions.

Fixes #315

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 16:17:35 -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
81d91f2ce0 Change gas in second cylinder in sac-test-dives
Due to that we can't handle gaschanges to the same gas in another
cylinder, this changes the second gas to EAN22 to workaround that.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 12:33:47 -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
627b351174 Pull more translations from Transifex
As usual, I am not the author, just the person pulling from Transifex.
Authorship is tracked there (rather badly).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 07:42:19 -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
Willem Ferguson
83766db87b A further update to the user manual
I have added a section about importing dives from other electronic
sources. There are some potential problems, because I know that the
intercation with divelogs.de is not yet fully functional

Signed-off-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-12-02 06:54:20 -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