Commit graph

2006 commits

Author SHA1 Message Date
Gehad elrobey
e9c4259db4 HTML: Add export list only option
Exporting small dive list only or choose to export the dive list with
all the dive details like the profile, Bookmarks, dive equipments and
statistics.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-24 21:39:10 +08:00
Anton Lundin
ccfdcca6e6 Drop like a stone mode in planner
Most of my dives i plan i know it will just be full speed down a line in
the beginning and thus the planner can figure out that leg of the plan
by it self.

The config box added here isn't connected, because i saw that the other
planner boxes wasn't connected ether, so i left it in the same state as
they where.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-24 17:26:31 +08:00
Anton Lundin
5904be2e06 Fix NO_PRINTING building again
Back in 6699e3ab ("Add print button to planner") unconditional printing
code was added. This puts that same code behind NO_PRINTING macro.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-24 17:18:58 +08:00
Henrik Brautaset Aronsen
630ec88dd4 Be more consistent in partial pressure naming
Lets just use pO₂ instead of PO2, ppO2, ppO₂, PO₂.
They all mean the same, but it's better to be
consistent

Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-23 06:48:54 +08:00
Tomaz Canabrava
6ee2758e06 Listen to EnabledChange to gray out the DatePicker
This small patch listens to EnabledChange to gray out the
date picker when the widget is in disabled mode, and to
paint the widget colored when it's on enabled state.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:43:13 -07:00
Tomaz Canabrava
be462ae1a6 Change the Star Widget to use QImage instead of QPixmap
Also, clean a few calls, this should make the widget a tiny
bit faster. This patch also moves the grayImage function from
the star widget to the global scope, so I can use it on the
Calendar widget.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:43:10 -07:00
Tomaz Canabrava
f3f03e2ee8 Better focus painting for Date Widget
This uses the system focus painging.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:43:07 -07:00
Tomaz Canabrava
ef6c410574 Added keyboard navigation to the calendar date picker.
Wee.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:57 -07:00
Tomaz Canabrava
a7240cd83f Added focus handling to the Date Picker.
Added focus handling for the date picker, this way the user
can use the keyboard to change the date. ( still not implemented )

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:53 -07:00
Tomaz Canabrava
70c8bbcc91 Added the calendar widget to change the calendar date.
Added a popup widget to change the calendar date, just like
the old QDateTimeEdit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:50 -07:00
Tomaz Canabrava
1fc22c6653 Correctly sets the minimum size of the calendar widget.
The old code cutted the calendar by half.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:46 -07:00
Tomaz Canabrava
0223ebf510 Added the new Date Widget on the MainTab.
the new date widget still needs a bit of work, but the
design is working already.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:42 -07:00
Tomaz Canabrava
a08d4ec790 Added a Partly Functional Date Picker widget.
This widget shows a date in a better way that it was done
in the old widget, much more elegantly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:38 -07:00
Tomaz Canabrava
867d9f1391 Simplify code
If a class inherits QObject, it doesn't needs to call
QObject::tr for the tr function.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 15:41:35 -07:00
Anton Lundin
bb44908507 planner: Switch to QSpinBox for SAC
QSpinBox is nice to see how different sac rate would affect our dive
plan.
"Hey, What would happen if I would be stressed and my sac goes up by 50%?"

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-20 06:37:44 -07:00
Anton Lundin
9400e1190b Enable Info box in the planner again.
Its great to be able to see the planned "turn pressure", EADD at
different points and so on.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18 04:56:20 -07:00
Anton Lundin
d8ec3988b1 Fix building with NO_MARBLE again
Back in 708f19830e ("Planner: New plannerSettingsWidget") the Globe
widget handling changed, and this updates the NO_MARBLE build option to
work after that.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18 04:56:08 -07:00
Thiago Macieira
ee11e1540e Don't use std::string in our code
This also explicitly states the encoding. It's just a file name and it's
always ASCII for us, but it's clear now.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-18 04:44:59 -07:00
Gehad elrobey
d363722c16 HTML: remove theme file if already exist in the export directory
as QFile:copy doesn't overwrite files by default, we must check before
copying if file exist and remove it.

We must be able to overwrite files here, user is already notified and
choosed to replace them.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-15 09:25:37 -07:00
Gehad elrobey
262472c9de HTML: fix the exporting dialog
export HTML into the file name choosen and export additional files into
a subdirectoy beside the html file, called htmlfilename_files

This is to follow the convension and doesn't create additional
directories to wrap the exports.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-15 09:25:17 -07:00
Dirk Hohndel
8bd535d092 User survey: force running the survey from command line
This way people can test the dialog much easier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 14:45:42 -07:00
Dirk Hohndel
181d4e2fa6 User survey: small updates
Just make it behave a little more sanely
- support Ctrl-W and Ctrl-Q
- remove the silly placeholder text for system info
- add language and version information

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 14:35:17 -07:00
Joseph W. Joshua
1ec5e6ffc4 OS Detection
Implements automatic OS and architecture detection. This code has
been taken from the Qt repositories for Qt 5.4 (LGPL) and slightly
modified into the SubsurfaceSysInfo class.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-14 12:50:35 -07:00
Dirk Hohndel
cdd3b3d9cd Start a user survey dialog
The idea is that a week after the user starts using Subsurface we ask them
if they would like to submit a survey response.

If you are running a development build, don't wait seven days.

This patch doesn't do anything with the user's selections, doesn't submit
anything to our server, etc. It's just a placeholder to tune what we
should ask, etc.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-13 14:03:51 -07:00
Dirk Hohndel
64236388e4 Prevent using uninitialized variable
numberOfPictures was be read before it is written.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-13 07:11:06 -07:00
Dirk Hohndel
a4050c2a71 Don't copy the current dive ontop of editedDive after edit has started
If you switch to edit mode by making a change to cylinders or weights,
then the data in the editedDive was changed and afterwards the current
dive was once again copied into the editedDive - even though we already
did that earlier when setting up the display.

Fixes #539

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 13:34:57 -07:00
Tomaz Canabrava
748198891d Much needed clean on the HTML export dialog code.
Correct usage of QFile, QString and code cleanup.

[Dirk Hohndel: plus whitespace cleanup and removal of qDebug() calls]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 12:42:35 -07:00
Dirk Hohndel
21be237b0e Delay loading of some settings until later
This early in init_ui() the settings may not be available, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 11:52:59 -07:00
Dirk Hohndel
6227372c2f Planner: don't show the planner panes by default
With commit 708f19830e ("Planner: New plannerSettingsWidget") we
suddenly started out showing the planner widget. Not useful. So let's
switch us back to the default screen :-)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 09:51:10 -07:00
Dirk Hohndel
69139782df Planner: update tabstop order again
Robert's commit 708f19830e ("Planner: New plannerSettingsWidget")
moved several of the widgets from the maintab area to the new planner
settings widget.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 09:34:58 -07:00
Robert C. Helling
708f19830e Planner: New plannerSettingsWidget
In planner mode, this replaces the globe with the dive plan and introduces
a new plannerSettingsWidget in the diveListPane. All new fields are still
disfunctional. This is WIP.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-12 09:30:46 -07:00
Tomaz Canabrava
6a9c4097c0 Change the QDialog for html export to getExistingFolder
The QDialog for html creates a folder, we need to choose a folder, not a
file. getSaveFileName was wrong. ;p

Fixes #533

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 14:28:19 -07:00
Tomaz Canabrava
c0593662b9 Fix layout of Dive Export
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 14:21:30 -07:00
Tomaz Canabrava
a20b3c192b Fix layout of import CVS
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 14:21:09 -07:00
Dirk Hohndel
79c68367c6 Fix uninitialized memory warning
It's kinda bogus, but since we add it to the Vector, we might as well
initialize all of it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 14:07:57 -07:00
Dirk Hohndel
2b59765da3 Allow the user to delete a dive computer from a dive
This can't be the only dive computer, of course. Goes nicely with the
ability to reprder them.

Fixes #551

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 13:56:33 -07:00
Dirk Hohndel
c4aa1f542c Profile: add a flag to force redrawing the profile
This is needed if something has changed that requires a redraw, but the
plotDives() function can't tell (for example when a dive computer has been
deleted and there's now a different DC in the same spot, with the same
number - see next commit).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 13:55:51 -07:00
Dirk Hohndel
b70c877b3c Deal with some uninitialized variable warnings
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 09:37:12 -07:00
Dirk Hohndel
b42df1dab6 Globe: do a better job detecting double clicks and setting GPS coordinates
For some reasons Marble appears to sometimes not detect double clicks and
call the correct callback. With this commit we manually intercept the
double clocks and route them to the right function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11 09:31:01 -07:00
Dirk Hohndel
f54849987e Remove unused variable
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 13:18:16 -07:00
Dirk Hohndel
52c7b6d934 Planner: fix the tab order
I know this is being redone, but the messed up tab order was driving me
insane when testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 13:12:42 -07:00
Dirk Hohndel
486ff0990f More layout work for stats tab
This finally gets me something that I like. The way the different boxes
get resized seems pleasant and intuitive. And it appears to do the right
thing on all platforms (I learned that having different levels of layout
nested creates no vertical offset on Linux/KDE, but a very ugly offset on
Mac, for example).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 12:59:54 -07:00
Dirk Hohndel
e6fe4760a0 Improve statistic on used gas
This raises the maximum number of gas mixes listed to 20 and also changes
the layout / design of the stats tab to make it much more attractive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 11:45:20 -07:00
Dirk Hohndel
6998dcdf6a Picture handling: when zooming thumbnail, put it in the foreground
This just seems to look much better.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 10:56:03 -07:00
Dirk Hohndel
e4a9fa74e8 Planner: don't reset GF when preferences change
The planner has its own view of the gradient factors. So replacing those
with the ones set up for viewing dives in the preferences is wrong.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 09:28:17 -07:00
Dirk Hohndel
445e937a5b Planner: show the GF used for planning on top of the profile
Showing the GF in the preferences is just confusing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 09:24:10 -07:00
Dirk Hohndel
6daeb276ad Planner: reset GFlow and GFhigh when we're done
While planning we might change the gradient factors. Make sure they are
back to what's in the preferences when we're done planning.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-10 09:11:34 -07:00
Dirk Hohndel
8a0d852a7c Add gas consumption statistic for selected dives
We already did a list of gases and volume consumed for the selected dive
on the Dive Info tab, but did not provide that same data on the Stats tab
for all the selected dives.

I arbitrary limited this to eight gases (as the list can get quite long
when you select a lot of dives). The gases are sorted by volume consumed.

Fixes #535

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-09 22:48:21 -07:00
Dirk Hohndel
0102604645 Don't show the average depth for the selected dives
Being shown between the deepest and shallowest dive's max depth it
confuses a lot of people - the average depth is frequently less than the
shallowest of the dives, so at first glance it looks like the "average" is
less than the "minimum". So having three numbers grouped like this that
use different algorithms is just distracting.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-09 20:32:44 -07:00
Lubomir I. Ivanov
8b3ebaa8a3 profilewidget2: fix -Wreorder warnings
warning: 'ProfileWidget2::someVariableName' will be
initialized after [-Wreorder]

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-09 16:55:44 -07:00