Commit graph

382 commits

Author SHA1 Message Date
Miika Turkia
e80b03699d Shrink the minimum size for preferences window
Let's have the preferences window as small as possible with the current
data in it. This should allow people with vertical resolution of 600 to
use the preferences window.

Fixes #1083

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28 04:54:51 -07:00
Miika Turkia
49cbb8308e Shrink the size of export dialog
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-28 04:54:10 -07:00
Dirk Hohndel
8f4e649c68 If cloud storage is offline, show that in title bar
Not sure if "local cache" is the best text, but it's accurate.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-17 12:27:01 +09:00
Rick Walsh
bb31517951 Planner: update cylinder mixes and MND and MOD when prefs are changed
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:08:48 -07:00
Rick Walsh
9fbd11744f Add function to calculate gas maximum narcotic depth
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:08:06 -07:00
Rick Walsh
1ba61d7ad5 Update gas deco MOD when deco pO2 is changed
This fix is reasonably straightforward when the divedatapoint structure stores
the cylinder rather than gasmix.

Fixes #970

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:08:01 -07:00
Rick Walsh
b1ed04a7f4 Have divedatapoint store cylinder id instead of gasmix
Determining the correct cylinder index from a known gas mix can be
complicated, but it is trivial to look up the gasmix from the cylinder_t
structure.

It makes sense to remember which cylinder is being used. This simplifies
handling changing a cylinder's gas mix, either directly by the user, or
indirectly in the planner. It also permits tracking of multiple cylinders of
the same mix, e.g. independent twins / sidemount.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-07-09 12:07:25 -07:00
Robert C. Helling
783844eb3d Set date and time when replanning a dive
Otherwise we pretend the dive is now.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-13 22:17:49 -07:00
Linus Torvalds
710d47a2da Make sure dive computer model is proper malloc'ed allocation
Reported-and-tested-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-06-11 10:29:31 -07:00
Rick Walsh
1e607ae98d fixup: Don't confuse EAD and END
The previous patch (Planner: add best mix EAD preference) used the term EAD
(equivalent air depth) in variable names and strings, when it should have been
END (equivalent narcotic depth).
They're not the same thing and shouldn't be confused.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:55 -07:00
Rick Walsh
9b29173363 Planner: add best mix EAD preference
Add best mix EAD preference and UI, along with a tooltip describing what it
does

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-21 07:03:38 -07:00
Miika Turkia
30976c05a4 Parse txt formatted log files
This parses .txt log files produced by Dataplus and Oceanlog software.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:07 -07:00
Miika Turkia
98741c864c Use encoded file name on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:28:00 -07:00
Miika Turkia
74065ad8aa Allow parsing of .txt files on import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-05 07:27:31 -07:00
Miika Turkia
1902d527d5 Parse date and time from on APD import
This will parse the date and time information on CSV import if the file
name matches the one used by APD log viewer (date and time are available
in the file name). Hard coding the year to 20?? is a bit unfortunate,
but as there is only 2 digits in the year, we have to invent something.
And it would be quite optimistic to assume this will bite us back any
time soon :D

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-03 09:50:32 -07:00
Miika Turkia
304af311f0 CSV import: import dive number if defined
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:10 -07:00
Miika Turkia
7ec83ef02a CSV import: import time field if available
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:07 -07:00
Miika Turkia
a83c674139 CSV import: support for user specified date format
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:25:03 -07:00
Miika Turkia
a480d28afd CSV import: use date field on profile import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-05-02 10:24:52 -07:00
Linus Torvalds
56ed3f1c61 Fix Qt date interfaces for times before 1970
This seems to work around the crazy QDateTime::fromTime_t() problem in Qt.

It is *very* lightly tested. In fact, the only test is that "test0.xml"
change that is part of this patch.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29 09:07:41 -07:00
Miika Turkia
d3867a09f3 DL7: parse temperature and cylinder pressure
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:17:52 -07:00
Miika Turkia
24edaf4be1 Parse date and time in DL7 import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:16:32 -07:00
Miika Turkia
1fec953a13 Special handling for DL7
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:45 -07:00
Miika Turkia
e31df43cde Detect DL7 depth units
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:34 -07:00
Miika Turkia
74f0192711 Basic GUI part for DL7 import
This sets the basic properties properly but is still missing the parsing
of meta-data, especially used units.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:25 -07:00
Miika Turkia
8a4f2f998a Fix file extension regesp
The original negative lookahead failed in case the file name contains
more than 1 dot as it looks for dot that is not followed by the given
extensions. And such a match exists in the file name. The new version
should look properly if the file ends with any of the given extensions.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:11 -07:00
Miika Turkia
4955f858bf Add CSV parsing trigger for zxu and zxl files
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:08:01 -07:00
Miika Turkia
46074ebf21 Add DAN DL7 file extensions for import UI
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:07:53 -07:00
Miika Turkia
375f698c78 Detect pipe as field separator in CSV import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-25 09:07:34 -07:00
Linus Torvalds
effad4b2c8 Fix seabear import sample overrun bug
The Seabear import fixed up the NDL and TTS in the samples from minutes
(in the import) to seconds (our internal format for all time).  But it
did it with a loop that overran the end of the samples array by one:

	for(int s_nr = 0 ; s_nr <= dive->dc.samples ; s_nr++) {

Fix it to use the proper "<" instead of "<=".

Reported-by: Stuart Vernon <stuartv@force2.net>
Tested-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-11 12:23:05 -07:00
Dirk Hohndel
6725d54db2 Desktop UI: make sure that git progress is actually shown
This updates the got progress indicator to the changed interface where we don't
pass in an explicit percentage.

It also finally fixes an old problem: If we don't allow the Qt main loop to
process the events, we'll never see a decent progress indicator...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 23:43:17 -07:00
Tomaz Canabrava
21e8b1e363 Fix compilation with the new folder architecture
A few more fixes for things that broke in commit 7be962bfc2 ("Move
subsurface-core to core and qt-mobile to mobile-widgets").

[Dirk Hohndel: slightly edited and overlap with Linus' patch removed]

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 12:32:36 -07:00
Linus Torvalds
ad2ac58ea2 Fix include paths
As expected, commit 7be962bfc2 ("Move subsurface-core to core and qt-mobile
to mobile-widgets") caused some breakage.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05 09:40:58 -07:00
Linus Torvalds
e0824ef9f3 Make gas change events always have a cylinder index
In commit df4e26c875 ("Start sanitizing gaschange event information")
back about a year and a half ago, I started sanitizing the gas switch
event data, allowing gas switches to be associated with a particular
cylinder index rather than just the gas mix that is switched to.

But that initial step only _allowed_ a gas switch event to be associated
with a particular cylinder, the primary model was still to just specify
the mix.

This finally takes the next step, and *always* associates a gas switch
event with a particular cylinder.  Instead of then looking up the
cylinder by trying to match gas mixes at runtime, subsurface now looks
it up when loading the dive initially as part of the dive fixup code.

The switch event still has an a separate gas mix associated with it, but
this patch also starts preparing for entirely relying on the gas mix in
the cylinder itself, by starting to pass in not just the event but also
the dive pointer to the routines that look up gas mix details.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:37:18 -07:00
Dirk Hohndel
7be962bfc2 Move subsurface-core to core and qt-mobile to mobile-widgets
Having subsurface-core as a directory name really messes with
autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an
autocomplete conflict and also was inconsistent with the desktop-widget
name for the directory containing the "other" UI.

And while cleaning up the resulting change in the path name for include
files, I decided to clean up those even more to make them consistent
overall.

This could have been handled in more commits, but since this requires a
make clean before the build, it seemed more sensible to do it all in one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 22:33:58 -07:00
Linus Torvalds
2d760a7bff Don't write back dive data that hasn't changed in git
This caches the git ID for the dive on load, and avoids building the
dive directory and hashing it on save as long as nothing has invalidated
the git ID cache.

That should make it much faster to write back data to the git
repository, since the dive tree structure and the divecomputer blobs in
particular are the bulk of it (due to all the sample data).  It's not
actually the git operations that are all that expensive, it's literally
generating the big blob with all the snprintf() calls for the data.

The git save used to be a fairly expensive with large data sets,
especially noticeable on mobile with much weaker CPU's.  This should
speed things up by at least a factor of two.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 17:27:10 -07:00
Dirk Hohndel
eea1ff6a83 Change the git progress update callback signature
This way we can include additional text. This will be used in later
patches.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04 14:17:45 -07:00
Werner Macho
23ea947b5a typo fix
small typo fix for GUI

Signed-off-by: Werner Macho <werner.macho@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 12:16:56 -07:00
Robert C. Helling
e93c99c8bc When changing units from psi to bar first change value, then max
otherwise the max interferes with the value. Furthermore this increases
the max values a bit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23 09:34:49 -07:00
Dirk Hohndel
abb3b03511 Don't start Add or Plan while accessing cloud storage
This avoids a race condition where we get confused about our internal
state.

Fixes #1031

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 17:41:15 -07:00
Robert C. Helling
48007ebc30 Make the reserve gas units aware
In the planner, for recreational mode, there is a setting indicating
the pressure at which the diver should be back at the surface. This
pressure was hardcoded to bar.

Fixes #1027

[Dirk Hohndel: small modifications, more reasonable step for psi,
               more reasonable maxima]

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 16:16:38 -07:00
Anton Lundin
77e1c2afa9 configure OSTC/OSTC3: Bugfix depth parameter unit
The unit for the depth parameters ain't meters, its 0.1 meters. This
caused the values stored to be out of range.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-22 08:46:40 -07:00
Dirk Hohndel
47ba8b38d4 Preferences: fix missing slot problem when creating new account
This is still a left over from the damage done when creating the
preferences objectification.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19 07:52:33 -07:00
Dirk Hohndel
44d715759c Silence warnings in facebook_integration.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:37 -08:00
Dirk Hohndel
09532d0463 Silence warnings in printdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:37 -08:00
Dirk Hohndel
54757fb694 Silence warnings in locationinformation.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:37 -08:00
Dirk Hohndel
eb09b79dc5 Silence warnings in configuredivecomputerdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:36 -08:00
Dirk Hohndel
ac7540b164 Silence warnings in divelogexportdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:36 -08:00
Dirk Hohndel
60ee897b29 Remove unused member function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:36 -08:00
Dirk Hohndel
b8fbf72182 Silence warnings in divelogimportdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:34 -08:00
Dirk Hohndel
b4bb1321bf Silence warnings in subsurfacewebservices.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:27 -08:00
Dirk Hohndel
b973d988dc Silence warnings in starwidget.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:27 -08:00
Dirk Hohndel
a670181ed2 Silence warnings in simplewidgets.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:27 -08:00
Dirk Hohndel
ee7b9dcd09 Silence warnings in modeldelegates.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
071e6dbd6f Silence warnings in mainwindow.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
8d19a6ae16 Silence warnings in downloadfromdivecomputer.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
234a659498 Silence warnings in diveshareexportdialog.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
7eb787ee5d Remove unused member function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
83fb735a3e Silence warnings in divelistview.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
de572815bd Silence warnings in subsurfacewebservices.h
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Dirk Hohndel
4e13322fa0 Clean up signedness confusion in statisticswidget.cpp
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09 21:50:26 -08:00
Tomaz Canabrava
5bf0e48700 Remove unused variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07 11:17:16 -08:00
Lubomir I. Ivanov
b275e604c1 templatelayout.cpp: fix potential issue in preprocessTemplate()
The function preprocessTemplate(), did not account well
for indexes in Grantlee variables, such as:
dive.weight# (where # is the index)
dive.cylinder#

To solve the issue the list (QList<QPair<QString, QString> >)
for variables to be replaced is populated will all possible
indexes:
0 - MAX_WEIGHTSYSTEM for weights
0 - MAX_CYLINDERS for cylinders

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29 15:42:33 -08:00
Lubomir I. Ivanov
0aa8ef918d templatelayout.cpp: add a HTML preprocessor stage
The current Grantlee template loading scheme does not
allow a preprocessing layer. With the recent DiveObjectHelper
changes the layer is required if we don't want to add a set
of dummy methods and Q_PROPERTIES which will only inflate
the DiveObjectHelper class.

Use the already present helper readTemplate() to load the
raw HTML template and pass it to a static function which
does some variable replacement to accomudate DiveObjectHelper.

This change is done for the sake of not breaking the Grantlee
HTML variables on the user side!

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-29 07:32:57 -08:00
Miika Turkia
ae22b7cae0 Divelogs.de import: encode + character on password
Upload seems to work as is...

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-23 14:07:49 +01:00
Jan Mulder
ce373db951 Update copyright for 2016
Trival string update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-02 09:28:56 -08:00
Miika Turkia
d6af28cc90 Attempt to detect time format on CSV import
This attempts to detect the time format when initially importing a CSV
file. Well, only the minutes:seconds notation is detected currently.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:22:47 -08:00
Miika Turkia
d9072cdefd Attempt to detect date format on CSV import
This tries to detect the date format when initially reading a CSV file
for importing.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-31 11:21:04 -08:00
Dirk Hohndel
6a8768ee26 Fix build breakage
Introduced in commit 31462f150dff ("We already have a QNetworkAcessManager
global, use it").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:51:58 -08:00
Tomaz Canabrava
8b7427c56d Move CloudStorage out of the widgets
Cloud Storage is a non-gui based class, we currently use
two different approaches for cloud storage, one on the desktop
target and other on the mobile target, we should use only one.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-26 09:50:32 -08:00
Tomaz Canabrava
2c5fad73e8 Start to use the QSettings ObjectWrapper
start of the QSettinsg Object Wrapper usage on the code
this first patch removes two macros that generated around
200 lines in runtime for something like a quarter of it
Basically, whenever we changed anything we called the
PreferencesDialog::settingsChanged and connected everythign
to that signal, now each setting has it's own changed signal
and we can call it directly.

The best thing about this approach is that we don't trigger
repaints for things that are not directly profile related. (
actually we still do, but the plan is to remove them in due time)

this commit breaks correct atualization of the profile (because
everything was connected to PreferencesDialog::settingsChanged)
and now I need to hunt a bit for the correct connections

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-25 13:04:01 -08:00
Anton Lundin
451293f1a0 configure OSTC/OSTC3: Add safety stop parameters
This adds the configure parameters for safety stops on the hwOS(OSTC3)
and OSTC computers.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:22 -08:00
Anton Lundin
91a72f45d4 configure OSTC3: Add temperature sensor offset
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-22 06:50:18 -08:00
krisalpha
b42dd941c1 Fix UI issue with location management
The index in the fixpopup function was incorrect which caused the user to
need TWO cursor down presses to move to the second element. I changed the
index value so the user now needs only one key press to traverse up/dowm.

Fixes #954

Signed-off-by: krishan Chopra <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-19 13:06:38 -08:00
Miika Turkia
b9000208fe Hide the time from trip tab
This hides the start time when viewing trip details.

See #964

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:40 -08:00
Miika Turkia
394ddba013 Mark date field readonly on trip edit
The date comes from the first dive in trip, thus no need to allow
editing (especially since the edited date seems to be discarded in any
case).

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-17 10:45:29 -08:00
krisalpha
7e9648c5cb Be more precise in our language: call it "mean depth"
As pointed by jwhferguson, I changed "show average depth" to "show
mean depth".

I modified file preferences_graph.ui and changed the text. This bug was
reported on fedora 22. i use ubuntu.layout and justification is nicely
displayed.

The patch also removes a no longer necessary include.

See #922

Signed-off-by: krisalpha <choprakrishan61@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-12 10:35:28 -08:00
Tomaz Canabrava
04d4da50c4 Fix memory leak on the printing system
We forgot to delete the Grantlee object before creating a new one

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:03:12 -08:00
Tomaz Canabrava
f07a9fa09f Simplify Finding the Templates
We don't need a list of QFileInfo if we are not using it
much better to have a list of the files directly

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:03:06 -08:00
Tomaz Canabrava
a809eec853 Don't iterate over the dive_table to discover the number of dives
dive_table.nr is exactly that.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:02:35 -08:00
Tomaz Canabrava
dec2572ec6 Don't if true then true
Set the values directly, seems much more sane.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:02:20 -08:00
Tomaz Canabrava
1210d4b575 Simplify code on the printingDialog
instead of duplicate the code that only chaged the QList that it
would access, create a temporary list and use it for dealing
with the code.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 10:01:51 -08:00
Tomaz Canabrava
a13fa83046 Removed grantlee template code to deal with non-Qobject
Since we alreday have a Q_PROPERTY on the DiveObjectHelper,
grantlee introspection can use that directly to access it's
data, so there's no need for us to redeclare everything.

More QObject Introspection, Less handmade boilerplate for
Grantlee, QML, and a few other things.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 08:05:36 -08:00
Tomaz Canabrava
19dee335e4 Lazy Initialize QPrinter
it was taking 3 - 4 secs here to open the print dialog,
first I tought it was a bug in our side, but it looks like
it's a Qt bug, and by lazy initializing it we don't actually
solve this, since it will still take 3 - 4 secs for the printer
to start, but the dialog will appear much quicker.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 08:04:58 -08:00
Tomaz Canabrava
25aa80846b Move Dive class from qthelper.h/cpp to it's own file
and rename it to DiveObjectHelper, since it should be an QObject
based class to make it easier on the QML, grantlee and widgets
side to display the dive's internal data.

each Q_PROPERTY defined in the DiveObjectHelper.h file
can be acessed directly via it's name.

So, if you are on a model that  returns a dive, acess it's name
by dive.name

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-08 08:04:44 -08:00
Dirk Hohndel
2882a1ef41 Remove the non-canonical Subusrface version
It no longer makes sense to lie about the version. If you are running a product
build, then the canonical version is the same version as the plain version used
to be. And in either case it makes much more sense to simply log the full
version information.

We used to have the differently styled versions for different OSs, but I don't
think this is needed anymore. Let's hope this doesn't go down as one of these
"famous last words" moments...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-20 07:59:50 -08:00
Tomaz Canabrava
13573915b6 Fix CMake to not add Facebook on Android
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-17 11:48:15 -08:00
Dirk Hohndel
7aab635585 Remove support for older libgit2 - we now require 0.23 or later
Also fixes a capitalization error that prevented finding libssh2 in some
circumstances. And adds a missing include when building with libzip on Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-15 13:33:00 -08:00
Dirk Hohndel
8f33403e4f Fetch the Subsurface webservice userid if cloud credentials were given
This allows users to not have to worry about this userid anymore. Both the
mobile app and the desktop app can now derive the userid from the cloud
storage credentials.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 14:32:03 -08:00
Anton Lundin
59042b2ed0 Fix disabling of facebook integration
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02 09:21:04 -08:00
Robert C. Helling
82d9709357 Make pictures respond to double clicks again
The Drag & Drop functionality swallowd the click events so double
clicks never happend. So here, we detect this and call the handler
explicitly.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-29 13:08:26 -08:00
Dirk Hohndel
23cb9b49c2 Remove unused code
Reported-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-25 09:13:35 -08:00
Dirk Hohndel
dabb6b2033 Location completion matches on whole name
When typing in a partial location name, the match now considers the whole
text, not just the start of the text. So typing in "Yell" will match both
"Yellow House" and "Mellow Yellow".

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24 11:11:39 -08:00
Robert C. Helling
d8e38764fd Drag and Drop Images
Now that we have the possibility to add images without meaningful
time stamps to a dive, we should let the user provide that time
offset manually. This patch allowed pictures to be dragged from
the image list to the profile.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24 09:22:16 -08:00
Dirk Hohndel
9295b3aa37 Add menu entry for creating GPS location
And disable it if there is no satellite based location service (but see
the comment in the previous commit - this doesn't appear to work
reliably).

Nothing happens when you use the menu entry. This just allows us to hook
this up later.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18 19:17:32 -08:00
Dirk Hohndel
ff5bd062f6 Location service: instantiate location provider in the desktop UI
We still aren't doing anything with it, but at least it's there now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18 18:52:44 -08:00
Dirk Hohndel
d70f85ce35 Cloud storage: modify protocol for checking cloud connectivity
In order to allow the backend to match account in multi user mode, it
needs to know if the requests are coming from the same instance of
Subsurface. Since I had to change the backend to add the ability to
retrieve a location service userid I added this capability at the same
time.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18 17:57:13 -08:00
Lubomir I. Ivanov
7e749e8ea4 qthelper: also support "maxcns" and "otu" in Grantlee HTML
Fixes #962

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16 15:06:32 -08:00
Lubomir I. Ivanov
c78a560442 templatelayout.h: expose cylinders and weights in Grantlee HTML
This patch adds the following HTML variables:
"dive.cylinders" -> Dive::cylinders()
"dive.cylinderX" -> Dive::cylinder(X)
"dive.weights" -> Dive::weights()
"dive.weightX" -> Dive::weight(X)

The patch also creates some macros to ease the Dive variable
lookup visually.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16 15:04:25 -08:00
Lubomir I. Ivanov
3365a506ef templatelayout.h: expose "dive.suit" as a Grantlee HTML variable
Having {{ dive.suit }} in the HTML will now return the
suit as QString (from struct dive->suit).

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16 15:03:59 -08:00
K. \"pestophagous\" Heller
0a2f5d25c0 Parse html links in the Notes section.
In the spirit of "Do the simplest thing that could
possibly work": capture Ctrl+leftclick mouse events
in the Notes area. If the string under the clicked
position is a valid url, then launch it.

Many common URI schemes will work. Typing a url that
starts with https:// will work. So will mailto: and
file://

See #733

Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15 22:22:53 -08:00
K. \"pestophagous\" Heller
99ed01e571 Make "Save Preferences" button mutate "prefs" struct.
Clicking Save in the preferences dialog will now cause
the GUI to immediately reflect the latest settings (just
as it behaved in 4.5).

Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15 22:22:41 -08:00
K. \"pestophagous\" Heller
f44c98d9c5 Restore proper spin-box/slider behavior for animation setting.
In 4.5 the signal-to-slot connections between the QSlider
and the QSpinBox were bidirectional. That setup is still
desirable; it must have been broken accidentally during
preferences refactorings.

Signed-off-by: K. Heller <pestophagous@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15 22:22:34 -08:00
Lubomir I. Ivanov
f5dbc3b44d Planner: support profile in planner print
The "Print" button in the planner dumps the QTextEdit to
a QPrinter via ::print(). This patch renders the Profile
to a Pixmap which is inserted as Base64 stream in an <img>
tag and fed on top of the QTextEdit HTML contents.

This route preserves the planner notes as text in PDF prints.
The quick alternative is to render the QTextDocument to
a QPixmap as well, but that will not preserve the text
and pagination becomes manual.

Possibly the QTextDocument can be rendered as a QPicture
but pagination is still an issue, while so far there is exactly
one user requesting this feature!

Related small change in ProfileWidget2:
Explicitly hide the tooltip when printMode is true.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15 21:07:27 -08:00
Dirk Hohndel
3453234a3b Missing half of the previous commit
Oops. I fixed the previous commit, tested the fix, and then forgot to
update the commit and instead pushed it out. That was dumb.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14 10:43:37 -08:00
Dirk Hohndel
97fa132202 Move proxy initialization into shared code
This way we can use the same code on desktop and mobile app.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14 09:39:02 -08:00
Dirk Hohndel
111a153295 Preferences: correctly hook up the signals to enable/disable cloud storage
This way the menu state matches the actual verification state again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-10 13:45:13 -08:00
Lubomir I. Ivanov
f0bd39c551 modeldelegates: remove printing related delegates
Remove HTMLDelegate and ProfilePrintDelagate as
these are obosolete. The print related rendering
at the moment happens via QWebView.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-10 09:08:16 -08:00
Tomaz Canabrava
c71df5baa5 Don't rely on CMAKE_AUTOUIC
Some old CMakes that we use had problems with it, change to use
the qt5_wrap_ui macro that's bundled with Qt.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Tomaz Canabrava
e1d43ade27 Removed unused files
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Tomaz Canabrava
f5f2c37184 Remove the PluginSystem
But keep the Interface so it's still userfull to create a new
SocialNetwork  when needed, but it will be part of the code,
and not a plugin.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Tomaz Canabrava
66091ff853 Remove Facebook from Plugins
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Dirk Hohndel
7b1950ca03 Statistics tab: clear min/max duration with just one dive selected
Otherwise if the user selects more than one dive, then goes back to just a
single dive, the maximum and minimum duration of the previous selected
group of dives stays visible which is clearly incorrect.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09 18:00:56 -08:00
Tomaz Canabrava
e0f43d8a84 Link the facebook plugin against the subsurface_interface
This should prevent a compile issue on mac, worked without it on linux.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 16:33:37 -08:00
Tomaz Canabrava
4ddf4f6d83 Removed C++11 from the code.
Make Dirk ungrumpy

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 16:33:34 -08:00
Dirk Hohndel
871f585f42 Make building plugins optional
This currently fails at least on my old Mac that I use to create binaries
that work on 10.7 and newer.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 16:31:38 -08:00
Tomaz Canabrava
125217074e Remove lambdas: they don't work on OSX 10.7
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 15:58:44 -08:00
Dirk Hohndel
9724ffc7b2 Cmake: remove references to removed source file
Otherwise the build breaks if FBSUPPORT is defined.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:48:40 -08:00
Tomaz Canabrava
8abf64d8c0 Finish the first facebook integration plugin
Now the plugin is usable, one can use it to send stuff to facebook.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:45:13 -08:00
Tomaz Canabrava
a1ff14a48f Facebook Plugin is aware of it's connection status
This patch makes facebook plugin aware of it's connection status
enabling uploads only when connected, and hooking some things up.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:45:08 -08:00
Tomaz Canabrava
72b85e3151 We are not using this code anymore, rip it off
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:45:02 -08:00
Tomaz Canabrava
287977b04c Change from uploadCurrentDive to requestUpload call
Since we can't forbit the plugins to upload more than just the
current dive, it's better to change the name of the call.
also add a stub to make sure it's calling the right method inside
the plugin.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:44:55 -08:00
Tomaz Canabrava
486857f2b4 Make it possible to connect to facebook again
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:44:40 -08:00
Tomaz Canabrava
70e6840d51 Convert most of the old code for FacebookPlugin to the new System
It should still not work correctly - but the plugin should be almost
ready - I'll do some papercuts on the next few commits.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08 09:43:35 -08:00
Lubomir I. Ivanov
829f7a2ee2 abstractpreferenceswidget.cpp: fix argument warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:33 -08:00
Lubomir I. Ivanov
809f507537 preferencesdialog.cpp: silence a switch warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:33 -08:00
Lubomir I. Ivanov
73ddd57cf0 preferences_network.cpp: remove some unused 'reply' variables
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:32 -08:00
Lubomir I. Ivanov
aee6f0b2c4 diveshareexportdialog.cpp: fix an argument order warning
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:32 -08:00
Lubomir I. Ivanov
6f713fcb99 maintab.cpp: remove unused variable
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:32 -08:00
Lubomir I. Ivanov
e7cd9d615c facebook_integration.cpp: add return statement to a 'bool' method
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:32 -08:00
Lubomir I. Ivanov
9614952611 mainwindow.cpp: remove unused variable 'diveSitePictures'
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:26:25 -08:00
Lubomir I. Ivanov
c2ff2be210 subsurfacewebservices.cpp: make sure 'changed' is not unused
Make sure 'changed' in SubsurfaceWebServices::buttonClicked()
is not unused even if NO_MARBLE is defined.

It appears to be used only in the #ifndef NO_MARBLE branch.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:40:55 +02:00
Lubomir I. Ivanov
c1495f08ec subsurfacewebservices.cpp: remove unused FILE variable
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:40:44 +02:00
Lubomir I. Ivanov
d40caaaa31 divelogimportdialog.cpp: declare an enum as type
'known' is a static variable which is not used.
by declaring 'enum Known', now there is a *type* which
enumerates the values.

Having 'static Known known = <something>' would then work,
but since there is no use of such a variable there is no point
of declaring it.

There is also no use of the 'Known' type itself and an anonymous
enum would work as well.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:32:19 +02:00
Lubomir I. Ivanov
9f7c26cb38 locationinformation.cpp: fix unused variable
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:23:25 +02:00
Lubomir I. Ivanov
43ebfec1ff btdeviceselectiondialog.cpp: fix unused variable
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:22:41 +02:00
Dirk Hohndel
9edb4f3fa9 Move ImageDownloader out of the desktop widgets
This required a bit more untangling, but with this it seems we can build
subsurface-mobile again (at least on the desktop).

Interesting is the removal from inside the ImageDownloader of the call to
DivePictureModel::instance()->updateDivePictures() - which actually could
cause some interesting recursion issues. If it turns out we did indeed
need this, it needs to be re-architected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 11:30:11 -08:00
Lubomir I. Ivanov
8e7be1b50a Untangle DiveCalculatedCeiling from MainWindow
DiveCalculatedCeiling is the last class the references
MainWindow in the profile-widget stack.

In modelDataChanged() it looks for the information()
widget and sets a slot for the dateTimeChanged() signal that
information() emits.

To solve the issue we make DiveCalculatedCeiling recieve
a ProfileWidget2 reference and make ProfileWidget2 emit
the dateTimeChangedItems() signal.

ProfileWidget2 itself listens for the dateTimeChanged()
signal that information() emits and emits dateTimeChangedItems()
to notify any possible children/item listeners in the
ProfileWidget2::dateTimeChanged() slot.

The connection between ProfileWidget2 and information()
is set in MainWindow. This makes DiveCalculatedCeiling
unaware of MainWindow and which class originally emits
the dateTimeChanged() signal to ProfileWidget2.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
--
Think delegation.

Tomaz, please take a look at this one, to double check
if i messed up.

also i have zero idea how the mobile app is setting these
connections, if it does so even.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 09:58:34 -08:00
Dirk Hohndel
1013ba39c5 Untangle Profile from MainWindow: shortcuts
This, too, should be done with signals.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 13:45:50 -08:00
Dirk Hohndel
081295cb40 Untangle Profile from MainWindow: files on command line
There's no reason why this should be on the MainWindow widget.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 13:45:50 -08:00
Rex Dieter
fcf47552c6 Use target_link_libraries for Grantlee
This allows for finding headers when not in /usr/include (like
parallel-installable distribution-packaged grantlee5)

Signed-off-by: Rex Dieter <rdieter@fedoraproject.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 13:45:50 -08:00
Tomaz Canabrava
4491711e09 Re-add the signal connections
The signal connections from the old preferences got lost when
we moved to the new ones because Designer is broken and can't
handle signals / connactions from copy/pasted content.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-04 17:24:31 -08:00
Lubomir I. Ivanov
5002fa4887 PreferencesDialog.cpp: store 'default_directory' in QSettings
This is needed only on Windows, so that the uninstaller knows
which directory to delete.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 09:04:23 -08:00
Guido Lerch
fb24210ad9 Context menu for images: add loading from file / web
Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:31:41 -08:00
Guido Lerch
b73b312673 Context menu for images: enable multi selection
Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:31:41 -08:00
Guido Lerch
951e3d920b Context menu for images: support deletion
Adding modified code to support deletion of selected images as
well as deleting of all images (with warning messagebox)

Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:31:41 -08:00
Guido Lerch
eb6d5415c1 Context menu for images: remove obsolete code
Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:31:41 -08:00
Guido Lerch
3c3523f9b8 Context menu for images
Just add a context menu for now - the following commits will make this
useful.

Signed-off-by: Guido Lerch <guido.lerch@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-03 08:31:04 -08:00
Dirk Hohndel
df7818a9b8 Preferences: make apply work
We didn't respond at all to that button. Also, the language settings
didn't propagate without this explicit call.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:53:47 -08:00
Tomaz Canabrava
9f93b9a934 Preferences: Call LoadPreferences from whitin the new dialog
When I removed the old preferences dialog, I forgot to load them
again. The code is in the wrong place: it should be on every and
each preferences dialog (or on the main preferences)

Beware if you used this wip code before, I may have destroyed
your preferences.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:53:18 -08:00
Tomaz Canabrava
a48e6241dc Forgot to set the static variable static
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:53:10 -08:00
Tomaz Canabrava
bf12c3533c Preferences: Use apply instead of reset to defaults
Change the Reset to Defaults button to Apply in the preferences dialog.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:52:30 -08:00
Tomaz Canabrava
ff57881265 Preferences: Remove the old dialog and use the new one
The new preferences dialog still needs a bit of fine tuning
but should already work.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:52:15 -08:00
Dirk Hohndel
8a3fb854c2 Preferences: hook up the UI page with the preferences structure
With this the new date and time formats mostly work

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:51:31 -08:00
Dirk Hohndel
f85883c707 Create date and time formats preferences
Now we can actually change them in preferences instead of just deriving
them from the language set.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:51:31 -08:00
Dirk Hohndel
222ce62bce Preferences: add date and time format to language page
Not hooked up, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02 12:51:31 -08:00
Dirk Hohndel
9eed778c68 Preferences: switch language preference to be a dropdown
The list widget takes too much space and isn't really any better. The
dropdown plus fliter is actually rather neat.

Also added back the connections so the dropdown and filter get disabled
when system default is selected (just as it was in the old preferences
dialog).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 13:14:06 -07:00
Tomaz Canabrava
8dad3457ef Make the skeleton Facebook plugin and make sure it is loaded
Currently we need to copy manually the plugin dynamic library
to the /plugins folder.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:52 -07:00
Tomaz Canabrava
391172240a Facebook plugin skeleton
Just to see if a plugin will compile.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:52 -07:00
Tomaz Canabrava
d3a8288ad5 Populate the MainMenu with social network actions
The magic happens here: We are iterating over the plugins
and populating the main menu with all actions provided by
them. Currently we can't test this as we don't have a single
plugin. Next patch series of commits will be adding the
Facebook plugin.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:52 -07:00
Tomaz Canabrava
9d1117cd6c Constify, Referencify
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:52 -07:00
Tomaz Canabrava
628eb76af4 It's safe to delete a Null Pointer
So don't check it with an if.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:51 -07:00
Tomaz Canabrava
c1b2907071 Fix warnings
Also, disable Facebook temporarely since I'm removing the preferences
widget in a few commits. Facebook will have to change to use a new
way of connection that I'm still creating.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:51 -07:00
Tomaz Canabrava
f682a2e6ac Remove reference to non-existing signal
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:51 -07:00
Tomaz Canabrava
8a54a46779 Preferences: random fixes
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:51 -07:00
Tomaz Canabrava
d9595ad266 Preferences: move network preferences to the new dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:51 -07:00
Tomaz Canabrava
cfecd1a9ab Preferences: move graph preferences to the new dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
57d7b59bdc Preferences: move units to the new dialog
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
c53615315e Code cleanup
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
1d2d046c0f Preferences: Port the default preferences to the new system
Simple port of the default preferences to the new preferences structure.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
7cd9e2b7bb Make icons work again
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
8cdae5ce24 Code cleanup
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
315641b0b4 Preferences: add GeoReference
Straigth port from the old version.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
5461eadd1b Preferences: start with all settings set
Load all settings as soon as we start the preferences.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
c06813317f Preferences: hook up the missing parts for the language prefs ui
And this actually made me find one memory leak on the old version:
We are constantly creating / leaking a new QSortFilterProxyModel
everytime a sync() is done on the settings. That's not a lot, maybe
once per time a user changes its settings... but it's still a leak.

And the code is more sanely separated this time. yey.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
c0d16267af Preferences: Apply / Cancel / Defaults
All functions that should control the preferences are
created.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:50 -07:00
Tomaz Canabrava
b7daffbf08 Preferences: Hook up the dialog buttons and make it work
Since I'm using a dialog created by hand, I also need to
hook things by hand. the code is very simple - debug output
kept in just to make sure things are indeed working.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
b7a476169d Preferecnes: add the initial skeleton
This Preferences dialog should be visually similar to the
old one - the main difference is how it acts on the preferences.
It's also not based on .ui files since it's a very simple widget
I prefered to mount it by hand - no more than 6 lines of c++ code.

Right now we have only one preference page on this, and nothing
is hoocked up.

I've also changed mainwindow a bit to only show this dialog for
testing purposes.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
255325e219 Preferences: add a new page for language
This is not hooked into anything - It's the bare minimum that I
need to continue creating the new preferences dialog. But take a
look at it... very simple. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
b35ccc3a35 Preferences: start to port preferences to a more sane design
Our preferences dialog right now is a rather huge dialog
with more than 9 subpages, and all of those pages are programmed
inside of the same class, same methods and all that - which means
that if I change something on the dialog I can break any
other thing quite easily.

The idea of this patch series is to make it harder to break
user settings and the settings dialog.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
1d6683f3e0 Move Profile widget out of desktop-widgets
The reason for that is, even if profile widget is made with qpainter
and for that reason it should be a desktop widget, it's being used
on the mobile version because of a lack of QML plotting library that
is fast and reliable.

We discovered that it was faster just to encapsulate our Profile in
a QML class and call it directly.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00
Tomaz Canabrava
e49d6213ad Move qt-ui to desktop-widgets
Since we have now destkop and mobile versions, 'qt-ui' was a very
poor name choice for a folder that contains only destkop-enabled
widgets.

Also, move the graphicsview-common.h/cpp to subsurface-core because
it doesn't depend on qgraphicsview, it merely implements all the
colors that we use throughout Subsurface, and we will use colors on both
desktop and mobile versions

Same thing applies for metrics.h/cpp

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30 10:36:49 -07:00