Commit graph

11081 commits

Author SHA1 Message Date
Rick Walsh
106a1ff5d1 Planner: add recreational mode tooltip
Recreational mode isn't self-explanatory.  Add a hint for the user.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-12 09:44:56 -07:00
Sergey Starosek
0c7e4d0cab Fix crash on empty arguments
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-12 09:44:07 -07:00
Dirk Hohndel
c9c9673b75 Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11 11:06:26 -07:00
Lubomir I. Ivanov
80056278f7 android.cpp: update path retriaval scheme
Android was skipped as a OS target when the recent path retriaval
modifications in <os>.c were made.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11 10:32:57 -07:00
Lubomir I. Ivanov
d0d83d5d7d profilewidget2: fix line width when printing on OSX and Linux
On OSX and Linux only, the cosmetic width of the QPen
on profile axes does not work and is weirdly dependent on the
fact if a printer is installed or not. Possible Qt bugs at hand.

The same is not present on Win32.

To solve the issues we add setPrintMode() in DiveCartesianAxis
and call it for all instances of the class in ProfileWidget2.

This patch also moves gridPen() as a private member function
of PartialGasPressureAxis as it now needs to access member
variables.

Fixes #943

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11 10:32:11 -07:00
Lubomir I. Ivanov
11e38710e4 profilewidget2: add resetZoom()
resetZoom() is now a new method that is called both
when 'printMode' is updated or when the dive is re-plotted.

Fixes a bug where zooming in on the profile and then
printing the dive has the profile at the wrong zoom level (makes
the profile look smaller).

Reported-by: Willem Ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11 10:31:25 -07:00
Gaetan Bisson
f1b4fb21db Use ~/.subsurface as default directory on Linux
This is more discreet than ~/subsurface (the previous default) and
follows a well-established tradition.

Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-11 10:24:03 -07:00
Sergey Starosek
bfaf57e1ec Remove UTF BOM from user manual files
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 13:12:58 -07:00
Sergey Starosek
2fd42cc1e4 User manual spelling fixes and tidy-up
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 13:12:06 -07:00
Sergey Starosek
aff6c3d1ad Documentation: update russian translation of user manual to english b74809b
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 13:11:58 -07:00
Sebastian Kügler
38e1dc1589 QML-UI: Layout improvements in app list and details header
- fix spacing and sizing in TopBar
- use an anchor layout for the delegate and split out labels and values: this
  allows more uniform alignment
- add the subsurface mobile icon to the first page
- various visual touch-ups to taste

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:59 -07:00
Sebastian Kügler
ac6b267d40 QML-UI: gridUnit is now dpi-corrected
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:54 -07:00
Sebastian Kügler
5195fcf919 QML-UI: improve list painting
- section headers get underline with a thick line
- items are separated by spacing and a thin grey line at the bottom
- spacing on both sides, aligning with header

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:51 -07:00
Sebastian Kügler
0ed2584231 QML-UI: be less chatty
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:48 -07:00
Sebastian Kügler
77fa4e37c8 QML-UI: add more properties to Units and Theme
- colors for accentuation (background and text)
- text color to paint on highlights
- units.spacing (derived from gridUnit, so it's dpi-corrected)
- port main.qml, especially the application header to this theming and
  sizing

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:42 -07:00
Sebastian Kügler
431b5e07fe QML-UI: basics for theming and hi-dpi support
- Theme: For theming, we're just defining some colors centrally for now
- Units: This object provides dpi-corrected sizing in the form of
  gridUnit. The idea is to base gridUnit on the rendered font size, so
  the ui scales with text size. As this interpolates font size and dpi,
  the sizing is rather responsive.

These are the basics, now we can kill lots of hardcoded pixel values.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:36 -07:00
glerch
67c306b527 Fix main window size, position, and state
Now size, position and state should be preserved correctly.

Signed-off-by: glerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:36:44 -07:00
Dirk Hohndel
65dbfd75e0 Make the mac bundle be a high resolution app
This way it no longer gets started in the ugly low resolution emulation
mode. What a difference.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 11:37:00 -07:00
Tomaz Canabrava
d611d97406 Do not show lack of coordinates as having same gps information
The filter that takes care to show the dive sites that have the
same gps information should not take into account dives that have
no gps information.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 10:50:51 -07:00
Miika Turkia
e500a9dea8 Ignore geolookups without value
It seems that geolookups might return null for some values. This will
result in corrupted XML as show_utf8 does not terminate the current tag
if t->value is empty. So let's just skip the geo data that is missing
the value.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 16:52:59 -07:00
Miika Turkia
c0ac73a478 Fix a crash when editing manually added dive
I have manually added dives from an ancient version of Subsurface.
Trying to edit these caused Subsurface to crash due to comparison of
string of dc.model that did not exist (to a static string). And further
down the execution path we were crashing as there were no samples
associated with the dive.

See #941

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 16:42:27 -07:00
Dirk Hohndel
640c746a1f Latest translations
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 13:11:26 +01:00
Lubomir I. Ivanov
4ed418dcc2 Fix font issue on Windows 10 in the weight widget
Column headers were drawin in a smaller font. This fixes it for no
apparent reason.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 11:52:37 +01:00
Dirk Hohndel
eccac1321f Deal with weird transifex issue involving leading space
Apparently transifex drops the leading space in the translation string and
then at runtime the string no longer matches. So let's just code this
differently.

This of course creates a new string but that new string should be the
string that transifex already asks people to translate...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 10:05:06 +01:00
Dirk Hohndel
f24ab1dfa2 Refresh the screen even if started with no valid files
If no command line argument is given and no default file is set we didn't
call refreshDisplay() and so the information widget stayed enabled even
though no dive was shown which looked really weird and was inconsistent
with what we showed when the user closed an already open file.

This makes the behavior more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 07:40:29 +01:00
Dirk Hohndel
37445df0b9 Clear date and time when no dive is shown
So far we showed bogus date and time - whatever time it might be in UTC at
midnight 2000-1-1 in your timezone. Instead we now show a discrete little
"-" in both fields.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 07:38:26 +01:00
Tomaz Canabrava
ef2765d0c4 Update UI on dive site widget when retrieving taxonomy
[Dirk Hohndel: slightly refactored this commit and the previous one to
               make the code actually work and make the split across the
               two commits more reasonable]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 06:28:45 +01:00
Tomaz Canabrava
2eed9c0b9b Move the algorithm to divesite.cpp file
This shouldn't be on the maintab.cpp, this file is already too convoluted.

[Dirk Hohndel: slightly refactored this commit and the next one to make
               the code actually work and make the split across the two
               commits more reasonable]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 06:27:38 +01:00
Tomaz Canabrava
ebf2407db6 Add the labels for taxonomy in dive site widget
Nothing to see here - just added the widgets on the .ui files

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-08 06:17:40 +01:00
Dirk Hohndel
09d6913161 export-html needs to actually calculate the statistics
Otherwise they will always be empty.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 22:09:15 +01:00
Dirk Hohndel
ea6f6b959e Prevent crash in export-html
We need to instantiate the window title updater...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 21:57:26 +01:00
Tomaz Canabrava
7bf398549b Passwords fields should have echoMode Password
so nobody can see what's being written.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 18:45:00 +01:00
Dirk Hohndel
f8279249b1 Add missing tooltip for the reverse geo location lookup
This sadly adds another string for tranlsations

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 18:42:21 +01:00
Lubomir I. Ivanov
afed054d82 modeldelegates.cpp: add custom highlight drawing in location items
There is a problem in LocationFilterDelegate::paint(), which
can manifest as very light background with white text in the
combo box from which the user selects a location - a
Windows 7 test case.

The main offenders are the drawControl() call which draws the
selected item background very bright and the fact that
the highlightText() is returning white.

It seems as if the combination of these is just wrong, theme
wise.

e5fa424a and 44762c42 fix that by branching Windows by version,
but do not cover the case where the user can use a custom theme -
e.g. dark selection highlight on Windows 7.

This patch skips drawControl() and draws the highlighted item
background manually. It makes it look similar to the small
tag highlights in TagWidget.

The patch adjust slightly the X offset of the drawn text.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 18:35:37 +01:00
Miika Turkia
2f89a2e6e2 Take dive's temperature into account for min/max temp
Generally we have the water temperature under divecomputer tag, but it
might only be available one level up (under the dive tag). Thus we
should take this into account in order to show the yearly/monthly
statistics properly.

Fixes #867

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 18:30:44 +01:00
Dirk Hohndel
937796bce9 Update README and ReleaseNotes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 17:31:08 +01:00
Dirk Hohndel
088c9003c0 Correctly parse GPS coordinates with a ',' between lat and lon
We use this in our own HTML export - and Google uses that in their
standard way of describing GPS coordinates.

With this the new test passes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 17:19:58 +01:00
Dirk Hohndel
5d2436b504 Add test for more GPS coordinates
We really should be able to parse the coordinates that we show in our own
HTML export as well as the standard Google format... both have a comma
between the latitude and longitude.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 17:18:44 +01:00
Lubomir I. Ivanov
3b809f2cd4 dive.h: don't declare force_fixup_dive() in the header
The compiler complains that said static (not-inline) function
in declared in the header but has no definition.

The function is only used as a helper in dive.c so so this
simply acts as a forward declaration and we can safely remove
it from dive.h. The same forward declaration can be in dive.c.

Since dive.h is include in *many* translation units, this
causes a lot instances of the same warning to be show.

If the function becomes part of the API, the static keyword
needs to be removed and the declaration needs to be added in
the header again.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 13:46:23 +01:00
Dirk Hohndel
43023fa519 0 initialize strings
Otherwise bad things happen when you strcat into them. Oops.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 09:38:55 +01:00
pestophagous
e522dd1a68 Preserve profile toggle-button state zoomed_plot across sessions.
Fixes #912

Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 08:34:47 +01:00
pestophagous
4f287b6f80 Bugfix for checkboxes in DC download window GUI repaint delay.
Bug was due to incorrect use of QAbstractItemModel::index.
The arguments should be in (row, col) sequence but we were
mistakenly passing in (col, row).

Fixes #820

Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 08:34:37 +01:00
Tomaz Canabrava
4b3a117401 Ask the Preferences Widget to show and be visible
The 'show' call only makes the dialog visible, but if it's
covered by any other window that's not from *this* program
it could still be hidden in some OSes. the call to raise()
asks the window manager to make the widget to be on top of the
widget stack.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 07:57:09 +01:00
Tomaz Canabrava
d120755d15 Simplify code
Do not call the setAttributte *everytime* the Preferences
is called, call it once on the constructor.

Also, no need to call the LanguageModel::instance() on the
instance method, it will be already called on the constructor
it seems that it's a leftover from a long while.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07 07:56:44 +01:00
Dirk Hohndel
4eb0c77d85 Avoid leaking memory
Coverity CID 1325756 and others

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 22:46:44 +01:00
Dirk Hohndel
415d3501da Avoid leaking memory
Coverity CID 1325758, 1325759, 1325760

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 22:46:43 +01:00
Miika Turkia
0db9bbdea7 Fix typo on string formatting option
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 21:22:58 +01:00
Tomaz Canabrava
786f164046 Be way more carefull when copying dive site
I don't know how I was not shot regarding on how broken the
old behavior was.

The new behavior:

1 copy the old_dive_site on top of the current_dive_site
  only if the current_dive_site was actually a new uuid,
  created by that method.

2 if the current_dive_site is an existing one but it doesn't
  have gps coords, copy only the gps coords.

This fixes existing dive sites copying notes and coordinates
from the old_dive_site.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 21:17:03 +01:00
Tomaz Canabrava
20f8c89d64 Remove unused code
This was needed when maintab had to thinker every little aspect
of the dive site selection, which has not been necessary for quite
a while.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 21:15:51 +01:00
Giorgio Marzano
637c3502e9 Force split dives attributes update.
Moved relevant code in a new helper function

Signed-off-by: Giorgio Marzano <marzano.giorgio@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06 21:12:33 +01:00