Just the xml file for the Ui location information.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add ability to undo deleted dives by storing a list of the
deleted dives in a QUndoCommand.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add the undocommands.cpp / undocommands.h files, which will hold a
collection of classes that will hold undo commands.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add an instance of QUndoStack in the mainwindow, and add undo/redo
actions in the edit menu. The QUndoStack will have a collection
of QUndoCommands to process the undo and redo events.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Reverse all the code using the UndoBuffer class so that we can
use the QUndoStack and QUndoCommand classes. These are Qt's own
inbuild undo framework classes, offering a better undo/redo
process.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This patch adds tests if the computer is actually a Predator and
if the value is close to what we would have computed anyway.
[Dirk Hohndel: minor change to use same_string() ]
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
In the designer we set the selection type to extendedSelection
but since I removed the widget from the designer, I also had
to set it in the code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Just a button on the UI.
This moves the layouts around, in an attempt to make them less
obtuse.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we have an null widget, we hide the stack.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
At least to me it seems more natural to enumerate them row by row instead
of column by column, so now we do
1 2 instead of 1 3
3 4 2 4
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The old way of creating the mainwindow made things a bit
dependent of the order of initialization, and we don't
assume that anymore.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The flicker was caused by removing all widgets (and thus setting
the size of the splitter to zero) and then re-adding them.
I've added four QStackedWdigets that have a consistent size and
the only thing I do now is to set the corresponding widget to visible
without removing / readding anything, and thus, not messing with
the sizes.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the last patch in the series of clearing up the
mainwindo.ui. Now to bugfixing.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now it uses the states on the mainwindow.cpp and it's finally
starting to be worth the hassle of reworking the UI.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now it's created in the mainwindow.cpp as part of the new
way to configure the interface.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Now it's started from mainwindo.cpp and it's part of the
new states
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It's now set up from the mainwindow.cpp file.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Not used yet. The idea is to call 'setApplicationState("plan");'
and all widgegts for plan will be magically setup because we
added the plan state with registerApplicationState.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
listGlobe and infoProfileSplitters weren't good names as
now we will be able to create more types of widgets there
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is the last of the current dialogs to be ported to the
new widgets system. now we need to clean the mainwindow of the
old code.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This new file is the interface for the Details of the planned dive
removed from the mainwindow.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The Plan mode still misses a widget that was done directly inside
the mainwindow. I'll extract it from there and create a proper
class in the next commit.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This will be used to set the 'default' state. The other
two possible states right now are plan and add; those will
be created right next.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
two #ifdef NO_PRINTING one over the other, merged them together.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This function registers the different widget layouts
that we will have in subsurface. Currently we have three layouts
(default, plan, add) and a few more are comming (for instance
location) and the code is scattered around. It was making me
unconfortable.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The combination of the map / struct will change based on the
state of the application. Currently a lot of different
widgets change what is shown on the main window, and it's very
messy.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If current_dive and displayed_dive still have the same tags then we
shouldn't touch the tags of other selected dives.
Fixes#826
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Before the dive is deleted, a copy is made and passed to the
undo buffer. When edit->undo is clicked, this dive is restored
to the dive list.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add a class to handle all undo/redo events. Whenever a user
action affects a dive, an undo command will be created. A list of
these commands will be stored in the UndoBuffer, to allow for
moving forwards/backwards in the list.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add an edit menu with undo and redo submenus, and connect them to
the UndoBuffer class. The submenus are only enabled when needed.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add an empty UndoBuffer class. This will be built up on to
implement a working undo/redo mechanism.
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If we have no default cylidner set and get no data about an air tank from
libdivecomputer, our cylinder will look completely empty by mistake.
Always setting some kind of description fixes that.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This increases the limits when parsing CSV files with dive profiles,
allowing us to import bigger files in one go.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
If the filename has extension of .apd, then set the known import
automatically.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>