Commit graph

130 commits

Author SHA1 Message Date
Dirk Hohndel
83c2addfef Move initialization of preferences to helper function
This way we can read the preferences without instantiating the
PreferencesDialog class.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-25 22:08:25 -07:00
Dirk Hohndel
9a68e356af Make password change asynchronous
This isn't perfect (if you make multiple requests things could go badly),
but it's better than just slapping the new password into the settings,
even if the update failed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 15:06:57 -07:00
Dirk Hohndel
ce008f52db Cloud storage: enable password update
This now allows the user to set a new password for the cloud service.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 11:10:40 -07:00
Dirk Hohndel
3ba3de8daf Add UI for cloud password change
This isn't hooked up yet, just the UI elements.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-22 07:34:36 -07:00
Dirk Hohndel
b1538c809d Code cleanup
Make precedence of && over || explicit.
Explicitly convert between char * and unsigned char *.
Don't assign potentially negative return code to an unsigend variable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 13:59:14 -07:00
Dirk Hohndel
cf047466b5 Cmake: make Facebook support an actual option
This way we can selectively turn off Facebook support.

And turning off both Facebook support and support for the user manual
allows us to not rely on QWebKit which once again allows debugging
Subsurface with valgrind on Arch Linux.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-06 12:11:07 -07:00
Dirk Hohndel
a413141b33 Geo taxonomy: adjust the preferences to the new data structures
This allows us to pick which three categories of geo taxonomy will be
shown in the UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-01 12:38:40 -07:00
Dirk Hohndel
1f0c9eec96 Preferences dialog: yet another attempt to make it fit
Designer is such an utter piece of crap I am at a lack for words.
After a few hours with a real UI tool (i.e., vim) I have the preferences
dialog reasonably close to where I want it. It's still not perfect, but at
least it no longer contains tons of unused space, it fits fine on a
1024x768 screen and it is visually consistent across the different pages.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-27 14:37:43 -07:00
Tomaz Canabrava
21c46b8c2d Preferences infrastructure for GeoManagement
Simple preferences infrastructure with default prefs, prefs and hooks for
the Qt Settings system and our preferences ui.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 17:11:51 -07:00
Dirk Hohndel
979eb464b3 Cloud storage: update File menu options once PIN is verified
The code didn't trigger the update routine after PIN verification, only if
just email/password were shown. A simple oversight. This is fixed now and
so the visibility of cloud open and cloud save options should refelect
whether verified credentials are in the preferences or not.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 14:04:31 -07:00
Dirk Hohndel
a4168ed591 Preferences: don't show error when resetting cloud email / password
Empty values won't work, of course, but they aren't an error, either.

Fixes #887

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-22 06:42:35 -07:00
Dirk Hohndel
617b105458 Cloud storage: create preference entry for base URL
This just deals with the mechanics. There is no UI to enter / change this
URL (and that's intentional), neither is it used, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-15 09:56:11 -07:00
Dirk Hohndel
60f4b37fab Cloud storage: only offer cloud storage related options when verified
If we don't have verified cloud credentials disable the menu options and
disallow the use of cloud storage as default data file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14 15:42:28 -07:00
Dirk Hohndel
4b120d1bf5 Cloud storage: show in preferences if cloud account was verified
This should make it easier to figure out what's happening.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14 14:06:44 -07:00
Dirk Hohndel
b5eb66545b Cloud storage: clean up handling of cloud storage account
Correctly tracking the status of our authentication with the cloud service
is non-trivial, especially since the user may quit Subsurface between
registering and verifying an account, they might even register on one
machine and verify on another.

This tries to make sure that when in doubt we check with the cloud service
backend. And we show errors in the UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14 14:06:28 -07:00
Dirk Hohndel
10b9202757 Preferences: hook up default file behavior in the dialog
This now sets the preference variable / config entry and keeps them in
sync. Doesn't actually change the behavior at program start, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-14 08:32:37 -07:00
Dirk Hohndel
492369b312 Cloud storage: Add preference option whether to sync in the background
This defaults to on as that's the most useful setting for the average
user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12 11:48:56 -07:00
Dirk Hohndel
3a0ffb70a0 Cloud storage: don't clear out password by mistake
If the user didn't enable saving the password to the preferences, then the
password was cleared out as the preferences got synced.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-12 11:28:20 -07:00
Dirk Hohndel
a04f1fd133 Cloud storage: deal with visibility of PIN entry
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09 17:03:53 -07:00
Dirk Hohndel
a07376b534 Cloud storage: initial support for confirming the email PIN
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-09 17:03:36 -07:00
Dirk Hohndel
318bf5cccc Cloud storage: first stab at creating an account on the backend
This triggers when the email address / password is changed in the
preferences. It opens an https connection with the backend server (the URL
is hardcoded) which should create an account with these credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-07 09:54:35 -07:00
Dirk Hohndel
a6b6674780 Cloud storage: rethink the terminology used
Cloud storage makes more sense that remote storage - at least I assume
that more people are used to thinking about "storing things in the cloud".

Don't use PIN or passphrase, call it a password everywhere.

Don't use copy_string() to copy the password - the git credentials routine
asserts that password is not NULL, so make sure we at least have a pointer
to an empty string here.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-31 19:45:05 -07:00
Dirk Hohndel
61c0d0c73d Remote storage: collect email and PIN in preferences
This allows entering / storing the PIN (aka passphrase) for the ssh key.
The email isn't used, yet - this will be used by the automated backend to
create a unique git repository that will turn into the remote storage.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:40:06 -07:00
Dirk Hohndel
20d1d2c385 Remote storage: add preference for the passphrase
While we don't expose it as this to the user, we'll need an ssh key and
potentially a passphrase in order to communicate with the git server in
our infrastructure. This simply sets up a way to store the passphrase.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-28 14:38:59 -07:00
Robert C. Helling
187f7dab9f Add option to display GPS coordinates as decimals
This adds a field to the units preferences to have GPS coordinates
show as decimals (as for example Google maps does it).

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-05-20 10:34:10 -07: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
Patrick Valsecchi
7e0ff8c1e4 Fixed CMakeLists.txt to work with Qt5
Signed-off-by: Patrick Valsecchi <patrick@thus.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-02 08:00:49 -08:00
Dirk Hohndel
f30ff4fde7 Facebook integration: only set the URL once
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-02-01 10:47:31 -08:00
Dirk Hohndel
39e68c795c Try to make the Facebook interaction be more pleasant
Show either the login screen or the disconnect button, plus some text that
explains what the user is expected to do.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:36:49 -08:00
Dirk Hohndel
cb6bda4e0c Compile Facebook support when building with Qt5
Now that Facebook approved our use of the API, we can build this by
default.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-30 22:08:50 -08:00
willem ferguson
a700be3207 CCR option: display o2 sensor data
This patch creates the possibility of viewing the individual sensor
values when the po2 button on the profile toolbar is activated. This
follows exactly the procedure for optionally displaying the setpoint
values while viewing po2. A checkbox in the preferences panel determines
whether sensor information is shown. By default it is set to OFF. When
checked, and the po2 button is activated, sensor1 values are shown in
grey, sensor2 in blue and sensor3 in brown.

Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-21 17:00:18 +12:00
Robert C. Helling
2923329e8e UI for pSCR preferences
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-20 22:38:52 +12:00
Dirk Hohndel
02d8dd5d13 Clean up the header files
Lots and lots and lots of header files were being included without being
needed. This attempts to clean some of that crud up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 23:00:43 +13:00
Dirk Hohndel
abddb3ecb9 Make Facebook support a config option
By default it is turned off, turn on by calling qmake with
CONFIG+=FBSUPPORT.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-17 08:43:49 +13:00
Joseph W. Joshua
25fc828458 Ignore QWebView in Android
Ignore QWebView instances in the preferences dialog when compiling under
Android, as QWebView is not yet supported under Android.

Signed-off-by: Joseph W. Joshua <joejoshw@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-14 07:49:24 +13:00
Robert C. Helling
7d8ecf8ec8 Add preferences field for default set-point
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Robert C. Helling
a478eb5711 Maintab combobox to set dive type
still needs some work

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-10 17:27:24 -08:00
Anton Lundin
3c15834c3c Remove unused headers
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-01-08 14:35:09 -08:00
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