mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
WIP-dont-use
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
29d9405a72
commit
52f156ee47
9 changed files with 24 additions and 19 deletions
|
@ -375,7 +375,7 @@ android {
|
||||||
../install-root-$${QT_ARCH}/lib/libzip.a \
|
../install-root-$${QT_ARCH}/lib/libzip.a \
|
||||||
../install-root-$${QT_ARCH}/lib/libxslt.a \
|
../install-root-$${QT_ARCH}/lib/libxslt.a \
|
||||||
../install-root-$${QT_ARCH}/lib/libxml2.a \
|
../install-root-$${QT_ARCH}/lib/libxml2.a \
|
||||||
../install-root-$${QT_ARCH}/lib/libsqlite3.a \
|
../install-root-$${QT_ARCH}/lib/libsqliteX.so \
|
||||||
../install-root-$${QT_ARCH}/lib/libssl_1_1.so \
|
../install-root-$${QT_ARCH}/lib/libssl_1_1.so \
|
||||||
../install-root-$${QT_ARCH}/lib/libcrypto_1_1.so \
|
../install-root-$${QT_ARCH}/lib/libcrypto_1_1.so \
|
||||||
../googlemaps-build/libplugins_geoservices_qtgeoservices_googlemaps_$${QT_ARCH}.so
|
../googlemaps-build/libplugins_geoservices_qtgeoservices_googlemaps_$${QT_ARCH}.so
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
set(SUBSURFACE_MOBILE_SRCS
|
set(SUBSURFACE_MOBILE_SRCS
|
||||||
qmlinterface.cpp
|
qmlinterface.cpp
|
||||||
qmlmanager.cpp
|
qmlmanager.cpp
|
||||||
statsmanager.cpp
|
statsmanager.cpp
|
||||||
themeinterface.cpp
|
themeinterface.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
|
if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
|
||||||
add_library(subsurface_mobile STATIC ${SUBSURFACE_MOBILE_SRCS})
|
add_library(subsurface_mobile STATIC ${SUBSURFACE_MOBILE_SRCS})
|
||||||
target_link_libraries(subsurface_mobile ${QT_LIBRARIES})
|
target_link_libraries(subsurface_mobile ${QT_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -38,7 +38,7 @@ Kirigami.ScrollablePage {
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: diveOrTripDelegate
|
id: diveOrTripDelegate
|
||||||
Kirigami.AbstractListItem {
|
Controls.ItemDelegate {
|
||||||
// this allows us to access properties of the currentItem from outside
|
// this allows us to access properties of the currentItem from outside
|
||||||
property variant myData: model
|
property variant myData: model
|
||||||
property var view: ListView.view
|
property var view: ListView.view
|
||||||
|
@ -46,7 +46,7 @@ Kirigami.ScrollablePage {
|
||||||
property bool invalid: isInvalid === true
|
property bool invalid: isInvalid === true
|
||||||
id: diveOrTripDelegateItem
|
id: diveOrTripDelegateItem
|
||||||
padding: 0
|
padding: 0
|
||||||
supportsMouseEvents: true
|
//supportsMouseEvents: true
|
||||||
anchors {
|
anchors {
|
||||||
left: parent ? parent.left : undefined
|
left: parent ? parent.left : undefined
|
||||||
right: parent ? parent.right : undefined
|
right: parent ? parent.right : undefined
|
||||||
|
@ -458,7 +458,7 @@ Kirigami.ScrollablePage {
|
||||||
icon {
|
icon {
|
||||||
name: ":/icons/list-add"
|
name: ":/icons/list-add"
|
||||||
}
|
}
|
||||||
color: subsurfaceTheme.textColor
|
//color: subsurfaceTheme.textColor
|
||||||
text: qsTr("Add dive")
|
text: qsTr("Add dive")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
startAddDive()
|
startAddDive()
|
||||||
|
@ -469,7 +469,7 @@ Kirigami.ScrollablePage {
|
||||||
icon {
|
icon {
|
||||||
name: ":icons/ic_filter_list"
|
name: ":icons/ic_filter_list"
|
||||||
}
|
}
|
||||||
color: subsurfaceTheme.textColor
|
//color: subsurfaceTheme.textColor
|
||||||
text: qsTr("Filter dives")
|
text: qsTr("Filter dives")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
rootItem.filterToggle = !rootItem.filterToggle
|
rootItem.filterToggle = !rootItem.filterToggle
|
||||||
|
|
|
@ -12,10 +12,10 @@ TemplatePage {
|
||||||
|
|
||||||
property int selectedExport: ExportType.EX_DIVES_XML
|
property int selectedExport: ExportType.EX_DIVES_XML
|
||||||
|
|
||||||
FileDialog {
|
FolderDialog {
|
||||||
id: saveAsDialog
|
id: saveAsDialog
|
||||||
folder: shortcuts.documents
|
currentFolder: shortcuts.documents
|
||||||
selectFolder: true
|
//selectFolder: true
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
manager.exportToFile(selectedExport, fileUrls, anonymize.checked)
|
manager.exportToFile(selectedExport, fileUrls, anonymize.checked)
|
||||||
pageStack.pop()
|
pageStack.pop()
|
||||||
|
|
|
@ -645,7 +645,7 @@ TemplatePage {
|
||||||
to: 150
|
to: 150
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: PrefTechnicalDetails.gflow
|
value: PrefTechnicalDetails.gflow
|
||||||
validator: RegExpValidator { regExp: /1?\d{0,2}%?/ }
|
validator: RegularExpressionValidator { regularExpression: /1?\d{0,2}%?/ }
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + "%"
|
return value + "%"
|
||||||
}
|
}
|
||||||
|
@ -679,7 +679,7 @@ TemplatePage {
|
||||||
to: 150
|
to: 150
|
||||||
stepSize: 1
|
stepSize: 1
|
||||||
value: PrefTechnicalDetails.gfhigh
|
value: PrefTechnicalDetails.gfhigh
|
||||||
validator: RegExpValidator { regExp: /1?\d{0,2}%?/ }
|
validator: RegularExpressionValidator { regularExpression: /1?\d{0,2}%?/ }
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
return value + "%"
|
return value + "%"
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ Kirigami.Page {
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: chartListDelegate
|
id: chartListDelegate
|
||||||
Kirigami.AbstractListItem {
|
Controls.ItemDelegate {
|
||||||
id: chartListDelegateItem
|
id: chartListDelegateItem
|
||||||
height: isHeader ? 1 + 8 * Kirigami.Units.smallSpacing : 11 * Kirigami.Units.smallSpacing // delegateInnerItem.height
|
height: isHeader ? 1 + 8 * Kirigami.Units.smallSpacing : 11 * Kirigami.Units.smallSpacing // delegateInnerItem.height
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
@ -735,9 +735,9 @@ if you have network connectivity and want to sync your data to cloud storage."),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QMLManager {
|
// QMLManager {
|
||||||
id: manager
|
// id: manager
|
||||||
}
|
// }
|
||||||
|
|
||||||
property bool initialized: manager.initialized
|
property bool initialized: manager.initialized
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
#include "core/btdiscovery.h"
|
#include "core/btdiscovery.h"
|
||||||
#include "core/downloadfromdcthread.h"
|
#include "core/downloadfromdcthread.h"
|
||||||
|
@ -29,6 +30,7 @@ struct DiveSiteChange; // An obscure implementation artifact - remove in due cou
|
||||||
|
|
||||||
class QMLManager : public QObject {
|
class QMLManager : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
QML_ELEMENT
|
||||||
Q_PROPERTY(bool loadFromCloud MEMBER m_loadFromCloud WRITE setLoadFromCloud NOTIFY loadFromCloudChanged)
|
Q_PROPERTY(bool loadFromCloud MEMBER m_loadFromCloud WRITE setLoadFromCloud NOTIFY loadFromCloudChanged)
|
||||||
Q_PROPERTY(QString startPageText MEMBER m_startPageText WRITE setStartPageText NOTIFY startPageTextChanged)
|
Q_PROPERTY(QString startPageText MEMBER m_startPageText WRITE setStartPageText NOTIFY startPageTextChanged)
|
||||||
Q_PROPERTY(bool verboseEnabled MEMBER m_verboseEnabled WRITE setVerboseEnabled NOTIFY verboseEnabledChanged)
|
Q_PROPERTY(bool verboseEnabled MEMBER m_verboseEnabled WRITE setVerboseEnabled NOTIFY verboseEnabledChanged)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#ifdef MAP_SUPPORT
|
#ifdef MAP_SUPPORT
|
||||||
#include "map-widget/qmlmapwidgethelper.h"
|
#include "map-widget/qmlmapwidgethelper.h"
|
||||||
|
@ -97,6 +98,9 @@ void run_mobile_ui(double initial_font_size)
|
||||||
#endif
|
#endif
|
||||||
QScreen *appScreen = QApplication::screens().at(0);
|
QScreen *appScreen = QApplication::screens().at(0);
|
||||||
int availableScreenWidth = appScreen->availableSize().width();
|
int availableScreenWidth = appScreen->availableSize().width();
|
||||||
|
|
||||||
|
QScopedPointer<QMLManager> qmlmanager(new QMLManager);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
QQmlContext *ctxt = engine.rootContext();
|
QQmlContext *ctxt = engine.rootContext();
|
||||||
|
|
||||||
|
@ -121,6 +125,7 @@ void run_mobile_ui(double initial_font_size)
|
||||||
ctxt->setContextProperty("vendorList", vendorList);
|
ctxt->setContextProperty("vendorList", vendorList);
|
||||||
ctxt->setContextProperty("swipeModel", MobileModels::instance()->swipeModel());
|
ctxt->setContextProperty("swipeModel", MobileModels::instance()->swipeModel());
|
||||||
ctxt->setContextProperty("diveModel", MobileModels::instance()->listModel());
|
ctxt->setContextProperty("diveModel", MobileModels::instance()->listModel());
|
||||||
|
ctxt->setContextProperty("manager", qmlmanager->instance());
|
||||||
set_non_bt_addresses();
|
set_non_bt_addresses();
|
||||||
|
|
||||||
// we need to setup the initial font size before the QML UI is instantiated
|
// we need to setup the initial font size before the QML UI is instantiated
|
||||||
|
@ -131,8 +136,6 @@ void run_mobile_ui(double initial_font_size)
|
||||||
ctxt->setContextProperty("logModel", MessageHandlerModel::self());
|
ctxt->setContextProperty("logModel", MessageHandlerModel::self());
|
||||||
ctxt->setContextProperty("subsurfaceTheme", themeInterface);
|
ctxt->setContextProperty("subsurfaceTheme", themeInterface);
|
||||||
|
|
||||||
qmlRegisterUncreatableType<QMLManager>("org.subsurfacedivelog.mobile",1,0,"ExportType","Enum is not a type");
|
|
||||||
|
|
||||||
#ifdef SUBSURFACE_MOBILE_DESKTOP
|
#ifdef SUBSURFACE_MOBILE_DESKTOP
|
||||||
if (!testqml.empty()) {
|
if (!testqml.empty()) {
|
||||||
QString fileLoad(testqml.c_str());
|
QString fileLoad(testqml.c_str());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue