aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/main.qml
AgeCommit message (Collapse)Author
2019-12-03mobile-widgets/qml: integrate export page in main.qmlGravatar jan Iversen
Add export function to GlobalDrawer, allowing the user to export the divelog. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-11-11mobile-widget/qml: correct syntax error introduced in e63257f0eGravatar jan Iversen
default parameter values is not supported as this syntax was introduced in ECMA-262 6th edition while QML only implements the fifth edition (as of Qt 5.11). remove default parameter and check for undefined instead. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-11-10Mobile: add ability to directly open support emailGravatar Dirk Hohndel
This is even easier and more obvious than copying the logs on the About page and then manually creating an email and pasting those logs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08Mobile: reconnect the correct model after changing filterGravatar Dirk Hohndel
This caused a blank, unusable dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08Mobile: allow message argument to showBusy functionGravatar Dirk Hohndel
When called without arguments, no message is shown. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08Mobile: add UI feature tests to Developer menuGravatar Dirk Hohndel
Running Subsurface-mobile on iOS, the notification texts are sometimes very hard to read, and in some situations the busy indicator isn't showing up at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-03Mobile: disconnect model while updating dive listGravatar Dirk Hohndel
If the dive list is connected to the model while the model is updated with the downloaded dives, sometimes the UI hangs completely. Disconnecting the model and then reconnecting it does add a fairly noticeable delay on longer dive lists, so there are tradeoffs here. Of course the obvious solution is to make reconnecting the model faster... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-03Mobile: use appendTextToLog to get timestamps in logsGravatar Dirk Hohndel
This helps tremendously when tracking down some problems. We should never use console.log. In the process this also updates a couple of the messages to be clearer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-27Mobile: make the GPS service icon work againGravatar Dirk Hohndel
I don't recall when this stopped working. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: try harder to get the right dive listGravatar Dirk Hohndel
This should ensure that the dive list correctly repopulates after the model was updated. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: also show busy spinner when applying GPS fixesGravatar Dirk Hohndel
That's another function that can take a little while. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: change show/hide busy functionsGravatar Dirk Hohndel
The old code was ill named - this way the busy spinner itself becomes reusable with a reasonable set of function names. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: provide better tracking of applied GPS fixesGravatar Dirk Hohndel
Also reset the page stack to make sure we don't end up with stale data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: reset dive list after applying GPS fixesGravatar Dirk Hohndel
This way new fixes are actually shown when the user looks at the dive list after applying the GPS fixes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-26Mobile: don't push map page if it's already on the stackGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14Mobile: pick icons depending on themeGravatar Dirk Hohndel
QML has ways to style icons - and we use that for the main theme color, but it doesn't seem to work (anymore?) for the edit and save icons. Instead of tracking down what changed there, simply switch between icons with different foreground color, depending on theme. All the other icons seem to work well in all three themes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: bring back the adaptive size for the tool barGravatar Dirk Hohndel
When switching to the global tool bar this was lost, and then it turned out to be broken and required more patches to fix. Commented out because it doesn't work at all. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: ensure consistent path when accessing arrow iconsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: implement our own back entry for GlobalDrawerGravatar Dirk Hohndel
This way we'll get a working back icon on Android and also correct font size for the (translated) Back text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: move pageIndex function to main.qmlGravatar Dirk Hohndel
This way it can be more easily called from other pages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: use tri-state variable to improve the map hackGravatar Dirk Hohndel
QML enums are a bit painful to use, so this uses poor man's emums instead. Basically what this changes is that a forced switch to the map doesn't count as picking the map. That seems obviously correct, as otherwise you could end up in a situation where a legitimate switch away from the map is ignored. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: insane hack to make map page workGravatar Dirk Hohndel
This makes no sense and seems crazy. But it also seems to work, For some reason with the current Kirigami version and Qt 5.13.1 selecting the map page makes the pageStack jump back to the previous page right away. I cannot find what triggers this behavior. Since I cannot fix the root cause, I am working around the bug. When we select the map page we remember that fact and when a different page is picked with the mapPage being the last page on the stack, we force the page selection back to the map page. I can imagine countless ways in which this could go horribly wrong - but right now I can't figure out a better solution. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: keep existing page stack when showing mapGravatar Dirk Hohndel
There doesn't appear to be a reason to pop all of the existing pages from the stack. Just on principle, only close the drawer if it was open. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: need to recalculate column width when rotatingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: don't make sub-pages fill the parentGravatar Dirk Hohndel
This had very strange results with the current Kirigami. Instead set the width of those pages based on our overall column width. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: change handling of columns and column widthGravatar Dirk Hohndel
The old calculation was clearly bogus, we'd also get zero columns here. Instead do a correct calculation of the number of columns and make the resulting column width a property of the rootItem so we can refer to it elsewhere. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13Mobile: ApplicationHeader is now deprecatedGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-06Fix text in darkmode on mobile app.Gravatar Paul Buxton
Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
2019-10-02Mobile: don't allow width change without rotationGravatar Dirk Hohndel
We get incorrect changes to a new screen width that causes us to try draw to a much larger screen than we actually have. Ignore those changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: add more debugging output for screen width issueGravatar Dirk Hohndel
Somehow we need to be able to figure out which width information is correct. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: recalculate base units only for first real changeGravatar Dirk Hohndel
Different Android devices seem to have different patterns of throwing incorrect width information at us. This seems like a really bad hack, but for the ones I've seen so far this should give us the right width information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02Mobile: only print debug output if there's informationGravatar Dirk Hohndel
On many devices the Screen property doesn't give us a manufacturer, model, or name. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-21Mobile: dump the information QML has about the screenGravatar Dirk Hohndel
Maybe this will allow us to customize things for certain devices? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-21Mobile: recalculate gridUnit and font size if width changesGravatar Dirk Hohndel
This could happen when you rotate a mobile device, or when running Subsurface-mobile on the desktop. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-21Mobile: move gridUnit and font adjustment to functionGravatar Dirk Hohndel
This way we can call it in other situations when needed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-11Mobile: adjust grid unit on very narrow screensGravatar Dirk Hohndel
If the default font size is big enough to leave us fewer than 21 grid units per row, shrink the grid unit. In order for this to create consistent results, we need to reduce the default column width to 21 grid units as well. And with that change, the columnWidth property becomes obsolete. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-12-21Mobile: UI for selecting what to copy-pasteGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-10-23Mobile/filtering: make busy indicator smallerGravatar Dirk Hohndel
Suggested-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: implement the filter update through a threadGravatar Dirk Hohndel
It's important to disconnect the model from the ListView, otherwise the update in a different thread will fail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23QML UI: add busy indicator to the main windowGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-23Mobile/filtering: first attempt to filter on dive siteGravatar Jan Mulder
[Dirk Hohndel: this is the starting point of my following commits, I decided to leave it in place to give Jan credit for the work he did on figuring out some of the plumbing needed to get things to work] Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-10-12QML, cleanup: remove stackViewGravatar Jan Mulder
There is no reason (any more?) to have a property defined that basically renames the global pageStack into a local pageView. Just cleanup. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile: factor out syncToCloud [3/3]Gravatar Jan Mulder
After the previous commits, we now have a preference that nicely preserves the state of the UI, and we have the well known git_local_only global, that is used to denote whether we want to use to local repo only, or we want to interact with the online cloud as well. This commit gets rid of the now superfluous syncToCloud logic. Instead we simply set the git_local_only directly. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile: preserve auto download status [2/3]Gravatar Jan Mulder
Hook up the new preference to the UI. So now, an earlier choice if automatic or manual download to the cloud is preserved in between sessions. Strictly speaking this fixes issue 1725. Notice that there is also a higly related syncToCloud thing present. As factoring out that seemingly duplicate piece of code is non-trivial, this will be done in a seperate commit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile: no switch to auto cloud in no-cloud modeGravatar Jan Mulder
We disabled the drawer menu button to switch between auto/manual sync when in no cloud mode. Unfortunately, disabeling does not give a visual cue to the user (like greyed out). Instead, just make this button invisable in no cloud mode. In conjunction a question. The manual sync to cloud menu item takes you to the Cloud Credetials page in case pressed in no cloud mode. While valid, this seems strange. This is not changed in this commit. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-01Mobile QML UI: bump Kirigami imports to 2.4Gravatar Jan Mulder
Primarily for reasens of keeping up with upstream. And hopefully bugfixes and added functionality. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-27mobile, QML UI: Settings page scalabilityGravatar Jan Mulder
A relatively big change for such a simple page. Most relevant changes are: 1) Do not use Kirigami.Header anymore. It appears that this header has word wrapping on (and we cannot override that). This is annoying on this page, as headings seems randomly be split over 2 lines, even in cases where there is more than enhough room to display it on one line. And as the Kirigami.Header is just a trivial wrapper of a Text field, we can simple replace it. 2) A lot of the toplevel GridLayouts had width properties set. These are not needed (and confused my debugging code), so they are removed withput any visual change. As a general rule, do not try to set properties that are not needed. In general, it can only lead to binding loops or undefined behavior. 3) Add a font size to our Theme. The step from regular to title size was a little too big. 4) And, obviously, numerous font.pointSize lines are added to actually resize the font. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25mobile, QML: introduce basePointSize in subsurfaceThemeGravatar Jan Mulder
By manipulation the used font pointSize property, we can dynamically scale fonts and derived UI objects. At the same time, we have some logic to determine the default font, its size, etc, for example depending on screen properties. The scaling of the UI (and its font) does not need to interfere with those defaults. However, when we want to reset the pointSize, we alter the default, so a backup of the default is needed. Ok, not al full backup, as the only thing we like to manipulate is the pointSize, to which we want to be able to return. All this leads to this commit. A basePointSize property is added, that is initialized from the default. Due to the binding logic of the QML engine, it is not a classic initialization, but a binding between the 2 properties. We need to break that binding explicitly, so that the original PointSize is always preserved. In addition, a display of the new font property is added to the developers theme test. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25QML UI: ensure we use the correct default fontGravatar Dirk Hohndel
It seems the documentation is incorrect - unless you explicitly set the ApplicationWindow font to the the Application Font (just writing this down sounds so silly...), it doesn't actually work. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-12mobile-widgets: replace qmlprefs::theme with qPrefDisplay::themeGravatar jan Iversen
Shortcut and use qPrefDisplay::theme() direct Signed-off-by: Jan Iversen <jani@apache.org>