A very simple to use widget:
StarWidget *stars = new StarWidget( windowParent);
stars->setMaximumStars(10);
stars->setCurrentStars( rand()%10);
stars->show();
connect(stars, SIGNAL(valueChanged(int)), someObj, SLOT(starsChangedValue(int)));
It currently uses a 'star.svg' file on the same folder as the binary.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Moves the DiveTrip model related code to models.h
The DiveTripModel was implemented in three parts:
DiveTripModel.h
DiveTripModel.cpp
MainWindow.cpp (the code to populate the model)
This patch changes the DiveTripModel from it's original
implementation to the file models.h, wich should store
all models (Dirk requested the Qt developers to not create
2 files per class, but instead to use a file for functionality,
and data-models are one functionality.)
Besides that, this code cleans up a bit the style:
removed operator<< for .push_back, const references where they apply,
moved the internal DiveItem class to the .cpp since it should be visible
only to the DiveTripModel class, and redesigned the current interface of
the model to be identical of the GTK one (used the UTF8-star and 2
subscribed, for instance).
Amit (the creator of the original code) should comment here if it's ok
with my changes.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fairly straight forward, so far just one tiny bit of code restructuring,
everything else separated cleanly.
Added statistics-gtk.c and statistics.h
This should make no difference to functionality.
Cherry-picked from Qt branch; fixed merge issues mostly caused by
dive_tags and Makefile changes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Surprisingly straight forward, just a couple of places where we really mix
significant logic with UI code (for example setting the window title).
I had to move amount_selected from display-gtk.h to display.h - I guess
the number of dives that are selected is UI independent. But I wonder if
we still will track this as a global variable in a Qt UI (since the Gtk
selection logic is the main reason this existed in the first place).
Added a new info.h files for the necessary declarations.
This should make no difference to functionality.
Cherry-picked from Qt branch; fixed merge issues mostly caused by
dive_tags and Makefile changes.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added the code that will load and populate the Tank Info
ComboBox that`s used by the user to select the Cylinder
description.
Code curerntly implements more than the GTK version since
the GTK version of it was a plain-list, this one is a
table based model that can be used in ListViews ( like
we use now in the ComboBox ) but also in TableViews
( if there`s a need in the future to see everything
that`s catalogued in the Tank Info struct. )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Fairly straight forward, so far just one tiny bit of code restructuring,
everything else separated cleanly.
Added statistics-gtk.c and statistics.h
This should make no difference to functionality.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Surprisingly straight forward, just a couple of places where we really mix
significant logic with UI code (for example setting the window title).
I had to move amount_selected from display-gtk.h to display.h - I guess
the number of dives that are selected is UI independent. But I wonder if
we still will track this as a global variable in a Qt UI (since the Gtk
selection logic is the main reason this existed in the first place).
Added a new info.h files for the necessary declarations.
This should make no difference to functionality.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Qtr_ hack isn't needed as in commit 720fc15b2dcd ("Introduce
QApplication") had already made sure that we are using gettext.
I didn't revert the two commits as I wanted to keep the added header
comments and fix the tooling in the Makefile as well.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should wrap gettext nicely and replace the "_()" macros we use in C
code.
Also added comments to the top of all the new files.
Suggested-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
1 - Open File already open files, it tries to not break the Gtk version,
but some methods on the GTK version still need to be called inside Qt
because the code is too tight-coupled.
2 - Close file already close files, same comments for the open file dialog
applies here.
3 - The code for adding new cylinders in the cylinder dialog is done,
already works and it's integrated with the system. There's a need to
implement the edit and delete now, but it will be easyer since I'm
starting to not get lost on the code.
4 - Some functions that were used to convert unities have been moved to
convert.h ( can be changed later, put there because it's easyer to
find something that converts in a convert.h =p ) because they were
static functions that operated in the GTK version but I need those
functions in the Qt version too.
[Dirk Hohndel: lots and lots of whitespace and coding style changes]
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add files for dive list model/view implementation. Replace TableView
with the custom list view. Amendments to makefile to match.
Note: we don't yet handle trips and may want to add additional columns
to describe the dive.
A single, dummy dive is added to show how this works (get root; item is
child of root). Purely to illustrate - needs proper integration etc.
Amend member names for dive list view components
Various naming changes to conform to coding style. Required changes to
members (remove prefix) and methods (avoid clash with members).
Clean up indentation (swap spaces for tabs). Code for model/view was
written with a different editor which had different settings :-/
[Dirk Hohndel: minor whitespace cleanup]
Signed-off-by: Amit Chaudhuri <amit.k.chaudhuri@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add some magic rules to detect which files need to be processed by the
moc or uic tools, as well as a way to manually specify exceptions.
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Relatively straight forward, just a handful of places where we call
show_error() (a UI function) from the logic code. In the process I noticed
a few places where error returns weren't dealt with correctly.
Added a new planner.h files for the necessary declarations.
This should make no difference to functionality.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Relatively straight forward, just a handful of places where we call
show_error() (a UI function) from the logic code. In the process I noticed
a few places where error returns weren't dealt with correctly.
Added a new planner.h files for the necessary declarations.
This should make no difference to functionality.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is based on several commits from Tomaz - mingled together and mildly
extended by Dirk (mostly Makefile hacking).
All Qt UI related stuff should eventually move into the qt-ui directory.
So the Makefile rules for moc and uic have been adjusted accordingly.
The MainWindow class has been moved into its own file in qt-ui (but just
with a placeholder, the existing class has simply been ifdef'ed out in
qt-gui.cpp for the moment).
We still have a couple of Qt things in qt-gui.cpp in the main directory...
all this needs to move into the qt-ui directory and be built with separate
.h files. Right now we have the one-off Makefile rule to create the
qt-gui.moc file from the qt-gui.cpp file.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is simplistic & brute force: any function that touches Gtk related
data structures is moved to divelist-gtk.c, everything else stays in
divelist.c.
Header files have been adjusted so that this still compiles and appears to
work. More thought is needed to truly abstract this out, but this seems to
be a good point to commit this change.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is simplistic & brute force: any function that touches Gtk related
data structures is moved to divelist-gtk.c, everything else stays in
divelist.c.
Header files have been adjusted so that this still compiles and appears to
work. More thought is needed to truly abstract this out, but this seems to
be a good point to commit this change.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is just an empty window with a File menu and a few items.
It shows how to hook up functions to menu actions.
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
The previous rules were conflicting, and the naming of the moc-generated
file to be included in .cpp files was deviating from what's most used in
Qt: the usual way is to
#include "file.moc"
and not
#include "file.moc.cpp"
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
This prevents Qt headers from defining macro symbols such as "emit" and
"signals", therefore avoiding conflicts when struct members with the
same names are defined in some C header.
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
Instantiate a QApplication and let Qt handle the event loop.
Add a QTranslator subclass to translate the UI via gettext.
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
Rename gtk-gui.c to qt-gui.cpp, and make the necessary changes so that
the project still builds.
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
Setup the build variables for building with QtWidgets, and add rules for
processing the Q_OBJECT macros with moc and generate widget code from
.ui files with uic.
Signed-off-by: Alberto Mardegan <mardy@users.sourceforge.net>
Commit 6044c22741 wrongly assumed that a disabled .po file had a companion
.disabled file instead of an .aliases file.
Running make after "tx pull -af" generated errors which I tried to fix. I
shouldn't have, because the Makefile did the right thing. It warned about a
missing .aliases file for a brand new translation.
So, I'm reverting the commit and use "tx pull -f" instead the next time I
need to test existing translations.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Disabled translations have a .disabled file instead of
an .aliases file. Without this patch I couldn't make
subsurface after a tx pull (when testing translations).
This patch makes the .aliases file an explicit requirement
for a valid translation.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Ensure that Kfreebsd and HURD are recognized as "like Linux"
Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Basic functionality is implemented but at least support for multiple
cylinders is missing. Event/alarm support is only partial.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Lintian, the Debian package static analyzer, was complaining about the
"wrong" permissions on these files.
Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Translation management is done through Transifex now for easy translations.
Translators should note that fuzzy strings are not used any more since
Transifex does not handle it (by choice).
In order to pull translations, you need a transifex.com account.
Signed-off-by: Kévin Raymond <shaiton@fedoraproject.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had this before - it appears that some versions of OSX need us to explicitly
list the frameworks we are using during the linking stage while others are
perfectly happy without that. But since listing them doesn't appear to hurt
this commit should be safe.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
To quote Linus:
Move the rule for the new version thing down.
Plain "make" will try to make the first target in the Makefile.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is dedicated to Lubomir ;)
Should work (tm). Not sure though if you want target
'gen_version_file' as a pre-requisite to $(NAME) or some other target.
[Dirk Hohndel: minor adjustments to make it work with gtk-gui.c]
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Most of the actual version numbers are derived from the git tag, but we do
have the fallback hard-coded in the Makefile (e.g. for people building
from a source tar-ball).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Removed oddly named and ridiculously outdated documentation text (scripts).
Created new directory 'scripts'.
Added unified version extraction script (scripts/get-version). Yes, it's
more shell script code but faster and more maintainable than the sed commands
and the swearwords/regexps repeated over and over again.
Makefile and packaging/macosx/make-package.sh modified accordingly.
I don't do windos neither macos but, AFAICS my tests show, it should be safe.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This improves the Plist.info and automates the version data that it uses
utilizing the same git magic that the Makefile uses.
It also makes the complete DMG creation a matter of simply running
packaging/macosx/make-package.sh
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
..they are of a higher quality anyway, and this way we have one less
library to worry about. And this way there is nobody who can claim that
openssl is not a system library and thus not compatible with the GPL.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply run
make prepare-po-files
and msgcat will be run over all po files to create consistent location
references. That plus the change I made earlier to how we update the po
files should create much smaller and easier to read diffs for translators.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While this is a pain for everyone, I decided not to edit out the code
reference noise - after all this is supposed to help translators find
where the text is used in case it's unclear how to translate something.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We still need proper paths and install options for the install-macosx
and create-macosx-bundle targets. This enables XSLT support when
running as ./subsurface, but doesn't hurt the other install targets.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Works like it should for the install-macosx target. I haven't tested
the create-macosx-bundle target, but it shouldn't be any different.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Getting the about icon to display in various scenarios on MacOSX
was a pain. Moving the icon to an include file solved the problem.
This commit also fixes the problem Dirk was having when converting
satellite.svg to a png in commit cf3c0266c2. I couldn't
quite get ImageMagick to preserve transparency and color when
converting subsurface-icon.svg, though, so I used Gimp instead.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
In preparation for a subsurface-icon.h, this should avoid confusion
about whether "subsurface.h" is a core header file.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
This was one of the reasons why I tagged version 2.9. I wanted to test all
the Makefile magic we added to get sane and automated versions on Windows
and Linux. And it turned out my sed script failed in rather obvious ways.
These changes appear to fix that - but of course you won't see that unless
you reset your git repository to the tag and manually apply this patch.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is intended as a visual sign that we are getting closer to 3.0.
We should consider this a "soft" code freeze / string freeze - I'm still
looking for a bunch of fixes, small additions and of course documentation,
but no new major features.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just like with the satellite icon we are creating a pixdata structure for
the flag.
The Makefile cleanup in commit df6a9ddd8a21 ("Auto-generate C file
dependencies, and make the build more quiet") removed the rules for
generating the .h file by mistake (I hope).
This adds a more generic rule back in and also makes sure that the data
structures get more useful names.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This became very obvious after commit df6a9ddd8a21 ("Auto-generate C file
dependencies, and make the build more quiet") went in; since not having
osm-gps-map is one of the few errors that aren't fatal for building it
seemed worth quieting this down.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This does some rough auto-generation of header file dependencies for all
the *.c files, rather than our file-by-file incomplete hardcoded ones.
It also stops showing the whole compile line, because it's ugly and
distracting. Instead it just shows "CC file.c". If you care about the
full thing, you still see them with "make -n".
Only tested on Linux. It probably is missing some Windows or
OSX-specific header includes.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This forces us to use the proper gtk accessor functions. It may not be
worth it if people actually do the Qt conversion, but if we want to try
gtk3 at some point, this might help.
This all came about because I was trying to explain on G+ what an
immense pain this all was to even figure out, if you don't actually know
gtk at all. Google and the gtk migration guide are almost useless, and
the gtk2 documentation itself actually uses the fields directly without
any accessor functions in several places.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a Makefile target to create the .nsi file from a template and to
hopefully create the right strings to magically get the correct version
strings in the Windows installer
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes sure that it's easy to tell from the about box whether this is
a released version or a development build.
If it is compiled at the exact location of the tag, "git describe
--tags" will just return the tag-name. Otherwise it will return
something like this
v2.1-393-ge03f31525aab
which means "v2.1 plus 393 commits, git SHA1 of tip is e03f31525aab",
which is a nice combination of git-readable (only the actual SHA1
matters) and human-readable (393 commits on top of v2.1).
And if you don't build from git sources, and don't have git installed,
it falls back on the old "v$(VERSION)" string.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This replaces the really lame "italics text" from commit abe810ca1a29
("Mark locations that have GPS location data attached") with a marginally
less lame GPS icon.There's a reason why I am not making a living as
graphics artist. But I think this is a huge step forward from what we had
before...
The satellite.svg file is very loosely based on a different icon that I
found as public domain here http://www.clker.com/clipart-30400.html.
From that I created the PNG and then that was converted into the
GdkPixdata via gdk-pixbuf-csource; a rule for that was added to
the Makefile but commented out as I don't know if this tool will always be
available in the path. Having this icon included in the sources avoids
locating yet another icon file.
Better icons are certainly welcome!
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
While we are waiting for an autotools generated Makefile, this should allow
people to build that don't have osm-gps-map.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For each dive recorded, place their GPS coordinates onto a map using the
OSM-GPS-MAP library.
This map is accessible via the "log" menu or the shortcut ctrl+M (M as map).
We check for the GPS coordinates "0, 0" which are the default when we do not
have real GPS coordinates set.
[Dirk Hohndel: fixed int/float math confusion, fixed some whitespace and
coding style issues, cleaned up some comments, added a
missing cast to prevent a compiler warning]
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-Off-By: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This does the "don't save defaults" for numeric values too.
Also, move the preferences loading/saving to a new "prefs.c" file.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
A new file download-dialog.c now contains all code related
to the download dialog, which was previously defined in gtk-gui.c.
Also, a new file callbacks-gtk.h now has two macros
OPTIONCALLBACK, UNITCALLBACK shared only between
download-dialog.c and gtk-gui.c.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The legacy nickname wrappers (that use the device_info structure) are
left in gtk-gui.c. We can slowly start moving away from them, we don't
want to start exporting that thing as some kind of generic interface.
This isn't a pure code movement - because we leave the legacy interfaces
alone, there are a few new interfaces in device.c (like "create a new
device_info entry") that were embedded into the legacy "create nickname"
code, and needed to be abstracted out.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There should be NO other changes in this commit - just moving the code and
adjusting the includes (and adding the entry point to display-gtk.h).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This comes with absolutely no gui - so the plan literally needs to be
compiled into Subsurface. Not exactly a feature, but this allowed me to
focus on the planning part instead of spending time on tedious UI work.
A new menu "Planner" with entry "Test Planner" calls into the hard-coded
function in planner.c. There a simple dive plan can be constructed with
calls to plan_add_segment(&diveplan, duration, depth at the end, fO2, pO2)
Calling plan(&diveplan) does the deco calculations and creates deco stops
that keep us below the ceiling (with the GFlow/high values currently
configured). The stop levels used are defined at the top of planner.c in
the stoplevels array - there is no need to do the traditional multiples of
3m or anything like that.
The dive including the ascents and deco stops all the way to the surface
is completed and then added as simulated dive to the end of the divelist
(I guess we could automatically select it later) and can be viewed.
This is crude but shows the direction we can go with this. Envision a nice
UI that allows you to simply enter the segments and pick the desired
stops.
What is missing is the ability to give the algorithm additional gases that
it can use during the deco phase - right now it simply keeps using the
last gas used in the diveplan.
All that said, there are clear bugs here - and sadly they seem to be in
the deco calculations, as with the example given the ceiling that is
calculated makes no sense. When displayed in smooth mode it has very
strange jumps up and down that I wouldn't expect. For example with GF
35/75 (the default) the deco ceiling when looking at the simulated dive
jumps from 16m back up to 13m around 14:10 into the dive. That seems very
odd.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This small change to the Makefile allows you to call
make CLCFLAGS=-DDEBUG
or some other define directly from the command line. It gets added to the
CFLAGS without overwriting the CFLAGS.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This simplifies the vendor/product fields into just a single "model"
string for the dive computer, since we can't really validly ever use it
any other way anyway.
Also, add 'deviceid' and 'diveid' fields: they are just 32-bit hex
values that are unique for that particular dive computer model. For
libdivecomputer, they are basically the first word of the SHA1 of the
data that libdivecomputer gives us.
(Trying to expose it in some other way is insane - different dive
computers use different models for the ID, so don't try to do some kind
of serial number or something like that)
For the Uemis Zurich, which doesn't use the libdivecomputer import, we
currently only set the model name. The computer does have some kind of
device ID string, and we could/should just do the same "SHA1 over the
ID" to give it a unique ID, but the pseudo-xml parsing confuses me, so
I'll let Dirk fix that up.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Simply call "make LIBDCDEVEL=1" and the libdivecomputer includefiles are
expected in ../libdivecomputer/include and the actual library is linked
from ../libdivecomputer/src/.libs
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The hold_depth field is rather misleading as it normally gives the safety
stop depth and only when the p_amb_tol goes "below the surface" does it
switch to showing the first deco stop depth.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Makefile change simply gets us the same setup with make install-macosx
that we are getting from the gtk-mac-bundler - with the launcher script
and subsurface installed as subsurface-bin.
The changes in the README are what make the difference for getting a
working dmg - there are a bunch of .so files that are part of gtk that
didn't have their dependency load paths updated - and those made the
application either crash or at least not display its own icon correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It turns out that we need aliases for all the languages. And more fiddling
when creating the dmg. And a specialized MacPorts build with the install
path as prefix. What this basically means is that our app will be
correctly localized iff run as /Applications/Subsurface.app
Otherwise the gtk default texts (on buttons for example) may or may not be
translated.
One remaining issue is that apparently Gtk's Mac integration triggers on
the untranslated name Help the Menu tree in order to work. Yet we can't
easily tell the app not to translate that word as the translations are
done internally in gtk - we'd basicall have to build special subsurface.mo
files for Mac that don't contain a translation of the word "Help" for this
to work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The update-po-files target creates backup files. Let's add them
to the "clean" target.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a bit of a hack to make my life easier.
make update-po-files
will extract the translation strings and merge them with the existing
translations - for all existing translations.
For good measure this commit includes the latest update of the po files
(but no new translations should be needed).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Linux didn't have a locale install target, and Windows didn't install
aliased locale files.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
[the macos/macosx typo was also found and a patch submitted by
Henrik Brautaset Aronsen <subsurface@henrik.synth.no>]
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With the right tools in place you can now create a bundle from the
Makefile by calling "make create-macos-bundle"
In the process of this I also moved the locale directory where we stage
our .mo files to share/locale (which is much more logical).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
gtk-mac-bundler uses Contents/Resources/share/locale, and
the install-macosx target should do the same.
Also quiet down the make process a bit
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some languages have identifiers that gettext can't determine
automatically in all OS'es. An example is Norwegian (no_NO, deprecated)
with its Bokmål (nb_NO) and Nynorsk (nn_NO) form.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit adds an install-cross-windows target to the Makefile that
creates a staging directory for us under packaging/windows that contains
the required .mo files. This currently fails for the Norwegian translation
because of the no_NO.UTF-8 vs nb issue - right now we just use the first
component of our own localization filename to find the matching Windows
localization and that fails.
The subsurface.nsi file is updated accordingly and this now appears to
create working installers with sane paths for the localization files.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The MacOSX applications bundle needs to be told where to bind the
text domain from.
Also copy the gettext .mo files in the install-macosx target.
[Dirk Hohndel: minor change in main(): move the path declaration to
the beginning of the function]
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
My previous take at adding gettext to the Makefile wasn't very good,
since it always relinked the subsurface executable.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added basic support for building gettext locales in the Makefile.
The po file name should match the target locale.
[Dirk Hohndel: Used git mv to rename the German .po file]
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Without "-headerpad_max_install_names", gtk-mac-bundler would complain
with "changing install names or rpaths can't be redone for:
/Applications/.subsurface.app/Contents/MacOS/subsurface-bin (for
architecture x86_64) because larger updated load commands do not fit"
Also, libdivecomputer needs to be configured with --with-prefix=/opt/local
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This includes one major hack that uses a private data structure from
libdivecomputer to allow us to show the Uemis Zurich as one computer the
user can import from.
Once the user has chosen the Uemis we don't use libdivecomputer but our
own downloader. Just like in the libdicecomputer case this runs in its own
thread and updates the import dialog with progress information.
The code also keeps track of the last dive that has been downloaded from a
Uemis computer so we only import new dives on subsequent downloads. And
since the Uemis Zurich gives us its device id, we make this a "per
divecomputer" property for people who dive with multiple Uemis Zurich
computers.
This uses the debugfile infrastructure to allow easily collecting
debugging output - especially on Windows where by default console output
is lost.
Known limitations: when the Uemis runs out of space (it uses its
filesystem for communication with the host computer) we have no graceful
way to reset things. This is why the code doesn't try to download ALL
dives on the computer but instead download them in increments of ten
dives. This clearly needs to be addressed once I understand how to reset
the device.
The Cancel button of the import dialog isn't correctly hooked up, yet.
I still need to figure out how to gracefully shut down a download without
potentially hanging the device.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes the time type unambiguous, and we can use G_TYPE_INT64 for it
in the divelist too.
It also implements a portable (and thread-safe) "utc_mkdate()" function
that acts kind of like gmtime_r(), but using the 64-bit timestamp_t. It
matches our original "utc_mktime()".
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>