Commit graph

92 commits

Author SHA1 Message Date
Willem Ferguson
0de3bc8452 Display CCR setpoint values on the po2 graph
When a CCR dive is viewed and the toolbar button for PO2 is activated,
both the PO2 (green line) and the O2 setpoint (red line) are shown.
This allows evaluation of the PO2 in the CCR loop with respect to the
pre-configured O2 setpoint.

The setpoint graph can be disabled from the Preferences/Graphs tab
by checking the appropriate checkbox.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-05 09:18:06 -08:00
Tomaz Canabrava
a65816db7d Remove uneeded Facebook album setting
This now is chosen directly from the popup box that appears when you try
to send a picture to facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-29 09:07:47 -08:00
Tomaz Canabrava
ee5d93e155 Changed Facebook stuff to socialnetworks.h/cpp
All Facebook related stuff now is on SocialNetworks.h/cpp
this makes it much easier to implement things and looking
for bugs.

working:
- logging in
- getting user id
- getting album id ( or creating it )

*much* more testing is needed, of course.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 15:54:28 -08:00
Tomaz Canabrava
a76fdd8d54 Create a Facebook album for Subsurface
We still need to do a lot of stuff on that part.
Currently when asking for sending a profile, it will just
create a private album.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 07:32:36 -08:00
Tomaz Canabrava
14a858cf2a Save and restore Facebook Prefs.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:38:12 -08:00
Tomaz Canabrava
5aa9fc6fe7 Get and save the UserID for use with Facebook.
Next: Publish something with the Graph API.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:58 -08:00
Tomaz Canabrava
9a2f836b1a Ask for facebook permission to post to a user newsfeed.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:50 -08:00
Tomaz Canabrava
a7e148c0a8 Disconnect from facebook manually.
Added a button to disconnect from facebook.
This clears the webview cookies so it correctly
disconnects us from facebook, and clears the
access token.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:41 -08:00
Tomaz Canabrava
cc69e6ffa2 State that you are connected on Facebook.
TODO: Disconnect from facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:37:28 -08:00
Tomaz Canabrava
1a5cd0e155 Connect to facebook, save the tokens for future use.
We can now correctly connect to facebook endpoint. Nothing
really fancy at the moment. =/

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:36:53 -08:00
Tomaz Canabrava
1b8169036f Allow subsurface to login with facebook.
This piece of code allows subsurface to login with facebook
using the 'Subsurface' app created within facebook for secure
reasons. I'm the admin of it currently - but I'll pass it to
Dirk as well.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-24 06:35:54 -08:00
Dirk Hohndel
b2af700a42 Remove debug output in preference setting
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30 07:46:24 -07:00
Robert C. Helling
3fc9c1e005 Tissue saturation plot a la Sherwater Pretel
This adds a toolbox icon to turn on a tissue plot inspired by the bar
graph of the Sherwater Petrel,

It shows the inert gas partial pressures for individual compartments. If
they are below the ambient pressure (grey line) they are shown in units of
the ambient pressure, if they are above, the excess is shown as a
percentage of the allowed overpressure for plain Buehlmann. So it has the
same units as a gradient factor. Thus also the a gradient factor line (for
the current depth) is shown.

The different tissues get different colors, greener for the faster ones and bluer
for the slower ones.

Positioning and on/off icon action still need some tender loving care.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-09-19 21:46:30 -07:00
Dirk Hohndel
6bb6e43846 Preferences: only save settings that are changed
This continues the effort started earlier to only save things that aren't
the default.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:46:50 -07:00
Dirk Hohndel
9aca309611 Default font: more fine tuning
In order to get rid of the old default font on Windows (Calibri) we are
going to near ridiculous length. The reason for this is that we in the
past always saved the default font in the settings (how stupid was that!)
and so now even with a new default font in place, since there is an
explicit font in the settings we take that instead of the default.

Instead of requiring our existing users to use a registry cleaner to get
the correct default font on Windows 7 and later (the VAST majority of our
Windows users at this stage), we simply explicitly ignore that old default
font.

There is one very nasty side effect. A user cannot set Calibri as their
font of choice on Windows 7 or later (because we always force them back
onto Segoe). Given how much nicer Segoe looks I think this is an
acceptable flaw - let's hope this doesn't come back to bite me in the
future.

At the same time this changes the default font size handling. We try to
get the default font size of the OS so the app looks "right". This seems
to not give me the expected result on Linux with KDE, but maybe I'm doing
it wrong? Looks good when testing on Windows.

See #712

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27 15:45:43 -07:00
Dirk Hohndel
e8d430341c TankBar: hook into prefs and make ppGraphs resize accordingly
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-15 08:11:14 -06:00
Tomaz Canabrava
65eefe7b59 Animation speed is a value, not a boolean
This breaks compatibility with old preferences, but it's a single
key and not that very important so I don't think it's a bigger issue
I've renamed prefs.animation to prefs.animation_speed to denote
that it's a value, and not a state.

Also, fixed the places that were treating it as a state (on/off)
to treat it like a correct value.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-23 07:50:03 -07:00
Tomaz Canabrava
1b6144350d Added a 'use default file' button on preferences.
Added a 'Use default file' button on preferences in a way
that doesn't clutters the interface.

Fixes #630

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-16 15:52:29 -07:00
Tomaz Canabrava
d993684fec Do not create a backup for Q_FOREACH container
Q_FOREACH will expand and already creates a copy of the
contained container, so this is just a waste of cpu cycles
and also increases a tiny bit the memory consumption.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15 16:55:10 -07:00
Tim Wootton
25114a4e84 preferences capitalisation consistency
Signed-off-by: Tim Wootton <tim@tee-jay.demon.co.uk>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-10 16:30:39 -07:00
Sergey Starosek
20e0aba0b4 Rename slot to get rid of auto-connect warning
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-28 06:35:19 -07:00
Sergey Starosek
b05d15c5a9 Make system proxy as default
On first start (no settings saved yet) system-wide proxy should be
default.

Proposed-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26 15:44:51 -07:00
Sergey Starosek
9fca5a51d9 Implement proxy settings loading/saving
- proxy settings are stored under [Network] group
- default is "No proxy"
- duplicate #def GET_TXT replaced with GET_INT_DEF

Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26 15:44:32 -07:00
Sergey Starosek
b5e90d7c93 UI setup for "Network settings" page
Signed-off-by: Sergey Starosek <sergey.starosek@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-26 15:44:13 -07:00
Dirk Hohndel
dd96b03d22 Add ability to reset the settings
This may be a bit crude and it doesn't actually FULLY reset the settings
(as for example the column widths will still be maintained), but it's a
good start, I think.

Fixes #552

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-25 17:46:51 +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
Dirk Hohndel
5ba573240f Gratuitous whitespace changes
I keep trying to get to consistenct.
Completely hopeless.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-22 11:40:22 -07:00
Dirk Hohndel
08689b2f89 Correctly parse boolean preferences
QVariant does the right thing, regardless of whether the value is stored
as int or as string - so let's just use that instead of manually checking
for integers (and failing if the values are stored as "true" and "false").

Fixes #511

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 15:56:49 -07:00
Dirk Hohndel
7809077b33 Fix odd indentation
I need to fix this in the tool as well...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-05-05 15:56:11 -07:00
Gehad
1306c0fecb Fixing Hotkeys inconsistency for divecomputer/pref/numbering windows
Fixing the Hotkeys inconsistencies in subsurface, All the popups should
react to 'esc' and 'ctrl-w'/'cmd-w' as 'cancel'. also 'ctrl-q'/'cmd-q'
should quit subsurface.

Fixes #489

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-25 13:24:39 -07:00
Gehad Elrobey
8380f09619 Renaming the prefs struct members to be consistent with the QSettings.
-Renaming prefs members for consistency.
-Changing references of QSettings to the prefs structure instead.
-Removing unused functions in pref.h were left over from an old version.
-Changing the data-type of bool members to short for consistency with other members.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-16 13:09:55 -07:00
Venkatesh Shukla
3abcde9a2a Add option to save userid in data files
The userid of Subsurface Webservice can be included in locally saved xml
files and git repository.
For xml files, it is stored in userid tag. For git repo, it is stored
in 00-Subsurface file present in the repo.
Preference dialog and webservice dialog modified to include option
for saving userid locally.

In case of difference in default userid and userid in local file,
some semantics are followed. These can be referred to here:
http://lists.hohndel.org/pipermail/subsurface/2014-April/011422.html

Fixes #473

Signed-off-by: Venkatesh Shukla <venkatesh.shukla.eee11@iitbhu.ac.in>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-14 09:40:30 -07:00
Lakshman
6a8d929876 Feature to show or hide heart rate graph
Adds new push button "HR" to the button bar on the dive profile to
toggle display of heart rate.

TODO: New icon for the heart rate button is needed.

Fixes #485

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-10 09:21:43 -07:00
Gehad
3125e0e695 Fix incorrect behavior in preference window
When doing some changes in the preference window and clicking "Apply", the
'Close without saving' button is supposed to restore the previous values.
However some fields were not restored correctly.

- The Animations Slider was never restored to its initial value.
  (A new member in the pref struct was added - pref.animation)

- The 'Font' and 'Font size' were restored correctly to the previous
  values but their effects weren't restored to the UI and that required to
  open the prefrences window again and press ok.

Fixes #481

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-07 13:06:15 -07:00
Lakshman
ecc8c1d995 Remove check option to show units in text label
Currently the feature to show temperature units while adding dive is
provided through checkbox in preferences->units section. This patch
disables this checkbox and always enables this feature.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-05 13:27:53 -07:00
Lakshman
7696fbf9cd Toggle showing average depth
Add additional check box in "preferences->graph" section that allows
users to hide average depth on dive profile.
By default this option is checked to show average depth.

Fixes #475

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-28 09:38:08 -07:00
Tomaz Canabrava
751c76a578 Support save / load for the Animation Speed on the Preferences
User can now fine-tune the animation speed on the preferences,
a value of zero disables it completely.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-11 17:41:41 -07:00
Lakshman
6e4466aa0a Show temperature units in the label when editing dive
Currently when user wants to add a new dive information,
the ways to know what unit system is being used are

 - Through preferences panel.
 - Save the dive information, which displays units in
   the text field.

This patch provides an option to the user to show current
unit system by displaying the unit on the side of the label
when the user is editing the fields.

This feature can be enabled or disabled by using the new
checkbox option i.e. `Show units in text labels` included
in `preferences->units` section.

Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-10 21:10:27 -07:00
Dirk Hohndel
76e6420f6b Massive automated whitespace cleanup
I know everyone will hate it.
Go ahead. Complain. Call me names.
At least now things are consistent and reproducible.
If you want changes, have your complaint come with a patch to
scripts/whitespace.pl so that we can automate it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27 20:09:57 -08:00
Tomaz Canabrava
8c56b2f45e Store zoomed plot in preferences
This patch makes the 'Zoomed Plot' a preference that can be stored and
retrieved, this way if the user sets the plot to be 'zoomed', this
information will persist even if they closed or opened subsurface again.

Also, added the 'Scale' button on the new profile, but didn't did the glue
code yet.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-27 10:48:35 -08:00
Danilo Cesar Lemes de Paula
5846ff972d Fixing default font on preference window
Default font was hardcoded as 14.
What happen if you change any other preference value is that the
application would start to use fontSize=14.

This commit loads the right value in the QDoubleSpinBox

Signed-off-by: Danilo Cesar Lemes de Paula <danilo.eu@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-26 11:51:33 -08:00
Boris Barbulovski
c86822c2f4 Replace mainWindow() with MainWindow::instance()
C++ style of accessing single instance class object.

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-12 11:42:59 -08:00
Patrick Majewski
936ac958ed Handle cancel in PreferencesDialog::on_chooseFile_clicked
If I click in the Preferences Dialog on the 3 dots to choose a default
file to load and cancel the opening FileDialog an empty string is returned
and set to the coresponding QLineEdit.

The new behavior (and mostly expected) is to update the QLineEdit only
if there is a filename returned from QFileDialog.

Signed-off-by: Patrick Majewski <dive@patrick-majewski.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-11 12:36:28 -08:00
Dirk Hohndel
3086741d49 Remove the graph options from the Preferences
All of these are now set from the toolbar next to the new profile. This
removes functionality for people using the old profile, but as we will rip
that out and switch to the new profile, soon, that seems an acceptable
side effect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08 14:29:40 -08:00
Michael Andreen
753ebc8ed4 Load preferences before they are saved.
Load all the settings in the PreferenceDialog constructor. Previously
all the settings were overwritten with default values the first time
PreferencesDialog::syncSettings() was called.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-02-08 09:08:48 -08:00
Tomaz Canabrava
96e35e542c Move save of preferences to the preferences dialog.
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>
2014-02-06 11:30:57 -08:00
Tomaz Canabrava
c84ef319a2 Create a toolbox on the left side of the new profile
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>
2014-02-06 06:34:05 -08:00
Tomaz Canabrava
7b9400685d Optimizations and fixes on the new profile.
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>
2014-02-05 06:30:33 -08:00
Dirk Hohndel
a27f67c026 Whitespace and coding style updates
Another futile attempt to cleanup the code and make coding style and
whitespace consistent. I tried to add a file that describes the key points
of our coding style. I have no illusions that this will help the least
bit...

This commit should ONLY change whitespace

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-16 11:50:56 +07:00
Dirk Hohndel
23973e8abd Don't show tanks that aren't used during a dive
Some dive computers will always download all tanks that they store, not
just the ones used in a dive. Most people only want to see the tanks that
they actually used during the dive (and for the others there's an option
to go back to the old behavior, just in case).

All this is only in memory / during runtime. If the dive computer provided
the extra data we will not throw it away.

Fixes #373

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-01-11 22:02:35 +07:00