mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 14:23:23 +00:00
c93b76eee6
Add CLOUD_STATUS enum to interface. Add cloud_verifification_status variable to interface, and make it strongly typed in QML. using backend.cloud_verification_status = 1 will fail but backend.cloud_verification_status = backend.CS_UNKNOWN is correct. Added note to the original definitions of the enums that they have been duplicated. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
23 lines
688 B
C++
23 lines
688 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "qmlinterface.h"
|
|
|
|
#include <QQmlEngine>
|
|
|
|
QMLInterface *QMLInterface::instance()
|
|
{
|
|
static QMLInterface *self = new QMLInterface;
|
|
return self;
|
|
}
|
|
|
|
void QMLInterface::setup(QQmlContext *ct)
|
|
{
|
|
// Register interface class
|
|
ct->setContextProperty("Backend", QMLInterface::instance());
|
|
|
|
// Make enums available as types
|
|
qmlRegisterUncreatableType<QMLInterface>("org.subsurfacedivelog.mobile",1,0,"Enums","Enum is not a type");
|
|
|
|
// relink signals to QML
|
|
connect(qPrefCloudStorage::instance(), &qPrefCloudStorage::cloud_verification_statusChanged,
|
|
[=] (int value) { emit instance()->cloud_verification_statusChanged(CLOUD_STATUS(value)); });
|
|
}
|