The setup of the item positions for the profile state should be done here.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Show a nice poster that Luisa did for Subsurface ( we have a few other
options that I'm waiting her to send. )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change the 'namespace ItemPos' declared on the commit before this one to a
struct that will have all the 'on canvas' and 'off canvas' positions and
representations of all items, so we know where to change.
Also remove the remaining stuff from planer that was going to exist on
this profile.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This addItem was being called twice, and a warning that the item was
already in the scene was annoying me.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit breaks the whole new profile. <3
The problem with the old code is that I was using the QStateMachine
and I just got tired of it. I will implement a much-simpler state
machine to do what I want instead of hitting my head on the wall
to understand how that was supposed to work.
This commit also adds a few helper methods to simplify the understanding
of the constructor and tries to make the logic a bit better. No graphics
are being show right now. :)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch starts the cleanup that will take a few iterations to finish.
The current profile code uses QStateMachine, and it's much too verbose
for something we can do with less than a third of its lines of code.
I also added on the beginning of the redesign of the profile code for
planner, edit and a few other things that are going to be ported to
the new profile in the future, but not currently - I just lack the time
to make that work for the next release.
This commit basically:
- moves all 'new' calls to the initializer-list
- create a new 'setupItem' private method to concentrate the calls
that any item will do
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Very few dive log files can be identified by the name of the root
element in the XML log. As same element names are used between different
software, we need to use attributes as well to identify correct XSLT to
convert the log to Subsurface format. I would not be surprised if at
some point we'll just have to present a dialog to the user and ask which
software is in use...but this is enough for now.
This also adds the shearwater.xslt to the list.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Every once in a while I need to update this so people building from source
who don't have asciidoc installed still have a reasonably current manual.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Change and shorten in some places the section dealing with data import
from foreign software.
Create Appendix C, containing information on data export from foreign
packages.
Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is needed because of a braindead issue on the Qt event
loop:
http://stackoverflow.com/questions/10059721/qt-qstatemachine-sync-problems-initial-state-not-set-on-started-signali
For the "event 1" to be received, the machine must already be
in a state that react to that signal. Even it was a queued
connection, the slot would be queued but only after the signal
was received, which it isn't since there is no connection
yet at that point.
To solve your problem, you can wait for the machine is in
"state A" before emitting the signal:
machine->start();
qApp->processEvents();
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will probably be added back in the future, but for now
they have no use and it was making me nauseaus.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Populate the status of the profile tool box as soon as the program
starts.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since we have now a mix of old / new prefs, remember
to change both when we alter something.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I had a few very strange bugs regarding to preferences (like clicking on
apply twice so things worked), because the code that moved from
"QSettings" to 'Internal Settings Struct' was being triggered on the
mainwindow, *after* the settingsChanged signal was emmited. This should
fix the problem.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds an entry to the dive list context menu to load images. The user
can select image files and set a time offset to align camera and dive
computer clocks.
Using the exif time stamp the images are tried to match to the times of
the selected dives (with a grace period of an hour before and after the
dive). Upon success an event of type 123 is created per image with the
string value being the path to the image. Those images are displayed as
thumbnails in the profile. If the matching dive does not yet have a geo
location specified but the image provides one it is copied to the dive
(making the camera a poor man's companion app).
This patch includes easyexif https://code.google.com/p/easyexif/ which is
originally under a New BSD License to parse the image meta data.
This commit includes a new test dive dives/test31.xml with a matching
image wreck.jpg to try out the functionallity.
Obvious to do's:
Have images on the map
Have the images clickable
Have a proper picture viewer
Give visual reference for image time shifting.
Use the new profile
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For quick acess of preferences the show / hide stuff from the Settings
dialog is now in that toolbox and in the future we can put a few more,
like 'Show Notifications Panel' and 'Enable Legend'
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds an event filter to hide normal tooltips on the new
profile. All tooltips should be displayed in the Notification Area.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch makes use of a cache variable instead of creating / accessing a
new one via operator[], because for some reason QGraphicsPolygonItem
doesn't return a reference for polygon and a copy is always made.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With this patch the tooltip is ready to work on the new profile, we just
need to actually use it.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The functionality is not there yet - just the item hovering
the screen.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is needed so we can share the dive tooltip item with the
new and old profile at the same time. Next few commits will be
setting the functionality of the tooltip item on the new one.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Set showWithPPGraph so that animateChangeLine() is always called the
first time settingsChanged() is called.
Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Except for the images involving the dive profile, all the images now are
from Gnome 3. Images for dive profile awaits finalisation of the new dive
profile.
Small changes to the text of the manual have been done, the most important
of which is that dealing with using the unified import dialogue of
Subsurface.
Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This works in a different way compared to the old widget.
To make it work we use vieport()'s height() and width()
and simplify the scroll position to:
scrollPosition = (mousePosition / totalLength) * scrollMaximum
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch uses the same code that lubomir used on the
old profile. It strangely didn't worked - most probably
because the scene has a fixed width() and height() of
100. the zoom works, and the movement works, but only
on the 100 first pixels of the profile.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch optimizes a few items when hitting the
'save preferences' dialog, since when a preference is
modified, all the items try to reload their visual
based on wether a preference changed or not, the correct
code for 'hey, my pref changed, let's update' needed
to be done.
now the axis will only set a new maximum if it's different
from the old one ( and thus, going to a new dive with
the same maxdepth or maxtime as the old one will not touch
their axis, not triggering gratuitous animations. )
also, the 'incr by 3m' was not being called - it seems
that our 'syncsettings' method is not storing things on
the 'prefs' global var. I added just for the incr by 3m
case, but it's something that we need to check later.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Created a method to check if calculations should take place
taking into consideration what changed on the model. if the
model changes *everything*, them, all calculations should
be done, but if just some of the columns of the model are
changed, only those columns should trigger an visual update
on the items.
In theory this patch looks right, but something is wrong (
calculations are not being made. ), so I'll commit this any
how, and fix on the next commit.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Cross-compilation tools provide the right .pc files and a pkg-config to
match, but often don't provide the scripts to match. Even if they did,
you'd have to change PATH to find them. So give pkg-config precedence.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When that happens, the include/version.h file is in the shadow build
dir, not in the sources.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds Gnome-based screenshots to the manual for most of the images not
involving the profile. More of the images remain to be done.
I rewrote small sections of the text to reflect some of the recent
changes. Several images still need to be replaced. The profile images will
be done once the profile panel has been finalised. Some text also still
needs working.
Signed-off-by: Willem Ferguson <willem@willem-Precision-M4700.(none)>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The gradient factor is shown with this patch, but the correct position
should still be adjusted.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a better way since we can enable / disable the deco by changing
the preferences later, and that will not need to recalculate everything
just because a polygon was set to invisible.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch only adds preference-awareness for the ceiling.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I've just discovered, quite by accident, a new undocumented feature of
qmake: it can write Makefile variables. So let's use this feature
where we can instead of our hack. The only thing is that it prepends
an "EXPORT_" prefix, so we can't use it for a variable like $(prefix)
that Linux distributions are expected to try to modify during make
install.
I've verified that the feature remains in Qt 5.x.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The last commit made the time and all other axis behave like the time
axis. Not cool.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit adds the same behavior for the old time markers on the new
ones.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Do not create a text label if the returned string is empty.
Also, fixed a potential crash after not creating a label and adding it to
the list of created labels.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch makes the color of the cylinder pressure use the sac colors.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Libdivecomputer wants us to return true if it should continue to loop over
the dives and false if we want to stop. Don't pass errors back.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is rather big, and I forgot to cut it in pieces.
The first part creates a new 'calculate_gas_information' that will not
fill the profile_info->maxpp member ( that should be removed from it as
soon as the new dialog is finished ). The reason for that is that all of
the profile data will be calculated and the graph needs to update
dynamically, so whenever the settings changes, I ask for the model which
is the biggest graph and replot only the ones we need.
The second part adds a new animation function 'animdelete' to fade-out and
delete the item when it's done. the old function 'hide' did just that but
a hide shouldn't delete anything.
The third part is preferenes awareness for the PP graphs. I created two
new functions that receive the settings key for visibility and use the
QSettings to show / hide them. This also works quite well for the axis;
if no graph is visible, the axis will also hide itself.
The fourth part is colors. The pp graphs now have the correct colors.
And a bit of code cleanup too.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Without this qmake doesn't take headers in qt-ui into account when
creating makefiles, causing parallel builds to fail.
Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Strangely enough, on the system I build this, I don't see the crash. But
when I create a DMG and run it on a different Mac, it crashes if
updateTicks() is called but scene() still returns 0.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>