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
|
@ -1,5 +1,6 @@
|
||||||
- desktop: Don't lose cursor position in notes when switching between windows [#3369]
|
- desktop: Don't lose cursor position in notes when switching between windows [#3369]
|
||||||
- Uemis support: fix the ability disconnect/reconnect the Zurich when its filesystem is full
|
- Uemis support: fix the ability disconnect/reconnect the Zurich when its filesystem is full
|
||||||
|
- general: rename dive master to dive guide
|
||||||
- libdivecomputer: add support for latest BLE hardware in OSTC dive computers
|
- libdivecomputer: add support for latest BLE hardware in OSTC dive computers
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
@ -204,7 +204,7 @@ void export_TeX(const char *filename, bool selected_only, bool plain, ExportCall
|
||||||
put_format(&buf, "\\def\\%sprofilename{profile%d}\n", ssrf, dive->number);
|
put_format(&buf, "\\def\\%sprofilename{profile%d}\n", ssrf, dive->number);
|
||||||
put_format(&buf, "\\def\\%scomment{%s}\n", ssrf, dive->notes ? dive->notes : "");
|
put_format(&buf, "\\def\\%scomment{%s}\n", ssrf, dive->notes ? dive->notes : "");
|
||||||
put_format(&buf, "\\def\\%sbuddy{%s}\n", ssrf, dive->buddy ? dive->buddy : "");
|
put_format(&buf, "\\def\\%sbuddy{%s}\n", ssrf, dive->buddy ? dive->buddy : "");
|
||||||
put_format(&buf, "\\def\\%sdivemaster{%s}\n", ssrf, dive->divemaster ? dive->divemaster : "");
|
put_format(&buf, "\\def\\%sdivemaster{%s}\n", ssrf, dive->diveguide ? dive->diveguide : "");
|
||||||
put_format(&buf, "\\def\\%ssuit{%s}\n", ssrf, dive->suit ? dive->suit : "");
|
put_format(&buf, "\\def\\%ssuit{%s}\n", ssrf, dive->suit ? dive->suit : "");
|
||||||
|
|
||||||
// Print cylinder data
|
// Print cylinder data
|
||||||
|
|
|
@ -264,9 +264,9 @@ int editBuddies(const QStringList &newList, bool currentDiveOnly)
|
||||||
return execute_edit(new EditBuddies(newList, currentDiveOnly));
|
return execute_edit(new EditBuddies(newList, currentDiveOnly));
|
||||||
}
|
}
|
||||||
|
|
||||||
int editDiveMaster(const QStringList &newList, bool currentDiveOnly)
|
int editDiveGuide(const QStringList &newList, bool currentDiveOnly)
|
||||||
{
|
{
|
||||||
return execute_edit(new EditDiveMaster(newList, currentDiveOnly));
|
return execute_edit(new EditDiveGuide(newList, currentDiveOnly));
|
||||||
}
|
}
|
||||||
|
|
||||||
void pasteDives(const dive *d, dive_components what)
|
void pasteDives(const dive *d, dive_components what)
|
||||||
|
|
|
@ -91,7 +91,7 @@ int editDiveSite(struct dive_site *newValue, bool currentDiveOnly);
|
||||||
int editDiveSiteNew(const QString &newName, bool currentDiveOnly);
|
int editDiveSiteNew(const QString &newName, bool currentDiveOnly);
|
||||||
int editTags(const QStringList &newList, bool currentDiveOnly);
|
int editTags(const QStringList &newList, bool currentDiveOnly);
|
||||||
int editBuddies(const QStringList &newList, bool currentDiveOnly);
|
int editBuddies(const QStringList &newList, bool currentDiveOnly);
|
||||||
int editDiveMaster(const QStringList &newList, bool currentDiveOnly);
|
int editDiveGuide(const QStringList &newList, bool currentDiveOnly);
|
||||||
void pasteDives(const dive *d, dive_components what);
|
void pasteDives(const dive *d, dive_components what);
|
||||||
void replanDive(dive *d); // dive computer(s) and cylinder(s) will be reset!
|
void replanDive(dive *d); // dive computer(s) and cylinder(s) will be reset!
|
||||||
void editProfile(dive *d); // dive computer(s) and cylinder(s) will be reset!
|
void editProfile(dive *d); // dive computer(s) and cylinder(s) will be reset!
|
||||||
|
|
|
@ -600,22 +600,22 @@ QString EditBuddies::fieldName() const
|
||||||
return Command::Base::tr("buddies");
|
return Command::Base::tr("buddies");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ***** DiveMaster *****
|
// ***** DiveGuide *****
|
||||||
QStringList EditDiveMaster::data(struct dive *d) const
|
QStringList EditDiveGuide::data(struct dive *d) const
|
||||||
{
|
{
|
||||||
return stringToList(d->divemaster);
|
return stringToList(d->diveguide);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditDiveMaster::set(struct dive *d, const QStringList &v) const
|
void EditDiveGuide::set(struct dive *d, const QStringList &v) const
|
||||||
{
|
{
|
||||||
QString text = v.join(", ");
|
QString text = v.join(", ");
|
||||||
free(d->divemaster);
|
free(d->diveguide);
|
||||||
d->divemaster = copy_qstring(text);
|
d->diveguide = copy_qstring(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString EditDiveMaster::fieldName() const
|
QString EditDiveGuide::fieldName() const
|
||||||
{
|
{
|
||||||
return Command::Base::tr("dive master");
|
return Command::Base::tr("dive guide");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void swapCandQString(QString &q, char *&c)
|
static void swapCandQString(QString &q, char *&c)
|
||||||
|
@ -633,8 +633,8 @@ PasteState::PasteState(dive *dIn, const dive *data, dive_components what) : d(dI
|
||||||
memset(&weightsystems, 0, sizeof(weightsystems));
|
memset(&weightsystems, 0, sizeof(weightsystems));
|
||||||
if (what.notes)
|
if (what.notes)
|
||||||
notes = data->notes;
|
notes = data->notes;
|
||||||
if (what.divemaster)
|
if (what.diveguide)
|
||||||
divemaster = data->divemaster;
|
diveguide = data->diveguide;
|
||||||
if (what.buddy)
|
if (what.buddy)
|
||||||
buddy = data->buddy;
|
buddy = data->buddy;
|
||||||
if (what.suit)
|
if (what.suit)
|
||||||
|
@ -706,8 +706,8 @@ void PasteState::swap(dive_components what)
|
||||||
{
|
{
|
||||||
if (what.notes)
|
if (what.notes)
|
||||||
swapCandQString(notes, d->notes);
|
swapCandQString(notes, d->notes);
|
||||||
if (what.divemaster)
|
if (what.diveguide)
|
||||||
swapCandQString(divemaster, d->divemaster);
|
swapCandQString(diveguide, d->diveguide);
|
||||||
if (what.buddy)
|
if (what.buddy)
|
||||||
swapCandQString(buddy, d->buddy);
|
swapCandQString(buddy, d->buddy);
|
||||||
if (what.suit)
|
if (what.suit)
|
||||||
|
@ -767,7 +767,7 @@ void PasteDives::undo()
|
||||||
// Send signals.
|
// Send signals.
|
||||||
DiveField fields(DiveField::NONE);
|
DiveField fields(DiveField::NONE);
|
||||||
fields.notes = what.notes;
|
fields.notes = what.notes;
|
||||||
fields.divemaster = what.divemaster;
|
fields.diveguide = what.diveguide;
|
||||||
fields.buddy = what.buddy;
|
fields.buddy = what.buddy;
|
||||||
fields.suit = what.suit;
|
fields.suit = what.suit;
|
||||||
fields.rating = what.rating;
|
fields.rating = what.rating;
|
||||||
|
@ -1322,8 +1322,8 @@ EditDive::EditDive(dive *oldDiveIn, dive *newDiveIn, dive_site *createDs, dive_s
|
||||||
changedFields |= DiveField::ATM_PRESS;
|
changedFields |= DiveField::ATM_PRESS;
|
||||||
if (oldDive->dive_site != newDive->dive_site)
|
if (oldDive->dive_site != newDive->dive_site)
|
||||||
changedFields |= DiveField::DIVESITE;
|
changedFields |= DiveField::DIVESITE;
|
||||||
if (!same_string(oldDive->divemaster, newDive->divemaster))
|
if (!same_string(oldDive->diveguide, newDive->diveguide))
|
||||||
changedFields |= DiveField::DIVEMASTER;
|
changedFields |= DiveField::DIVEGUIDE;
|
||||||
if (!same_string(oldDive->buddy, newDive->buddy))
|
if (!same_string(oldDive->buddy, newDive->buddy))
|
||||||
changedFields |= DiveField::BUDDY;
|
changedFields |= DiveField::BUDDY;
|
||||||
if (oldDive->rating != newDive->rating)
|
if (oldDive->rating != newDive->rating)
|
||||||
|
|
|
@ -229,7 +229,7 @@ public:
|
||||||
QString fieldName() const override;
|
QString fieldName() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fields that work with tag-lists (tags, buddies, divemasters) work differently and therefore
|
// Fields that work with tag-lists (tags, buddies, dive guides) work differently and therefore
|
||||||
// have their own base class. In this case, it's not a template, as all these lists are base
|
// have their own base class. In this case, it's not a template, as all these lists are base
|
||||||
// on strings.
|
// on strings.
|
||||||
class EditTagsBase : public EditDivesBase {
|
class EditTagsBase : public EditDivesBase {
|
||||||
|
@ -276,7 +276,7 @@ public:
|
||||||
QString fieldName() const override;
|
QString fieldName() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class EditDiveMaster : public EditTagsTemplate<DiveField::DIVEMASTER> {
|
class EditDiveGuide : public EditTagsTemplate<DiveField::DIVEGUIDE> {
|
||||||
public:
|
public:
|
||||||
using EditTagsTemplate::EditTagsTemplate; // Use constructor of base class.
|
using EditTagsTemplate::EditTagsTemplate; // Use constructor of base class.
|
||||||
QStringList data(struct dive *d) const override;
|
QStringList data(struct dive *d) const override;
|
||||||
|
@ -289,7 +289,7 @@ struct PasteState {
|
||||||
dive *d;
|
dive *d;
|
||||||
dive_site *divesite;
|
dive_site *divesite;
|
||||||
QString notes;
|
QString notes;
|
||||||
QString divemaster;
|
QString diveguide;
|
||||||
QString buddy;
|
QString buddy;
|
||||||
QString suit;
|
QString suit;
|
||||||
int rating;
|
int rating;
|
||||||
|
|
|
@ -224,7 +224,7 @@ static void free_dive_structures(struct dive *d)
|
||||||
fulltext_unregister(d);
|
fulltext_unregister(d);
|
||||||
/* free the strings */
|
/* free the strings */
|
||||||
free(d->buddy);
|
free(d->buddy);
|
||||||
free(d->divemaster);
|
free(d->diveguide);
|
||||||
free(d->notes);
|
free(d->notes);
|
||||||
free(d->suit);
|
free(d->suit);
|
||||||
/* free tags, additional dive computers, and pictures */
|
/* free tags, additional dive computers, and pictures */
|
||||||
|
@ -272,7 +272,7 @@ static void copy_dive_nodc(const struct dive *s, struct dive *d)
|
||||||
d->full_text = NULL;
|
d->full_text = NULL;
|
||||||
invalidate_dive_cache(d);
|
invalidate_dive_cache(d);
|
||||||
d->buddy = copy_string(s->buddy);
|
d->buddy = copy_string(s->buddy);
|
||||||
d->divemaster = copy_string(s->divemaster);
|
d->diveguide = copy_string(s->diveguide);
|
||||||
d->notes = copy_string(s->notes);
|
d->notes = copy_string(s->notes);
|
||||||
d->suit = copy_string(s->suit);
|
d->suit = copy_string(s->suit);
|
||||||
copy_cylinders(&s->cylinders, &d->cylinders);
|
copy_cylinders(&s->cylinders, &d->cylinders);
|
||||||
|
@ -319,7 +319,7 @@ void selective_copy_dive(const struct dive *s, struct dive *d, struct dive_compo
|
||||||
if (clear)
|
if (clear)
|
||||||
clear_dive(d);
|
clear_dive(d);
|
||||||
CONDITIONAL_COPY_STRING(notes);
|
CONDITIONAL_COPY_STRING(notes);
|
||||||
CONDITIONAL_COPY_STRING(divemaster);
|
CONDITIONAL_COPY_STRING(diveguide);
|
||||||
CONDITIONAL_COPY_STRING(buddy);
|
CONDITIONAL_COPY_STRING(buddy);
|
||||||
CONDITIONAL_COPY_STRING(suit);
|
CONDITIONAL_COPY_STRING(suit);
|
||||||
if (what.rating)
|
if (what.rating)
|
||||||
|
@ -2616,7 +2616,7 @@ struct dive *merge_dives(const struct dive *a, const struct dive *b, int offset,
|
||||||
*trip = get_preferred_trip(a, b);
|
*trip = get_preferred_trip(a, b);
|
||||||
MERGE_TXT(res, a, b, notes, "\n--\n");
|
MERGE_TXT(res, a, b, notes, "\n--\n");
|
||||||
MERGE_TXT(res, a, b, buddy, ", ");
|
MERGE_TXT(res, a, b, buddy, ", ");
|
||||||
MERGE_TXT(res, a, b, divemaster, ", ");
|
MERGE_TXT(res, a, b, diveguide, ", ");
|
||||||
MERGE_MAX(res, a, b, rating);
|
MERGE_MAX(res, a, b, rating);
|
||||||
MERGE_TXT(res, a, b, suit, ", ");
|
MERGE_TXT(res, a, b, suit, ", ");
|
||||||
MERGE_MAX(res, a, b, number);
|
MERGE_MAX(res, a, b, number);
|
||||||
|
|
|
@ -32,7 +32,7 @@ struct dive {
|
||||||
timestamp_t when;
|
timestamp_t when;
|
||||||
struct dive_site *dive_site;
|
struct dive_site *dive_site;
|
||||||
char *notes;
|
char *notes;
|
||||||
char *divemaster, *buddy;
|
char *diveguide, *buddy;
|
||||||
struct cylinder_table cylinders;
|
struct cylinder_table cylinders;
|
||||||
struct weightsystem_table weightsystems;
|
struct weightsystem_table weightsystems;
|
||||||
char *suit;
|
char *suit;
|
||||||
|
@ -78,7 +78,7 @@ extern int same_gasmix_cylinder(const cylinder_t *cyl, int cylid, const struct d
|
||||||
struct dive_components {
|
struct dive_components {
|
||||||
unsigned int divesite : 1;
|
unsigned int divesite : 1;
|
||||||
unsigned int notes : 1;
|
unsigned int notes : 1;
|
||||||
unsigned int divemaster : 1;
|
unsigned int diveguide : 1;
|
||||||
unsigned int buddy : 1;
|
unsigned int buddy : 1;
|
||||||
unsigned int suit : 1;
|
unsigned int suit : 1;
|
||||||
unsigned int rating : 1;
|
unsigned int rating : 1;
|
||||||
|
|
|
@ -848,7 +848,7 @@ static bool has_people(const filter_constraint &c, const struct dive *d)
|
||||||
QStringList dive_people;
|
QStringList dive_people;
|
||||||
for (const QString &s: QString(d->buddy).split(",", SKIP_EMPTY))
|
for (const QString &s: QString(d->buddy).split(",", SKIP_EMPTY))
|
||||||
dive_people.push_back(s.trimmed());
|
dive_people.push_back(s.trimmed());
|
||||||
for (const QString &s: QString(d->divemaster).split(",", SKIP_EMPTY))
|
for (const QString &s: QString(d->diveguide).split(",", SKIP_EMPTY))
|
||||||
dive_people.push_back(s.trimmed());
|
dive_people.push_back(s.trimmed());
|
||||||
return check(c, dive_people);
|
return check(c, dive_people);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ static std::vector<QString> getWords(const dive *d)
|
||||||
{
|
{
|
||||||
std::vector<QString> res;
|
std::vector<QString> res;
|
||||||
tokenize(QString(d->notes), res);
|
tokenize(QString(d->notes), res);
|
||||||
tokenize(QString(d->divemaster), res);
|
tokenize(QString(d->diveguide), res);
|
||||||
tokenize(QString(d->buddy), res);
|
tokenize(QString(d->buddy), res);
|
||||||
tokenize(QString(d->suit), res);
|
tokenize(QString(d->suit), res);
|
||||||
for (const tag_entry *tag = d->tag_list; tag; tag = tag->next)
|
for (const tag_entry *tag = d->tag_list; tag; tag = tag->next)
|
||||||
|
|
|
@ -296,7 +296,7 @@ static int divinglog_dive(void *param, int columns, char **data, char **column)
|
||||||
state->cur_dive->dc.duration.seconds = atoi(data[6]) * 60;
|
state->cur_dive->dc.duration.seconds = atoi(data[6]) * 60;
|
||||||
|
|
||||||
if (data[7])
|
if (data[7])
|
||||||
utf8_string(data[7], &state->cur_dive->divemaster);
|
utf8_string(data[7], &state->cur_dive->diveguide);
|
||||||
|
|
||||||
if (data[8])
|
if (data[8])
|
||||||
state->cur_dive->airtemp.mkelvin = C_to_mkelvin(atol(data[8]));
|
state->cur_dive->airtemp.mkelvin = C_to_mkelvin(atol(data[8]));
|
||||||
|
|
|
@ -214,8 +214,8 @@ static void parse_dive_location(char *line, struct membuffer *str, struct git_pa
|
||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_dive_divemaster(char *line, struct membuffer *str, struct git_parser_state *state)
|
static void parse_dive_diveguide(char *line, struct membuffer *str, struct git_parser_state *state)
|
||||||
{ UNUSED(line); state->active_dive->divemaster = detach_cstring(str); }
|
{ UNUSED(line); state->active_dive->diveguide = detach_cstring(str); }
|
||||||
|
|
||||||
static void parse_dive_buddy(char *line, struct membuffer *str, struct git_parser_state *state)
|
static void parse_dive_buddy(char *line, struct membuffer *str, struct git_parser_state *state)
|
||||||
{ UNUSED(line); state->active_dive->buddy = detach_cstring(str); }
|
{ UNUSED(line); state->active_dive->buddy = detach_cstring(str); }
|
||||||
|
@ -1113,8 +1113,9 @@ static void divecomputer_parser(char *line, struct membuffer *str, struct git_pa
|
||||||
struct keyword_action dive_action[] = {
|
struct keyword_action dive_action[] = {
|
||||||
#undef D
|
#undef D
|
||||||
#define D(x) { #x, parse_dive_ ## x }
|
#define D(x) { #x, parse_dive_ ## x }
|
||||||
D(airpressure), D(airtemp), D(buddy), D(chill), D(current), D(cylinder), D(divemaster), D(divesiteid), D(duration),
|
/* For historical reasons, we accept divemaster and diveguide */
|
||||||
D(gps), D(invalid), D(location), D(notes), D(notrip), D(rating), D(suit), D(surge),
|
D(airpressure), D(airtemp), D(buddy), D(chill), D(current), D(cylinder), D(diveguide), { "divemaster", parse_dive_diveguide },
|
||||||
|
D(divesiteid), D(duration), D(gps), D(invalid), D(location), D(notes), D(notrip), D(rating), D(suit), D(surge),
|
||||||
D(tags), D(visibility), D(watersalinity), D(watertemp), D(wavesize), D(weightsystem)
|
D(tags), D(visibility), D(watersalinity), D(watertemp), D(wavesize), D(weightsystem)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1322,7 +1322,10 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf, str
|
||||||
return;
|
return;
|
||||||
if (MATCH("notes", utf8_string, &dive->notes))
|
if (MATCH("notes", utf8_string, &dive->notes))
|
||||||
return;
|
return;
|
||||||
if (MATCH("divemaster", utf8_string, &dive->divemaster))
|
// For historic reasons, we accept dive guide as well as dive master
|
||||||
|
if (MATCH("diveguide", utf8_string, &dive->diveguide))
|
||||||
|
return;
|
||||||
|
if (MATCH("divemaster", utf8_string, &dive->diveguide))
|
||||||
return;
|
return;
|
||||||
if (MATCH("buddy", utf8_string, &dive->buddy))
|
if (MATCH("buddy", utf8_string, &dive->buddy))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -97,7 +97,7 @@ static void show_utf8(struct membuffer *b, const char *prefix, const char *value
|
||||||
|
|
||||||
static void save_overview(struct membuffer *b, struct dive *dive)
|
static void save_overview(struct membuffer *b, struct dive *dive)
|
||||||
{
|
{
|
||||||
show_utf8(b, "divemaster ", dive->divemaster, "\n");
|
show_utf8(b, "divemaster ", dive->diveguide, "\n");
|
||||||
show_utf8(b, "buddy ", dive->buddy, "\n");
|
show_utf8(b, "buddy ", dive->buddy, "\n");
|
||||||
show_utf8(b, "suit ", dive->suit, "\n");
|
show_utf8(b, "suit ", dive->suit, "\n");
|
||||||
show_utf8(b, "notes ", dive->notes, "\n");
|
show_utf8(b, "notes ", dive->notes, "\n");
|
||||||
|
|
|
@ -370,7 +370,7 @@ static void write_one_dive(struct membuffer *b, struct dive *dive, const char *p
|
||||||
put_HTML_watertemp(b, dive, "\"water\":\"", "\"");
|
put_HTML_watertemp(b, dive, "\"water\":\"", "\"");
|
||||||
put_string(b, " },");
|
put_string(b, " },");
|
||||||
write_attribute(b, "buddy", dive->buddy, ", ");
|
write_attribute(b, "buddy", dive->buddy, ", ");
|
||||||
write_attribute(b, "divemaster", dive->divemaster, ", ");
|
write_attribute(b, "divemaster", dive->diveguide, ", ");
|
||||||
write_attribute(b, "suit", dive->suit, ", ");
|
write_attribute(b, "suit", dive->suit, ", ");
|
||||||
put_HTML_tags(b, dive, "\"tags\":", ",");
|
put_HTML_tags(b, dive, "\"tags\":", ",");
|
||||||
if (!list_only) {
|
if (!list_only) {
|
||||||
|
@ -528,6 +528,7 @@ void export_translation(const char *file_name)
|
||||||
write_attribute(b, "Surge", translate("gettextFromC", "Surge"), ", ");
|
write_attribute(b, "Surge", translate("gettextFromC", "Surge"), ", ");
|
||||||
write_attribute(b, "Chill", translate("gettextFromC", "Chill"), ", ");
|
write_attribute(b, "Chill", translate("gettextFromC", "Chill"), ", ");
|
||||||
write_attribute(b, "Duration", translate("gettextFromC", "Duration"), ", ");
|
write_attribute(b, "Duration", translate("gettextFromC", "Duration"), ", ");
|
||||||
|
write_attribute(b, "DiveGuide", translate("gettextFromC", "Diveguide"), ", ");
|
||||||
write_attribute(b, "DiveMaster", translate("gettextFromC", "Divemaster"), ", ");
|
write_attribute(b, "DiveMaster", translate("gettextFromC", "Divemaster"), ", ");
|
||||||
write_attribute(b, "Buddy", translate("gettextFromC", "Buddy"), ", ");
|
write_attribute(b, "Buddy", translate("gettextFromC", "Buddy"), ", ");
|
||||||
write_attribute(b, "Suit", translate("gettextFromC", "Suit"), ", ");
|
write_attribute(b, "Suit", translate("gettextFromC", "Suit"), ", ");
|
||||||
|
|
|
@ -162,7 +162,7 @@ static void save_salinity(struct membuffer *b, struct divecomputer *dc)
|
||||||
|
|
||||||
static void save_overview(struct membuffer *b, struct dive *dive, bool anonymize)
|
static void save_overview(struct membuffer *b, struct dive *dive, bool anonymize)
|
||||||
{
|
{
|
||||||
show_utf8_blanked(b, dive->divemaster, " <divemaster>", "</divemaster>\n", 0, anonymize);
|
show_utf8_blanked(b, dive->diveguide, " <divemaster>", "</divemaster>\n", 0, anonymize);
|
||||||
show_utf8_blanked(b, dive->buddy, " <buddy>", "</buddy>\n", 0, anonymize);
|
show_utf8_blanked(b, dive->buddy, " <buddy>", "</buddy>\n", 0, anonymize);
|
||||||
show_utf8_blanked(b, dive->notes, " <notes>", "</notes>\n", 0, anonymize);
|
show_utf8_blanked(b, dive->notes, " <notes>", "</notes>\n", 0, anonymize);
|
||||||
show_utf8_blanked(b, dive->suit, " <suit>", "</suit>\n", 0, anonymize);
|
show_utf8_blanked(b, dive->suit, " <suit>", "</suit>\n", 0, anonymize);
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct DiveField {
|
||||||
unsigned int water_temp : 1;
|
unsigned int water_temp : 1;
|
||||||
unsigned int atm_press : 1;
|
unsigned int atm_press : 1;
|
||||||
unsigned int divesite : 1;
|
unsigned int divesite : 1;
|
||||||
unsigned int divemaster : 1;
|
unsigned int diveguide : 1;
|
||||||
unsigned int buddy : 1;
|
unsigned int buddy : 1;
|
||||||
unsigned int rating : 1;
|
unsigned int rating : 1;
|
||||||
unsigned int visibility : 1;
|
unsigned int visibility : 1;
|
||||||
|
@ -49,7 +49,7 @@ struct DiveField {
|
||||||
WATER_TEMP = 1 << 5,
|
WATER_TEMP = 1 << 5,
|
||||||
ATM_PRESS = 1 << 6,
|
ATM_PRESS = 1 << 6,
|
||||||
DIVESITE = 1 << 7,
|
DIVESITE = 1 << 7,
|
||||||
DIVEMASTER = 1 << 8,
|
DIVEGUIDE = 1 << 8,
|
||||||
BUDDY = 1 << 9,
|
BUDDY = 1 << 9,
|
||||||
RATING = 1 << 10,
|
RATING = 1 << 10,
|
||||||
VISIBILITY = 1 << 11,
|
VISIBILITY = 1 << 11,
|
||||||
|
@ -159,7 +159,7 @@ inline DiveField::DiveField(int flags) :
|
||||||
water_temp((flags & WATER_TEMP) != 0),
|
water_temp((flags & WATER_TEMP) != 0),
|
||||||
atm_press((flags & ATM_PRESS) != 0),
|
atm_press((flags & ATM_PRESS) != 0),
|
||||||
divesite((flags & DIVESITE) != 0),
|
divesite((flags & DIVESITE) != 0),
|
||||||
divemaster((flags & DIVEMASTER) != 0),
|
diveguide((flags & DIVEGUIDE) != 0),
|
||||||
buddy((flags & BUDDY) != 0),
|
buddy((flags & BUDDY) != 0),
|
||||||
rating((flags & RATING) != 0),
|
rating((flags & RATING) != 0),
|
||||||
visibility((flags & VISIBILITY) != 0),
|
visibility((flags & VISIBILITY) != 0),
|
||||||
|
|
|
@ -860,7 +860,7 @@ static bool uemis_delete_dive(device_data_t *devdata, uint32_t diveid)
|
||||||
|
|
||||||
free(dive->dc.sample);
|
free(dive->dc.sample);
|
||||||
free((void *)dive->notes);
|
free((void *)dive->notes);
|
||||||
free((void *)dive->divemaster);
|
free((void *)dive->diveguide);
|
||||||
free((void *)dive->buddy);
|
free((void *)dive->buddy);
|
||||||
free((void *)dive->suit);
|
free((void *)dive->suit);
|
||||||
taglist_free(dive->tag_list);
|
taglist_free(dive->tag_list);
|
||||||
|
|
|
@ -117,9 +117,9 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="divemaster">
|
<widget class="QCheckBox" name="diveguide">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Divemaster</string>
|
<string>Dive guide</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -305,7 +305,7 @@ DiveComponentSelection::DiveComponentSelection(QWidget *parent, struct dive *tar
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
what = _what;
|
what = _what;
|
||||||
UI_FROM_COMPONENT(divesite);
|
UI_FROM_COMPONENT(divesite);
|
||||||
UI_FROM_COMPONENT(divemaster);
|
UI_FROM_COMPONENT(diveguide);
|
||||||
UI_FROM_COMPONENT(buddy);
|
UI_FROM_COMPONENT(buddy);
|
||||||
UI_FROM_COMPONENT(rating);
|
UI_FROM_COMPONENT(rating);
|
||||||
UI_FROM_COMPONENT(visibility);
|
UI_FROM_COMPONENT(visibility);
|
||||||
|
@ -327,7 +327,7 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button)
|
||||||
{
|
{
|
||||||
if (current_dive && ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
|
if (current_dive && ui.buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole) {
|
||||||
COMPONENT_FROM_UI(divesite);
|
COMPONENT_FROM_UI(divesite);
|
||||||
COMPONENT_FROM_UI(divemaster);
|
COMPONENT_FROM_UI(diveguide);
|
||||||
COMPONENT_FROM_UI(buddy);
|
COMPONENT_FROM_UI(buddy);
|
||||||
COMPONENT_FROM_UI(rating);
|
COMPONENT_FROM_UI(rating);
|
||||||
COMPONENT_FROM_UI(visibility);
|
COMPONENT_FROM_UI(visibility);
|
||||||
|
@ -345,8 +345,8 @@ void DiveComponentSelection::buttonClicked(QAbstractButton *button)
|
||||||
text.setString(&cliptext);
|
text.setString(&cliptext);
|
||||||
if (what->divesite && current_dive->dive_site)
|
if (what->divesite && current_dive->dive_site)
|
||||||
text << tr("Dive site: ") << current_dive->dive_site->name << "\n";
|
text << tr("Dive site: ") << current_dive->dive_site->name << "\n";
|
||||||
if (what->divemaster)
|
if (what->diveguide)
|
||||||
text << tr("Dive master: ") << current_dive->divemaster << "\n";
|
text << tr("Dive guide: ") << current_dive->diveguide << "\n";
|
||||||
if (what->buddy)
|
if (what->buddy)
|
||||||
text << tr("Buddy: ") << current_dive->buddy << "\n";
|
text << tr("Buddy: ") << current_dive->buddy << "\n";
|
||||||
if (what->rating)
|
if (what->rating)
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
struct Completers {
|
struct Completers {
|
||||||
QCompleter *divemaster;
|
QCompleter *diveguide;
|
||||||
QCompleter *buddy;
|
QCompleter *buddy;
|
||||||
QCompleter *tags;
|
QCompleter *tags;
|
||||||
};
|
};
|
||||||
|
@ -129,13 +129,13 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
|
|
||||||
Completers completers;
|
Completers completers;
|
||||||
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
|
completers.buddy = new QCompleter(&buddyModel, ui.buddy);
|
||||||
completers.divemaster = new QCompleter(&diveMasterModel, ui.divemaster);
|
completers.diveguide = new QCompleter(&diveGuideModel, ui.diveguide);
|
||||||
completers.tags = new QCompleter(&tagModel, ui.tagWidget);
|
completers.tags = new QCompleter(&tagModel, ui.tagWidget);
|
||||||
completers.buddy->setCaseSensitivity(Qt::CaseInsensitive);
|
completers.buddy->setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
completers.divemaster->setCaseSensitivity(Qt::CaseInsensitive);
|
completers.diveguide->setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
completers.tags->setCaseSensitivity(Qt::CaseInsensitive);
|
completers.tags->setCaseSensitivity(Qt::CaseInsensitive);
|
||||||
ui.buddy->setCompleter(completers.buddy);
|
ui.buddy->setCompleter(completers.buddy);
|
||||||
ui.divemaster->setCompleter(completers.divemaster);
|
ui.diveguide->setCompleter(completers.diveguide);
|
||||||
ui.tagWidget->setCompleter(completers.tags);
|
ui.tagWidget->setCompleter(completers.tags);
|
||||||
ui.diveNotesMessage->hide();
|
ui.diveNotesMessage->hide();
|
||||||
ui.multiDiveWarningMessage->hide();
|
ui.multiDiveWarningMessage->hide();
|
||||||
|
@ -260,8 +260,8 @@ void MainTab::divesChanged(const QVector<dive *> &dives, DiveField field)
|
||||||
ui.tagWidget->setText(get_taglist_string(current_dive->tag_list));
|
ui.tagWidget->setText(get_taglist_string(current_dive->tag_list));
|
||||||
if (field.buddy)
|
if (field.buddy)
|
||||||
ui.buddy->setText(current_dive->buddy);
|
ui.buddy->setText(current_dive->buddy);
|
||||||
if (field.divemaster)
|
if (field.diveguide)
|
||||||
ui.divemaster->setText(current_dive->divemaster);
|
ui.diveguide->setText(current_dive->diveguide);
|
||||||
|
|
||||||
// If duration or depth changed, the profile needs to be replotted
|
// If duration or depth changed, the profile needs to be replotted
|
||||||
if (field.duration || field.depth)
|
if (field.duration || field.depth)
|
||||||
|
@ -384,8 +384,8 @@ void MainTab::updateDiveInfo()
|
||||||
ui.tabWidget->setCurrentIndex(lastTabSelectedDiveTrip);
|
ui.tabWidget->setCurrentIndex(lastTabSelectedDiveTrip);
|
||||||
lastSelectedDive = false;
|
lastSelectedDive = false;
|
||||||
// only use trip relevant fields
|
// only use trip relevant fields
|
||||||
ui.divemaster->setVisible(false);
|
ui.diveguide->setVisible(false);
|
||||||
ui.DivemasterLabel->setVisible(false);
|
ui.DiveguideLabel->setVisible(false);
|
||||||
ui.buddy->setVisible(false);
|
ui.buddy->setVisible(false);
|
||||||
ui.BuddyLabel->setVisible(false);
|
ui.BuddyLabel->setVisible(false);
|
||||||
ui.rating->setVisible(false);
|
ui.rating->setVisible(false);
|
||||||
|
@ -426,12 +426,12 @@ void MainTab::updateDiveInfo()
|
||||||
ui.location->show();
|
ui.location->show();
|
||||||
ui.locationPopupButton->show();
|
ui.locationPopupButton->show();
|
||||||
ui.editDiveSiteButton->show();
|
ui.editDiveSiteButton->show();
|
||||||
ui.divemaster->setVisible(true);
|
ui.diveguide->setVisible(true);
|
||||||
ui.buddy->setVisible(true);
|
ui.buddy->setVisible(true);
|
||||||
ui.rating->setVisible(true);
|
ui.rating->setVisible(true);
|
||||||
ui.RatingLabel->setVisible(true);
|
ui.RatingLabel->setVisible(true);
|
||||||
ui.BuddyLabel->setVisible(true);
|
ui.BuddyLabel->setVisible(true);
|
||||||
ui.DivemasterLabel->setVisible(true);
|
ui.DiveguideLabel->setVisible(true);
|
||||||
ui.TagLabel->setVisible(true);
|
ui.TagLabel->setVisible(true);
|
||||||
ui.tagWidget->setVisible(true);
|
ui.tagWidget->setVisible(true);
|
||||||
ui.dateEdit->setReadOnly(false);
|
ui.dateEdit->setReadOnly(false);
|
||||||
|
@ -452,7 +452,7 @@ void MainTab::updateDiveInfo()
|
||||||
updateNotes(current_dive);
|
updateNotes(current_dive);
|
||||||
updateDiveSite(current_dive);
|
updateDiveSite(current_dive);
|
||||||
updateDateTime(current_dive);
|
updateDateTime(current_dive);
|
||||||
ui.divemaster->setText(current_dive->divemaster);
|
ui.diveguide->setText(current_dive->diveguide);
|
||||||
ui.buddy->setText(current_dive->buddy);
|
ui.buddy->setText(current_dive->buddy);
|
||||||
}
|
}
|
||||||
ui.duration->setText(render_seconds_to_string(current_dive->duration.seconds));
|
ui.duration->setText(render_seconds_to_string(current_dive->duration.seconds));
|
||||||
|
@ -467,7 +467,7 @@ void MainTab::updateDiveInfo()
|
||||||
clearTabs();
|
clearTabs();
|
||||||
ui.rating->setCurrentStars(0);
|
ui.rating->setCurrentStars(0);
|
||||||
ui.location->clear();
|
ui.location->clear();
|
||||||
ui.divemaster->clear();
|
ui.diveguide->clear();
|
||||||
ui.buddy->clear();
|
ui.buddy->clear();
|
||||||
ui.notes->clear();
|
ui.notes->clear();
|
||||||
/* set date and time to minimums which triggers showing the special value text */
|
/* set date and time to minimums which triggers showing the special value text */
|
||||||
|
@ -558,12 +558,12 @@ void MainTab::on_buddy_editingFinished()
|
||||||
divesEdited(Command::editBuddies(stringToList(ui.buddy->toPlainText()), false));
|
divesEdited(Command::editBuddies(stringToList(ui.buddy->toPlainText()), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::on_divemaster_editingFinished()
|
void MainTab::on_diveguide_editingFinished()
|
||||||
{
|
{
|
||||||
if (ignoreInput || !current_dive)
|
if (ignoreInput || !current_dive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
divesEdited(Command::editDiveMaster(stringToList(ui.divemaster->toPlainText()), false));
|
divesEdited(Command::editDiveGuide(stringToList(ui.diveguide->toPlainText()), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::on_duration_editingFinished()
|
void MainTab::on_duration_editingFinished()
|
||||||
|
|
|
@ -44,7 +44,7 @@ slots:
|
||||||
void rejectChanges();
|
void rejectChanges();
|
||||||
void on_location_diveSiteSelected();
|
void on_location_diveSiteSelected();
|
||||||
void on_locationPopupButton_clicked();
|
void on_locationPopupButton_clicked();
|
||||||
void on_divemaster_editingFinished();
|
void on_diveguide_editingFinished();
|
||||||
void on_buddy_editingFinished();
|
void on_buddy_editingFinished();
|
||||||
void on_diveTripLocation_editingFinished();
|
void on_diveTripLocation_editingFinished();
|
||||||
void on_notes_editingFinished();
|
void on_notes_editingFinished();
|
||||||
|
@ -67,7 +67,7 @@ private:
|
||||||
bool editMode;
|
bool editMode;
|
||||||
bool ignoreInput; // When computionally editing fields, we have to ignore changed-signals
|
bool ignoreInput; // When computionally editing fields, we have to ignore changed-signals
|
||||||
BuddyCompletionModel buddyModel;
|
BuddyCompletionModel buddyModel;
|
||||||
DiveMasterCompletionModel diveMasterModel;
|
DiveGuideCompletionModel diveGuideModel;
|
||||||
TagCompletionModel tagModel;
|
TagCompletionModel tagModel;
|
||||||
bool lastSelectedDive;
|
bool lastSelectedDive;
|
||||||
int lastTabSelectedDive;
|
int lastTabSelectedDive;
|
||||||
|
|
|
@ -314,9 +314,9 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="DivemasterLabel">
|
<widget class="QLabel" name="DiveguideLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Divemaster</string>
|
<string>Dive guide</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="isHeader" stdset="0">
|
<property name="isHeader" stdset="0">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -340,7 +340,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="TagWidget" name="divemaster">
|
<widget class="TagWidget" name="diveguide">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -542,7 +542,9 @@ QVariant TemplateLayout::getValue(QString list, QString property, const State &s
|
||||||
} else if (property == "depth") {
|
} else if (property == "depth") {
|
||||||
return get_depth_string(d->dc.maxdepth.mm, true, true);
|
return get_depth_string(d->dc.maxdepth.mm, true, true);
|
||||||
} else if (property == "divemaster") {
|
} else if (property == "divemaster") {
|
||||||
return d->divemaster;
|
return d->diveguide;
|
||||||
|
} else if (property == "diveguide") {
|
||||||
|
return d->diveguide;
|
||||||
} else if (property == "buddy") {
|
} else if (property == "buddy") {
|
||||||
return d->buddy;
|
return d->buddy;
|
||||||
} else if (property == "airTemp") {
|
} else if (property == "airTemp") {
|
||||||
|
|
|
@ -57,15 +57,15 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: qsTr("Dive master")
|
text: qsTr("Dive guide")
|
||||||
font.pointSize: subsurfaceTheme.regularPointSize
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
Layout.preferredWidth: gridWidth * 0.75
|
Layout.preferredWidth: gridWidth * 0.75
|
||||||
}
|
}
|
||||||
SsrfSwitch {
|
SsrfSwitch {
|
||||||
checked: manager.toggleDiveMaster(false)
|
checked: manager.toggleDiveGuide(false)
|
||||||
Layout.preferredWidth: gridWidth * 0.25
|
Layout.preferredWidth: gridWidth * 0.25
|
||||||
onClicked: {
|
onClicked: {
|
||||||
manager.toggleDiveMaster(true)
|
manager.toggleDiveGuide(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
|
|
|
@ -19,9 +19,9 @@ Kirigami.Page {
|
||||||
property alias buddyIndex: detailsEdit.buddyIndex
|
property alias buddyIndex: detailsEdit.buddyIndex
|
||||||
property alias buddyText: detailsEdit.buddyText
|
property alias buddyText: detailsEdit.buddyText
|
||||||
property alias buddyModel: detailsEdit.buddyModel
|
property alias buddyModel: detailsEdit.buddyModel
|
||||||
property alias divemasterIndex: detailsEdit.divemasterIndex
|
property alias diveguideIndex: detailsEdit.diveguideIndex
|
||||||
property alias divemasterText: detailsEdit.divemasterText
|
property alias diveguideText: detailsEdit.diveguideText
|
||||||
property alias divemasterModel: detailsEdit.divemasterModel
|
property alias diveguideModel: detailsEdit.diveguideModel
|
||||||
property alias tagText: detailsEdit.tagText
|
property alias tagText: detailsEdit.tagText
|
||||||
property alias depth: detailsEdit.depthText
|
property alias depth: detailsEdit.depthText
|
||||||
property alias duration: detailsEdit.durationText
|
property alias duration: detailsEdit.durationText
|
||||||
|
@ -351,7 +351,7 @@ Kirigami.Page {
|
||||||
watertemp = modelData.waterTemp
|
watertemp = modelData.waterTemp
|
||||||
suitIndex = manager.suitList.indexOf(modelData.suit)
|
suitIndex = manager.suitList.indexOf(modelData.suit)
|
||||||
buddyText = modelData.buddy;
|
buddyText = modelData.buddy;
|
||||||
divemasterText = modelData.diveMaster
|
diveguideText = modelData.diveGuide
|
||||||
tagText = modelData.tags
|
tagText = modelData.tags
|
||||||
notes = modelData.notes
|
notes = modelData.notes
|
||||||
if (modelData.singleWeight) {
|
if (modelData.singleWeight) {
|
||||||
|
|
|
@ -20,8 +20,8 @@ Item {
|
||||||
property alias suitText: suitBox.editText
|
property alias suitText: suitBox.editText
|
||||||
property alias buddyIndex: buddyBox.currentIndex
|
property alias buddyIndex: buddyBox.currentIndex
|
||||||
property alias buddyText: buddyBox.editText
|
property alias buddyText: buddyBox.editText
|
||||||
property alias divemasterIndex: divemasterBox.currentIndex
|
property alias diveguideIndex: diveguideBox.currentIndex
|
||||||
property alias divemasterText: divemasterBox.editText
|
property alias diveguideText: diveguideBox.editText
|
||||||
property alias tagText: txtTag.text
|
property alias tagText: txtTag.text
|
||||||
property alias cylinderIndex0: cylinderBox0.currentIndex
|
property alias cylinderIndex0: cylinderBox0.currentIndex
|
||||||
property alias cylinderIndex1: cylinderBox1.currentIndex
|
property alias cylinderIndex1: cylinderBox1.currentIndex
|
||||||
|
@ -36,7 +36,7 @@ Item {
|
||||||
property var endpressure: []
|
property var endpressure: []
|
||||||
property var startpressure: []
|
property var startpressure: []
|
||||||
property alias suitModel: suitBox.model
|
property alias suitModel: suitBox.model
|
||||||
property alias divemasterModel: divemasterBox.model
|
property alias diveguideModel: diveguideBox.model
|
||||||
property alias buddyModel: buddyBox.model
|
property alias buddyModel: buddyBox.model
|
||||||
property alias cylinderModel0: cylinderBox0.model
|
property alias cylinderModel0: cylinderBox0.model
|
||||||
property alias cylinderModel1: cylinderBox1.model
|
property alias cylinderModel1: cylinderBox1.model
|
||||||
|
@ -64,11 +64,11 @@ Item {
|
||||||
detailsEdit.depthText = ""
|
detailsEdit.depthText = ""
|
||||||
detailsEdit.airtempText = ""
|
detailsEdit.airtempText = ""
|
||||||
detailsEdit.watertempText = ""
|
detailsEdit.watertempText = ""
|
||||||
detailsEdit.divemasterText = ""
|
detailsEdit.diveguideText = ""
|
||||||
detailsEdit.buddyText = ""
|
detailsEdit.buddyText = ""
|
||||||
suitBox.currentIndex = -1
|
suitBox.currentIndex = -1
|
||||||
buddyBox.currentIndex = -1
|
buddyBox.currentIndex = -1
|
||||||
divemasterBox.currentIndex = -1
|
diveguideBox.currentIndex = -1
|
||||||
cylinderBox0.currentIndex = -1
|
cylinderBox0.currentIndex = -1
|
||||||
cylinderBox1.currentIndex = -1
|
cylinderBox1.currentIndex = -1
|
||||||
cylinderBox2.currentIndex = -1
|
cylinderBox2.currentIndex = -1
|
||||||
|
@ -118,7 +118,7 @@ Item {
|
||||||
// apply the changes to the dive_table
|
// apply the changes to the dive_table
|
||||||
manager.commitChanges(dive_id, detailsEdit.number, detailsEdit.dateText, locationBox.editText, detailsEdit.gpsText, detailsEdit.durationText,
|
manager.commitChanges(dive_id, detailsEdit.number, detailsEdit.dateText, locationBox.editText, detailsEdit.gpsText, detailsEdit.durationText,
|
||||||
detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText,
|
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,
|
detailsEdit.weightText, detailsEdit.notesText, startpressure,
|
||||||
endpressure, usedGas, usedCyl,
|
endpressure, usedGas, usedCyl,
|
||||||
detailsEdit.rating,
|
detailsEdit.rating,
|
||||||
|
@ -296,13 +296,13 @@ Item {
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
Layout.preferredWidth: Kirigami.Units.gridUnit * 4
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
text: qsTr("Divemaster:")
|
text: qsTr("Dive guide:")
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
id: divemasterBox
|
id: diveguideBox
|
||||||
flickable: detailsEditFlickable
|
flickable: detailsEditFlickable
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.divemasterList : null
|
manager.diveguideList : null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
|
@ -481,7 +481,7 @@ Item {
|
||||||
// fifth row
|
// fifth row
|
||||||
//-----------
|
//-----------
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
text: qsTr("Divemaster:")
|
text: qsTr("Dive guide:")
|
||||||
opacity: 0.6
|
opacity: 0.6
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col1Width
|
Layout.maximumWidth: detailsView.col1Width
|
||||||
|
@ -501,8 +501,8 @@ Item {
|
||||||
// sixth row
|
// sixth row
|
||||||
//-----------
|
//-----------
|
||||||
TemplateLabelSmall {
|
TemplateLabelSmall {
|
||||||
id: txtDiveMaster
|
id: txtDiveGuide
|
||||||
text: diveMaster
|
text: diveGuide
|
||||||
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere
|
||||||
Layout.maximumWidth: detailsView.col1Width
|
Layout.maximumWidth: detailsView.col1Width
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
|
|
|
@ -157,9 +157,9 @@ Kirigami.ApplicationWindow {
|
||||||
detailsWindow.buddyIndex = -1
|
detailsWindow.buddyIndex = -1
|
||||||
detailsWindow.buddyText = ""
|
detailsWindow.buddyText = ""
|
||||||
detailsWindow.depth = ""
|
detailsWindow.depth = ""
|
||||||
detailsWindow.divemasterModel = manager.divemasterList
|
detailsWindow.diveguideModel = manager.diveguideList
|
||||||
detailsWindow.divemasterIndex = -1
|
detailsWindow.diveguideIndex = -1
|
||||||
detailsWindow.divemasterText = ""
|
detailsWindow.diveguideText = ""
|
||||||
detailsWindow.notes = ""
|
detailsWindow.notes = ""
|
||||||
detailsWindow.location = ""
|
detailsWindow.location = ""
|
||||||
detailsWindow.gps = ""
|
detailsWindow.gps = ""
|
||||||
|
|
|
@ -306,7 +306,7 @@ QMLManager::QMLManager() :
|
||||||
|
|
||||||
// Let's set some defaults to be copied so users don't necessarily need
|
// Let's set some defaults to be copied so users don't necessarily need
|
||||||
// to know how to configure this
|
// to know how to configure this
|
||||||
what.divemaster = true;
|
what.diveguide = true;
|
||||||
what.buddy = true;
|
what.buddy = true;
|
||||||
what.suit = true;
|
what.suit = true;
|
||||||
what.tags = true;
|
what.tags = true;
|
||||||
|
@ -458,7 +458,7 @@ void QMLManager::updateAllGlobalLists()
|
||||||
{
|
{
|
||||||
emit buddyListChanged();
|
emit buddyListChanged();
|
||||||
emit suitListChanged();
|
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
|
// TODO: It would be nice if we could export the list of locations via model/view instead of a Q_PROPERTY
|
||||||
emit locationListChanged();
|
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
|
// 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,
|
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)
|
QStringList startpressure, QStringList endpressure, QStringList gasmix, QStringList usedCylinder, int rating, int visibility, QString state)
|
||||||
{
|
{
|
||||||
struct dive *orig = get_dive_by_uniq_id(diveId.toInt());
|
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("watertmp:'%1'\n").arg(watertemp) <<
|
||||||
QStringLiteral("suit :'%1'\n").arg(suit) <<
|
QStringLiteral("suit :'%1'\n").arg(suit) <<
|
||||||
QStringLiteral("buddy :'%1'\n").arg(buddy) <<
|
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("tags :'%1'\n").arg(tags) <<
|
||||||
QStringLiteral("weight :'%1'\n").arg(weight) <<
|
QStringLiteral("weight :'%1'\n").arg(weight) <<
|
||||||
QStringLiteral("state :'%1'\n").arg(state);
|
QStringLiteral("state :'%1'\n").arg(state);
|
||||||
|
@ -1212,13 +1212,13 @@ void QMLManager::commitChanges(QString diveId, QString number, QString date, QSt
|
||||||
free(d->buddy);
|
free(d->buddy);
|
||||||
d->buddy = copy_qstring(buddy);
|
d->buddy = copy_qstring(buddy);
|
||||||
}
|
}
|
||||||
if (d->divemaster != diveMaster) {
|
if (d->diveguide != diveGuide) {
|
||||||
if (diveMaster.contains(",")){
|
if (diveGuide.contains(",")){
|
||||||
diveMaster = diveMaster.replace(QRegularExpression("\\s*,\\s*"), ", ");
|
diveGuide = diveGuide.replace(QRegularExpression("\\s*,\\s*"), ", ");
|
||||||
}
|
}
|
||||||
diveChanged = true;
|
diveChanged = true;
|
||||||
free(d->divemaster);
|
free(d->diveguide);
|
||||||
d->divemaster = copy_qstring(diveMaster);
|
d->diveguide = copy_qstring(diveGuide);
|
||||||
}
|
}
|
||||||
// normalize the tag list we have and the one we get from the UI
|
// normalize the tag list we have and the one we get from the UI
|
||||||
// try hard to deal with accidental white space issues
|
// try hard to deal with accidental white space issues
|
||||||
|
@ -1523,12 +1523,12 @@ bool QMLManager::toggleNotes(bool toggle)
|
||||||
return what.notes;
|
return what.notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QMLManager::toggleDiveMaster(bool toggle)
|
bool QMLManager::toggleDiveGuide(bool toggle)
|
||||||
{
|
{
|
||||||
if (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)
|
bool QMLManager::toggleBuddy(bool toggle)
|
||||||
|
@ -1764,9 +1764,9 @@ QStringList QMLManager::buddyList() const
|
||||||
return buddyModel.stringList();
|
return buddyModel.stringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QMLManager::divemasterList() const
|
QStringList QMLManager::diveguideList() const
|
||||||
{
|
{
|
||||||
return divemasterModel.stringList();
|
return diveguideModel.stringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QMLManager::locationList() const
|
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(QString notificationText MEMBER m_notificationText WRITE setNotificationText NOTIFY notificationTextChanged)
|
||||||
Q_PROPERTY(QStringList suitList READ suitList NOTIFY suitListChanged)
|
Q_PROPERTY(QStringList suitList READ suitList NOTIFY suitListChanged)
|
||||||
Q_PROPERTY(QStringList buddyList READ buddyList NOTIFY buddyListChanged)
|
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 locationList READ locationList NOTIFY locationListChanged)
|
||||||
Q_PROPERTY(QStringList cylinderListInit READ cylinderListInit CONSTANT)
|
Q_PROPERTY(QStringList cylinderListInit READ cylinderListInit CONSTANT)
|
||||||
Q_PROPERTY(QStringList defaultCylinderListInit READ defaultCylinderListInit CONSTANT)
|
Q_PROPERTY(QStringList defaultCylinderListInit READ defaultCylinderListInit CONSTANT)
|
||||||
|
@ -144,7 +144,7 @@ public:
|
||||||
|
|
||||||
QStringList suitList() const;
|
QStringList suitList() const;
|
||||||
QStringList buddyList() const;
|
QStringList buddyList() const;
|
||||||
QStringList divemasterList() const;
|
QStringList diveguideList() const;
|
||||||
QStringList locationList() const;
|
QStringList locationList() const;
|
||||||
QStringList cylinderListInit() const;
|
QStringList cylinderListInit() const;
|
||||||
QStringList defaultCylinderListInit() const;
|
QStringList defaultCylinderListInit() const;
|
||||||
|
@ -169,7 +169,7 @@ public slots:
|
||||||
void commitChanges(QString diveId, QString number, QString date, QString location, QString gps,
|
void commitChanges(QString diveId, QString number, QString date, QString location, QString gps,
|
||||||
QString duration, QString depth, QString airtemp,
|
QString duration, QString depth, QString airtemp,
|
||||||
QString watertemp, QString suit, QString buddy,
|
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);
|
QStringList endpressure, QStringList gasmix, QStringList usedCylinder, int rating, int visibility, QString state);
|
||||||
void updateTripDetails(QString tripIdString, QString tripLocation, QString tripNotes);
|
void updateTripDetails(QString tripIdString, QString tripLocation, QString tripNotes);
|
||||||
void removeDiveFromTrip(int id);
|
void removeDiveFromTrip(int id);
|
||||||
|
@ -185,7 +185,7 @@ public slots:
|
||||||
void pasteDiveData(int id);
|
void pasteDiveData(int id);
|
||||||
bool toggleDiveSite(bool toggle);
|
bool toggleDiveSite(bool toggle);
|
||||||
bool toggleNotes(bool toggle);
|
bool toggleNotes(bool toggle);
|
||||||
bool toggleDiveMaster(bool toggle);
|
bool toggleDiveGuide(bool toggle);
|
||||||
bool toggleBuddy(bool toggle);
|
bool toggleBuddy(bool toggle);
|
||||||
bool toggleSuit(bool toggle);
|
bool toggleSuit(bool toggle);
|
||||||
bool toggleRating(bool toggle);
|
bool toggleRating(bool toggle);
|
||||||
|
@ -223,7 +223,7 @@ public slots:
|
||||||
private:
|
private:
|
||||||
BuddyCompletionModel buddyModel;
|
BuddyCompletionModel buddyModel;
|
||||||
SuitCompletionModel suitModel;
|
SuitCompletionModel suitModel;
|
||||||
DiveMasterCompletionModel divemasterModel;
|
DiveGuideCompletionModel diveguideModel;
|
||||||
DiveSiteSortedModel locationModel;
|
DiveSiteSortedModel locationModel;
|
||||||
QString m_startPageText;
|
QString m_startPageText;
|
||||||
QString m_lastError;
|
QString m_lastError;
|
||||||
|
@ -280,7 +280,7 @@ signals:
|
||||||
void btEnabledChanged();
|
void btEnabledChanged();
|
||||||
void suitListChanged();
|
void suitListChanged();
|
||||||
void buddyListChanged();
|
void buddyListChanged();
|
||||||
void divemasterListChanged();
|
void diveguideListChanged();
|
||||||
void locationListChanged();
|
void locationListChanged();
|
||||||
void cloudCacheListChanged();
|
void cloudCacheListChanged();
|
||||||
void waitingForPositionChanged();
|
void waitingForPositionChanged();
|
||||||
|
|
|
@ -53,14 +53,14 @@ bool BuddyCompletionModel::relevantDiveField(const DiveField &f)
|
||||||
return f.buddy;
|
return f.buddy;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList DiveMasterCompletionModel::getStrings()
|
QStringList DiveGuideCompletionModel::getStrings()
|
||||||
{
|
{
|
||||||
return getCSVList(&dive::divemaster);
|
return getCSVList(&dive::diveguide);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DiveMasterCompletionModel::relevantDiveField(const DiveField &f)
|
bool DiveGuideCompletionModel::relevantDiveField(const DiveField &f)
|
||||||
{
|
{
|
||||||
return f.divemaster;
|
return f.diveguide;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList SuitCompletionModel::getStrings()
|
QStringList SuitCompletionModel::getStrings()
|
||||||
|
|
|
@ -26,7 +26,7 @@ private:
|
||||||
bool relevantDiveField(const DiveField &f) override;
|
bool relevantDiveField(const DiveField &f) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DiveMasterCompletionModel final : public CompletionModelBase {
|
class DiveGuideCompletionModel final : public CompletionModelBase {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
QStringList getStrings() override;
|
QStringList getStrings() override;
|
||||||
|
|
|
@ -234,7 +234,7 @@ QVariant DiveTripModelBase::diveData(const struct dive *d, int column, int role)
|
||||||
case MobileListModel::WaterTempRole: return get_temperature_string(d->watertemp, true);
|
case MobileListModel::WaterTempRole: return get_temperature_string(d->watertemp, true);
|
||||||
case MobileListModel::SacRole: return formatSac(d);
|
case MobileListModel::SacRole: return formatSac(d);
|
||||||
case MobileListModel::SumWeightRole: return formatSumWeight(d);
|
case MobileListModel::SumWeightRole: return formatSumWeight(d);
|
||||||
case MobileListModel::DiveMasterRole: return d->divemaster;
|
case MobileListModel::DiveGuideRole: return d->diveguide;
|
||||||
case MobileListModel::BuddyRole: return d->buddy;
|
case MobileListModel::BuddyRole: return d->buddy;
|
||||||
case MobileListModel::TagsRole: return get_taglist_string(d->tag_list);
|
case MobileListModel::TagsRole: return get_taglist_string(d->tag_list);
|
||||||
case MobileListModel::NotesRole: return formatNotes(d);
|
case MobileListModel::NotesRole: return formatNotes(d);
|
||||||
|
|
|
@ -31,7 +31,7 @@ QHash<int, QByteArray> MobileListModelBase::roleNames() const
|
||||||
roles[WaterTempRole] = "waterTemp";
|
roles[WaterTempRole] = "waterTemp";
|
||||||
roles[SacRole] = "sac";
|
roles[SacRole] = "sac";
|
||||||
roles[SumWeightRole] = "sumWeight";
|
roles[SumWeightRole] = "sumWeight";
|
||||||
roles[DiveMasterRole] = "diveMaster";
|
roles[DiveGuideRole] = "diveGuide";
|
||||||
roles[BuddyRole] = "buddy";
|
roles[BuddyRole] = "buddy";
|
||||||
roles[TagsRole] = "tags";
|
roles[TagsRole] = "tags";
|
||||||
roles[NotesRole]= "notes";
|
roles[NotesRole]= "notes";
|
||||||
|
|
|
@ -39,7 +39,7 @@ public:
|
||||||
WaterTempRole,
|
WaterTempRole,
|
||||||
SacRole,
|
SacRole,
|
||||||
SumWeightRole,
|
SumWeightRole,
|
||||||
DiveMasterRole,
|
DiveGuideRole,
|
||||||
BuddyRole,
|
BuddyRole,
|
||||||
TagsRole,
|
TagsRole,
|
||||||
NotesRole,
|
NotesRole,
|
||||||
|
|
|
@ -1429,7 +1429,7 @@ struct PeopleBinner : public StringBinner<PeopleBinner, StringBin> {
|
||||||
std::vector<QString> dive_people;
|
std::vector<QString> dive_people;
|
||||||
for (const QString &s: QString(d->buddy).split(",", SKIP_EMPTY))
|
for (const QString &s: QString(d->buddy).split(",", SKIP_EMPTY))
|
||||||
dive_people.push_back(s.trimmed());
|
dive_people.push_back(s.trimmed());
|
||||||
for (const QString &s: QString(d->divemaster).split(",", SKIP_EMPTY))
|
for (const QString &s: QString(d->diveguide).split(",", SKIP_EMPTY))
|
||||||
dive_people.push_back(s.trimmed());
|
dive_people.push_back(s.trimmed());
|
||||||
return dive_people;
|
return dive_people;
|
||||||
}
|
}
|
||||||
|
@ -1442,10 +1442,10 @@ struct PeopleVariable : public StatsVariableTemplate<StatsVariable::Type::Discre
|
||||||
}
|
}
|
||||||
QString diveCategories(const dive *d) const override {
|
QString diveCategories(const dive *d) const override {
|
||||||
QString buddy = QString(d->buddy).trimmed();
|
QString buddy = QString(d->buddy).trimmed();
|
||||||
QString divemaster = QString(d->divemaster).trimmed();
|
QString diveguide = QString(d->diveguide).trimmed();
|
||||||
if (!buddy.isEmpty() && !divemaster.isEmpty())
|
if (!buddy.isEmpty() && !diveguide.isEmpty())
|
||||||
buddy += ", ";
|
buddy += ", ";
|
||||||
return buddy + divemaster;
|
return buddy + diveguide;
|
||||||
}
|
}
|
||||||
std::vector<const StatsBinner *> binners() const override {
|
std::vector<const StatsBinner *> binners() const override {
|
||||||
return { &people_binner };
|
return { &people_binner };
|
||||||
|
@ -1477,7 +1477,7 @@ struct BuddyVariable : public StatsVariableTemplate<StatsVariable::Type::Discret
|
||||||
struct DiveGuideBinner : public StringBinner<DiveGuideBinner, StringBin> {
|
struct DiveGuideBinner : public StringBinner<DiveGuideBinner, StringBin> {
|
||||||
std::vector<QString> to_bin_values(const dive *d) const {
|
std::vector<QString> to_bin_values(const dive *d) const {
|
||||||
std::vector<QString> dive_guides;
|
std::vector<QString> dive_guides;
|
||||||
for (const QString &s: QString(d->divemaster).split(",", SKIP_EMPTY))
|
for (const QString &s: QString(d->diveguide).split(",", SKIP_EMPTY))
|
||||||
dive_guides.push_back(s.trimmed());
|
dive_guides.push_back(s.trimmed());
|
||||||
return dive_guides;
|
return dive_guides;
|
||||||
}
|
}
|
||||||
|
@ -1489,7 +1489,7 @@ struct DiveGuideVariable : public StatsVariableTemplate<StatsVariable::Type::Dis
|
||||||
return StatsTranslations::tr("Dive guides");
|
return StatsTranslations::tr("Dive guides");
|
||||||
}
|
}
|
||||||
QString diveCategories(const dive *d) const override {
|
QString diveCategories(const dive *d) const override {
|
||||||
return QString(d->divemaster).trimmed();
|
return QString(d->diveguide).trimmed();
|
||||||
}
|
}
|
||||||
std::vector<const StatsBinner *> binners() const override {
|
std::vector<const StatsBinner *> binners() const override {
|
||||||
return { &dive_guide_binner };
|
return { &dive_guide_binner };
|
||||||
|
|
|
@ -223,13 +223,13 @@ function getExpanded(dive)
|
||||||
{
|
{
|
||||||
var res = '<table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
|
var res = '<table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
|
||||||
'</td><td class="words"> ' + translate.Time + ': </td><td>' + dive.time +
|
'</td><td class="words"> ' + translate.Time + ': </td><td>' + dive.time +
|
||||||
'</td><td class="words"> ' + translate.Location + ': </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a>' + getDiveCoor(dive) +
|
'</td><td class="words"> ' + translate.Location + ': </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, diveguide:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a>' + getDiveCoor(dive) +
|
||||||
'</td></tr></table>' +
|
'</td></tr></table>' +
|
||||||
'<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
|
'<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
|
||||||
'</td><td class="words"> ' + translate.Water_Temp + ': </td><td>' + dive.temperature.water +
|
'</td><td class="words"> ' + translate.Water_Temp + ': </td><td>' + dive.temperature.water +
|
||||||
'</td><td class="words"> ' + translate.Rating + ':</td><td>' + putRating(dive.rating) +
|
'</td><td class="words"> ' + translate.Rating + ':</td><td>' + putRating(dive.rating) +
|
||||||
'</td></tr></table><table><tr><td class="words">' + translate.Max_Depth + ': </td><td>' + put_depth_unit(dive.maxdepth) + " " + depth_unit + '</td></tr><tr><td class="words">' + translate.Duration + ': </td><td>' + dive.dive_duration +
|
'</td></tr></table><table><tr><td class="words">' + translate.Max_Depth + ': </td><td>' + put_depth_unit(dive.maxdepth) + " " + depth_unit + '</td></tr><tr><td class="words">' + translate.Duration + ': </td><td>' + dive.dive_duration +
|
||||||
'</td></tr><tr><td class="words">' + translate.DiveMaster + ': </td><td>' + dive.divemaster +
|
'</td></tr><tr><td class="words">' + translate.DiveGuide + ': </td><td>' + dive.diveguide +
|
||||||
'</td></tr><tr><td class="words"><p>' + translate.Buddy + ': </p></td><td>' + dive.buddy +
|
'</td></tr><tr><td class="words"><p>' + translate.Buddy + ': </p></td><td>' + dive.buddy +
|
||||||
'</td></tr><tr><td class="words">' + translate.Suit + ': </td><td>' + dive.suit +
|
'</td></tr><tr><td class="words">' + translate.Suit + ': </td><td>' + dive.suit +
|
||||||
'</td></tr><tr><td class="words">' + translate.Tags + ': </td><td>' + putTags(dive.tags) +
|
'</td></tr><tr><td class="words">' + translate.Tags + ': </td><td>' + putTags(dive.tags) +
|
||||||
|
@ -244,7 +244,7 @@ function putTags(tags)
|
||||||
{
|
{
|
||||||
var result = "";
|
var result = "";
|
||||||
for (var i in tags) {
|
for (var i in tags) {
|
||||||
result += '<a onclick=\"Search_list_Modules(\'' + tags[i] + '\', {location:false, divemaster:false, buddy:false, notes:false, tags:true,})\">' + tags[i] + '</a>';
|
result += '<a onclick=\"Search_list_Modules(\'' + tags[i] + '\', {location:false, diveguide:false, buddy:false, notes:false, tags:true,})\">' + tags[i] + '</a>';
|
||||||
if (i < tags.length - 1)
|
if (i < tags.length - 1)
|
||||||
result += ', ';
|
result += ', ';
|
||||||
}
|
}
|
||||||
|
@ -556,7 +556,7 @@ function SearchModules(searchfor, searchOptions)
|
||||||
if (searchOptions === null) {
|
if (searchOptions === null) {
|
||||||
searchOptions = {};
|
searchOptions = {};
|
||||||
searchOptions.location = searchingModules["location"].enabled;
|
searchOptions.location = searchingModules["location"].enabled;
|
||||||
searchOptions.divemaster = searchingModules["divemaster"].enabled;
|
searchOptions.diveguide = searchingModules["diveguide"].enabled;
|
||||||
searchOptions.buddy = searchingModules["buddy"].enabled;
|
searchOptions.buddy = searchingModules["buddy"].enabled;
|
||||||
searchOptions.notes = searchingModules["notes"].enabled;
|
searchOptions.notes = searchingModules["notes"].enabled;
|
||||||
searchOptions.tags = searchingModules["tags"].enabled;
|
searchOptions.tags = searchingModules["tags"].enabled;
|
||||||
|
@ -568,8 +568,8 @@ function SearchModules(searchfor, searchOptions)
|
||||||
if (searchOptions.location === true)
|
if (searchOptions.location === true)
|
||||||
keywordResult.Union(searchingModules["location"].search(keywords[i]));
|
keywordResult.Union(searchingModules["location"].search(keywords[i]));
|
||||||
|
|
||||||
if (searchOptions.divemaster === true)
|
if (searchOptions.diveguide === true)
|
||||||
keywordResult.Union(searchingModules["divemaster"].search(keywords[i]));
|
keywordResult.Union(searchingModules["diveguide"].search(keywords[i]));
|
||||||
|
|
||||||
if (searchOptions.buddy === true)
|
if (searchOptions.buddy === true)
|
||||||
keywordResult.Union(searchingModules["buddy"].search(keywords[i]));
|
keywordResult.Union(searchingModules["buddy"].search(keywords[i]));
|
||||||
|
@ -965,7 +965,7 @@ function get_dive_HTML(dive)
|
||||||
{
|
{
|
||||||
var table1 = '<h2 class="det_hed">' + translate.Dive_information + '</h2><table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
|
var table1 = '<h2 class="det_hed">' + translate.Dive_information + '</h2><table><tr><td class="words">' + translate.Date + ': </td><td>' + dive.date +
|
||||||
'</td><td class="words"> ' + translate.Time + ': </td><td>' + dive.time +
|
'</td><td class="words"> ' + translate.Time + ': </td><td>' + dive.time +
|
||||||
'</td><td class="words"> ' + translate.Location + ': </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, divemaster:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a></td>' + getDiveCoor(dive) +
|
'</td><td class="words"> ' + translate.Location + ': </td><td>' + '<a onclick=\"Search_list_Modules(\'' + dive.location + '\', {location:true, diveguide:false, buddy:false, notes:false, tags:false,})\">' + dive.location + '</a></td>' + getDiveCoor(dive) +
|
||||||
'</tr></table>';
|
'</tr></table>';
|
||||||
var table2 = '<table><tr><td class="words">' + translate.Rating + ':</td><td>' + putRating(dive.rating) + '</td>';
|
var table2 = '<table><tr><td class="words">' + translate.Rating + ':</td><td>' + putRating(dive.rating) + '</td>';
|
||||||
if (dive.wavesize > 0)
|
if (dive.wavesize > 0)
|
||||||
|
@ -982,7 +982,7 @@ function get_dive_HTML(dive)
|
||||||
var table3 = '<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
|
var table3 = '<table><tr><td class="words">' + translate.Air_Temp + ': </td><td>' + dive.temperature.air +
|
||||||
'</td><td class="words"> ' + translate.Water_Temp + ': </td><td>' + dive.temperature.water +
|
'</td><td class="words"> ' + translate.Water_Temp + ': </td><td>' + dive.temperature.water +
|
||||||
'</td></tr></table><table><tr><td class="words">' + translate.Max_Depth + ': </td><td>' + put_depth_unit(dive.maxdepth) + " " + depth_unit + '</td></tr><tr><td class="words">' + translate.Duration + ': </td><td>' + dive.dive_duration +
|
'</td></tr></table><table><tr><td class="words">' + translate.Max_Depth + ': </td><td>' + put_depth_unit(dive.maxdepth) + " " + depth_unit + '</td></tr><tr><td class="words">' + translate.Duration + ': </td><td>' + dive.dive_duration +
|
||||||
'</td></tr><tr><td class="words">' + translate.DiveMaster + ': </td><td>' + dive.divemaster +
|
'</td></tr><tr><td class="words">' + translate.DiveGuide + ': </td><td>' + dive.diveguide +
|
||||||
'</td></tr><tr><td class="words"><p>' + translate.Buddy + ': </p></td><td>' + dive.buddy +
|
'</td></tr><tr><td class="words"><p>' + translate.Buddy + ': </p></td><td>' + dive.buddy +
|
||||||
'</td></tr><tr><td class="words">' + translate.Suit + ': </td><td>' + dive.suit +
|
'</td></tr><tr><td class="words">' + translate.Suit + ': </td><td>' + dive.suit +
|
||||||
'</td></tr><tr><td class="words">' + translate.Tags + ': </td><td>' + putTags(dive.tags) +
|
'</td></tr><tr><td class="words">' + translate.Tags + ': </td><td>' + putTags(dive.tags) +
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue