mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/summary: remove dive summary calculation
Since we now use a model to calculate the dive summary, there is no need to export recalculation of the dive summary via QMLInterface. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
a5823a5b0d
commit
1809dbd00a
3 changed files with 2 additions and 23 deletions
|
@ -33,14 +33,13 @@ Kirigami.ScrollablePage {
|
||||||
Connections {
|
Connections {
|
||||||
target: Backend
|
target: Backend
|
||||||
onLengthChanged: {
|
onLengthChanged: {
|
||||||
Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
|
reload()
|
||||||
}
|
}
|
||||||
onVolumeChanged: {
|
onVolumeChanged: {
|
||||||
Backend.summaryCalculation(selectionPrimary.currentIndex, selectionSecondary.currentIndex)
|
reload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
columns: 3
|
columns: 3
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
|
@ -89,14 +89,4 @@ void QMLInterface::setup(QQmlContext *ct)
|
||||||
|
|
||||||
// Make enums available as types
|
// Make enums available as types
|
||||||
qmlRegisterUncreatableType<QMLInterface>("org.subsurfacedivelog.mobile",1,0,"Enums","Enum is not a type");
|
qmlRegisterUncreatableType<QMLInterface>("org.subsurfacedivelog.mobile",1,0,"Enums","Enum is not a type");
|
||||||
|
|
||||||
// calculate divesummary first time.
|
|
||||||
// this is needed in order to load the divesummary page
|
|
||||||
diveSummary::summaryCalculation(0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMLInterface::summaryCalculation(int primaryPeriod, int secondaryPeriod)
|
|
||||||
{
|
|
||||||
diveSummary::summaryCalculation(primaryPeriod, secondaryPeriod);
|
|
||||||
emit diveSummaryTextChanged(diveSummary::diveSummaryText);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "core/settings/qPrefTechnicalDetails.h"
|
#include "core/settings/qPrefTechnicalDetails.h"
|
||||||
#include "qt-models/diveplannermodel.h"
|
#include "qt-models/diveplannermodel.h"
|
||||||
#include "backend-shared/plannershared.h"
|
#include "backend-shared/plannershared.h"
|
||||||
#include "backend-shared/divesummary.h"
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
|
@ -79,8 +78,6 @@ class QMLInterface : public QObject {
|
||||||
Q_PROPERTY(bool verbatim_plan READ verbatim_plan WRITE set_verbatim_plan NOTIFY verbatim_planChanged);
|
Q_PROPERTY(bool verbatim_plan READ verbatim_plan WRITE set_verbatim_plan NOTIFY verbatim_planChanged);
|
||||||
Q_PROPERTY(bool display_variations READ display_variations WRITE set_display_variations NOTIFY display_variationsChanged);
|
Q_PROPERTY(bool display_variations READ display_variations WRITE set_display_variations NOTIFY display_variationsChanged);
|
||||||
|
|
||||||
Q_PROPERTY(QStringList diveSummaryText READ diveSummaryText NOTIFY diveSummaryTextChanged);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// function to do the needed setup
|
// function to do the needed setup
|
||||||
static void setup(QQmlContext *ct);
|
static void setup(QQmlContext *ct);
|
||||||
|
@ -168,9 +165,6 @@ public:
|
||||||
};
|
};
|
||||||
Q_ENUM(DIVE_MODE);
|
Q_ENUM(DIVE_MODE);
|
||||||
|
|
||||||
// Function to calculate dive summary
|
|
||||||
Q_INVOKABLE void summaryCalculation(int primaryPeriod, int secondaryPeriod);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CLOUD_STATUS cloud_verification_status() { return (CLOUD_STATUS)prefs.cloud_verification_status; }
|
CLOUD_STATUS cloud_verification_status() { return (CLOUD_STATUS)prefs.cloud_verification_status; }
|
||||||
DURATION duration_units() { return (DURATION)prefs.units.duration_units; }
|
DURATION duration_units() { return (DURATION)prefs.units.duration_units; }
|
||||||
|
@ -218,8 +212,6 @@ public:
|
||||||
bool verbatim_plan() { return prefs.verbatim_plan; }
|
bool verbatim_plan() { return prefs.verbatim_plan; }
|
||||||
bool display_variations() { return prefs.display_variations; }
|
bool display_variations() { return prefs.display_variations; }
|
||||||
|
|
||||||
const QStringList &diveSummaryText() { return diveSummary::diveSummaryText; }
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void set_cloud_verification_status(CLOUD_STATUS value) { qPrefCloudStorage::set_cloud_verification_status(value); }
|
void set_cloud_verification_status(CLOUD_STATUS value) { qPrefCloudStorage::set_cloud_verification_status(value); }
|
||||||
void set_duration_units(DURATION value) { qPrefUnits::set_duration_units((units::DURATION)value); }
|
void set_duration_units(DURATION value) { qPrefUnits::set_duration_units((units::DURATION)value); }
|
||||||
|
@ -315,8 +307,6 @@ signals:
|
||||||
void display_transitionsChanged(bool value);
|
void display_transitionsChanged(bool value);
|
||||||
void verbatim_planChanged(bool value);
|
void verbatim_planChanged(bool value);
|
||||||
void display_variationsChanged(bool value);
|
void display_variationsChanged(bool value);
|
||||||
|
|
||||||
void diveSummaryTextChanged(QStringList);
|
|
||||||
private:
|
private:
|
||||||
QMLInterface();
|
QMLInterface();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue