mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: replace dive master by dive guide
In general, replace "dive master" by "dive guide". However, do not change written dive logs for now. On reading, accept both versions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
889827aadb
commit
9e0712d5dc
38 changed files with 141 additions and 133 deletions
|
|
@ -57,15 +57,15 @@ Kirigami.ScrollablePage {
|
|||
}
|
||||
}
|
||||
Controls.Label {
|
||||
text: qsTr("Dive master")
|
||||
text: qsTr("Dive guide")
|
||||
font.pointSize: subsurfaceTheme.regularPointSize
|
||||
Layout.preferredWidth: gridWidth * 0.75
|
||||
}
|
||||
SsrfSwitch {
|
||||
checked: manager.toggleDiveMaster(false)
|
||||
checked: manager.toggleDiveGuide(false)
|
||||
Layout.preferredWidth: gridWidth * 0.25
|
||||
onClicked: {
|
||||
manager.toggleDiveMaster(true)
|
||||
manager.toggleDiveGuide(true)
|
||||
}
|
||||
}
|
||||
Controls.Label {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ Kirigami.Page {
|
|||
property alias buddyIndex: detailsEdit.buddyIndex
|
||||
property alias buddyText: detailsEdit.buddyText
|
||||
property alias buddyModel: detailsEdit.buddyModel
|
||||
property alias divemasterIndex: detailsEdit.divemasterIndex
|
||||
property alias divemasterText: detailsEdit.divemasterText
|
||||
property alias divemasterModel: detailsEdit.divemasterModel
|
||||
property alias diveguideIndex: detailsEdit.diveguideIndex
|
||||
property alias diveguideText: detailsEdit.diveguideText
|
||||
property alias diveguideModel: detailsEdit.diveguideModel
|
||||
property alias tagText: detailsEdit.tagText
|
||||
property alias depth: detailsEdit.depthText
|
||||
property alias duration: detailsEdit.durationText
|
||||
|
|
@ -351,7 +351,7 @@ Kirigami.Page {
|
|||
watertemp = modelData.waterTemp
|
||||
suitIndex = manager.suitList.indexOf(modelData.suit)
|
||||
buddyText = modelData.buddy;
|
||||
divemasterText = modelData.diveMaster
|
||||
diveguideText = modelData.diveGuide
|
||||
tagText = modelData.tags
|
||||
notes = modelData.notes
|
||||
if (modelData.singleWeight) {
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ Item {
|
|||
property alias suitText: suitBox.editText
|
||||
property alias buddyIndex: buddyBox.currentIndex
|
||||
property alias buddyText: buddyBox.editText
|
||||
property alias divemasterIndex: divemasterBox.currentIndex
|
||||
property alias divemasterText: divemasterBox.editText
|
||||
property alias diveguideIndex: diveguideBox.currentIndex
|
||||
property alias diveguideText: diveguideBox.editText
|
||||
property alias tagText: txtTag.text
|
||||
property alias cylinderIndex0: cylinderBox0.currentIndex
|
||||
property alias cylinderIndex1: cylinderBox1.currentIndex
|
||||
|
|
@ -36,7 +36,7 @@ Item {
|
|||
property var endpressure: []
|
||||
property var startpressure: []
|
||||
property alias suitModel: suitBox.model
|
||||
property alias divemasterModel: divemasterBox.model
|
||||
property alias diveguideModel: diveguideBox.model
|
||||
property alias buddyModel: buddyBox.model
|
||||
property alias cylinderModel0: cylinderBox0.model
|
||||
property alias cylinderModel1: cylinderBox1.model
|
||||
|
|
@ -64,11 +64,11 @@ Item {
|
|||
detailsEdit.depthText = ""
|
||||
detailsEdit.airtempText = ""
|
||||
detailsEdit.watertempText = ""
|
||||
detailsEdit.divemasterText = ""
|
||||
detailsEdit.diveguideText = ""
|
||||
detailsEdit.buddyText = ""
|
||||
suitBox.currentIndex = -1
|
||||
buddyBox.currentIndex = -1
|
||||
divemasterBox.currentIndex = -1
|
||||
diveguideBox.currentIndex = -1
|
||||
cylinderBox0.currentIndex = -1
|
||||
cylinderBox1.currentIndex = -1
|
||||
cylinderBox2.currentIndex = -1
|
||||
|
|
@ -118,7 +118,7 @@ Item {
|
|||
// apply the changes to the dive_table
|
||||
manager.commitChanges(dive_id, detailsEdit.number, detailsEdit.dateText, locationBox.editText, detailsEdit.gpsText, detailsEdit.durationText,
|
||||
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText,
|
||||
suitBox.editText, buddyBox.editText, divemasterBox.editText, detailsEdit.tagText,
|
||||
suitBox.editText, buddyBox.editText, diveguideBox.editText, detailsEdit.tagText,
|
||||
detailsEdit.weightText, detailsEdit.notesText, startpressure,
|
||||
endpressure, usedGas, usedCyl,
|
||||
detailsEdit.rating,
|
||||
|
|
@ -296,13 +296,13 @@ Item {
|
|||
TemplateLabelSmall {
|
||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||
horizontalAlignment: Text.AlignRight
|
||||
text: qsTr("Divemaster:")
|
||||
text: qsTr("Dive guide:")
|
||||
}
|
||||
TemplateEditComboBox {
|
||||
id: divemasterBox
|
||||
id: diveguideBox
|
||||
flickable: detailsEditFlickable
|
||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||
manager.divemasterList : null
|
||||
manager.diveguideList : null
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ Item {
|
|||
// fifth row
|
||||
//-----------
|
||||
TemplateLabelSmall {
|
||||
text: qsTr("Divemaster:")
|
||||
text: qsTr("Dive guide:")
|
||||
opacity: 0.6
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
Layout.maximumWidth: detailsView.col1Width
|
||||
|
|
@ -501,8 +501,8 @@ Item {
|
|||
// sixth row
|
||||
//-----------
|
||||
TemplateLabelSmall {
|
||||
id: txtDiveMaster
|
||||
text: diveMaster
|
||||
id: txtDiveGuide
|
||||
text: diveGuide
|
||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||
Layout.maximumWidth: detailsView.col1Width
|
||||
color: subsurfaceTheme.textColor
|
||||
|
|
|
|||
|
|
@ -157,9 +157,9 @@ Kirigami.ApplicationWindow {
|
|||
detailsWindow.buddyIndex = -1
|
||||
detailsWindow.buddyText = ""
|
||||
detailsWindow.depth = ""
|
||||
detailsWindow.divemasterModel = manager.divemasterList
|
||||
detailsWindow.divemasterIndex = -1
|
||||
detailsWindow.divemasterText = ""
|
||||
detailsWindow.diveguideModel = manager.diveguideList
|
||||
detailsWindow.diveguideIndex = -1
|
||||
detailsWindow.diveguideText = ""
|
||||
detailsWindow.notes = ""
|
||||
detailsWindow.location = ""
|
||||
detailsWindow.gps = ""
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ QMLManager::QMLManager() :
|
|||
|
||||
// Let's set some defaults to be copied so users don't necessarily need
|
||||
// to know how to configure this
|
||||
what.divemaster = true;
|
||||
what.diveguide = true;
|
||||
what.buddy = true;
|
||||
what.suit = true;
|
||||
what.tags = true;
|
||||
|
|
@ -458,7 +458,7 @@ void QMLManager::updateAllGlobalLists()
|
|||
{
|
||||
emit buddyListChanged();
|
||||
emit suitListChanged();
|
||||
emit divemasterListChanged();
|
||||
emit diveguideListChanged();
|
||||
// TODO: It would be nice if we could export the list of locations via model/view instead of a Q_PROPERTY
|
||||
emit locationListChanged();
|
||||
}
|
||||
|
|
@ -1062,7 +1062,7 @@ bool QMLManager::checkDepth(dive *d, QString depth)
|
|||
|
||||
// update the dive and return the notes field, stripped of the HTML junk
|
||||
void QMLManager::commitChanges(QString diveId, QString number, QString date, QString location, QString gps, QString duration, QString depth,
|
||||
QString airtemp, QString watertemp, QString suit, QString buddy, QString diveMaster, QString tags, QString weight, QString notes,
|
||||
QString airtemp, QString watertemp, QString suit, QString buddy, QString diveGuide, QString tags, QString weight, QString notes,
|
||||
QStringList startpressure, QStringList endpressure, QStringList gasmix, QStringList usedCylinder, int rating, int visibility, QString state)
|
||||
{
|
||||
struct dive *orig = get_dive_by_uniq_id(diveId.toInt());
|
||||
|
|
@ -1083,7 +1083,7 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
|
|||
QStringLiteral("watertmp:'%1'\n").arg(watertemp) <<
|
||||
QStringLiteral("suit :'%1'\n").arg(suit) <<
|
||||
QStringLiteral("buddy :'%1'\n").arg(buddy) <<
|
||||
QStringLiteral("diveMstr:'%1'\n").arg(diveMaster) <<
|
||||
QStringLiteral("diveGde :'%1'\n").arg(diveGuide) <<
|
||||
QStringLiteral("tags :'%1'\n").arg(tags) <<
|
||||
QStringLiteral("weight :'%1'\n").arg(weight) <<
|
||||
QStringLiteral("state :'%1'\n").arg(state);
|
||||
|
|
@ -1212,13 +1212,13 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
|
|||
free(d->buddy);
|
||||
d->buddy = copy_qstring(buddy);
|
||||
}
|
||||
if (d->divemaster != diveMaster) {
|
||||
if (diveMaster.contains(",")){
|
||||
diveMaster = diveMaster.replace(QRegularExpression("\\s*,\\s*"), ", ");
|
||||
if (d->diveguide != diveGuide) {
|
||||
if (diveGuide.contains(",")){
|
||||
diveGuide = diveGuide.replace(QRegularExpression("\\s*,\\s*"), ", ");
|
||||
}
|
||||
diveChanged = true;
|
||||
free(d->divemaster);
|
||||
d->divemaster = copy_qstring(diveMaster);
|
||||
free(d->diveguide);
|
||||
d->diveguide = copy_qstring(diveGuide);
|
||||
}
|
||||
// normalize the tag list we have and the one we get from the UI
|
||||
// try hard to deal with accidental white space issues
|
||||
|
|
@ -1523,12 +1523,12 @@ bool QMLManager::toggleNotes(bool toggle)
|
|||
return what.notes;
|
||||
}
|
||||
|
||||
bool QMLManager::toggleDiveMaster(bool toggle)
|
||||
bool QMLManager::toggleDiveGuide(bool toggle)
|
||||
{
|
||||
if (toggle)
|
||||
what.divemaster = what.divemaster ? false : true;
|
||||
what.diveguide = what.diveguide ? false : true;
|
||||
|
||||
return what.divemaster;
|
||||
return what.diveguide;
|
||||
}
|
||||
|
||||
bool QMLManager::toggleBuddy(bool toggle)
|
||||
|
|
@ -1764,9 +1764,9 @@ QStringList QMLManager::buddyList() const
|
|||
return buddyModel.stringList();
|
||||
}
|
||||
|
||||
QStringList QMLManager::divemasterList() const
|
||||
QStringList QMLManager::diveguideList() const
|
||||
{
|
||||
return divemasterModel.stringList();
|
||||
return diveguideModel.stringList();
|
||||
}
|
||||
|
||||
QStringList QMLManager::locationList() const
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class QMLManager : public QObject {
|
|||
Q_PROPERTY(QString notificationText MEMBER m_notificationText WRITE setNotificationText NOTIFY notificationTextChanged)
|
||||
Q_PROPERTY(QStringList suitList READ suitList NOTIFY suitListChanged)
|
||||
Q_PROPERTY(QStringList buddyList READ buddyList NOTIFY buddyListChanged)
|
||||
Q_PROPERTY(QStringList divemasterList READ divemasterList NOTIFY divemasterListChanged)
|
||||
Q_PROPERTY(QStringList diveguideList READ diveguideList NOTIFY diveguideListChanged)
|
||||
Q_PROPERTY(QStringList locationList READ locationList NOTIFY locationListChanged)
|
||||
Q_PROPERTY(QStringList cylinderListInit READ cylinderListInit CONSTANT)
|
||||
Q_PROPERTY(QStringList defaultCylinderListInit READ defaultCylinderListInit CONSTANT)
|
||||
|
|
@ -144,7 +144,7 @@ public:
|
|||
|
||||
QStringList suitList() const;
|
||||
QStringList buddyList() const;
|
||||
QStringList divemasterList() const;
|
||||
QStringList diveguideList() const;
|
||||
QStringList locationList() const;
|
||||
QStringList cylinderListInit() const;
|
||||
QStringList defaultCylinderListInit() const;
|
||||
|
|
@ -169,7 +169,7 @@ public slots:
|
|||
void commitChanges(QString diveId, QString number, QString date, QString location, QString gps,
|
||||
QString duration, QString depth, QString airtemp,
|
||||
QString watertemp, QString suit, QString buddy,
|
||||
QString diveMaster, QString tags, QString weight, QString notes, QStringList startpressure,
|
||||
QString diveGuide, QString tags, QString weight, QString notes, QStringList startpressure,
|
||||
QStringList endpressure, QStringList gasmix, QStringList usedCylinder, int rating, int visibility, QString state);
|
||||
void updateTripDetails(QString tripIdString, QString tripLocation, QString tripNotes);
|
||||
void removeDiveFromTrip(int id);
|
||||
|
|
@ -185,7 +185,7 @@ public slots:
|
|||
void pasteDiveData(int id);
|
||||
bool toggleDiveSite(bool toggle);
|
||||
bool toggleNotes(bool toggle);
|
||||
bool toggleDiveMaster(bool toggle);
|
||||
bool toggleDiveGuide(bool toggle);
|
||||
bool toggleBuddy(bool toggle);
|
||||
bool toggleSuit(bool toggle);
|
||||
bool toggleRating(bool toggle);
|
||||
|
|
@ -223,7 +223,7 @@ public slots:
|
|||
private:
|
||||
BuddyCompletionModel buddyModel;
|
||||
SuitCompletionModel suitModel;
|
||||
DiveMasterCompletionModel divemasterModel;
|
||||
DiveGuideCompletionModel diveguideModel;
|
||||
DiveSiteSortedModel locationModel;
|
||||
QString m_startPageText;
|
||||
QString m_lastError;
|
||||
|
|
@ -280,7 +280,7 @@ signals:
|
|||
void btEnabledChanged();
|
||||
void suitListChanged();
|
||||
void buddyListChanged();
|
||||
void divemasterListChanged();
|
||||
void diveguideListChanged();
|
||||
void locationListChanged();
|
||||
void cloudCacheListChanged();
|
||||
void waitingForPositionChanged();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue