summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
AgeCommit message (Collapse)Author
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-11Undo: make diverse trip-related operations undo-ableGravatar Berthold Stoeger
AddDivesToTrip, CreateTrip, AutogroupDives, RemoveAutogenTrips and MergeTrips basically all did the same thing as RemoveDivesFromTrip, which was already implemented. Thus, factor our the common functionality and hook it up to make all these functions undo-able. Don't do the autogroup-call everytime the dive-list is rebuilt (that would create innumberable undo-actions), but only on dive-load / import or if expressly asked by the user [by switching the autogroup flag]. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-10QML UI: disable rescan when no bluetoothGravatar Jan Mulder
This is cosmetic only. It make no sense to selected rescan when Bluetooth is off. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-10QML UI: do not try to download from DC with empty vendor/productGravatar Jan Mulder
Disable the Download button when one of the fields vendor, product, connection is not filled in. The app will crash when trying. In addition, make the underlying core code to actual download more safe by checking this, and silently fail instead of crash. And, yes, this is a double fix in this scenario, but the core code is used in more places, so better safe than sorry. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-09Mobile/DC download: reset the "Download" buttonGravatar Jocke
When changing to another DC, reset the "Download" button text. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-09Mobile/rememberDCs: remove duplicated codeGravatar Jocke
The code to disable a quick button has moved to the DC matching logic, in order to inactivate the correct button also for USB DCs. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-09Mobile/rememberDC: update matching logicGravatar Jocke
Update the matching logic to account for known and unknown BT DCs. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
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-09Mobile: mark divelist changed on no-cloud to cloud accountGravatar Jan Mulder
This simple one-liner fixes an actual bug. On switching from a no-cloud account to a actual cloud account, the dives from the no-cloud are added to the actual cloud account. And indeed the dives appear correctly. However, when exiting the app right away, these added dives are not commited to the local storage. Simply, the divelist needs to be marked dirty. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI: set proper active background color for downloaded divesGravatar Jan Mulder
And another simple one. Make the active background of the dowloaded dives follow the theme. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI, trivial: set proper background color GPS listGravatar Jan Mulder
The background color was plain white, where we use a slightly different color in other places. In addition, the background when clicking on a row did not follow the theme setting. Consistency fix. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI, consistency: add text attribute for all actionsGravatar Jan Mulder
Something I only see on mobile-on-desktop, so at this point in time not very relevant to the device apps. When hovering on the action button, a toast message shows a hint box. These where empty in some cases. So, just give the actions a text attribute where it was missing. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-07QML UI, cleanup: remove usesless ItemGravatar Jan Mulder
Trivial cleanup. A QML Item is intendend for visual items, so embedding a timer in it is plain useless. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-06Import: pass "downloaded" parameter to process_imported_dives()Gravatar Berthold Stoeger
process_imported_dives() is more efficient for downloaded than for imported (from a file) dives, because it checks only the divecomputer of the first dive. This condition is checked via the "downloaded" flag of the first dive. Instead, pass an argument to process_imported_dives(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-06Core: remove preexisting field from struct dive_tableGravatar Berthold Stoeger
Dives are now in all cases imported via distinct dive_tables. Therefore the "preexisting" marker is useless. Remove. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-02Mobile: simpify startup logicGravatar Jan Mulder
When starting the mobile app, I noticed a short display of an empty page with title "Cloud creditials" just before showing the divelist. Simply a not nice visual effect. This commit simplifies some logic and resolves this. As the code in this part is fragile, this is tested for normal and clean startup of the app, switching credentials, from no cloud to valid account (which even nicely imports the no cloud dives: this surprised me as I have never seen this working). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-02Mobile: remove all related data when forgetting DCsGravatar Jocke
We need to delete all related data when forgetting dive computers or we will have an issue if we connect a DC from the same vendor but of a different model. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-10-01Mobile download from DC: improve selection logicGravatar Jocke
Improve the logic when auto selecting a DC for download. Some USB cables only supply vendor information but we can select the correct model if we have downloaded from it before. For BT/BLE our discovery process adds the device name to the address, so we need to keep that in mind when we try to match against what we seen before. When we have a positive match for a DC we have seen before we deactivate the corresponding button of our saved DCs. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
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-10-01QML UI: clip divedetails ListviewGravatar Jan Mulder
A technically trival commit, but one with long story. This commit basically reverts dd1d90b5295b146e (1.5 year ago). While upgrading Kirigami after Kirigami commit 26b8bdea24c39, we suddenly have overlapping divelist and details pages in case they are both on the pageStack (this occurrs when navigating from divedetails to the divelist using breadcrumb navigation). At this point, its not clear (to me) if this the by design of Kirigami, or an unintended effect of the mentioned Kirigami commit. This all said. Simply clipping resolves our issue of overlapping pages, and it does not harm. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-10-01QML UI: trivial resize of dateboxGravatar Jan Mulder
Something that I simply overlooked earlier with respect to scaling the divelist. The trip databox did scale a bit, but it was not nicely related to the hight of the trip header. So there was a tiny overflow on the small scale on a small device. Fixed here. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-30QML UI: correct trip separator lineGravatar Jan Mulder
Partially cosmetic and partially a bug fix. 1) the seperator line between trips and dives that are not in a trip was drawn in the background color => the line was invisible. 2) When looking very closely, there was a 1-2 pixel wide error between the seperator line between trips and dives that are not in a trip. 3) there was a comment that the trip separator needed to be extra thick. IMHO, this looks ugly, and is superfluous as there is a nice sidebar along the dives that belong to the trip. Finally, the line shall not be displayed when not in a trip. So, basically, the line (the QML rectangle) is completely rewritten, to take care of all issues. There is 1 hack: the line color is taken from the dive separator line. But its fully unclear to me where that color is defined in Qt/QML or Kirigami, so I hardcoded the proper color. That just works. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-30QML UI: center delete from divelist buttonGravatar Jan Mulder
A small cosmetic change. The delete from divelist button was "glued" to the top of the line. Not nice, so just center it vertically, and make the button a tiny bit smaller, so that it fits nicely on the line. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-30QML UI, cleanup: no reason for 2 overlapping mouseareasGravatar Jan Mulder
Fully usure why the code was as it was. The trip header had 2 overlapping mouse areas, to expand the trip and vise versa. Simply remove the smallest one. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-30QML UI, cleanup: do not use iconSizes for unrelated sizingGravatar Jan Mulder
A very unimportant change, but found when looking through the code for places where size of icons where used. The one changed here has nothing to do with icon related placement of a string, so its replaced by a way more logical placement of the affected string. Simply center the "no dives in the dive list" for an empty logbook on the screen, instead of at some random place in the upper left corner. Like I said: very unimportant, but it just looks nicer in the UI. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-29Mobile: don't call clear_dive() on deleteDiveGravatar Berthold Stoeger
clear_dive() will be called anyway in the subsequent call to copy_dive(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
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-26mobile, QML UI: whitespace in dive details pageGravatar Jan Mulder
There was a strange big margin at the top of the the dive details page. Just make it a bit more "normal". Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-26mobile, QML UI: margings and paddings in download screenGravatar Jan Mulder
There was a significant of not needed whitespace on the download from DC page. Most importantly, the bottom buttons where not on the bottom, so we had to truncate the downloaded dives early (to prevent overflowing the buttons). Further, a tiny bit of padding is removed between the 3 top pull down items. All this, results in the diplay of more dives without scrolling. For example, previously, only 1 dive (with 1 stored DC) was shown on my 5.5" device, and now 3 (scale: regular). Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-26mobile, QML UI: make SsrfCheckBox resizableGravatar Jan Mulder
Changed some hard coded size and positioning of the SsrfCheckBox, in such a way that is scales nicely to the current setting of the mobile_scale. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-26mobile, QML UI: fix overlapping buttonGravatar Jan Mulder
The select buttons in the downloaded dives delegate overlapped the dive data. Simple margin change fixes this. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-26mobile, QML UI: ssrfButton and download controls resizableGravatar Jan Mulder
Make the ssrfButton and the pull down menu's on the download page resizable. Notice that also the contents of the pulldown menu's is scaled based on the font size. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25Mobile: use editText instead of currentText in Suit and DiveMaster boxesGravatar Berthold Stoeger
A user reported problems with editing the Suit and DiveMaster fields. Apparently, editing does not change the currentText. Without doing a deeper analysis, simply use editText (a more proper fix might be changing the currentIndex on editing). (Parially?) fixes #1694 Reported-by: Mark Powell <mcpowell123@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-25mobile, QML: correct font scaling of the divelistGravatar Jan Mulder
Changing the scale, it seems that the header of trips is not rescaled. The reason for this is simple. That string does not use our manipulated font but a different one. In fact, this is the only ocurrence on the divelist that did not scale. However, other screens hardly rescaled at all. All these will be fixed in seperate commits. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25mobile, QML: scale font from the buttonsGravatar Jan Mulder
After the work in the previous commit, it gets very simple to implement font scaling. Just assign a the new desired font scale to the used font metrics. The QML engine does all the work. 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-25mobile, QML: do not user a local font metric objectGravatar Jan Mulder
This theme test display created a new local FontMetrics object, that does not per definition correspond with the "global" font metric as defined in main.qml. The fix is simple. Display the font theme data based on the one and only font metric from main.qml Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-25QML UI: add settings for scale factorGravatar Dirk Hohndel
The visual feels backwards as the selected one is grayed out... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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-25Mobile/download DC: disable selected DC buttonGravatar Jocke
Disable the button for the currently selected DC. This gives an extra visual hint of which DC is currently selected. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25Mobile/settings: clear all of qPrefDiveComputer.vendorGravatar Jocke
To prevent stale data in the download DC path we need to clear the entire qPrefDiveComputer.vendor() object when the user purges the used DCs. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25Mobile/Settings: Disable unusable optionGravatar Jocke
Disable the "Forget DCs" button when there is no DCs saved. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25Mobile/download DC: simplify startupGravatar Jocke
Since we now store the last used DCs in out preferences we can use the information to pre-populate the DC selector. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25Mobile/downloadDC: always start with empty indexGravatar Jocke
To prevent stale data being visible always set the combobox indexes to -1 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-25Mobile: let Flow object use all of the parent widthGravatar Jocke
There is no point in further restricting the width of the Flow object. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-09-23Core: split process_dives() in post-import and post-load versionsGravatar Berthold Stoeger
process_dives() is used to post-process the dive table after loading or importing. The first parameter states whether this was after load or import. Especially in the light of undo, load and import are fundamentally different things. Notably, that latter should be undo-able, whereas the former is not. Therefore, as a first step to make import undo-able, split the function in two versions and remove the first parameter. It turns out the the load-version is very light. It only sets the DC nicknames and sorts the dive-table. There seems to be no reason to merge dives. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-23Mobile/remember DCs: try to match device namesGravatar Dirk Hohndel
We only store the address part of the connection name, so don't try to find an exact match, try to find the sub-string. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-23Mobile/settings: add button to forget remembered dive computersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>