summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-11-29Allow to use QML imports shipped in the qrc fileGravatar Sebastian Kügler
This adds qrc://imports to the paths that the Qml engine considers for findings import plugins. This change makes loading the mobilecomponents plugin work (it won't be found otherwise). Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29Add banner image for the left drawer menuGravatar Sebastian Kügler
This picture is used for the header part of the drawer which can be swiped in from the left. I'm sure Dirk has a better one, but this works quite nicely until he gets to replace it. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29port these as well to mobilecomponentsGravatar Sebastian Kügler
Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29use mobilecomponents for our pagesGravatar Sebastian Kügler
This is a dumb port of a number of properties to use the new theme and units API. - import the plugin - change accessors from units and theme to MobileComponents.Unit and MobileComponents.Theme Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29Add new files to the qrcGravatar Sebastian Kügler
This adds only the bits from MobileComponent that we already use to the qrc file, including two icons go-next and go-previous (2 simple SVG icons taken from the breeze theme). Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-29import mobilecomponentsGravatar Sebastian Kügler
This commit adds the .qml and qmldir files for the MobileComponents import. It contains low-level things like units and theme, and mid-level things like Heading, and high-level navigation in the form of an ApplicationWindow and Drawers that hold menues and provide swipe interactions between the pages. These components are a more full version of the "light" plasma components we have been using to make the UI scale well and appear more consistent (coloring, spacing, alignment, etc.). An interesting change is that Units and Theme are now singleton types, which is more efficient. It does mean a few changes to our current API usage: - units becomes Units - theme becomes Theme - 2 properties move out of each (we can't subclass singleton types) This change also means that we're using the vanilla upstream components, so it's very easy to get improvements to these rather young components in, and we don't have to do this work on our own. The mobilecomponents consist of just a bunch of qml files which we can deploy through the qrc file. In the next commits, we will gradually make the current UI use these new elements. Signed-off-by: Sebastian Kügler <sebas@kde.org>
2015-11-25Don't overwrite air temperatureGravatar Dirk Hohndel
If we already have an air temperature set, don't overwrite it with potentially less accurate infromation from the first sample. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-25Remove unused codeGravatar Dirk Hohndel
Reported-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Location completion matches on whole nameGravatar Dirk Hohndel
When typing in a partial location name, the match now considers the whole text, not just the start of the text. So typing in "Yell" will match both "Yellow House" and "Mellow Yellow". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Cmake: fix building of Subsurface-mobile on MacGravatar Dirk Hohndel
The error message was completely useless, but it turned out to be an issue of the order of arguments to add_executable(). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Drag and Drop ImagesGravatar Robert C. Helling
Now that we have the possibility to add images without meaningful time stamps to a dive, we should let the user provide that time offset manually. This patch allowed pictures to be dragged from the image list to the profile. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Only close html tags if they were opened beforeGravatar Robert C. Helling
The runtime html table is printed only if printing a verbatim diveplan is disabled. So the closing tags should be printed only in that case. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24CGI script wrapper for smtk2ssrf.plGravatar Robert C. Helling
This script should go to the cgi-bin directory of the webserver to proivide conversion of SmarTrack files as a web service. Paths need to be adopted and more html to make it more beautiful should be added. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Interpret - as STDOUT on writing xml filesGravatar Robert C. Helling
This prepares for the smartrack converter webservice. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Update INSTALL file to reflect new dependenciesGravatar Pedro Neves
The INSTALL file was updated to reflect the need to install qtlocation5-dev (and similar packages on various Linux distros) to prevent build errors with latest master. Signed-off-by: Pedro Neves <nevesdiver@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-23Last set of updates to the user manual in this roundGravatar Wendie Fisher
Once again focus on language and readability. Signed-off-by: Wendie Fisher <wendie@divedad.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-19main.qml: fix crash on native Win32 desktopGravatar Lubomir I. Ivanov
Testing the mobile application on Win32 desktop results in a crash. Using ApplicationWindow for some reason makes the executable enter an inifinity loop on startup until it runs out of RAM. The output is: setGeometryDp: Unable to set geometry 160x1200+720+426 on ApplicationWindow_ QMLTYPE_12_QML_111/''. Resulting geometry: 160x885+720+426 (frame: 4, 23, 4, 4, custom margin: 0, 0, 0, 0, minimum size: 0x47, maximum size: 16777215x 16777215). To fix the crash use "Window" instead of "ApplicationWindow". Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> ACKed-by: Sebastian Kügler <sebas@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18subsurface-mobile-main.cpp: fix unused variable 'application'Gravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Another missing call to mark_divelist_changedGravatar Dirk Hohndel
Thanks again to Lubomir for finding this. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18libdivecomputer.h: fix warning with DC_VERSION on Win32Gravatar Lubomir I. Ivanov
"warning: "DC_VERSION" redefined" is thrown if a chain of includes previously includes windows.h: In file included from c:/bin/mingw/i686-w64-mingw32/include/windows.h:71:0, from C:/bin/qt/5.5/mingw492_32/include/QtCore/qt_windows.h:63, from C:/bin/qt/5.5/mingw492_32/include/QtGui/qopengl.h:43, from C:/bin/qt/5.5/mingw492_32/include/QtQuick/qquickwindow.h:39, from C:/bin/qt/5.5/mingw492_32/include/QtQuick/QQuickWindow:1, from C:/dev/subsurface/subsurface-core/qt-gui.h:13, from C:\dev\subsurface\subsurface-mobile-main.cpp:9: and which on it's own includes wingdi.h which defines "DC_VERSION 10" (windows printer stack related). To solve the warning DC_VERSION is undefined in subsurface-core/libdivecomputer.h. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18applyLocations should be a void functionGravatar Dirk Hohndel
Another issue pointed out by Lubomir. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18gpslocation.cpp: fix signed vs unsinged int comparison warningGravatar Lubomir I. Ivanov
QDateTime::toTime_t() is misleading as it does not return a C time_t type, but a 'unsigned int' or rather the Qt 'uint' typedef. To prevent the warning we cast it to 'time_t' and to comply with the 'lastTime' variable. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: when applying GPS locations mark divelist changedGravatar Dirk Hohndel
Lubomir pointed out that this variable was unused. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Add menu entry for creating GPS locationGravatar Dirk Hohndel
And disable it if there is no satellite based location service (but see the comment in the previous commit - this doesn't appear to work reliably). Nothing happens when you use the menu entry. This just allows us to hook this up later. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: check presence of location sourceGravatar Dirk Hohndel
In theory this should only report a location service if this is a satellite based service, but sadly geoclue appears to claim that there is a satellite based service in my Linux VM - so I'm doubtful that this does what the documentation says it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: instantiate location provider in the desktop UIGravatar Dirk Hohndel
We still aren't doing anything with it, but at least it's there now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: move into subsurface-coreGravatar Dirk Hohndel
While this is primarily something targeted at a mobile device, with many of the 2 in 1 devices it is possible that the user might be running the desktop version of Subsurface on a mobile device. As a first step to make it possible to collect GPS fixes on such a device we need to make the infrastructure to do so available in the desktop application as well. This still needs to be hooked up in the desktop UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: make message delivery configurableGravatar Dirk Hohndel
Instead of directly using the status output for the QML UI, set up the function used to display messages to the user as part of the constructor. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Cloud storage: modify protocol for checking cloud connectivityGravatar Dirk Hohndel
In order to allow the backend to match account in multi user mode, it needs to know if the requests are coming from the same instance of Subsurface. Since I had to change the backend to add the ability to retrieve a location service userid I added this capability at the same time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: set user agent stringGravatar Dirk Hohndel
This allows the backend to know which version of Subsurface is contacting it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Cmake: add SUBSURFACE_MOBILE definition earlierGravatar Dirk Hohndel
This way it is set when subsurface-core is built. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: retrieve the userid using the cloud storage APIGravatar Dirk Hohndel
This should actually not be in the mobile section at all. This needs to be available on the desktop as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18QML UI: remove manual setting of web service useridGravatar Dirk Hohndel
It's just not user friendly to have two different user IDs for two different web services that we provide. Instead in the following commits we'll add a way to retrieve the location service web service userid with your cloud storage user id. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16Make Subsurface-mobile compile againGravatar Dirk Hohndel
This is a quick fix but it changes semantice. Previously weight() gave you the total weight carried, now it just gives you the first weight item on the list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper.cpp: improve getFormattedCylinder()Gravatar Lubomir I. Ivanov
When the user requests "dive.cylinders" from Grantlee HTML we need to always put at least the default cylinder and mark the description as "unknown" (same as other locations) if it's not set (i.e. when the description pointer is NULL). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper: also support "maxcns" and "otu" in Grantlee HTMLGravatar Lubomir I. Ivanov
Fixes #962 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16templatelayout.h: expose cylinders and weights in Grantlee HTMLGravatar Lubomir I. Ivanov
This patch adds the following HTML variables: "dive.cylinders" -> Dive::cylinders() "dive.cylinderX" -> Dive::cylinder(X) "dive.weights" -> Dive::weights() "dive.weightX" -> Dive::weight(X) The patch also creates some macros to ease the Dive variable lookup visually. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16templatelayout.h: expose "dive.suit" as a Grantlee HTML variableGravatar Lubomir I. Ivanov
Having {{ dive.suit }} in the HTML will now return the suit as QString (from struct dive->suit). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper: add means to retreive weight and cylinder info in DiveGravatar Lubomir I. Ivanov
The Dive helper class only picks the first cylinder and the total weight. This patch adds the option to dump the cylinders and weights as formatted lists (via cylinders() and weights()) or to retrieve a specific cylinder or weight via (cylinder(index) and weight(index)). Each cylinder and weight string contains detailed information: cylinder: - desc. - pressure (+start/end) - gasmix - etc... weight: - desc. - weight (in units e.g. kg) If no description is found for a cylinder or weight the contents for this particular unit is filled with EMPTY_DIVE_STRING ("--"). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper.cpp: define EMPTY_DIVE_STRINGGravatar Lubomir I. Ivanov
The macro is used as a common replacer for the "--" string when the Dive class members return no particular information for a "struct dive" property. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16CMakeLists: use correct 'desktop-widgets' pathGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16dive.c: fix a couple of comment typosGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15Parse html links in the Notes section.Gravatar K. \"pestophagous\" Heller
In the spirit of "Do the simplest thing that could possibly work": capture Ctrl+leftclick mouse events in the Notes area. If the string under the clicked position is a valid url, then launch it. Many common URI schemes will work. Typing a url that starts with https:// will work. So will mailto: and file:// See #733 Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15Make "Save Preferences" button mutate "prefs" struct.Gravatar K. \"pestophagous\" Heller
Clicking Save in the preferences dialog will now cause the GUI to immediately reflect the latest settings (just as it behaved in 4.5). Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15Restore proper spin-box/slider behavior for animation setting.Gravatar K. \"pestophagous\" Heller
In 4.5 the signal-to-slot connections between the QSlider and the QSpinBox were bidirectional. That setup is still desirable; it must have been broken accidentally during preferences refactorings. Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15Planner: support profile in planner printGravatar Lubomir I. Ivanov
The "Print" button in the planner dumps the QTextEdit to a QPrinter via ::print(). This patch renders the Profile to a Pixmap which is inserted as Base64 stream in an <img> tag and fed on top of the QTextEdit HTML contents. This route preserves the planner notes as text in PDF prints. The quick alternative is to render the QTextDocument to a QPixmap as well, but that will not preserve the text and pagination becomes manual. Possibly the QTextDocument can be rendered as a QPicture but pagination is still an issue, while so far there is exactly one user requesting this feature! Related small change in ProfileWidget2: Explicitly hide the tooltip when printMode is true. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15printing_templates: mark 'dive.notes' as 'safe'Gravatar Lubomir I. Ivanov
Grantlee has a way to display a variable as HTML by marking it as 'safe' e.g.: {{ dive.notes|safe }} This allows any HTML to be preserved when printing. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15qthelper.cpp: support line breaks for notes when printingGravatar Lubomir I. Ivanov
The Dive::put_notes() does not handle HTML formatting or line breaks properly. Apparently Grantlee supports HTML variables, but the planned notes (which are HTML) look very bad when inserted in the Grantlee template - e.g. the text is huge and the table box is cut for some odd reason. I don't have a good solution for these issues ATM; especially for the "table cell being cut part". An important feature in the dive notes is to support line breaks. This patch adds support for line breaks both in planned dive notes and non-planned dive notes via the <br> tag. This makes the planned dive notes look tolerable. The next step would be to support the <br> tag, which has to happen in the bundled templates them self. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15simple spelling changesGravatar Stephen Hemminger
Fix obvious spelling mistakes in comments (and one error message). Yes, this is trivial but I saw one while reviewing some of the code and after that decided to run code through some tools. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15subsurfacestartup.c: leave free_prefs() emptyGravatar Lubomir I. Ivanov
There is a bug on OSX where free() is called on non-allocated memory in free_prefs(). Most of the preferences are not freed in free_prefs() while copy_string() is used on them, so let's not free() any pointers in free_prefs() and leave them as one-time leaks. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>