Commit graph

7275 commits

Author SHA1 Message Date
Tomaz Canabrava
d769c6016f Copy the name and the coords when entering the EditDiveSite state
Name and coords of the current dive are copied to the edit dive site
screen.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
68691c9d6d Accept / Cancel location edit
Make it possible to cancel or accept the location edit and
get back to the mainwindow default state.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
7d66dcd12d Enable the location edit widget on mainwindow
Clicking on the 'Manage' button now brings you to the widget to manage it.
Nothing has been added on it yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
e3d800885f Create a new state for the MainWindow: EditDiveSite
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
3516ff2ab2 Create simple class to hold the location management.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
63e998b4bd More meaningfull names for the ui elements.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:34:02 -08:00
Tomaz Canabrava
c173fc567d Add the ui file for the location information
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>
2015-02-11 16:34:02 -08:00
Lubomir I. Ivanov
fd1a33d935 mainwindow.cpp: don't use ui.globePane
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:18:25 -08:00
Martin Long
dca78fe6fc UDDF Export: Moved equipmentused to informationbeforedive section as per updated spec
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:15:28 -08:00
Martin Long
9b6c546244 UDDF Export: Moved tankdata before samples, as expected in xsd definition.
Signed-off-by: Martin Long <martin@longhome.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-11 16:15:19 -08:00
Grace Karanja
60a7404ed4 Add option to undo deleted dives
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>
2015-02-11 08:07:23 -08:00
Grace Karanja
6d996a7874 Add a structure to hold undo commands
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>
2015-02-11 08:05:53 -08:00
Grace Karanja
ef14798d6d Add undo stack
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>
2015-02-11 08:00:39 -08:00
Grace Karanja
013da6b0af Reverse undo buffer
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>
2015-02-11 07:59:46 -08:00
Dirk Hohndel
6374d9cc03 These pO2 samples exist in both the Predator and the Petrel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 15:19:57 -08:00
Robert C. Helling
8fa205a59d Be a bit more careful when deleting pO2 values
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>
2015-02-10 14:56:33 -08:00
Tomaz Canabrava
e44deed734 Fix a regression on selection caused by the new interface code
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>
2015-02-10 13:45:06 -08:00
Tomaz Canabrava
81ba72b219 Add a new button on the MainTab to handle management of geo locations
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>
2015-02-10 12:49:03 -08:00
Tomaz Canabrava
bb9398d08f Fix build without marble
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>
2015-02-10 12:47:55 -08:00
Tomaz Canabrava
d53723fade Remove unused enums
Thuis is garbage from the old code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:47 -08:00
Dirk Hohndel
3296089953 Change the order of the quadrants
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>
2015-02-10 10:45:47 -08:00
Dirk Hohndel
ca154a65da Rename the widget to better reflect what it does
This widget defines what's in each quadrant of the main window.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:47 -08:00
Sergey Starosek
4817bb2991 Add missing Atomic Aquatics logo
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
9b62d36757 Fix broken connection
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>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
9b547e6c71 Remove the flicker issue and the resize issue.
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>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
7b46a8fddf Don't set the state if it's the same
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
3912adfe5b Save the size of the widgets to restore it later.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
194dd8bd97 Finish the cleanup of mainwindow.ui
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>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
4867ee8ad8 Move the Profile out of the mainwindow.ui
And place it in mainwindow.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:46 -08:00
Tomaz Canabrava
6b038c2a9a Remove the ProfileWidget from mainwindow.ui
It is now in mainwindo.cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
2992d78f83 Remove the PlannerWidget from mainwindow.ui
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
238c0573da Remove information panel from mainwindow.ui
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
c30aee1ae5 Remove the Globe from the mainwindow.ui
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
cf4d55c470 Remove the DiveList from the mainwindow.ui
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
c69aab04f4 Correctly set up the Planner state
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
57e938d040 Create the method that changes the state of the application
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
93198a8098 Change splitter names to something more meaningfull
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
486226be18 Add the PlannerDetails class
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
5098e8672e Add a new file, plannerDetails.ui
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
727e397aa5 Add the modes for ADD and PLAN
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>
2015-02-10 10:45:45 -08:00
Tomaz Canabrava
7d48c1fc26 Add the first call to registerApplicationState
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>
2015-02-10 10:45:44 -08:00
Tomaz Canabrava
9e3bff6b7c Simplify a bit of code
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>
2015-02-10 10:45:44 -08:00
Tomaz Canabrava
38aab70555 Implement the registerApplicationState function
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>
2015-02-10 10:45:44 -08:00
Tomaz Canabrava
aa56797b0b Add a new struct that will hold the widgets for each corner
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>
2015-02-10 10:45:44 -08:00
Sergey Starosek
e9a1684d63 Update russian translation of user manual (7b44cf2)
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 07:22:59 -08:00
Sergey Starosek
f591ead1ec User manual spelling fixes
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-10 07:22:29 -08:00
Dirk Hohndel
585d6a004b Only update tags in the selected dives if they were changed
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>
2015-02-10 06:31:37 -08:00
Grace Karanja
d60a620193 Add ability to undo deleted dives
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>
2015-02-09 21:02:19 -08:00
Grace Karanja
8d1e4557a9 Add UndoCommand class
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>
2015-02-09 21:02:16 -08:00
Grace Karanja
c5138b2090 Add menu entries for undo/redo
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>
2015-02-09 21:02:13 -08:00