Commit graph

3737 commits

Author SHA1 Message Date
Lubomir I. Ivanov
005f8ecf83 profilegraphics.cpp: Use text sizes in plot_text()
Make the active font (fnt) use the 'size' member of the received
text_render_options_t. This allows changing the size of
certain text elements.

For the moment most text elements are set to 12px.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:24:02 -07:00
Lubomir I. Ivanov
88b1e09dee printlayout.cpp: Increase the font size in tables bellow profile
Because of varying font (screen) DPI we use pixel sized fonts
when printing. Apparently 8px does not look that good on Windows
default fonts, but kinda OK on Linux. We compensate by
increasing the font size and table rows to 9px.

Also decrease the padding between the table and profile to 5px.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:23:56 -07:00
Lubomir I. Ivanov
f818ece074 graphicsview-common.cpp: Add more contrast to certain B/W colors
There was a report that the depth and time texts were small
and require more contrast on the B/W print. Use BLACK1 for these.

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>
2013-10-15 04:23:43 -07:00
Lubomir I. Ivanov
d347ef5336 profile.h: Adjust text sizes (*_TEXT_SIZE)
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:23:35 -07:00
Lubomir I. Ivanov
b3234d3d8d color.h: Define the color BLACK1
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:23:16 -07:00
Dirk Hohndel
e93f96a8eb Add test dive with tank pressure sensor information
This is a real data from a Uemis Zurich divecomputer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 04:12:16 -07:00
Dirk Hohndel
dba4245075 Make sure version.h is updated whenever the git version changes
The easiest way to do this seems to make it depend on the correct git
reference. qmake will do the right thing (and create a fixed version.h based on
the VERSION variable) if the user is working from a tar ball.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 03:53:33 -07:00
Dirk Hohndel
03f4089acb Get the version at make time, not qmake time
Let's see how many tries it will take me to get this one right...
The name of the .dmg needs to be determined when running make, not qmake.
Otherwise we'd have to force the user to run qmake every time version.h
changes. This looks better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-15 02:49:46 -07:00
Dirk Hohndel
5477c1ffa0 Actually get the correct full version for DMG
This is what I get for trying to be smart and pushing a change from the Linux
box because the fix was 'obvious'. Duh. It was not. In order to get the real
full version including the git hash we always have to pass 'linux' to the
gen-version script, even on a Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 22:43:50 -07:00
Dirk Hohndel
9dbf5a6daa Use full version for Mac dmg file
Only tagged releases should get the short version number.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 22:39:29 -07:00
Dirk Hohndel
640f2067d5 Only calculate decompression if the user turned the preference on
There's no point in wasting the cycles otherwise.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 17:24:25 -07:00
Lubomir I. Ivanov
7861103139 Print: remove profile border when printing
Custom widget frame styles such as 'Sunken' and 'Raised' which seem to
varry between OS will be captured as well:
http://harmattan-dev.nokia.com/docs/library/html/qt4/qframe.html#Shape-enum

So instead we temporarily set the profile frame to QFrame::NoFrame and
then restore it to the previous value.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 13:15:58 -07:00
Lubomir I. Ivanov
561d00d599 INSTALL: add notes for a native win32 build
There are more details to it, but i decided to exclude them
as these seem situational:

- libraries tend to mostly fail to build from source on win32...
- libiconv may be required by an oddly pre-built libxml2 package
- pkg-config requires a CMD wrapper so that an extra CRLF line is
trimmed from stdout

If someone takes on this task, i guess he/she may pop on the
mailing list for questions.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 13:15:27 -07:00
Miika Turkia
080b1bcc5a Enable file selection dialog for preferences
This enabled a file selection dialog for selecting default log file
under the preferences.

[Dirk Hohndel: added missing declaration to .h file]

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 13:14:09 -07:00
Patrick Valsecchi
291ce1d9ac Fix the DC ceiling in the profile.
entry->ndl is computed and therefore should not be used for showing
the DC's ceiling. That made the DC ceiling jump to 0m when the computed
celing was at 0.

Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-14 12:30:32 -07:00
Miika Turkia
39d7ae5f3a Use QDir::currentPath to get the current directory
applicationDirPath() does not find the source directory (if build
directory differs from source directory). Using currentPath() allows one
to still run built Subsurface from the source directory and find e.g.
xslt_path.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:31:34 -07:00
Lubomir I. Ivanov
a2a93ff04b Models: fix two potential crashes
CylinderModels::setDive() and WeightModel::setDive() have
potential to pass the 'last' argument to beginInsertRows() as
a negative number which triggers an assert that 'last' cannot
be smaller than 'first'.

Patch attempts to fix that by only calling beginInsertRows()
when there is at least one row to insert.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:31:25 -07:00
Lubomir I. Ivanov
d23266ad51 subsurface-install.pri: attempt to fix the perl command line
\$^ or $(DESTDIR_TARGET) do not expand for some reason,
but also we cannot use $$DESTDIR, $$TARGET, or $$DESTDIR_TARGET
because these are empty. So what we use is a hardcoded path
(debug/release) and a target with an .exe suffix on win32.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:31:14 -07:00
Lubomir I. Ivanov
b589dedf3c subsurface-configure.pri: fix for the QMAKE_HOST.os check
Looks like having $$ before QMAKE_HOST.os does not work.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:31:06 -07:00
Tim Wootton
a014fb1099 Adds missing "EndPress" column header for cylinder table
The end pressure was appearing in the column headed "O2"

Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:30:56 -07:00
Dirk Hohndel
5b72348eff Try to fix the Google Maps issue
This is trial and error, based on a few websites describing the api.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:30:44 -07:00
Dirk Hohndel
f5fbbfddb2 Fix uninitialized variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-13 11:30:36 -07:00
Dirk Hohndel
39f9fb09db Include location flag in bundle
The little marker flag for our dives was missing on the Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-12 11:38:35 -07:00
Thiago Macieira
6026fef35e Fix two issues with directory searches on Windows
First, make sure we actually match /c/windows from the beginning, not
if it occurs in the middle of the path.

Second, make sure that directories containing the binaries are
searched first. Do that by using unshift (prepend) instead of push
(append).

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-12 10:30:00 -07:00
Linus Torvalds
58b668c714 Fix dive planner sidebar depth units
The dive planner always showed the depth in our internal units, ie
millimeter, in the sidebar that showed the plan points.

That made little sense in metric mode, and none at all in imperial. The
_graph_ showed things in meter and feet.

So make the DivePlannerPointsModel always convert things to and from the
user units.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 20:26:28 -07:00
Dirk Hohndel
d031b54d16 Install qt translations into Mac bundle
This is much harder than it should be...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 13:51:03 -07:00
Dirk Hohndel
344fc98bfc Better diagnostic message when not finding translations
This way we know where the program was looking for the files.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 13:50:35 -07:00
Dirk Hohndel
e5a2e025d7 Ignore the Subsurface.app folder
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 13:50:24 -07:00
Dirk Hohndel
35952a59d0 Get cross build to work again
...and re-enable silent mode by default for cross builds

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 13:33:38 -07:00
Thiago Macieira
4a213bba41 Tabify win-ldd.pl - subsurface coding style
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:05:55 -07:00
Thiago Macieira
336acb3e18 Ignore the Windows system directories when searching for DLLs
We don't want to deploy kernel32.dll or such.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:05:47 -07:00
Thiago Macieira
1fdbc2eaa4 Fix the DLL search path order
The correct order on Windows is:
 1. Local directory (relative to the binary)
 2. $PATH
 3. System dirs

We insert our -L flags between 1 and 2 above.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:05:43 -07:00
Thiago Macieira
2a871fc3e4 Set the objdump default to "objdump" in win-ldd.pl
The environment variable is to be used if the caller knows that the
default objdump can't parse Windows DLL files (COFF-PE). On Fedora,
Debian, and OpenSUSE, the default objdump can, and obviously the
native one on Windows can too.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:05:37 -07:00
Thiago Macieira
fa532f0f28 Fix deployment: make isn't expanding $(DESTDIR_TARGET) for me
I don't know why. Working around the issue by using $^ (all
dependencies) and listing the files to be processed as dependencies for
the rule.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:05:22 -07:00
Thiago Macieira
c684df4976 Fix the sed regexp: we want to match "lib" followed by : or at the end
There was one extra backslash that got passed to sed, which meant it
matched a literal dollar sign.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:05:07 -07:00
Thiago Macieira
d3aceafdaa Fix non-expansion of some Makefile variables
Apparently SED isn't set on Windows-native Makefiles. And for some
reason, $(CC) wasn't getting expanded properly -- it expanded to "cc",
even though it is set at the beginning of the Makefile to "gcc".

Reported-by: Lubomir I. Ivanov
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 12:04:40 -07:00
Thiago Macieira
84549b891f Advise people to compile libdivecomputer only statically
Because Linus says so.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 10:20:33 -07:00
Anton Lundin
c585d1ed02 Remove some arguments, that we find in plot_data
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 10:19:29 -07:00
Anton Lundin
dd3b8210a9 Remove unused arg in plot_cylinder_pressure
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 10:18:07 -07:00
Dirk Hohndel
dee7bdd1ad Fix bug in Documentation make invocation
Without the trailing slash the Makefile in Documentation would create the wrong
target name (with run-together path / filename) and therefore would always
recompile the documentation.
And we don't need to check that the Documentation directory exists - it's part
of our sources...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 09:31:58 -07:00
Dirk Hohndel
66c04092d2 We no longer use the .translation file
This was a broken workaround, anyway.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 09:26:48 -07:00
Dirk Hohndel
2e2212da5f Fix translation compilation
Now the Makefile should automatically detect when it needs to create a specific
.qm file and do the right thing to create it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-11 09:25:46 -07:00
Tomaz Canabrava
beb40ae494 Finish clearing up the TableModels
There are other models ( Tree Models and Model Items
) that are not affected by this commits, this is
already a good cleanup but it can be extended
to also fix those two other possibilities.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 11:42:33 -03:00
Tomaz Canabrava
fac316865c Another Model Cleanup
Conversion of the WSInfoModel, that populates the list
of weigthsystems in the Equipment tab.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 11:13:16 -03:00
Tomaz Canabrava
a4efa8c444 Second model converted to be less boilerplated.
Second model converted to be less boilerplated,
there are right now 7 models that will need to
be ported. each model can remove around 30 to 40
LOC, so this is not such a bigger improvement,
but it's an 'keeping an eye on the future'.

Also fixed a bug where the returned value was dummy.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 11:04:27 -03:00
Tomaz Canabrava
26c87fafc2 Begin to Cleanup the Models, trying to reduce boilerplate.
The Model View system in Qt is *very* verbose, this is the
beginning of a series of patches that will concentrate
the boilerplate somewhere and reduce the amount of lines
and will also try to make the code cleaner and easyer to
understand,

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 10:50:40 -03:00
Tomaz Canabrava
1b9a4f2bf8 Good deal of whitespace fixes and code cleanup.
I just went thru all of subsurface code removing
some whitespaces issues and trying to make the
code prettyer, I also removed a few QString issues.d

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 10:21:04 -03:00
Tomaz Canabrava
9ed933d033 Added rules on gitignore for the Translations generation.
Added rules on the gitignore file for ignoring the translations
that are generated during compile time.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
2013-10-11 09:26:04 -03:00
Dirk Hohndel
e3e47b34a1 Automatically build translations
This runs lrelease against the .ts files and automatically recreates the .qm
files if any of the .ts files changes.

This also moves the .ts files into the translations directory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-10 14:52:56 -07:00
Dirk Hohndel
f5423c48b8 Try harder to find the translation files
They could be below the data directory ("share") or next to it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-10-10 14:52:30 -07:00