aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-03-31undo: autogenerate string get() and data() functions using a templateGravatar Berthold Stoeger
Do this in analogy to other types. However, here we have to convert from / to QString. We could do this in an even more general way by using two templat parameters: one for the Qt type, one for the core type and define conversion functions. However, let's not do this for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31undo: autogenerate trivial set() and data() functions by a templateGravatar Berthold Stoeger
Some dive-editing undo commands have trivial setter and getter functions: they simply read and write a struct dive member. Autogenerate these in a template to which we pass a pointer to member as template argument. For the invalid-flag we have to turn the edit command from int to bool, since that is how the flag is store in the dive struct. Sadly, quite a number of the setters do funky things and we cannot autogenerate them. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31undo: generate fieldId() virtual functions by templatesGravatar Berthold Stoeger
Most edit commands derive from a common base class EditBase, which declares a fieldId() virtual function that has to be defined by the child classes. This is tedious. For some reason the C++ makers refuse to allow "virtual member constants". To make the code somewhat less verbose, create these functions by a template. Of course, we could introduce the template parameter directly in the EditBase class. However, that would mean that the code in this base class is generated for every single undo command. I'm not sure we want that. This should als make it somewhat less tedious to create new edit commands by copy & paste. We could do the same for the fieldName. However, that is more complicated for two reasons: 1) For historic reasons(?) C++ doesn't allow for string literals as template parameters. Therefore, arrays-of-string would have to be defined, which is not very nice. 2) We would have to make sure that these strings are recognized by Qt's translation machinery and use the QT_TRANSLATE_NOOP macro, which makes the whole thing even less attractive. Maybe later. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31cleanup: make QMLManager member functions privateGravatar Berthold Stoeger
The - mergeLocalRepo() - openLocalThenRemote() functions were not invoked from outside QMLManager. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31mobile: don't call saveChangesLocal() twice on non-iOSGravatar Berthold Stoeger
QMLManager::changesNeedSaving() behaves differently on iOS: it only saves locally with saveChangesLocal(), whereas all other OS save to cloud with saveChangesCloud(). Nevertheless, even for other OS saveChangesLocal() is called even though that will be called in saveChancesCloud anyway. Therefore, compile the saveChangesLocal() call in changesNeedSaving conditionally. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31cleanup: don't compile subsurface-helper.cpp for testsGravatar Berthold Stoeger
It is unclear why the subsurface-helper.cpp file was linked with the tests. In any case, it led to comlicated ifdef-ery, so let's remove that for now and readd later if the need arises. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31Update CHANGELOGGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-summary: use 64bit integers for statisticsGravatar Dirk Hohndel
We still support 32bit ARM platforms, and there long is 32 bits. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-details: don't show virtual keyboard in dive view modeGravatar Dirk Hohndel
At least in 4.9.3.1258/3.0.1 I was able to reproduce a situation where I edit one dive, go back to the dive list, then tap on a different dive and then the keyboard pops up, obscuring a big chunk of the screen. This tries to make sure the keyboard isn't shown in dive view mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile: improve Android back key behaviorGravatar Dirk Hohndel
There are two places where we try to prevemt unintended app exits. Once, in the onBackRequested signal handler on the dive list. This was missing special handling for the situation where one of the drawers was open. The second place is the onClosing signal handler in main.qml. Naively I thought that this was enough to catch all cases where we were about to exit the app, but apparently an explicit manager.quit() is a bit too forceful and doesn't get to that signal handler. With this commit we check for open drawers in both places. Belts and suspenders, I guess. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/user-manual: update to remove reference to 'map it' buttonGravatar Dirk Hohndel
It's still in the screen shot, but I'll fix that some other time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-details: remove the redundant 'map it' buttonGravatar Dirk Hohndel
You can already get to the map by either clicking on the location text or on the left action button. This third way to get there reduces the available space for the location text, and can cause positioning issues with very long location texts creating three or more lines of text, which then overwrites the dateRow below. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31mobile/dive-list: avoid using undefined value as booleanGravatar Dirk Hohndel
This gets rid of an annoying and noisy warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-31cleanup: remove loadFromCloud() declaration from QMLManager.hGravatar Berthold Stoeger
This getter functions was not defined anywhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: use setPointSizeF() in themeInterface::set_currentScale()Gravatar Berthold Stoeger
The compiler complained that we were passing a float to the QFont::setPointSize() function, which expects an integer. Solve this by using the QFont::setPointSizeF() function. This might introduce a user-visible change, albeit very unlikely: We now may set the point-size to a non-integer number. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: fix initialization order in QMLProfile constructorGravatar Berthold Stoeger
The compiler complains that members were initialized out-of-order. Even though this is not an issue here it is correct to emit a warning, since only then it is guaranteed that the objects are destructed in reverse-order with respect to construction. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: un-slotify QMLManager functionsGravatar Berthold Stoeger
Some slots in QMLManager were not called from the outside, some only directly from C++-code. Make the former private and the latter public member functions. The idea here is to document which functions are actually called from the outside and which are called from QML or connected to signals. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: replace REGISTER_TYPE macro by templateGravatar Berthold Stoeger
Arguably easier to read. By using the qWarning("...") instead of the qWarning() << "..." version, we can remove the <QDebug> include. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: move initialization of QMLInterfaceGravatar Berthold Stoeger
QMLInterface was initialized in the register_qml_types function. Therein, it was in an if branch that tested whether the passed-in engine argument was not NULL. However, on mobile this could never be NULL. Let's just move the initialization out of that function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: move initialization of ThemeInterfaceGravatar Berthold Stoeger
The ThemeInterface was initialized and connected to QML in the register_qml_types() function. However, it is not a type. Move the initialization to a place where we create the other global QML objects. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: fold ThemeInterface::setup() into constructorGravatar Berthold Stoeger
There appears to be no reason for two-phase initialization. Let's keep things simple: let the constructor produce a functioning object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: don't send values in changed-signals of ThemeInterfaceGravatar Berthold Stoeger
According to the Qt-docs you *may* send the new values in the NOTIFY signal of Q_PROPERTYs. However, since changes will lead to a reevaluation of a whole expression, this argument will be unused. All it does is make the code more verbose and brittle: What happens if you send the wrong value? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30coding style: rename themeInterface to ThemeInterfaceGravatar Berthold Stoeger
As per coding style, class names are PascalCase. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: make color-constants in themeinterface.cpp staticGravatar Berthold Stoeger
There were no outside users - no point in exporting them. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30cleanup: make members of ThemeInterface non-staticGravatar Berthold Stoeger
We have a singleton class ThemeInterface, which means that it is global and exists only once. It's members are static, i.e. also global. A message from the department of redundancy department? In any case, that makes no sense. Let's just make these members local to the class. I would even rip out the whole singleton thing, since the object is not accessed anywhere outside from QML. Let's keep it for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-30CHANGELOG updateGravatar Dirk Hohndel
This remove the old pre-3.0 entries and adds entries for 3.0.0->master Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30mobile UI: don't exit when using back button to close drawersGravatar Dirk Hohndel
An Android user might reasonably assume that they can use the back button to close the global or context drawers. So act accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30Increment mobile versionGravatar Dirk Hohndel
That's needed to be able to push out new binaries to the stores. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30mobile/dive-list: add indicator that dive list is being processedGravatar Dirk Hohndel
This should deal with the rather confusing 'No dive in dive list' shown while loading and processing the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30message handler: make the log output less verboseGravatar Dirk Hohndel
Skip truly identical / repetitive messages. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30mobile/dive-list: show/hide virtual keyboard as needed for filterGravatar Dirk Hohndel
This should happen automatically, but for some reason it doesn't. So let's try to force it manually. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-30mobile/dive-list: make sure filter input area is visibleGravatar Dirk Hohndel
Since apparently the header property of the ListView isn't reliably making sure that our filter input line is visible, let's move the filter header to be it's own visual element and manually manage the relationship between that and the ListView. The obvious idea was to anchor the ListView to the bottom of the filterHeader, but that didn't work in my tests. So instead we are using the topMargin to make sure that there is space to show the header. Because this re-indents the whole filterHeader, 'git show -w' gives a much better idea what this commit actually changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-29mobile/cleanup: use a mutex to protect storage accessGravatar Dirk Hohndel
Instead of the crude and error prone bool, let's just use the right tool for this job. In order to avoid issues with a goto across a mutex boundary, this slightly restructures the code in one place - 'git show -w' makes it clear that this is really rather simple in its changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28Increment mobile versionGravatar Dirk Hohndel
That's needed to be able to push out new binaries to the stores. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28mobile/save-changes: untangle the handling of alreadySavingGravatar Dirk Hohndel
I'm suspicious that an issue that some people have seen around changes not being saved is caused by our handling of alreadySaving. When starting with Subsurface-mobile in no-autosync mode, we were able to end in a scenario where alreadySaving was true, even though there were no unsaved changes. And in that case no changes made during such a session were saved unless the user forced a manual sync with the server. This commit radically changes our approach to handling the flag. It moves it right next to the actual calls into code that could modify git storage, and ensures that the flag can never stay set. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28mobile/cleanup: tiny coding style issue that bugged meGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-28mobile: when editing dives update the fulltext filterGravatar Berthold Stoeger
In the mobile version of the dive-editing command, the fulltext filter was not updated. Thus, when editing a dive while the filter was active, the dive would disappear. Unregister the old and register the new version. Reported-by: Chirana Gheorghita Eugeniu Theodor <office@adaptcom.ro> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-28mobile: fix filter flag when editing divesGravatar Berthold Stoeger
When editing dives, the undo-command sends a filte changed signal. The models catch the signal and check whether the filter status changed. The mobile-version of the dive-edit command simply exchanged the dives. This could lead to inconsistencies when the filter flag was overwritten. Therefore, make sure that the filter flag is not overwritten by the dive-exchange. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-27ReleaseNotes: start independent MobileReleaseNotes fileGravatar Dirk Hohndel
Only having release notes for the desktop version really doesn't make sense anymore. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27Latest translationsGravatar Dirk Hohndel
With this, international Portuguese, Swedish, Finnish, Hebrew, Spanish, Romanian, Dutch, and German are 100% translated. Catalan, Chinese, and Bulgarian are more than 90% translated as well. A HUGE thank you to the translators once again stepping up. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27mobile/user-manual: update bundled htmlGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27mobile/user-manual: add hyperlinks where usefulGravatar Dirk Hohndel
Suggested-by: Martin de Weger <martin@deweger.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27mobile/user-manual: small language tweaksGravatar Crawford Currie
[Dirk Hohndel: added another fix to Crawford's commit] Signed-off-by: Crawford Currie <curriedot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-27mobile UI: disable action button / drawer interactionsGravatar Dirk Hohndel
This is a feature that I never fully understood, but that apparently is causing the drawers to show up for people who are just trying to interact with the action button. The approach here is really drastic and crude, but in my testing it seems to work. Reported-by: Hartley Horwitz <hhrwtz@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26mobile UI: add create trip to DiveDetails context menuGravatar Dirk Hohndel
Should have done that in the first place. That's what happens when you are rushing it... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26iOS: ensure changes are saved locallyGravatar Dirk Hohndel
This was disabled in the past because it was deemed to slow. A lot of time has passed, since. Maybe on current phones / iPads this is acceptable again? Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26cleanup: remove dead codeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26mobile/dive-list: add ability to create tripGravatar Dirk Hohndel
This adds a context menu entry for top level dives that allows the user to create a trip for that dive. Unfortunately this creates a new string to translate right before a release... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-26mobile/cleanup: pageStack.pop() doesn't take a string argumentGravatar Dirk Hohndel
This happens to do the expected thing, anyway, but let's not keep this broken code around. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>