Commit graph

9662 commits

Author SHA1 Message Date
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
Lubomir I. Ivanov
c6baeb8142 desktop-main.cpp: fix unused 'application' variable
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2015-11-07 22:19:20 +02:00
Dirk Hohndel
dab207a8c8 Subsurface-mobile: load preferences after org is set up
The persistent storage of the preferences includes the Organization name
set in the application. So we need to make sure we load the preferences
AFTER setting up the Organization in the init_ui() call.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 11:25:12 -08:00
Dirk Hohndel
aaac2cbe9c Android: go back to using Qt's DataLocation
It appears that the default path we tried to use on Android since commit
80056278f7 ("android.cpp: update path retriaval scheme") didn't work -
so let's just go back to what we used to do as that was perfectly fine.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 10:52:19 -08:00
Dirk Hohndel
787b12cff4 Remove unnecessary call from tests
Now that the WindowTitleUpdater is fixed we don't need to create an
instance in the tests, either.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:56:41 -08:00
Dirk Hohndel
878c05afed Don't crash if we have no WindowTitleUpdater registered
Subsurface-mobile doesn't have a window title with the name of our file
name at this point, so simply don't try to trigger the update.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:53:17 -08:00
Dirk Hohndel
61e36124e4 Subsurface-mobile: make sure we load the preferences
Otherwise all kinds of things don't work right.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:51:01 -08:00
Sebastian Kügler
a0a3bf8870 Improve labels in login dialog
We want short labels here in order to allow more horizontal space to be
taken by the inputs.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:04:35 -08:00
Sebastian Kügler
ff82d1cc15 Improve TopBar and login window layout
This provides a bit more spacing around the logo and aligns the text to
the bottom of the logo, rather than to its horizontal center. Looks
cleaner.

Text in the login page is now aligned towards the inputs, giving a
closer connection between label and widget.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:04:22 -08:00
Sebastian Kügler
09b7ebf28b tighter margins on start page
We use units.largeSpacing margins for page-level spacing.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:04:10 -08:00
Sebastian Kügler
2b70b76133 Rejig navigation
This change streamlines the navigation across the pages to be in line
with the stackview organization. The top bar becomes a static element
with the title and a button that either opens the preferences or shows
the back arrow.

This makes it a bit more efficient, since we load the title bar only
one, and there are no strange animations in the title. The stackview
gets the role of content container, the "chrome" around it is laid out
in main.qml.

Most of the churn in this patch comes from moving large blocks of code
between files with different indentation levels.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:47 -08:00
Sebastian Kügler
0e26afbf0a Remove hard-coded size from label component
This isn't necessary anymore with the default font size fixed, remove
it. The label itself is still useful for coloring, and perhaps more
styling in the future.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:20 -08:00
Sebastian Kügler
cc032c9830 Clean up dead code in units
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:03:01 -08:00
Sebastian Kügler
6b886f0da2 Improve 1st start experience
This commit adds a start page that is shown when there are no dives in
the list, for example when the user first starts the app. Instead of a
large empty screen, we offer 3 ways for the user to get dives onto the
device: download from cloud storage, dive computer and adding dives
manually.

This fills in the empty space in the dive list, and isn't a top-level
item since it really just makes sure the user isn't greeted with a big
empty space, which looks pretty unpolished, but rather guided through
the first steps.

Needs aligning of the naming in the actions.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:02:48 -08:00
Sebastian Kügler
6dfac6a081 Improve layout of login dialog
- Add margins consistent with other pages
- Top-align the dialog, we want to keep the inputs as high as possible
  on the screen to prevent the on-screen-keyboard from covering them
- Add a checkbox to show the password, with input on mobile devices,
  this is a commonly found and useful feature
- Remove Cancel button, this is just navigation chrome, the user can
  simply use the back button in the top bar (will be fixed in a
  subsequent patch)

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:02:20 -08:00
Sebastian Kügler
aae4a326f4 organize qml files in subdirectories
This makes the organization of the qml files a bit more fine-grained, it
prevents mixing of .cpp and QML files, and also of what's compiled, and
what's included in the app as qrc data.

In particular:
- subsurface specific QML items go into the qml/ subdirectory
- theme and unit definitions to into qml/theme subdirectory (they
  already were located in a theme directory)
- generic components, such as our Label goes into qml/components

This facilitates sharing of functionality and identifying common stuff
better. Ideally, we can pull qml/theme and qml/components from a
standardized set at some point, so we don't have to maintain that code.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:00:59 -08:00
Sebastian Kügler
95ac4c4454 Fix indentation in qrc file
Tabs slippped in while the rest of the file uses spaces.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:00:30 -08:00
Sebastian Kügler
82f10380c9 Recognize Android as CMAKE_SYSTEM_NAME
This fixes the build for me against Qt 5.5. It seems Android is not
Linux anymore, but uses its own CMAKE_SYSTEM_NAME now, so in this case
we also want to compile android.cpp.

This change should be rather safe, since it catches a condition that was
not previously handled.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07 09:00:22 -08:00
Sebastian Kügler
10b68dad96 android build: remote -u flag from git pull
git pull -u isn't known on my systems (recent Debian and Ubuntu), so
better not use this flag.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:07:43 -08:00
Sebastian Kügler
b7e33eb8bb More info in ThemeTest
This makes problems with the default font more apparent

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:07:32 -08:00
Sebastian Kügler
7b320a7d34 Improve theme information panel
- add sizing information for fonts and fontmetrics
- compute devicePixelRatio from fontmetrics

This shows that Android doesn't give us accurate information about the
default font (hence the Text items being way too small) and a wrong
Screen.devicePixelRatio, which we can actually compute ourselves.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:06:03 -08:00
Sebastian Kügler
cdcb5c1603 Include label in the binary
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:05:56 -08:00
Sebastian Kügler
ffe44f9aaf new Label item
Add a Label that we can use for styled text until we figured out how to
set the default font size.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:05:52 -08:00
Sebastian Kügler
6d3a5e6bd4 Theme tweaks
- gridUnits is dynamic again, using FontMetrics now
- Add a page to display some sizing-relevant details, so we can debug
  dpi problems a bit better on Android

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:05:45 -08:00
Sebastian Kügler
9dc8f13a0a Replace units.spacing with units.smallSpacing
In line with the new Units API.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:04:47 -08:00
Sebastian Kügler
74586d7922 Add some compatibility extensions to theme and unit
- This allows us to use these new things without changing much in our
  own code, things now work again.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:04:36 -08:00
Sebastian Kügler
cbb8866b08 Add qmldir file
This will be needed at some point, so better put it in the right place
already, so we don't forget enabling the singleton usage once we've
fleshed out how that could work exactly.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:04:32 -08:00
Sebastian Kügler
5fb054a17c some changes from the upstream wip-branch
- remove the singleton usage, this will need a bit more magic in the
  background. Not a huge problem since we're only using one instance
  anyway, and the object itself is rather light
- hardcode gridUnit for now. I'd like to use TextMetrics or FontMetrics
  there directly, but I'm not sure we can depend on Qt 5.4 and QtQuick
  2.5.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 14:04:21 -08:00
Sebastian Kügler
c8227e200d more complete implementation of Plasma's Units
This is a currently work-in-progress attempt at making a minimal set of
Plasma components available.

The code needs a bunch of adjustments yet, which I'm making in tune with
upstream. The idea is to create a standardized sub-set of Plasma's QML
API for applications, which brings only minimal new dependencies (for
now: none).

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 13:50:01 -08:00
Dirk Hohndel
b76d3fa25f Better file names for Subsurface-mobile related sources
They aren't Android specific - they are for the QML UI mobile app which
should run on iOS as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 13:44:13 -08:00
Sebastian Kügler
ab66f6fc98 Use default font size on Android
This solves the root problem of most of the dpi-depdent sizing in the
mobile Android version.

When setting a custom font size, we circumvent Android's defaults, which
means that we end up setting the font size further down the road to get
readable fonts.

I suppose this was set in order to make the QWidget-based user interface
"work" on Android. Hard-coding a font size at this central point brings
more headache than needed, one could instead consider adding an #ifdef
Q_OS_ANDROID in main window.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 13:41:56 -08: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
Dirk Hohndel
bb566f7798 Don't connect to the PreferencesDialog in Subsurface-mobile
Just more untangling from the desktop UI.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 10:20:18 -08:00
Dirk Hohndel
7e5b66d2c4 Remove more unnecessary include file references
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 10:04:17 -08:00
Lubomir I. Ivanov
5d758524be profile.h: fix incomplete type
ruleritem.cpp throws an error about incomplete type
'struct gas_pressures'.

'struct gas_pressures' is defined in dive.h, so every header
that has usage of the type needs to include dive.h.

Such a header is profile.h which has 'struct gas_pressures pressures'
in 'struct plot_data', by including dive.h on top of profile.h
every source file (e.g. ruleritem.cpp) that includes profile.h will
now receive knowledge of a complete 'struct gas_pressures' type.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 09:59:00 -08:00
Lubomir I. Ivanov
788b3289e9 remove some mainwindow.h includes
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 09:58:46 -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
Lubomir I. Ivanov
61e768036e This patch reverts ae709ab30e
things like:

potentially, for every item interested in 'printMode'
can clutter the profile-widget stack a lot.

instead the items should be aware of the profile widget
instance and not MainWindow.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 09:58:17 -08:00
Lubomir I. Ivanov
6d7eefd52d Untagle DiveCartesianAxis from MainWindow
DiveCartesianAxis and derivatives can recieve
ProfileWidget2 as an instance in their constructor.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 09:58:08 -08:00
Wendie Fisher
81f1238ab9 Updates to the user manual
Small changes to the language to make it easier to read.

Signed-off-by: Wendie Fisher <wendie@divedad.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-06 09:52:30 -08:00
Dirk Hohndel
ae709ab30e Untangle profile from MainWindow: work around print mode
Since we don't support printing in subsurface-mobile this solves the
problem at hand - but it doesn't do what we really want which is to
untangle the Profile from the MainWindow.

Partial credit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 21:20:10 -08:00
Dirk Hohndel
3ef9e07380 Profile: include Qt headers directly
No reason to include mainwindow.h

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 17:05:30 -08:00
Dirk Hohndel
f3232b1a6f Profile: don't compile the desktop specific parts on mobile
When building subsurface-mobile we won't be using all these UI elements,
so let's not build them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 16:05:44 -08:00
Dirk Hohndel
662e2a0ff3 Profile: add define when building subsurface-mobile
This way we can conditionally compile out more dependencies on desktop
widgets.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 16:05:19 -08:00
Dirk Hohndel
332e484d68 Untangle Profile from MainTab
This one was easy.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 15:20:05 -08:00
Dirk Hohndel
06e65e4c02 Cmake: untangle subsurface and subsurface-mobile
In the cmake restructuring it seems that subsurface-mobile building got
completely messed up. With this subsurface-mobile still doesn't actually
build (still too many unfulfilled dependencies, but we're getting closer).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 15:06:10 -08:00