No need to add more code to Subsurface by bringing in std::string too.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Rewrite of the way we handle the last used directory for the loading /
saving of files.
we didn't reuse anything for the code, and that's error prone
and also dumb =p. Reworked that so we have a nice method
to help us out on that. lastUsedDir and updateLastUsedDir
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the Gtk version there were no option to disable the showing of time
in the mouse over, so this removes that option to limit the amount of
clutter in the settings panel.
This also renames the time and temperature to match the names they used
to have. T -> @, Temp -> T
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We remember what was selected before and restore it. Maybe there's a more
"Qt way" of doing this, but my implementation appears to work :-)
Also remove unconditional debug output that snuck into an earlier commit.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We previously did did bad things when running with an empty configuration.
This attemps to clean it. We will now correctly handle the splitters in
almost all cases ( if I didn't break anything on the way. )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Let the user choose if the calculation of ndl and tts is worth the time
it takes.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This now offers the correct gases for which we have cylinders defined.
For both the planner and add dive we still don't end up with the correct
cylinders in the resulting dive. But that's for another commit to fix.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This should leave the program in a consistent state after add dive was
cancelled (and do the right thing in case the dive list was empty).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This just makes sure that we do the right thing with the staging drive,
that we don't mess up the selection, the we are smart about using our
helper functions, etc.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is intended to allow the user to provide the gases / cylinders that
she will be diving with. With that information the planner can warn the
user about insufficient gases, but more importantly it can show relevant
gases in the gas select drop down.
Right now the add cylinder button doesn't add a cylinder - that's a
problem.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The user could add a dive, and in the middle click on the 'plan'
button. Since we didn't cared about that on the widget, a lot of
inconsistencies could occour. this fixes that by setting a flag
on the Planner, that has now three modes: nothing, plan and add.
(maybe in the future an edit mode will be valid too.)
If in 'NOTHING' mode, user can enter the addition, edition and
planning. If in any other mode, user can't do a thing. The mode
gets back to NOTHING when user accepts or cancels a plan / add
/ edition.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a try: when the user changes the orientation on the columns
by clicking on the title of them and organizing by something that's
not the number, we lost track of the opened branches. this commit
doesn't fix that, but it fixes a possible similar issue.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
I got a bit lost trying to find the code that handled DiveList columns
today, so I thought it was better to move it to its file, after all we
do have a divelistview.h :)
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This just proves one point: I'm retarded.
I moved some code around and forgot to close the old group, so I created a
group inside 'MainWindow' that handled the ListWidget, wich was not the
right thing to do at all.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I basically rewrote the way we handled the splitters. It now uses a state
to know what it's doing, and will only update the value of the
saved-to-disk splitter size if the state shows the splitters (currently
only VIEWALL), where all the other states should hide the splitters, and
the values of the splitters don't matter.
Fixes#225
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Since the model name is written into the XML file it has to be a literal
string that isn't translated. Otherwise a datafile written in one locale
behaves differently when opened by Subsurface under a different locale.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch enables editing a dive that was manually entered,
it doesn't cover dive plans yet because on the plan I need to
figure out what are the 'user-entered' points, and what are
the algorithm point. and I feel lazy. =p
One last thing that's missing is to revert the dive to the
previous condition if the user cancels the edition, currently
canceling and applying ok is the same thing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Added a new option to edit the dive in the profile view. The option
will only be visible if the dive was manually entered or if the dive
is a plan.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
We cannot use tr("").toLocal8bit().constData(); on a function
that expects a char* because the object will be deleted on the
next line, so a strdup is necessary.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
This patch does the hooking up to show the dialog of the
divelogs.de window when the user selects it on the menu.:
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Created a WebService dialog that will handle download and upload
from all child based webservices. Also, ported the currently - only
- one webservice to use the new dialog.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Implement exporting in UDDF format as was done in Gtk version. File menu
exports all the dives, right click on selection exports the selected
ones.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This tracks the autogroup state remembered in data files. Toggling the
checkable menu item causes the divelist to be marked as changed. This
might actually be untrue - but that's really hard to track so this is the
"better safe than sorry" approach.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is really nice to have when looking at specific parts of a dive.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch implements GUI for importing CSV log files. One is able to
configure what columns contain time, depth and temperature fields.
Pre-configured log applications currently included are ADP log viewer
and XP5. (Both of these use actually tab as separator, so the field
separator currently hard-coded.)
[Dirk Hohndel: minor fixes]
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- remove the build flags and libraries from the Makefile / Configure.mk
- remove the glib types (gboolean, gchar, gint64, gint)
- comment out / hack around gettext
- replace the glib file helper functions
- replace g_ascii_strtod
- replace g_build_filename
- use environment variables instead of g_get_home_dir() & g_get_user_name()
- comment out GPS string parsing (uses glib utf8 macros)
This needs massive cleanup, but it's a snapshot of what I have right now, in
case people want to look at it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch fixes some unsane values that was being retrieved
by the ui-files on first time opening. it creates a basic layout
of the application using the current desktop size.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Those preferences removed ( basically the ones about visibility of
the List View of the Table ) are now managed by the Qt Settings
system, and thus there's no need to have them there. wich gave us
a pretty good cleanup.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Some people (free divers) are loving ft/s or m/s units for vertical speeds.
Now they can choose between /min or /s in the configuration (only Qt UI).
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For a new installation, subsurface will now start on fullscreen,
this fixes the bug where subsurface would start using the interface
file ( mainwindow.ui ) configured size, and that silly monster
always changes when editing something.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
The first time the user loads subsurface, the default_filename
is not configured yet, but yet the software tries to load "",
sending an error message that this file doesn't exists.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Taiane Ramos <exhora.tat@gmail.com>
This means we don't have to new/delete them, which is a waste of
overhead.
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This means we can also remove the forward declarations.
This is the first step in removing the memory allocation for the ui
sub-classes. Without the second step, this commit is just making the
compilation time increase for no good reason :-)
Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch removes the magic indexes used to control the mainwindow
display of the profile and planner by an enum. a bit more verbose
but hard to miss.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Things need to be cleared out and disabled. But fixing this bug leaves
another issue - while the newly selected dive after a delete acts as if it
was selected, it doesn't show up as selected in the dive list.
Reported-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>