Commit graph

270 commits

Author SHA1 Message Date
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
3ebbf6bc5d QML-UI: find the include files
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-05 07:59:09 -08:00
Sebastian Kügler
38e1dc1589 QML-UI: Layout improvements in app list and details header
- fix spacing and sizing in TopBar
- use an anchor layout for the delegate and split out labels and values: this
  allows more uniform alignment
- add the subsurface mobile icon to the first page
- various visual touch-ups to taste

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:59 -07:00
Sebastian Kügler
ac6b267d40 QML-UI: gridUnit is now dpi-corrected
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:54 -07:00
Sebastian Kügler
5195fcf919 QML-UI: improve list painting
- section headers get underline with a thick line
- items are separated by spacing and a thin grey line at the bottom
- spacing on both sides, aligning with header

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:51 -07:00
Sebastian Kügler
0ed2584231 QML-UI: be less chatty
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:48 -07:00
Sebastian Kügler
77fa4e37c8 QML-UI: add more properties to Units and Theme
- colors for accentuation (background and text)
- text color to paint on highlights
- units.spacing (derived from gridUnit, so it's dpi-corrected)
- port main.qml, especially the application header to this theming and
  sizing

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:42 -07:00
Sebastian Kügler
431b5e07fe QML-UI: basics for theming and hi-dpi support
- Theme: For theming, we're just defining some colors centrally for now
- Units: This object provides dpi-corrected sizing in the form of
  gridUnit. The idea is to base gridUnit on the rendered font size, so
  the ui scales with text size. As this interpolates font size and dpi,
  the sizing is rather responsive.

These are the basics, now we can kill lots of hardcoded pixel values.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-09 12:51:36 -07:00
Grace Karanja
56771159a8 QML UI: Show log correctly
Correctly show the log messages. The log window will display all
messages emitted by the QML Manager class.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
cd28082c39 QML UI: Fix error when closing the log window
When closing the log window, do not try to save the changes. This
should only be done when closing the DiveDetails.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
89c7e4cd67 QML UI: Show message when loading dives
Show a message at the start of fetching dives, so that the user knows
whats going on.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
9e53b3082c QML UI: Add ViewLog menu
Add a menu entry to show the application log.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
ee13c5c282 QML UI: Add QML Log viewer
Add the ability to preview the application log in QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
ab7db605e5 QML UI: Move top bar to its own file
Move the QML top panel to its own file, so that it can be used in
other files.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:49:09 -07:00
Grace Karanja
5a7dbf0225 QML UI: Use AddDive instead of clear dive
No need to clear the dives when adding a new one.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:15 -07:00
Grace Karanja
a734a2ee19 QML UI: Dynamically change button text
Dynamically change the text of the show/hide profile button.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:15 -07:00
Grace Karanja
3d5ad19888 QML UI: Add button to hide dive profile
Allow toggling of dive profile visibility

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:15 -07:00
Grace Karanja
1925b3d012 QML UI: Remove clearDetails() function in DiveList.qml
This function is not needed, as we will move all of the logic to
C++.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:14 -07:00
Grace Karanja
a3bdf49b84 QML UI: Clear divelist model before starting new dive
When user clicks on AddDive, we should clear the model.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:14 -07:00
Grace Karanja
8d03d26480 QML UI: Start Add Dive feature
Start working on the add dive feature, to enable the user add a
new dive using the mobile UI.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-08-31 15:24:14 -07:00
Joakim Bygdell
fc746c2129 QML UI: move back button back to the left and center text
The top bars on the main page and dive details should be the same height
and keep the same layout.

[Dirk Hohndel: refactored Joakim's patch to work on top of what was
               already in master]

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-30 10:13:25 -07:00
Joakim Bygdell
59a18ab000 QML UI: make the top bars look the same
The top bars on the main page and dive details should be the dame height
and keep the same layout.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-30 06:14:53 -07:00
Joakim Bygdell
10e531d907 QML UI: dynamic button sizes
Butons are sized based in the text printed on them,
we want our buttons to have a meaningful minimum size and a
preferred size that is similar regardless of screen resolution.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-30 06:14:34 -07:00
Grace Karanja
d337def212 QML UI: Fix incorrect sizing of dive profile
This resizes the dive profile to always maintain an equal width and
height, so that the sizing is the same in all devices.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-29 15:21:06 -07:00
Dirk Hohndel
4b29cc21fb QML UI: show dive number and date in the detail view
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 12:26:51 -07:00
Dirk Hohndel
16c6ff0089 QML UI: consistent title and attempt of back button for dive details
The back arrow looks terrible. I'm not clear on how this is supposed to be
implemented.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 09:55:18 -07:00
Dirk Hohndel
32e5a8d29a QML UI: if the cloud credentials are set, open the dive list
There's no point opening to an empty screen and asking the user to do this
via the menu.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 09:15:04 -07:00
Dirk Hohndel
975ca2e56a QML UI: prevent crash when trying to set message without window
If we try to set up a message before the window has been instantiated we
should ignore the message, not crash.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 09:14:06 -07:00
Robert C. Helling
0ca42ea4a4 Adjusted spacing
and a typo in comment

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27 06:30:08 -07:00
Joakim Bygdell
3d5232a622 QML UI: add style to the menu button
Add some style to the menu button so that it fits the theme.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:53 -07:00
Joakim Bygdell
7be21b1d41 QML UI: add Subsurface mobile to top of app
We have space over so lets add the name to the top.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:50 -07:00
Joakim Bygdell
64601672a8 QML UI: make the app blue
White is boring, so lets change the color of the android app to
a more pleasing subsurface blue.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:47 -07:00
Joakim Bygdell
f1f13ed407 QML UI: create menu to house the buttons
Runing the android version on a phone the screen must be tilted
sideways to accommodate all buttons.
This creates a single button that triggers a popup menu that houses the buttons.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26 06:19:43 -07:00
Grace Karanja
ea574b6b11 QML UI: Show profile on Android
This is a better way for showing the profile. The show() and hide()
statements are replaced by a QTransform statement.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-25 19:39:05 +03:00
Dirk Hohndel
a05e37188b QML UI: make sure the dive list is empty before loading dives
When testing subsurface-mobile on the desktop from an account that had a
default file set up in the Subsurface preferences that file would already
be loaded creating rather confusing output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24 13:18:30 -07:00
Grace Karanja
e93bb9230f QML UI: Add download from divecomputer window
Add a window to be used when downloading from dive computers.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-23 14:46:52 +03:00
Grace Karanja
ab44c78993 QML UI: Move DiveDetails to the StackView
Add a DiveDetails.qml to hold the dive details, and display it in
the stack view when the user taps on a dive.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-22 09:53:19 +03:00
Grace Karanja
ea11eff279 QML UI: Implement saving of cloud password
If the user ticks the 'Save Password' box, then we save the password
for future use.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-22 09:53:19 +03:00
Grace Karanja
0c9756c5d7 QML UI: Implement showing of the dive profile on QML
Link the QMLProfile class to the DiveList.qml file. The profile is
displayed above the dive details.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-17 12:00:38 -07:00
Grace Karanja
59232ca172 QML UI: Add QMLProfile class
Add a C++ class to render the dive profile. The rendered image is then
passed on to QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 12:00:29 -07:00
Grace Karanja
df1a1f7034 QML UI: Implement saving of dives
This implements saving of some dive details to the cloud service. When the
user closes an open dives, any changed details will be cached, and when they
click on the 'Save Changes' button is pressed, the changes will be saved to
the cloud.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-17 19:12:39 +03:00
Dirk Hohndel
15de7f0b71 QML UI: implement a message area to show information to the user
This is just a quick first stab to do this, but it at least allows us to
share some information with the user.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 17:39:13 -07:00
Dirk Hohndel
16759715e6 QML UI: explicitly reference the button for size
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 17:38:01 -07:00
Dirk Hohndel
4491c91b93 Whitespace cleanup
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 17:36:49 -07:00
Dirk Hohndel
164cafe5d3 QML UI: use stackView to show sub windows
QML on Android doesn't support multiple windows, so dialogs that work on
the desktop are not a good solution on Android. A much more natural way to
present sub windows is a stackView.

In order to do this Preferences needs to be an item and the structure of
the ApplicationWindow needs to change a bit.

This also removes the hard coded sizes and instead tries to design this in
a resolution independent manner.

The diff appears larger than the actual change because of an increase of
indentation for the ApplicationWindow content.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 10:59:33 -07:00
Dirk Hohndel
57e9784d27 QML UI: improve preferences layout
And make it resolution independent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 10:55:45 -07:00
Dirk Hohndel
ac074bf239 QML UI: start making things resolution independent
Don't hard code sizes as devices tend to have much higher pixel density
than desktop computers. Instead make sizes relative to the content.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 10:52:44 -07:00
Dirk Hohndel
4088f9f652 QML UI: set window size on desktop devices
On Android the app figures out the size by itself.

Also change the name to match our naming scheme (Subsurface mobile for the
QML UI).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-12 10:52:15 -07:00
Grace Karanja
ebcf3e67c5 QML UI: whitespace fix
Fix some whitespace issues in the QMLManager and DiveListModel
classes.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:04:18 -07:00
Grace Karanja
c4fda447fd QML UI: show dive details in TextBoxes
Show the dive details in editable text boxes. This will make it easier
for the user to edit the displayed information.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:04:06 -07:00
Grace Karanja
bdf87ff60e QML UI: move the dive list to a separate file
Move the dive list qml code to a separate file for easier management.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:04:01 -07:00
Grace Karanja
866d67c5e7 QML UI: Load dives from cloud
Load dives from the Subsurface cloud service using the user's saved
credentials. This will display the dives in the same way as loading
them from a local file.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:03:56 -07:00
Grace Karanja
f01ec470e7 QML UI: add button to show the preferences window
Add a button in the main qml file to show the preferences window. This
window is linked to the QMLManager class, so any changes made will be
saved to the user's settings file.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:03:43 -07:00
Grace Karanja
956336ae1a QML UI: add QML Preferences Dialog
This will allow the user to edit and save their Subsurface cloud
credentials.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:03:36 -07:00
Grace Karanja
5791f580df QML UI: add cloud credential fields to the QMLManager class
These fields will be used by the QML Ui to save/retrieve the user's
cloud credentials.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
2015-07-10 06:03:20 -07:00
Grace Karanja
4e9128f847 Display more details
Show more dive info in the extended view of the dive.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:29:14 -07:00
Grace Karanja
e4e6e896c1 Fix bug where dives are shown twice
On the QML page, dives are repeated. Adding process_dives to
QMLManager after calling parse_file solves this.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:28:49 -07:00
Grace Karanja
ee9452ae8a Group dives by trips
Group dives according to the allocated dive trips.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:28:39 -07:00
Grace Karanja
f0c7779753 Show dive details when a dive is clicked
When a dive is clicked, show the dive details on the QML page.
This contains basic details, and will be expanded further.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:28:28 -07:00
Grace Karanja
f21d3d558e Add TextButton.qml file
This file contains a styled button for use in QML

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:28:17 -07:00
Grace Karanja
4c40908954 Group dives by location
Group dives on the QML page by location.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:27:47 -07:00
Grace Karanja
28ab1f6413 Better theme for dive list view
Set a rounded blue rectangle on the selected item.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:27:39 -07:00
Grace Karanja
b7e4b35cde Add DiveListModel
This model will be used to show the dives in QML. This commit adds
the model, and the means to link it to QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:26:56 -07:00
Grace Karanja
315a245868 Link QMLManager to the main.qml file
Add a link between the C++ and QML parts of the app using the
qmlRegisterType function.

[Dirk Hohndel: changed the name to org.subsurfacedivelog.mobile]

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:24:25 -07:00
Grace Karanja
59be048549 Add QMLManager class
Add a QMLManager class. This class will be used as a link between
the C++ and QML aspects of the mobile application.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:19:42 -07:00
Grace Karanja
6ba5b45c00 Add FileOpen dialog to QML
Add a dialog to select dive files in the QML interface, and also
add a menu entry to open the dialog.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:19:06 -07:00
Grace Karanja
e2c1d24d02 Add a menu to main.qml
Add a menu with an Exit submenu in the main.qml file. This closes
the application when clicked.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:17:14 -07:00
Grace Karanja
424cf6ca57 Add resource file to hold QML files
Add a resource file to hold any QML files that will be used in the
mobile port.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:16:33 -07:00
Grace Karanja
4e426e3a12 Create empty qt-mobile directory
Create a qt-mobile directory, with a blank main.qml file. This file
will be built up-on to come up with a usable mobile interface.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-20 14:16:12 -07:00