diff options
154 files changed, 4343 insertions, 3665 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8680b2143..03e8b8899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +- Mobile: add default cylinder functionality for new dives [#1535] +- Desktop/Export: fix bug related to quoted text when exporting to HTML [#1576] +- Desktop/Map-Widget: add support for filtering of map locations [#1581] - Android: switch to Download page when dive computer is plugged in and try to populate vendor / device / connection based on the information we get - Mobile: enable multiple cylinder editing for dives that uses more than one cylinder diff --git a/android-mobile/res/xml/device_filter.xml b/android-mobile/res/xml/device_filter.xml index 413daa61f..046b12f2b 100644 --- a/android-mobile/res/xml/device_filter.xml +++ b/android-mobile/res/xml/device_filter.xml @@ -2,27 +2,27 @@ <resources> <!-- FTDI Chips --> <!-- (Smart Interface), Heinrichs Weikamp --> - <usb-device vendor-id="1027" product-id="24577"/> - <usb-device vendor-id="1027" product-id="24592"/> - <usb-device vendor-id="1027" product-id="24593"/> + <usb-device vendor-id="0x0403" product-id="0x6001"/> + <usb-device vendor-id="0x0403" product-id="0x6010"/> + <usb-device vendor-id="0x0403" product-id="0x6011"/> <!-- May be Aqualung custom PID? --> - <usb-device vendor-id="1027" product-id="24597"/> + <usb-device vendor-id="0x0403" product-id="0x6015"/> <!-- Oceanic Custom PID --> - <usb-device vendor-id="1027" product-id="62560"/> + <usb-device vendor-id="0x0403" product-id="0xf460"/> <!-- Suunto Custom PID --> - <usb-device vendor-id="1027" product-id="63104"/> + <usb-device vendor-id="0x0403" product-id="0xf680"/> <!-- Cressi (Leonardo) Custom PID --> - <usb-device vendor-id="1027" product-id="34768"/> + <usb-device vendor-id="0x0403" product-id="0x87d0"/> <!-- USB devices --> <!-- EON Steel --> - <usb-device vendor-id="5267" product-id="48"/> + <usb-device vendor-id="0x1493" product-id="0x30"/> <!-- EON Steel core --> - <usb-device vendor-id="5267" product-id="51"/> + <usb-device vendor-id="0x1493" product-id="0x33"/> <!-- Scubapro G2 --> - <usb-device vendor-id="11884" product-id="12801"/> + <usb-device vendor-id="0x2e6c" product-id="0x3201"/> <!-- Scubapro Aladin Square --> - <usb-device vendor-id="49745" product-id="8198"/> + <usb-device vendor-id="0xc251" product-id="0x2006"/> <!-- Atomics Aquatics Cobalt --> - <usb-device vendor-id="1137" product-id="2184"/> + <usb-device vendor-id="0x0471" product-id="0x0888"/> </resources> diff --git a/android/res/xml/device_filter.xml b/android/res/xml/device_filter.xml index 413daa61f..046b12f2b 100644 --- a/android/res/xml/device_filter.xml +++ b/android/res/xml/device_filter.xml @@ -2,27 +2,27 @@ <resources> <!-- FTDI Chips --> <!-- (Smart Interface), Heinrichs Weikamp --> - <usb-device vendor-id="1027" product-id="24577"/> - <usb-device vendor-id="1027" product-id="24592"/> - <usb-device vendor-id="1027" product-id="24593"/> + <usb-device vendor-id="0x0403" product-id="0x6001"/> + <usb-device vendor-id="0x0403" product-id="0x6010"/> + <usb-device vendor-id="0x0403" product-id="0x6011"/> <!-- May be Aqualung custom PID? --> - <usb-device vendor-id="1027" product-id="24597"/> + <usb-device vendor-id="0x0403" product-id="0x6015"/> <!-- Oceanic Custom PID --> - <usb-device vendor-id="1027" product-id="62560"/> + <usb-device vendor-id="0x0403" product-id="0xf460"/> <!-- Suunto Custom PID --> - <usb-device vendor-id="1027" product-id="63104"/> + <usb-device vendor-id="0x0403" product-id="0xf680"/> <!-- Cressi (Leonardo) Custom PID --> - <usb-device vendor-id="1027" product-id="34768"/> + <usb-device vendor-id="0x0403" product-id="0x87d0"/> <!-- USB devices --> <!-- EON Steel --> - <usb-device vendor-id="5267" product-id="48"/> + <usb-device vendor-id="0x1493" product-id="0x30"/> <!-- EON Steel core --> - <usb-device vendor-id="5267" product-id="51"/> + <usb-device vendor-id="0x1493" product-id="0x33"/> <!-- Scubapro G2 --> - <usb-device vendor-id="11884" product-id="12801"/> + <usb-device vendor-id="0x2e6c" product-id="0x3201"/> <!-- Scubapro Aladin Square --> - <usb-device vendor-id="49745" product-id="8198"/> + <usb-device vendor-id="0xc251" product-id="0x2006"/> <!-- Atomics Aquatics Cobalt --> - <usb-device vendor-id="1137" product-id="2184"/> + <usb-device vendor-id="0x0471" product-id="0x0888"/> </resources> diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 9babe1931..310ba6659 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -103,13 +103,16 @@ set(SUBSURFACE_CORE_LIB_SRCS # classes to manage struct preferences for QWidget and QML settings/qPref.cpp - settings/qPrefAnimations.cpp settings/qPrefCloudStorage.cpp settings/qPrefDisplay.cpp settings/qPrefDiveComputer.cpp settings/qPrefDivePlanner.cpp settings/qPrefFacebook.cpp + settings/qPrefGeneral.cpp + settings/qPrefGeocoding.cpp + settings/qPrefLanguage.cpp settings/qPrefLocationService.cpp + settings/qPrefPartialPressureGas.cpp settings/qPrefPrivate.cpp settings/qPrefProxy.cpp settings/qPrefTechnicalDetails.cpp @@ -119,7 +122,6 @@ set(SUBSURFACE_CORE_LIB_SRCS #Subsurface Qt have the Subsurface structs QObjectified for easy access via QML. subsurface-qt/DiveObjectHelper.cpp subsurface-qt/CylinderObjectHelper.cpp - subsurface-qt/SettingsObjectWrapper.cpp ${SERIAL_FTDI} ${PLATFORM_SRC} diff --git a/core/datatrak.h b/core/datatrak.h index 7aea1741f..05534fcee 100644 --- a/core/datatrak.h +++ b/core/datatrak.h @@ -41,8 +41,6 @@ static const struct models_table_t g_models[] = { {0xEE, 0x44, "Uwatec Unknown model", DC_FAMILY_UWATEC_ALADIN}, }; -extern struct sample *add_sample(struct sample *sample, int time, struct divecomputer *dc); - #define JUMP(_ptr, _n) if ((long) (_ptr += _n) > maxbuf) goto bail #define CHECK(_ptr, _n) if ((long) _ptr + _n > maxbuf) goto bail #define read_bytes(_n) \ diff --git a/core/deco.c b/core/deco.c index e8bafd426..f072a2a17 100644 --- a/core/deco.c +++ b/core/deco.c @@ -479,7 +479,7 @@ void calc_crushing_pressure(struct deco_state *ds, double pressure) } /* add period_in_seconds at the given pressure and gas to the deco calculation */ -void add_segment(struct deco_state *ds, double pressure, const struct gasmix *gasmix, int period_in_seconds, int ccpo2, enum divemode_t divemode, int sac) +void add_segment(struct deco_state *ds, double pressure, struct gasmix gasmix, int period_in_seconds, int ccpo2, enum divemode_t divemode, int sac) { UNUSED(sac); int ci; @@ -581,7 +581,7 @@ void restore_deco_state(struct deco_state *data, struct deco_state *target, bool } -int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct dive *dive, bool smooth) +int deco_allowed_depth(double tissues_tolerance, double surface_pressure, const struct dive *dive, bool smooth) { int depth; double pressure_delta; diff --git a/core/deco.h b/core/deco.h index 075e7758c..717aa94cf 100644 --- a/core/deco.h +++ b/core/deco.h @@ -8,7 +8,7 @@ extern "C" { extern double buehlmann_N2_t_halflife[]; -extern int deco_allowed_depth(double tissues_tolerance, double surface_pressure, struct dive *dive, bool smooth); +extern int deco_allowed_depth(double tissues_tolerance, double surface_pressure, const struct dive *dive, bool smooth); double get_gf(struct deco_state *ds, double ambpressure_bar, const struct dive *dive); diff --git a/core/dive.c b/core/dive.c index 482ba585b..044c969ee 100644 --- a/core/dive.c +++ b/core/dive.c @@ -99,13 +99,13 @@ void add_sample_pressure(struct sample *sample, int sensor, int mbar) * This function returns a negative number for "no legacy mode", * or a non-negative number that indicates the o2 sensor index. */ -int legacy_format_o2pressures(struct dive *dive, struct divecomputer *dc) +int legacy_format_o2pressures(const struct dive *dive, const struct divecomputer *dc) { int i, o2sensor; o2sensor = (dc->divemode == CCR) ? get_cylinder_idx_by_use(dive, OXYGEN) : -1; for (i = 0; i < dc->samples; i++) { - struct sample *s = dc->sample + i; + const struct sample *s = dc->sample + i; int seen_pressure = 0, idx; for (idx = 0; idx < MAX_SENSORS; idx++) { @@ -130,7 +130,7 @@ int legacy_format_o2pressures(struct dive *dive, struct divecomputer *dc) return o2sensor < 0 ? 256 : o2sensor; } -int event_is_gaschange(struct event *ev) +int event_is_gaschange(const struct event *ev) { return ev->type == SAMPLE_EVENT_GASCHANGE || ev->type == SAMPLE_EVENT_GASCHANGE2; @@ -184,7 +184,7 @@ struct event *add_event(struct divecomputer *dc, unsigned int time, int type, in return ev; } -static int same_event(struct event *a, struct event *b) +static int same_event(const struct event *a, const struct event *b) { if (a->time.seconds != b->time.seconds) return 0; @@ -255,9 +255,9 @@ void add_extra_data(struct divecomputer *dc, const char *key, const char *value) * saving the dive mode for each event. When the events occur AFTER 'time' seconds, the last stored divemode * is returned. This function is self-tracking, relying on setting the event pointer 'evp' so that, in each iteration * that calls this function, the search does not have to begin at the first event of the dive */ -enum divemode_t get_current_divemode(struct divecomputer *dc, int time, struct event **evp, enum divemode_t *divemode) +enum divemode_t get_current_divemode(const struct divecomputer *dc, int time, const struct event **evp, enum divemode_t *divemode) { - struct event *ev = *evp; + const struct event *ev = *evp; if (*divemode == UNDEF_COMP_TYPE) { *divemode = dc->divemode; ev = dc ? get_next_event(dc->events, "modechange") : NULL; @@ -270,17 +270,16 @@ enum divemode_t get_current_divemode(struct divecomputer *dc, int time, struct e return *divemode; } -/* this returns a pointer to static variable - so use it right away after calling */ -struct gasmix *get_gasmix_from_event(struct dive *dive, struct event *ev) +struct gasmix get_gasmix_from_event(const struct dive *dive, const struct event *ev) { - static struct gasmix dummy; + struct gasmix dummy = { 0 }; if (ev && event_is_gaschange(ev)) { int index = ev->gas.index; if (index >= 0 && index < MAX_CYLINDERS) - return &dive->cylinder[index].gasmix; - return &ev->gas.mix; + return dive->cylinder[index].gasmix; + return ev->gas.mix; } - return &dummy; + return dummy; } int get_pressure_units(int mb, const char **units) @@ -481,7 +480,7 @@ static void free_pic(struct picture *picture); /* this is very different from the copy_divecomputer later in this file; * this function actually makes full copies of the content */ -static void copy_dc(struct divecomputer *sdc, struct divecomputer *ddc) +static void copy_dc(const struct divecomputer *sdc, struct divecomputer *ddc) { *ddc = *sdc; ddc->model = copy_string(sdc->model); @@ -557,7 +556,7 @@ void clear_dive(struct dive *d) /* make a true copy that is independent of the source dive; * all data structures are duplicated, so the copy can be modified without * any impact on the source */ -void copy_dive(struct dive *s, struct dive *d) +void copy_dive(const struct dive *s, struct dive *d) { clear_dive(d); /* simply copy things over, but then make actual copies of the @@ -598,7 +597,7 @@ struct dive *clone_dive(struct dive *s) d->_component = copy_string(s->_component) // copy elements, depending on bits in what that are set -void selective_copy_dive(struct dive *s, struct dive *d, struct dive_components what, bool clear) +void selective_copy_dive(const struct dive *s, struct dive *d, struct dive_components what, bool clear) { if (clear) clear_dive(d); @@ -642,9 +641,10 @@ struct event *clone_event(const struct event *src_ev) } /* copies all events in this dive computer */ -void copy_events(struct divecomputer *s, struct divecomputer *d) +void copy_events(const struct divecomputer *s, struct divecomputer *d) { - struct event *ev, **pev; + const struct event *ev; + struct event **pev; if (!s || !d) return; ev = s->events; @@ -658,24 +658,24 @@ void copy_events(struct divecomputer *s, struct divecomputer *d) *pev = NULL; } -int nr_cylinders(struct dive *dive) +int nr_cylinders(const struct dive *dive) { int nr; for (nr = MAX_CYLINDERS; nr; --nr) { - cylinder_t *cylinder = dive->cylinder + nr - 1; + const cylinder_t *cylinder = dive->cylinder + nr - 1; if (!cylinder_nodata(cylinder)) break; } return nr; } -int nr_weightsystems(struct dive *dive) +int nr_weightsystems(const struct dive *dive) { int nr; for (nr = MAX_WEIGHTSYSTEMS; nr; --nr) { - weightsystem_t *ws = dive->weightsystem + nr - 1; + const weightsystem_t *ws = dive->weightsystem + nr - 1; if (!weightsystem_none(ws)) break; } @@ -683,7 +683,7 @@ int nr_weightsystems(struct dive *dive) } /* copy the equipment data part of the cylinders */ -void copy_cylinders(struct dive *s, struct dive *d, bool used_only) +void copy_cylinders(const struct dive *s, struct dive *d, bool used_only) { int i,j; cylinder_t t[MAX_CYLINDERS]; @@ -729,7 +729,7 @@ int cylinderuse_from_text(const char *text) return -1; } -void copy_samples(struct divecomputer *s, struct divecomputer *d) +void copy_samples(const struct divecomputer *s, struct divecomputer *d) { /* instead of carefully copying them one by one and calling add_sample * over and over again, let's just copy the whole blob */ @@ -876,13 +876,13 @@ void fixup_dc_duration(struct divecomputer *dc) /* Which cylinders had gas used? */ #define SOME_GAS 5000 -static unsigned int get_cylinder_used(struct dive *dive) +static unsigned int get_cylinder_used(const struct dive *dive) { int i; unsigned int mask = 0; for (i = 0; i < MAX_CYLINDERS; i++) { - cylinder_t *cyl = dive->cylinder + i; + const cylinder_t *cyl = dive->cylinder + i; int start_mbar, end_mbar; if (cylinder_nodata(cyl)) @@ -899,10 +899,10 @@ static unsigned int get_cylinder_used(struct dive *dive) } /* Which cylinders do we know usage about? */ -static unsigned int get_cylinder_known(struct dive *dive, struct divecomputer *dc) +static unsigned int get_cylinder_known(const struct dive *dive, const struct divecomputer *dc) { unsigned int mask = 0; - struct event *ev; + const struct event *ev; /* We know about using the O2 cylinder in a CCR dive */ if (dc->divemode == CCR) { @@ -926,7 +926,7 @@ static unsigned int get_cylinder_known(struct dive *dive, struct divecomputer *d return mask; } -void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *mean, int *duration) +void per_cylinder_mean_depth(const struct dive *dive, struct divecomputer *dc, int *mean, int *duration) { int i; int depthtime[MAX_CYLINDERS] = { 0, }; @@ -974,7 +974,7 @@ void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *me } if (!dc->samples) fake_dc(dc); - struct event *ev = get_next_event(dc->events, "gaschange"); + const struct event *ev = get_next_event(dc->events, "gaschange"); for (i = 0; i < dc->samples; i++) { struct sample *sample = dc->sample + i; uint32_t time = sample->time.seconds; @@ -1019,10 +1019,10 @@ static void update_min_max_temperatures(struct dive *dive, temperature_t tempera } } -int gas_volume(cylinder_t *cyl, pressure_t p) +int gas_volume(const cylinder_t *cyl, pressure_t p) { double bar = p.mbar / 1000.0; - double z_factor = gas_compressibility_factor(&cyl->gasmix, bar); + double z_factor = gas_compressibility_factor(cyl->gasmix, bar); return lrint(cyl->type.size.mliter * bar_to_atm(bar) / z_factor); } @@ -1040,10 +1040,10 @@ static int same_rounded_pressure(pressure_t a, pressure_t b) * tell us what the first gas is with a gas change event in the first sample. * Sneakily we'll use a return value of 0 (or FALSE) when there is no explicit * first cylinder - in which case cylinder 0 is indeed the first cylinder */ -int explicit_first_cylinder(struct dive *dive, struct divecomputer *dc) +int explicit_first_cylinder(const struct dive *dive, const struct divecomputer *dc) { if (dc) { - struct event *ev = get_next_event(dc->events, "gaschange"); + const struct event *ev = get_next_event(dc->events, "gaschange"); if (ev && ((dc->sample && ev->time.seconds == dc->sample[0].time.seconds) || ev->time.seconds <= 1)) return get_cylinder_index(dive, ev); else if (dc->divemode == CCR) @@ -1055,7 +1055,7 @@ int explicit_first_cylinder(struct dive *dive, struct divecomputer *dc) /* this gets called when the dive mode has changed (so OC vs. CC) * there are two places we might have setpoints... events or in the samples */ -void update_setpoint_events(struct dive *dive, struct divecomputer *dc) +void update_setpoint_events(const struct dive *dive, struct divecomputer *dc) { struct event *ev; int new_setpoint = 0; @@ -1072,9 +1072,9 @@ void update_setpoint_events(struct dive *dive, struct divecomputer *dc) // by mistake when it's actually CCR is _bad_ // So we make sure, this comes from a Predator or Petrel and we only remove // pO2 values we would have computed anyway. - struct event *ev = get_next_event(dc->events, "gaschange"); - struct gasmix *gasmix = get_gasmix_from_event(dive, ev); - struct event *next = get_next_event(ev, "gaschange"); + const struct event *ev = get_next_event(dc->events, "gaschange"); + struct gasmix gasmix = get_gasmix_from_event(dive, ev); + const struct event *next = get_next_event(ev, "gaschange"); for (int i = 0; i < dc->samples; i++) { struct gas_pressures pressures; @@ -1092,7 +1092,7 @@ void update_setpoint_events(struct dive *dive, struct divecomputer *dc) // an "SP change" event at t=0 is currently our marker for OC vs CCR // this will need to change to a saner setup, but for now we can just // check if such an event is there and adjust it, or add that event - ev = get_next_event(dc->events, "SP change"); + ev = get_next_event_mutable(dc->events, "SP change"); if (ev && ev->time.seconds == 0) { ev->value = new_setpoint; } else { @@ -1113,7 +1113,7 @@ void sanitize_gasmix(struct gasmix *mix) if (!o2) return; /* 20.8% to 21% O2 is just air */ - if (gasmix_is_air(mix)) { + if (gasmix_is_air(*mix)) { mix->o2.permille = 0; return; } @@ -1232,7 +1232,7 @@ static void sanitize_cylinder_info(struct dive *dive) * Output: i) The icd_data stucture is filled with the delta_N2 and delta_He numbers (as permille). * ii) Function returns a boolean indicating an exceeding of the rule-of-fifths. False = no icd problem. */ -bool isobaric_counterdiffusion(struct gasmix *oldgasmix, struct gasmix *newgasmix, struct icd_data *results) +bool isobaric_counterdiffusion(struct gasmix oldgasmix, struct gasmix newgasmix, struct icd_data *results) { if (!prefs.show_icd) return false; @@ -1242,7 +1242,7 @@ bool isobaric_counterdiffusion(struct gasmix *oldgasmix, struct gasmix *newgasmi } /* some events should never be thrown away */ -static bool is_potentially_redundant(struct event *event) +static bool is_potentially_redundant(const struct event *event) { if (!strcmp(event->name, "gaschange")) return false; @@ -1331,7 +1331,7 @@ static void fixup_duration(struct dive *dive) * What do the dive computers say the water temperature is? * (not in the samples, but as dc property for dcs that support that) */ -unsigned int dc_watertemp(struct divecomputer *dc) +unsigned int dc_watertemp(const struct divecomputer *dc) { int sum = 0, nr = 0; @@ -1355,7 +1355,7 @@ static void fixup_watertemp(struct dive *dive) /* * What do the dive computers say the air temperature is? */ -unsigned int dc_airtemp(struct divecomputer *dc) +unsigned int dc_airtemp(const struct divecomputer *dc) { int sum = 0, nr = 0; @@ -1609,7 +1609,7 @@ static void fixup_dive_pressures(struct dive *dive, struct divecomputer *dc) simplify_dc_pressures(dc); } -int find_best_gasmix_match(struct gasmix *mix, cylinder_t array[], unsigned int used) +int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[], unsigned int used) { int i; int best = -1, score = INT_MAX; @@ -1623,7 +1623,7 @@ int find_best_gasmix_match(struct gasmix *mix, cylinder_t array[], unsigned int match = array + i; if (cylinder_nodata(match)) continue; - distance = gasmix_distance(mix, &match->gasmix); + distance = gasmix_distance(mix, match->gasmix); if (distance >= score) continue; best = i; @@ -1641,14 +1641,14 @@ static bool validate_gaschange(struct dive *dive, struct event *event) int o2, he, value; /* We'll get rid of the per-event gasmix, but for now sanitize it */ - if (gasmix_is_air(&event->gas.mix)) + if (gasmix_is_air(event->gas.mix)) event->gas.mix.o2.permille = 0; /* Do we already have a cylinder index for this gasmix? */ if (event->gas.index >= 0) return true; - index = find_best_gasmix_match(&event->gas.mix, dive->cylinder, 0); + index = find_best_gasmix_match(event->gas.mix, dive->cylinder, 0); if (index < 0) return false; @@ -1657,8 +1657,8 @@ static bool validate_gaschange(struct dive *dive, struct event *event) event->gas.mix = dive->cylinder[index].gasmix; /* Convert to odd libdivecomputer format */ - o2 = get_o2(&event->gas.mix); - he = get_he(&event->gas.mix); + o2 = get_o2(event->gas.mix); + he = get_he(event->gas.mix); o2 = (o2 + 5) / 10; he = (he + 5) / 10; @@ -1804,7 +1804,7 @@ struct dive *fixup_dive(struct dive *dive) #define MERGE_TXT(res, a, b, n, sep) res->n = merge_text(a->n, b->n, sep) #define MERGE_NONZERO(res, a, b, n) res->n = a->n ? a->n : b->n -struct sample *add_sample(struct sample *sample, int time, struct divecomputer *dc) +struct sample *add_sample(const struct sample *sample, int time, struct divecomputer *dc) { struct sample *p = prepare_sample(dc); @@ -1969,7 +1969,7 @@ static char *merge_text(const char *a, const char *b, const char *sep) if (a->field != b->field) \ return a->field < b->field ? -1 : 1 -static int sort_event(struct event *a, struct event *b) +static int sort_event(const struct event *a, const struct event *b) { SORT(a, b, time.seconds); SORT(a, b, type); @@ -1978,10 +1978,10 @@ static int sort_event(struct event *a, struct event *b) return strcmp(a->name, b->name); } -static int same_gas(struct event *a, struct event *b) +static int same_gas(const struct event *a, const struct event *b) { if (a->type == b->type && a->flags == b->flags && a->value == b->value && !strcmp(a->name, b->name) && - same_gasmix(&a->gas.mix, &b->gas.mix)) { + same_gasmix(a->gas.mix, b->gas.mix)) { return true; } return false; @@ -2056,7 +2056,7 @@ static void merge_events(struct divecomputer *res, struct divecomputer *src1, st } } -static void merge_weightsystem_info(weightsystem_t *res, weightsystem_t *a, weightsystem_t *b) +static void merge_weightsystem_info(weightsystem_t *res, const weightsystem_t *a, const weightsystem_t *b) { if (!a->weight.grams) a = b; @@ -2069,7 +2069,7 @@ static void merge_weightsystem_info(weightsystem_t *res, weightsystem_t *a, weig * A negative number returned indicates that a match could not be found. * Call parameters: dive = the dive being processed * cylinder_use_type = an enum, one of {oxygen, diluent, bailout} */ -extern int get_cylinder_idx_by_use(struct dive *dive, enum cylinderuse cylinder_use_type) +extern int get_cylinder_idx_by_use(const struct dive *dive, enum cylinderuse cylinder_use_type) { int cylinder_index; for (cylinder_index = 0; cylinder_index < MAX_CYLINDERS; cylinder_index++) { @@ -2079,7 +2079,7 @@ extern int get_cylinder_idx_by_use(struct dive *dive, enum cylinderuse cylinder_ return -1; // negative number means cylinder_use_type not found in list of cylinders } -int gasmix_distance(const struct gasmix *a, const struct gasmix *b) +int gasmix_distance(struct gasmix a, struct gasmix b) { int a_o2 = get_o2(a), b_o2 = get_o2(b); int a_he = get_he(a), b_he = get_he(b); @@ -2100,7 +2100,7 @@ int gasmix_distance(const struct gasmix *a, const struct gasmix *b) * divemode = the dive mode pertaining to this point in the dive profile. * This function called by: calculate_gas_information_new() in profile.c; add_segment() in deco.c. */ -extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, enum divemode_t divemode) +extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, struct gasmix mix, double po2, enum divemode_t divemode) { if ((divemode != OC) && po2) { // This is a rebreather dive where pressures->o2 is defined if (po2 >= amb_pressure) { @@ -2138,7 +2138,7 @@ extern void fill_pressures(struct gas_pressures *pressures, const double amb_pre /* Force an initial gaschange event to the (old) gas #0 */ static void add_initial_gaschange(struct dive *dive, struct divecomputer *dc) { - struct event *ev = get_next_event(dc->events, "gaschange"); + const struct event *ev = get_next_event(dc->events, "gaschange"); if (ev && ev->time.seconds < 30) return; @@ -2205,20 +2205,20 @@ void cylinder_renumber(struct dive *dive, int mapping[]) dc_cylinder_renumber(dive, dc, mapping); } -int same_gasmix(struct gasmix *a, struct gasmix *b) +int same_gasmix(struct gasmix a, struct gasmix b) { if (gasmix_is_air(a) && gasmix_is_air(b)) return 1; - return a->o2.permille == b->o2.permille && a->he.permille == b->he.permille; + return a.o2.permille == b.o2.permille && a.he.permille == b.he.permille; } int same_gasmix_cylinder(cylinder_t *cyl, int cylid, struct dive *dive, bool check_unused) { - struct gasmix *mygas = &cyl->gasmix; + struct gasmix mygas = cyl->gasmix; for (int i = 0; i < MAX_CYLINDERS; i++) { if (i == cylid || cylinder_none(&dive->cylinder[i])) continue; - struct gasmix *gas2 = &dive->cylinder[i].gasmix; + struct gasmix gas2 = dive->cylinder[i].gasmix; if (gasmix_distance(mygas, gas2) == 0 && (is_cylinder_used(dive, i) || check_unused)) return i; } @@ -2230,7 +2230,7 @@ static int pdiff(pressure_t a, pressure_t b) return a.mbar && b.mbar && a.mbar != b.mbar; } -static int different_manual_pressures(cylinder_t *a, cylinder_t *b) +static int different_manual_pressures(const cylinder_t *a, const cylinder_t *b) { return pdiff(a->start, b->start) || pdiff(a->end, b->end); } @@ -2244,17 +2244,17 @@ static int different_manual_pressures(cylinder_t *a, cylinder_t *b) * same cylinder use (ie OC/Diluent/Oxygen), and if pressures * have been added manually they need to match. */ -static int match_cylinder(cylinder_t *cyl, struct dive *dive, unsigned int available) +static int match_cylinder(const cylinder_t *cyl, const struct dive *dive, unsigned int available) { int i; for (i = 0; i < MAX_CYLINDERS; i++) { - cylinder_t *target; + const cylinder_t *target; if (!(available & (1u << i))) continue; target = dive->cylinder + i; - if (!same_gasmix(&cyl->gasmix, &target->gasmix)) + if (!same_gasmix(cyl->gasmix, target->gasmix)) continue; if (cyl->cylinder_use != target->cylinder_use) continue; @@ -2425,7 +2425,7 @@ static void merge_temperatures(struct dive *res, struct dive *a, struct dive *b) * The 'next' dive is not involved in the dive merging, but is the dive * that will be the next dive after the merged dive. */ -static void pick_trip(struct dive *res, struct dive *pick) +static void pick_trip(struct dive *res, const struct dive *pick) { tripflag_t tripflag = pick->tripflag; dive_trip_t *trip = pick->divetrip; @@ -2690,7 +2690,7 @@ static int similar(unsigned long a, unsigned long b, unsigned long expected) * positive for "same dive" and negative for "definitely * not the same dive" */ -int match_one_dc(struct divecomputer *a, struct divecomputer *b) +int match_one_dc(const struct divecomputer *a, const struct divecomputer *b) { /* Not same model? Don't know if matching.. */ if (!a->model || !b->model) @@ -2722,10 +2722,10 @@ int match_one_dc(struct divecomputer *a, struct divecomputer *b) * 0 for "don't know" * 1 for "is definitely the same dive" */ -static int match_dc_dive(struct divecomputer *a, struct divecomputer *b) +static int match_dc_dive(const struct divecomputer *a, const struct divecomputer *b) { do { - struct divecomputer *tmp = b; + const struct divecomputer *tmp = b; do { int match = match_one_dc(a, tmp); if (match) @@ -2737,7 +2737,7 @@ static int match_dc_dive(struct divecomputer *a, struct divecomputer *b) return 0; } -static bool new_without_trip(struct dive *a) +static bool new_without_trip(const struct dive *a) { return a->downloaded && !a->divetrip; } @@ -2771,7 +2771,7 @@ static bool new_without_trip(struct dive *a) * dives together manually. But this tries to handle the sane * cases. */ -static int likely_same_dive(struct dive *a, struct dive *b) +static int likely_same_dive(const struct dive *a, const struct dive *b) { int match, fuzz = 20 * 60; @@ -2875,7 +2875,7 @@ static int same_sample(struct sample *a, struct sample *b) static int same_dc(struct divecomputer *a, struct divecomputer *b) { int i; - struct event *eva, *evb; + const struct event *eva, *evb; i = match_one_dc(a, b); if (i) @@ -2899,7 +2899,7 @@ static int same_dc(struct divecomputer *a, struct divecomputer *b) return eva == evb; } -static int might_be_same_device(struct divecomputer *a, struct divecomputer *b) +static int might_be_same_device(const struct divecomputer *a, const struct divecomputer *b) { /* No dive computer model? That matches anything */ if (!a->model || !b->model) @@ -2958,7 +2958,7 @@ static struct divecomputer *find_matching_computer(struct divecomputer *match, s } -static void copy_dive_computer(struct divecomputer *res, struct divecomputer *a) +static void copy_dive_computer(struct divecomputer *res, const struct divecomputer *a) { *res = *a; res->model = copy_string(a->model); @@ -3859,7 +3859,7 @@ static bool new_picture_for_dive(struct dive *d, const char *filename) // only add pictures that have timestamps between 30 minutes before the dive and // 30 minutes after the dive ends #define D30MIN (30 * 60) -bool dive_check_picture_time(struct dive *d, int shift_time, timestamp_t timestamp) +bool dive_check_picture_time(const struct dive *d, int shift_time, timestamp_t timestamp) { offset_t offset; if (timestamp) { @@ -4026,7 +4026,7 @@ void delete_current_divecomputer(void) /* helper function to make it easier to work with our structures * we don't interpolate here, just use the value from the last sample up to that time */ -int get_depth_at_time(struct divecomputer *dc, unsigned int time) +int get_depth_at_time(const struct divecomputer *dc, unsigned int time) { int depth = 0; if (dc && dc->sample) @@ -4039,7 +4039,7 @@ int get_depth_at_time(struct divecomputer *dc, unsigned int time) } //Calculate O2 in best mix -fraction_t best_o2(depth_t depth, struct dive *dive) +fraction_t best_o2(depth_t depth, const struct dive *dive) { fraction_t fo2; @@ -4051,7 +4051,7 @@ fraction_t best_o2(depth_t depth, struct dive *dive) } //Calculate He in best mix. O2 is considered narcopic -fraction_t best_he(depth_t depth, struct dive *dive) +fraction_t best_he(depth_t depth, const struct dive *dive) { fraction_t fhe; int pnarcotic, ambient; @@ -4063,10 +4063,10 @@ fraction_t best_he(depth_t depth, struct dive *dive) return fhe; } -bool gasmix_is_air(const struct gasmix *gasmix) +bool gasmix_is_air(struct gasmix gasmix) { - int o2 = gasmix->o2.permille; - int he = gasmix->he.permille; + int o2 = gasmix.o2.permille; + int he = gasmix.he.permille; return (he == 0) && (o2 == 0 || ((o2 >= O2_IN_AIR - 1) && (o2 <= O2_IN_AIR + 1))); } @@ -4108,17 +4108,17 @@ int calculate_depth_to_mbar(int depth, pressure_t surface_pressure, int salinity return mbar; } -int depth_to_mbar(int depth, struct dive *dive) +int depth_to_mbar(int depth, const struct dive *dive) { return calculate_depth_to_mbar(depth, dive->surface_pressure, dive->salinity); } -double depth_to_bar(int depth, struct dive *dive) +double depth_to_bar(int depth, const struct dive *dive) { return depth_to_mbar(depth, dive) / 1000.0; } -double depth_to_atm(int depth, struct dive *dive) +double depth_to_atm(int depth, const struct dive *dive) { return mbar_to_atm(depth_to_mbar(depth, dive)); } @@ -4127,7 +4127,7 @@ double depth_to_atm(int depth, struct dive *dive) * (that's the one that some dive computers like the Uemis Zurich * provide - for the other models that do this libdivecomputer has to * take care of this, but the Uemis we support natively */ -int rel_mbar_to_depth(int mbar, struct dive *dive) +int rel_mbar_to_depth(int mbar, const struct dive *dive) { int cm; double specific_weight = 1.03 * 0.981; @@ -4138,7 +4138,7 @@ int rel_mbar_to_depth(int mbar, struct dive *dive) return cm * 10; } -int mbar_to_depth(int mbar, struct dive *dive) +int mbar_to_depth(int mbar, const struct dive *dive) { pressure_t surface_pressure; if (dive->surface_pressure.mbar) @@ -4149,7 +4149,7 @@ int mbar_to_depth(int mbar, struct dive *dive) } /* MOD rounded to multiples of roundto mm */ -depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit, struct dive *dive, int roundto) +depth_t gas_mod(struct gasmix mix, pressure_t po2_limit, const struct dive *dive, int roundto) { depth_t rounded_depth; @@ -4159,7 +4159,7 @@ depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit, struct dive *dive, int } /* Maximum narcotic depth rounded to multiples of roundto mm */ -depth_t gas_mnd(struct gasmix *mix, depth_t end, struct dive *dive, int roundto) +depth_t gas_mnd(struct gasmix mix, depth_t end, const struct dive *dive, int roundto) { depth_t rounded_depth; pressure_t ppo2n2; @@ -4184,14 +4184,14 @@ struct dive *get_dive_from_table(int nr, struct dive_table *dt) return dt->dives[nr]; } -struct dive_site *get_dive_site_for_dive(struct dive *dive) +struct dive_site *get_dive_site_for_dive(const struct dive *dive) { if (dive) return get_dive_site_by_uuid(dive->dive_site_uuid); return NULL; } -const char *get_dive_country(struct dive *dive) +const char *get_dive_country(const struct dive *dive) { struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid); if (ds) { @@ -4210,10 +4210,10 @@ const char *get_dive_location(const struct dive *dive) return NULL; } -unsigned int number_of_computers(struct dive *dive) +unsigned int number_of_computers(const struct dive *dive) { unsigned int total_number = 0; - struct divecomputer *dc = &dive->dc; + const struct divecomputer *dc = &dive->dc; if (!dive) return 1; @@ -4276,31 +4276,44 @@ int get_idx_by_uniq_id(int id) return i; } -bool dive_site_has_gps_location(struct dive_site *ds) +bool dive_site_has_gps_location(const struct dive_site *ds) { return ds && (ds->latitude.udeg || ds->longitude.udeg); } -int dive_has_gps_location(struct dive *dive) +int dive_has_gps_location(const struct dive *dive) { if (!dive) return false; return dive_site_has_gps_location(get_dive_site_by_uuid(dive->dive_site_uuid)); } -struct gasmix *get_gasmix(struct dive *dive, struct divecomputer *dc, int time, struct event **evp, struct gasmix *gasmix) +struct gasmix get_gasmix(const struct dive *dive, const struct divecomputer *dc, int time, const struct event **evp, struct gasmix gasmix) { - struct event *ev = *evp; + const struct event *ev = *evp; + struct gasmix res; - if (!gasmix) { + if (!ev) { + /* on first invocation, get initial gas mix and first event (if any) */ int cyl = explicit_first_cylinder(dive, dc); - gasmix = &dive->cylinder[cyl].gasmix; + res = dive->cylinder[cyl].gasmix; ev = dc ? get_next_event(dc->events, "gaschange") : NULL; + } else { + res = gasmix; } + while (ev && ev->time.seconds < time) { - gasmix = get_gasmix_from_event(dive, ev); + res = get_gasmix_from_event(dive, ev); ev = get_next_event(ev->next, "gaschange"); } *evp = ev; - return gasmix; + return res; +} + +/* get the gas at a certain time during the dive */ +struct gasmix get_gasmix_at_time(const struct dive *d, const struct divecomputer *dc, duration_t time) +{ + const struct event *ev = NULL; + struct gasmix gasmix = { 0 }; + return get_gasmix(d, dc, time.seconds, &ev, gasmix); } diff --git a/core/dive.h b/core/dive.h index 01ec1fd3d..4c24dad74 100644 --- a/core/dive.h +++ b/core/dive.h @@ -71,7 +71,7 @@ struct icd_data { // This structure provides communication between function isob int dHe; // The change in fraction (permille) of helium during the change }; -extern bool isobaric_counterdiffusion(struct gasmix *oldgasmix, struct gasmix *newgasmix, struct icd_data *results); +extern bool isobaric_counterdiffusion(struct gasmix oldgasmix, struct gasmix newgasmix, struct icd_data *results); /* * Events are currently based straight on what libdivecomputer gives us. @@ -100,7 +100,7 @@ struct event { char name[]; }; -extern int event_is_gaschange(struct event *ev); +extern int event_is_gaschange(const struct event *ev); extern int get_pressure_units(int mb, const char **units); extern double get_depth_units(int mm, int *frac, const char **units); @@ -113,33 +113,33 @@ extern depth_t units_to_depth(double depth); extern int units_to_sac(double volume); /* Volume in mliter of a cylinder at pressure 'p' */ -extern int gas_volume(cylinder_t *cyl, pressure_t p); -extern double gas_compressibility_factor(struct gasmix *gas, double bar); -extern double isothermal_pressure(struct gasmix *gas, double p1, int volume1, int volume2); -extern double gas_density(struct gasmix *gas, int pressure); -extern int same_gasmix(struct gasmix *a, struct gasmix *b); +extern int gas_volume(const cylinder_t *cyl, pressure_t p); +extern double gas_compressibility_factor(struct gasmix gas, double bar); +extern double isothermal_pressure(struct gasmix gas, double p1, int volume1, int volume2); +extern double gas_density(struct gasmix gas, int pressure); +extern int same_gasmix(struct gasmix a, struct gasmix b); -static inline int get_o2(const struct gasmix *mix) +static inline int get_o2(struct gasmix mix) { - return mix->o2.permille ?: O2_IN_AIR; + return mix.o2.permille ?: O2_IN_AIR; } -static inline int get_he(const struct gasmix *mix) +static inline int get_he(struct gasmix mix) { - return mix->he.permille; + return mix.he.permille; } struct gas_pressures { double o2, n2, he; }; -extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, const struct gasmix *mix, double po2, enum divemode_t dctype); +extern void fill_pressures(struct gas_pressures *pressures, const double amb_pressure, struct gasmix mix, double po2, enum divemode_t dctype); extern void sanitize_gasmix(struct gasmix *mix); -extern int gasmix_distance(const struct gasmix *a, const struct gasmix *b); -extern int find_best_gasmix_match(struct gasmix *mix, cylinder_t array[], unsigned int used); +extern int gasmix_distance(struct gasmix a, struct gasmix b); +extern int find_best_gasmix_match(struct gasmix mix, const cylinder_t array[], unsigned int used); -extern bool gasmix_is_air(const struct gasmix *gasmix); +extern bool gasmix_is_air(struct gasmix gasmix); /* Linear interpolation between 'a' and 'b', when we are 'part'way into the 'whole' distance from a to b */ static inline int interpolate(int a, int b, int part, int whole) @@ -152,8 +152,8 @@ static inline int interpolate(int a, int b, int part, int whole) return (a+b)/2; } -void get_gas_string(const struct gasmix *gasmix, char *text, int len); -const char *gasname(const struct gasmix *gasmix); +void get_gas_string(struct gasmix gasmix, char *text, int len); +const char *gasname(struct gasmix gasmix); #define MAX_SENSORS 2 struct sample // BASE TYPE BYTES UNITS RANGE DESCRIPTION @@ -334,7 +334,7 @@ struct dive { extern void invalidate_dive_cache(struct dive *dive); extern bool dive_cache_is_valid(const struct dive *dive); -extern int get_cylinder_idx_by_use(struct dive *dive, enum cylinderuse cylinder_use_type); +extern int get_cylinder_idx_by_use(const struct dive *dive, enum cylinderuse cylinder_use_type); extern void cylinder_renumber(struct dive *dive, int mapping[]); extern int same_gasmix_cylinder(cylinder_t *cyl, int cylid, struct dive *dive, bool check_unused); @@ -352,9 +352,9 @@ struct dive_components { unsigned int weights : 1; }; -extern enum divemode_t get_current_divemode(struct divecomputer *dc, int time, struct event **evp, enum divemode_t *divemode); -extern struct event *get_next_divemodechange(struct event **evd, bool update_pointer); -extern enum divemode_t get_divemode_at_time(struct divecomputer *dc, int dtime, struct event **ev_dmc); +extern enum divemode_t get_current_divemode(const struct divecomputer *dc, int time, const struct event **evp, enum divemode_t *divemode); +extern struct event *get_next_divemodechange(const struct event **evd, bool update_pointer); +extern enum divemode_t get_divemode_at_time(const struct divecomputer *dc, int dtime, const struct event **ev_dmc); /* picture list and methods related to dive picture handling */ struct picture { @@ -373,7 +373,7 @@ struct picture { for (struct picture *picture = (_divestruct).picture_list; picture; picture = picture->next) extern struct picture *alloc_picture(); -extern bool dive_check_picture_time(struct dive *d, int shift_time, timestamp_t timestamp); +extern bool dive_check_picture_time(const struct dive *d, int shift_time, timestamp_t timestamp); extern void dive_create_picture(struct dive *d, const char *filename, int shift_time, bool match_all); extern void dive_add_picture(struct dive *d, struct picture *newpic); extern bool dive_remove_picture(struct dive *d, const char *filename); @@ -382,22 +382,22 @@ extern bool picture_check_valid(const char *filename, int shift_time); extern void dive_set_geodata_from_picture(struct dive *d, struct picture *pic); extern void picture_free(struct picture *picture); -extern bool has_gaschange_event(struct dive *dive, struct divecomputer *dc, int idx); -extern int explicit_first_cylinder(struct dive *dive, struct divecomputer *dc); -extern int get_depth_at_time(struct divecomputer *dc, unsigned int time); +extern bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx); +extern int explicit_first_cylinder(const struct dive *dive, const struct divecomputer *dc); +extern int get_depth_at_time(const struct divecomputer *dc, unsigned int time); -extern fraction_t best_o2(depth_t depth, struct dive *dive); -extern fraction_t best_he(depth_t depth, struct dive *dive); +extern fraction_t best_o2(depth_t depth, const struct dive *dive); +extern fraction_t best_he(depth_t depth, const struct dive *dive); extern int get_surface_pressure_in_mbar(const struct dive *dive, bool non_null); extern int calculate_depth_to_mbar(int depth, pressure_t surface_pressure, int salinity); -extern int depth_to_mbar(int depth, struct dive *dive); -extern double depth_to_bar(int depth, struct dive *dive); -extern double depth_to_atm(int depth, struct dive *dive); -extern int rel_mbar_to_depth(int mbar, struct dive *dive); -extern int mbar_to_depth(int mbar, struct dive *dive); -extern depth_t gas_mod(struct gasmix *mix, pressure_t po2_limit, struct dive *dive, int roundto); -extern depth_t gas_mnd(struct gasmix *mix, depth_t end, struct dive *dive, int roundto); +extern int depth_to_mbar(int depth, const struct dive *dive); +extern double depth_to_bar(int depth, const struct dive *dive); +extern double depth_to_atm(int depth, const struct dive *dive); +extern int rel_mbar_to_depth(int mbar, const struct dive *dive); +extern int mbar_to_depth(int mbar, const struct dive *dive); +extern depth_t gas_mod(struct gasmix mix, pressure_t po2_limit, const struct dive *dive, int roundto); +extern depth_t gas_mnd(struct gasmix mix, depth_t end, const struct dive *dive, int roundto); #define SURFACE_THRESHOLD 750 /* somewhat arbitrary: only below 75cm is it really diving */ @@ -442,10 +442,10 @@ extern unsigned int dc_number; extern struct dive *get_dive(int nr); extern struct dive *get_dive_from_table(int nr, struct dive_table *dt); -extern struct dive_site *get_dive_site_for_dive(struct dive *dive); -extern const char *get_dive_country(struct dive *dive); +extern struct dive_site *get_dive_site_for_dive(const struct dive *dive); +extern const char *get_dive_country(const struct dive *dive); extern const char *get_dive_location(const struct dive *dive); -extern unsigned int number_of_computers(struct dive *dive); +extern unsigned int number_of_computers(const struct dive *dive); extern struct divecomputer *get_dive_dc(struct dive *dive, int nr); extern timestamp_t dive_endtime(const struct dive *dive); @@ -475,8 +475,8 @@ extern "C" { extern struct dive *get_dive_by_uniq_id(int id); extern int get_idx_by_uniq_id(int id); -extern bool dive_site_has_gps_location(struct dive_site *ds); -extern int dive_has_gps_location(struct dive *dive); +extern bool dive_site_has_gps_location(const struct dive_site *ds); +extern int dive_has_gps_location(const struct dive *dive); extern int report_error(const char *fmt, ...); extern void set_error_cb(void(*cb)(char *)); // Callback takes ownership of passed string @@ -487,7 +487,7 @@ extern bool time_during_dive_with_offset(struct dive *dive, timestamp_t when, ti struct dive *find_dive_n_near(timestamp_t when, int n, timestamp_t offset); /* Check if two dive computer entries are the exact same dive (-1=no/0=maybe/1=yes) */ -extern int match_one_dc(struct divecomputer *a, struct divecomputer *b); +extern int match_one_dc(const struct divecomputer *a, const struct divecomputer *b); extern void parse_xml_init(void); extern int parse_xml_buffer(const char *url, const char *buf, int size, struct dive_table *table, const char **params); @@ -499,9 +499,9 @@ extern int parse_dm5_buffer(sqlite3 *handle, const char *url, const char *buf, i extern int parse_shearwater_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct dive_table *table); extern int parse_cobalt_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct dive_table *table); extern int parse_divinglog_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct dive_table *table); -extern int parse_dlf_buffer(unsigned char *buffer, size_t size); +extern int parse_dlf_buffer(unsigned char *buffer, size_t size, struct dive_table *table); -extern int parse_file(const char *filename); +extern int parse_file(const char *filename, struct dive_table *table); extern int parse_csv_file(const char *filename, char **params, int pnr, const char *csvtemplate); extern int parse_seabear_log(const char *filename); extern int parse_txt_file(const char *filename, const char *csv); @@ -547,8 +547,8 @@ extern struct dive *alloc_dive(void); extern void record_dive_to_table(struct dive *dive, struct dive_table *table); extern void record_dive(struct dive *dive); extern void clear_dive(struct dive *dive); -extern void copy_dive(struct dive *s, struct dive *d); -extern void selective_copy_dive(struct dive *s, struct dive *d, struct dive_components what, bool clear); +extern void copy_dive(const struct dive *s, struct dive *d); +extern void selective_copy_dive(const struct dive *s, struct dive *d, struct dive_components what, bool clear); extern struct dive *clone_dive(struct dive *s); extern void clear_table(struct dive_table *table); @@ -557,37 +557,38 @@ extern void alloc_samples(struct divecomputer *dc, int num); extern void free_samples(struct divecomputer *dc); extern struct sample *prepare_sample(struct divecomputer *dc); extern void finish_sample(struct divecomputer *dc); +extern struct sample *add_sample(const struct sample *sample, int time, struct divecomputer *dc); extern void add_sample_pressure(struct sample *sample, int sensor, int mbar); -extern int legacy_format_o2pressures(struct dive *dive, struct divecomputer *dc); +extern int legacy_format_o2pressures(const struct dive *dive, const struct divecomputer *dc); extern void sort_table(struct dive_table *table); extern struct dive *fixup_dive(struct dive *dive); extern void fixup_dc_duration(struct divecomputer *dc); extern int dive_getUniqID(); -extern unsigned int dc_airtemp(struct divecomputer *dc); -extern unsigned int dc_watertemp(struct divecomputer *dc); +extern unsigned int dc_airtemp(const struct divecomputer *dc); +extern unsigned int dc_watertemp(const struct divecomputer *dc); extern int split_dive(struct dive *); extern void split_dive_at_time(struct dive *dive, duration_t time); extern struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer_downloaded); extern struct dive *try_to_merge(struct dive *a, struct dive *b, bool prefer_downloaded); extern struct event *clone_event(const struct event *src_ev); -extern void copy_events(struct divecomputer *s, struct divecomputer *d); +extern void copy_events(const struct divecomputer *s, struct divecomputer *d); extern void free_events(struct event *ev); -extern void copy_cylinders(struct dive *s, struct dive *d, bool used_only); -extern void copy_samples(struct divecomputer *s, struct divecomputer *d); -extern bool is_cylinder_used(struct dive *dive, int idx); -extern bool is_cylinder_prot(struct dive *dive, int idx); +extern void copy_cylinders(const struct dive *s, struct dive *d, bool used_only); +extern void copy_samples(const struct divecomputer *s, struct divecomputer *d); +extern bool is_cylinder_used(const struct dive *dive, int idx); +extern bool is_cylinder_prot(const struct dive *dive, int idx); extern void fill_default_cylinder(cylinder_t *cyl); extern void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int time, int idx); extern struct event *add_event(struct divecomputer *dc, unsigned int time, int type, int flags, int value, const char *name); extern void remove_event(struct event *event); -extern void update_event_name(struct dive *d, struct event* event, const char *name); +extern void update_event_name(struct dive *d, struct event *event, const char *name); extern void add_extra_data(struct divecomputer *dc, const char *key, const char *value); -extern void per_cylinder_mean_depth(struct dive *dive, struct divecomputer *dc, int *mean, int *duration); -extern int get_cylinder_index(struct dive *dive, struct event *ev); -extern struct gasmix *get_gasmix_from_event(struct dive *, struct event *ev); -extern int nr_cylinders(struct dive *dive); -extern int nr_weightsystems(struct dive *dive); +extern void per_cylinder_mean_depth(const struct dive *dive, struct divecomputer *dc, int *mean, int *duration); +extern int get_cylinder_index(const struct dive *dive, const struct event *ev); +extern struct gasmix get_gasmix_from_event(const struct dive *, const struct event *ev); +extern int nr_cylinders(const struct dive *dive); +extern int nr_weightsystems(const struct dive *dive); /* UI related protopypes */ @@ -606,7 +607,7 @@ extern void clear_events(void); extern void set_dc_nickname(struct dive *dive); extern void set_autogroup(bool value); -extern int total_weight(struct dive *); +extern int total_weight(const struct dive *); #ifdef __cplusplus } @@ -663,7 +664,7 @@ struct deco_state { bool icd_warning; }; -extern void add_segment(struct deco_state *ds, double pressure, const struct gasmix *gasmix, int period_in_seconds, int setpoint, enum divemode_t divemode, int sac); +extern void add_segment(struct deco_state *ds, double pressure, struct gasmix gasmix, int period_in_seconds, int setpoint, enum divemode_t divemode, int sac); extern void clear_deco(struct deco_state *ds, double surface_pressure); extern void dump_tissues(struct deco_state *ds); extern void set_gf(short gflow, short gfhigh); @@ -716,9 +717,18 @@ extern void vpmb_start_gradient(struct deco_state *ds); extern void clear_vpmb_state(struct deco_state *ds); extern void printdecotable(struct decostop *table); -extern struct event *get_next_event(struct event *event, const char *name); +/* Since C doesn't have parameter-based overloading, two versions of get_next_event. */ +extern const struct event *get_next_event(const struct event *event, const char *name); +extern struct event *get_next_event_mutable(struct event *event, const char *name); -extern struct gasmix *get_gasmix(struct dive *dive, struct divecomputer *dc, int time, struct event **evp, struct gasmix *gasmix); +/* Get gasmixes at increasing timestamps. + * In "evp", pass a pointer to a "struct event *" which is NULL-initialized on first invocation. + * On subsequent calls, pass the same "evp" and the "gasmix" from previous calls. + */ +extern struct gasmix get_gasmix(const struct dive *dive, const struct divecomputer *dc, int time, const struct event **evp, struct gasmix gasmix); + +/* Get gasmix at a given time */ +extern struct gasmix get_gasmix_at_time(const struct dive *dive, const struct divecomputer *dc, duration_t time); /* these structs holds the information that * describes the cylinders / weight systems. @@ -740,9 +750,8 @@ struct ws_info_t { extern struct ws_info_t ws_info[MAX_WS_INFO]; extern bool cylinder_nodata(const cylinder_t *cyl); -extern bool cylinder_none(void *_data); -extern bool weightsystem_none(void *_data); -extern bool no_weightsystems(weightsystem_t *ws); +extern bool cylinder_none(const cylinder_t *cyl); +extern bool weightsystem_none(const weightsystem_t *ws); extern void remove_cylinder(struct dive *dive, int idx); extern void remove_weightsystem(struct dive *dive, int idx); extern void reset_cylinders(struct dive *dive, bool track_gas); @@ -755,7 +764,7 @@ extern void set_informational_units(const char *units); extern void set_git_prefs(const char *prefs); extern char *get_dive_date_c_string(timestamp_t when); -extern void update_setpoint_events(struct dive *dive, struct divecomputer *dc); +extern void update_setpoint_events(const struct dive *dive, struct divecomputer *dc); #ifdef __cplusplus } diff --git a/core/divecomputer.cpp b/core/divecomputer.cpp index 978074e62..5e177e541 100644 --- a/core/divecomputer.cpp +++ b/core/divecomputer.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "divecomputer.h" #include "dive.h" -#include "subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefDiveComputer.h" #include "subsurface-string.h" DiveComputerList dcList; @@ -123,14 +123,12 @@ extern "C" void call_for_each_dc (void *f, void (*callback)(void *, const char * extern "C" int is_default_dive_computer(const char *vendor, const char *product) { - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - return dc->vendor() == vendor && dc->product() == product; + return qPrefDiveComputer::vendor() == vendor && qPrefDiveComputer::product() == product; } extern "C" int is_default_dive_computer_device(const char *name) { - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - return dc->device() == name; + return qPrefDiveComputer::device() == name; } extern "C" void set_dc_nickname(struct dive *dive) diff --git a/core/divelist.c b/core/divelist.c index b81e89d25..f643d14f6 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -7,8 +7,9 @@ * unsigned int amount_selected; * void dump_selection(void) * void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p) - * int total_weight(struct dive *dive) - * int get_divenr(struct dive *dive) + * int total_weight(const struct dive *dive) + * int get_divenr(const struct dive *dive) + * int get_divesite_idx(const struct dive_site *ds) * int init_decompression(struct dive *dive) * void update_cylinder_related_info(struct dive *dive) * void dump_trip_list(void) @@ -26,6 +27,7 @@ * int unsaved_changes() * void remove_autogen_trips() * void sort_table(struct dive_table *table) + * bool is_trip_before_after(const struct dive *dive, bool before) */ #include <unistd.h> #include <stdio.h> @@ -94,8 +96,8 @@ void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2max_p) for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = dive->cylinder + i; - int o2 = get_o2(&cyl->gasmix); - int he = get_he(&cyl->gasmix); + int o2 = get_o2(cyl->gasmix); + int he = get_he(cyl->gasmix); if (!is_cylinder_used(dive, i)) continue; @@ -122,7 +124,7 @@ void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2max_p) *o2max_p = maxo2; } -int total_weight(struct dive *dive) +int total_weight(const struct dive *dive) { int i, total_grams = 0; @@ -132,19 +134,18 @@ int total_weight(struct dive *dive) return total_grams; } -static int active_o2(struct dive *dive, struct divecomputer *dc, duration_t time) +static int active_o2(const struct dive *dive, const struct divecomputer *dc, duration_t time) { - struct gasmix gas; - get_gas_at_time(dive, dc, time, &gas); - return get_o2(&gas); + struct gasmix gas = get_gasmix_at_time(dive, dc, time); + return get_o2(gas); } /* calculate OTU for a dive - this only takes the first divecomputer into account */ -static int calculate_otu(struct dive *dive) +static int calculate_otu(const struct dive *dive) { int i; double otu = 0.0; - struct divecomputer *dc = &dive->dc; + const struct divecomputer *dc = &dive->dc; for (i = 1; i < dc->samples; i++) { int t; @@ -180,11 +181,11 @@ int const cns_table[][3] = { }; /* Calculate the CNS for a single dive */ -double calculate_cns_dive(struct dive *dive) +static double calculate_cns_dive(const struct dive *dive) { int n; size_t j; - struct divecomputer *dc = &dive->dc; + const struct divecomputer *dc = &dive->dc; double cns = 0.0; /* Caclulate the CNS for each sample in this dive and sum them */ @@ -346,14 +347,14 @@ static int calculate_cns(struct dive *dive) /* * Return air usage (in liters). */ -static double calculate_airuse(struct dive *dive) +static double calculate_airuse(const struct dive *dive) { int airuse = 0; int i; for (i = 0; i < MAX_CYLINDERS; i++) { pressure_t start, end; - cylinder_t *cyl = dive->cylinder + i; + const cylinder_t *cyl = dive->cylinder + i; start = cyl->start.mbar ? cyl->start : cyl->sample_start; end = cyl->end.mbar ? cyl->end : cyl->sample_end; @@ -374,9 +375,9 @@ static double calculate_airuse(struct dive *dive) } /* this only uses the first divecomputer to calculate the SAC rate */ -static int calculate_sac(struct dive *dive) +static int calculate_sac(const struct dive *dive) { - struct divecomputer *dc = &dive->dc; + const struct divecomputer *dc = &dive->dc; double airuse, pressure, sac; int duration, meandepth; @@ -404,9 +405,9 @@ static int calculate_sac(struct dive *dive) static void add_dive_to_deco(struct deco_state *ds, struct dive *dive) { struct divecomputer *dc = &dive->dc; - struct gasmix *gasmix = NULL; + struct gasmix gasmix = { 0 }; int i; - struct event *ev = NULL, *evd = NULL; + const struct event *ev = NULL, *evd = NULL; enum divemode_t current_divemode = UNDEF_COMP_TYPE; if (!dc) @@ -428,10 +429,10 @@ static void add_dive_to_deco(struct deco_state *ds, struct dive *dive) } } -int get_divenr(struct dive *dive) +int get_divenr(const struct dive *dive) { int i; - struct dive *d; + const struct dive *d; // tempting as it may be, don't die when called with dive=NULL if (dive) for_each_dive(i, d) { @@ -441,10 +442,10 @@ int get_divenr(struct dive *dive) return -1; } -int get_divesite_idx(struct dive_site *ds) +int get_divesite_idx(const struct dive_site *ds) { int i; - struct dive_site *d; + const struct dive_site *d; // tempting as it may be, don't die when called with dive=NULL if (ds) for_each_dive_site(i, d) { @@ -577,7 +578,7 @@ int init_decompression(struct deco_state *ds, struct dive *dive) #endif return surface_time; } - add_segment(ds, surface_pressure, &air, surface_time, 0, dive->dc.divemode, prefs.decosac); + add_segment(ds, surface_pressure, air, surface_time, 0, dive->dc.divemode, prefs.decosac); #if DECO_CALC_DEBUG & 2 printf("Tissues after surface intervall of %d:%02u:\n", FRACTION(surface_time, 60)); dump_tissues(ds); @@ -615,7 +616,7 @@ int init_decompression(struct deco_state *ds, struct dive *dive) #endif return surface_time; } - add_segment(ds, surface_pressure, &air, surface_time, 0, dive->dc.divemode, prefs.decosac); + add_segment(ds, surface_pressure, air, surface_time, 0, dive->dc.divemode, prefs.decosac); #if DECO_CALC_DEBUG & 2 printf("Tissues after surface intervall of %d:%02u:\n", FRACTION(surface_time, 60)); dump_tissues(ds); @@ -776,7 +777,7 @@ void find_new_trip_start_time(dive_trip_t *trip) } /* check if we have a trip right before / after this dive */ -bool is_trip_before_after(struct dive *dive, bool before) +bool is_trip_before_after(const struct dive *dive, bool before) { int idx = get_idx_by_uniq_id(dive->id); if (before) { diff --git a/core/divelist.h b/core/divelist.h index d014b4df1..5467f10ae 100644 --- a/core/divelist.h +++ b/core/divelist.h @@ -23,8 +23,8 @@ extern char *get_dive_gas_string(struct dive *dive); struct dive **grow_dive_table(struct dive_table *table); extern void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p); -extern int get_divenr(struct dive *dive); -extern int get_divesite_idx(struct dive_site *ds); +extern int get_divenr(const struct dive *dive); +extern int get_divesite_idx(const struct dive_site *ds); extern void remove_dive_from_trip(struct dive *dive, short was_autogen); extern dive_trip_t *create_and_hookup_trip_from_dive(struct dive *dive); extern void autogroup_dives(void); @@ -39,7 +39,7 @@ extern void combine_trips(struct dive_trip *trip_a, struct dive_trip *trip_b); extern void find_new_trip_start_time(dive_trip_t *trip); extern struct dive *first_selected_dive(); extern struct dive *last_selected_dive(); -extern bool is_trip_before_after(struct dive *dive, bool before); +extern bool is_trip_before_after(const struct dive *dive, bool before); extern void set_dive_nr_for_current_dive(); int get_min_datafile_version(); diff --git a/core/divelogexportlogic.cpp b/core/divelogexportlogic.cpp index 82c8b452f..cb700e79a 100644 --- a/core/divelogexportlogic.cpp +++ b/core/divelogexportlogic.cpp @@ -148,8 +148,10 @@ void exportHtmlInitLogic(const QString &filename, struct htmlExportSetting &hes) export_HTML(qPrintable(json_dive_data), qPrintable(photosDirectory), hes.selectedOnly, hes.listOnly); QString searchPath = getSubsurfaceDataPath("theme"); - if (searchPath.isEmpty()) + if (searchPath.isEmpty()) { + report_error(qPrintable(gettextFromC::tr("Cannot find a folder called 'theme' in the standard locations"))); return; + } searchPath += QDir::separator(); diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index a05dffb8d..da8c09f54 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -1,7 +1,7 @@ #include "downloadfromdcthread.h" #include "core/libdivecomputer.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefDiveComputer.h" #include <QDebug> #include <QRegularExpression> #if defined(Q_OS_ANDROID) @@ -57,11 +57,10 @@ void DownloadThread::run() } else { qDebug() << "Finishing download thread:" << downloadTable.nr << "dives downloaded"; } - auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings; - dcs->set_vendor(internalData->vendor); - dcs->set_product(internalData->product); - dcs->set_device(internalData->devname); - dcs->set_device_name(m_data->devBluetoothName()); + qPrefDiveComputer::set_vendor(internalData->vendor); + qPrefDiveComputer::set_product(internalData->product); + qPrefDiveComputer::set_device(internalData->devname); + qPrefDiveComputer::set_device_name(m_data->devBluetoothName()); } static void fill_supported_mobile_list() @@ -252,13 +251,12 @@ QStringList DCDeviceData::getProductListFromVendor(const QString &vendor) int DCDeviceData::getMatchingAddress(const QString &vendor, const QString &product) { - auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings; - if (dcs->vendor() == vendor && - dcs->product() == product) { + if (qPrefDiveComputer::vendor() == vendor && + qPrefDiveComputer::product() == product) { // we are trying to show the last dive computer selected for (int i = 0; i < connectionListModel.rowCount(); i++) { QString address = connectionListModel.address(i); - if (address.contains(dcs->device())) + if (address.contains(qPrefDiveComputer::device())) return i; } } @@ -415,11 +413,10 @@ device_data_t *DCDeviceData::internalData() int DCDeviceData::getDetectedVendorIndex() { - auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings; - if (!dcs->vendor().isEmpty()) { + if (!qPrefDiveComputer::vendor().isEmpty()) { // use the last one for (int i = 0; i < vendorList.length(); i++) { - if (vendorList[i] == dcs->vendor()) + if (vendorList[i] == qPrefDiveComputer::vendor()) return i; } } @@ -436,12 +433,11 @@ int DCDeviceData::getDetectedVendorIndex() int DCDeviceData::getDetectedProductIndex(const QString ¤tVendorText) { - auto dcs = SettingsObjectWrapper::instance()->dive_computer_settings; - if (!dcs->vendor().isEmpty()) { - if (dcs->vendor() == currentVendorText) { + if (!qPrefDiveComputer::vendor().isEmpty()) { + if (qPrefDiveComputer::vendor() == currentVendorText) { // we are trying to show the last dive computer selected for (int i = 0; i < productList[currentVendorText].length(); i++) { - if (productList[currentVendorText][i] == dcs->product()) + if (productList[currentVendorText][i] == qPrefDiveComputer::product()) return i; } } diff --git a/core/equipment.c b/core/equipment.c index 53e4c273f..39bf97af9 100644 --- a/core/equipment.c +++ b/core/equipment.c @@ -69,19 +69,18 @@ bool cylinder_nodata(const cylinder_t *cyl) !cyl->deco_gas_used.mliter; } -static bool cylinder_nosamples(cylinder_t *cyl) +static bool cylinder_nosamples(const cylinder_t *cyl) { return !cyl->sample_start.mbar && !cyl->sample_end.mbar; } -bool cylinder_none(void *_data) +bool cylinder_none(const cylinder_t *cyl) { - cylinder_t *cyl = _data; return cylinder_nodata(cyl) && cylinder_nosamples(cyl); } -void get_gas_string(const struct gasmix *gasmix, char *text, int len) +void get_gas_string(struct gasmix gasmix, char *text, int len) { if (gasmix_is_air(gasmix)) snprintf(text, len, "%s", translate("gettextFromC", "air")); @@ -94,27 +93,18 @@ void get_gas_string(const struct gasmix *gasmix, char *text, int len) } /* Returns a static char buffer - only good for immediate use by printf etc */ -const char *gasname(const struct gasmix *gasmix) +const char *gasname(struct gasmix gasmix) { static char gas[64]; get_gas_string(gasmix, gas, sizeof(gas)); return gas; } -bool weightsystem_none(void *_data) +bool weightsystem_none(const weightsystem_t *ws) { - weightsystem_t *ws = _data; return !ws->weight.grams && !ws->description; } -bool no_weightsystems(weightsystem_t *ws) -{ - for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++) - if (!weightsystem_none(ws + i)) - return false; - return true; -} - /* * We hardcode the most common standard cylinders, * we should pick up any other names from the dive @@ -216,7 +206,7 @@ void reset_cylinders(struct dive *dive, bool track_gas) if (cylinder_none(cyl)) continue; if (cyl->depth.mm == 0) /* if the gas doesn't give a mod, calculate based on prefs */ - cyl->depth = gas_mod(&cyl->gasmix, decopo2, dive, M_OR_FT(3,10)); + cyl->depth = gas_mod(cyl->gasmix, decopo2, dive, M_OR_FT(3,10)); if (track_gas) cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar; cyl->gas_used.mliter = 0; diff --git a/core/file.c b/core/file.c index 5c12c0a5d..abef20a7d 100644 --- a/core/file.c +++ b/core/file.c @@ -75,7 +75,7 @@ out: } -static void zip_read(struct zip_file *file, const char *filename) +static void zip_read(struct zip_file *file, const char *filename, struct dive_table *table) { int size = 1024, n, read = 0; char *mem = malloc(size); @@ -86,11 +86,11 @@ static void zip_read(struct zip_file *file, const char *filename) mem = realloc(mem, size); } mem[read] = 0; - (void) parse_xml_buffer(filename, mem, read, &dive_table, NULL); + (void) parse_xml_buffer(filename, mem, read, table, NULL); free(mem); } -int try_to_open_zip(const char *filename) +int try_to_open_zip(const char *filename, struct dive_table *table) { int success = 0; /* Grr. libzip needs to re-open the file, it can't take a buffer */ @@ -105,7 +105,7 @@ int try_to_open_zip(const char *filename) /* skip parsing the divelogs.de pictures */ if (strstr(zip_get_name(zip, index, 0), "pictures/")) continue; - zip_read(file, filename); + zip_read(file, filename, table); zip_fclose(file); success++; } @@ -126,7 +126,7 @@ static int db_test_func(void *param, int columns, char **data, char **column) } -static int try_to_open_db(const char *filename, struct memblock *mem) +static int try_to_open_db(const char *filename, struct memblock *mem, struct dive_table *table) { sqlite3 *handle; char dm4_test[] = "select count(*) from sqlite_master where type='table' and name='Dive' and sql like '%ProfileBlob%'"; @@ -146,7 +146,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem) /* Testing if DB schema resembles Suunto DM5 database format */ retval = sqlite3_exec(handle, dm5_test, &db_test_func, 0, NULL); if (!retval) { - retval = parse_dm5_buffer(handle, filename, mem->buffer, mem->size, &dive_table); + retval = parse_dm5_buffer(handle, filename, mem->buffer, mem->size, table); sqlite3_close(handle); return retval; } @@ -154,7 +154,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem) /* Testing if DB schema resembles Suunto DM4 database format */ retval = sqlite3_exec(handle, dm4_test, &db_test_func, 0, NULL); if (!retval) { - retval = parse_dm4_buffer(handle, filename, mem->buffer, mem->size, &dive_table); + retval = parse_dm4_buffer(handle, filename, mem->buffer, mem->size, table); sqlite3_close(handle); return retval; } @@ -162,7 +162,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem) /* Testing if DB schema resembles Shearwater database format */ retval = sqlite3_exec(handle, shearwater_test, &db_test_func, 0, NULL); if (!retval) { - retval = parse_shearwater_buffer(handle, filename, mem->buffer, mem->size, &dive_table); + retval = parse_shearwater_buffer(handle, filename, mem->buffer, mem->size, table); sqlite3_close(handle); return retval; } @@ -170,7 +170,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem) /* Testing if DB schema resembles Atomic Cobalt database format */ retval = sqlite3_exec(handle, cobalt_test, &db_test_func, 0, NULL); if (!retval) { - retval = parse_cobalt_buffer(handle, filename, mem->buffer, mem->size, &dive_table); + retval = parse_cobalt_buffer(handle, filename, mem->buffer, mem->size, table); sqlite3_close(handle); return retval; } @@ -178,7 +178,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem) /* Testing if DB schema resembles Divinglog database format */ retval = sqlite3_exec(handle, divinglog_test, &db_test_func, 0, NULL); if (!retval) { - retval = parse_divinglog_buffer(handle, filename, mem->buffer, mem->size, &dive_table); + retval = parse_divinglog_buffer(handle, filename, mem->buffer, mem->size, table); sqlite3_close(handle); return retval; } @@ -204,7 +204,7 @@ static int try_to_open_db(const char *filename, struct memblock *mem) * * Followed by the data values (all comma-separated, all one long line). */ -static int open_by_filename(const char *filename, const char *fmt, struct memblock *mem) +static int open_by_filename(const char *filename, const char *fmt, struct memblock *mem, struct dive_table *table) { // hack to be able to provide a comment for the translated string static char *csv_warning = QT_TRANSLATE_NOOP3("gettextFromC", @@ -213,7 +213,7 @@ static int open_by_filename(const char *filename, const char *fmt, struct memblo /* Suunto Dive Manager files: SDE, ZIP; divelogs.de files: DLD */ if (!strcasecmp(fmt, "SDE") || !strcasecmp(fmt, "ZIP") || !strcasecmp(fmt, "DLD")) - return try_to_open_zip(filename); + return try_to_open_zip(filename, table); /* CSV files */ if (!strcasecmp(fmt, "CSV")) @@ -234,17 +234,17 @@ static int open_by_filename(const char *filename, const char *fmt, struct memblo return 0; } -static int parse_file_buffer(const char *filename, struct memblock *mem) +static int parse_file_buffer(const char *filename, struct memblock *mem, struct dive_table *table) { int ret; char *fmt = strrchr(filename, '.'); - if (fmt && (ret = open_by_filename(filename, fmt + 1, mem)) != 0) + if (fmt && (ret = open_by_filename(filename, fmt + 1, mem, table)) != 0) return ret; if (!mem->size || !mem->buffer) return report_error("Out of memory parsing file %s\n", filename); - return parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, NULL); + return parse_xml_buffer(filename, mem->buffer, mem->size, table, NULL); } int check_git_sha(const char *filename, struct git_repository **git_p, const char **branch_p) @@ -281,7 +281,7 @@ int check_git_sha(const char *filename, struct git_repository **git_p, const cha return 1; } -int parse_file(const char *filename) +int parse_file(const char *filename, struct dive_table *table) { struct git_repository *git; const char *branch = NULL; @@ -327,7 +327,7 @@ int parse_file(const char *filename) fmt = strrchr(filename, '.'); if (fmt && (!strcasecmp(fmt + 1, "DB") || !strcasecmp(fmt + 1, "BAK") || !strcasecmp(fmt + 1, "SQL"))) { - if (!try_to_open_db(filename, &mem)) { + if (!try_to_open_db(filename, &mem, table)) { free(mem.buffer); return 0; } @@ -335,27 +335,26 @@ int parse_file(const char *filename) /* Divesoft Freedom */ if (fmt && (!strcasecmp(fmt + 1, "DLF"))) { - if (!parse_dlf_buffer(mem.buffer, mem.size)) { - free(mem.buffer); - return 0; - } - return -1; + ret = parse_dlf_buffer(mem.buffer, mem.size, table); + free(mem.buffer); + return ret; } /* DataTrak/Wlog */ if (fmt && !strcasecmp(fmt + 1, "LOG")) { - ret = datatrak_import(&mem, &dive_table); + ret = datatrak_import(&mem, table); free(mem.buffer); return ret; } /* OSTCtools */ if (fmt && (!strcasecmp(fmt + 1, "DIVE"))) { - ostctools_import(filename, &dive_table); + free(mem.buffer); + ostctools_import(filename, table); return 0; } - ret = parse_file_buffer(filename, &mem); + ret = parse_file_buffer(filename, &mem, table); free(mem.buffer); return ret; } diff --git a/core/file.h b/core/file.h index 9653fbb96..7dbd07b48 100644 --- a/core/file.h +++ b/core/file.h @@ -16,7 +16,7 @@ extern void ostctools_import(const char *file, struct dive_table *table); extern "C" { #endif extern int readfile(const char *filename, struct memblock *mem); -extern int try_to_open_zip(const char *filename); +extern int try_to_open_zip(const char *filename, struct dive_table *table); #ifdef __cplusplus } #endif diff --git a/core/gas-model.c b/core/gas-model.c index 49c677967..7fb9ce111 100644 --- a/core/gas-model.c +++ b/core/gas-model.c @@ -26,7 +26,7 @@ * NOTE! Helium coefficients are a linear mix operation between the * 323K and one for 273K isotherms, to make everything be at 300K. */ -double gas_compressibility_factor(struct gasmix *gas, double bar) +double gas_compressibility_factor(struct gasmix gas, double bar) { static const double o2_coefficients[3] = { -7.18092073703e-04, @@ -69,15 +69,15 @@ double gas_compressibility_factor(struct gasmix *gas, double bar) /* Compute the new pressure when compressing (expanding) volome v1 at pressure p1 bar to volume v2 * taking into account the compressebility (to first order) */ -double isothermal_pressure(struct gasmix *gas, double p1, int volume1, int volume2) +double isothermal_pressure(struct gasmix gas, double p1, int volume1, int volume2) { double p_ideal = p1 * volume1 / volume2 / gas_compressibility_factor(gas, p1); return p_ideal * gas_compressibility_factor(gas, p_ideal); } -inline double gas_density(struct gasmix *gas, int pressure) { - int density = gas->he.permille * HE_DENSITY + gas->o2.permille * O2_DENSITY + (1000 - gas->he.permille - gas->o2.permille) * N2_DENSITY; +inline double gas_density(struct gasmix gas, int pressure) { + int density = gas.he.permille * HE_DENSITY + gas.o2.permille * O2_DENSITY + (1000 - gas.he.permille - gas.o2.permille) * N2_DENSITY; return density * (double) pressure / gas_compressibility_factor(gas, pressure / 1000.0) / SURFACE_PRESSURE / 1000000.0; } diff --git a/core/gaspressures.c b/core/gaspressures.c index 626d617bf..1b191369b 100644 --- a/core/gaspressures.c +++ b/core/gaspressures.c @@ -350,7 +350,7 @@ void populate_pressure_information(struct dive *dive, struct divecomputer *dc, s cylinder_t *cylinder = dive->cylinder + sensor; pr_track_t *track = NULL; pr_track_t *current = NULL; - struct event *ev, *b_ev; + const struct event *ev, *b_ev; int missing_pr = 0, dense = 1; enum divemode_t dmode = dc->divemode; const double gasfactor[5] = {1.0, 0.0, prefs.pscr_ratio/1000.0, 1.0, 1.0 }; diff --git a/core/import-divinglog.c b/core/import-divinglog.c index 4e205d661..3e2f396ba 100644 --- a/core/import-divinglog.c +++ b/core/import-divinglog.c @@ -137,7 +137,7 @@ extern int divinglog_profile(void *handle, int columns, char **data, char **colu cur_sample->pressure[0].mbar = pressure * 100; cur_sample->rbt.seconds = rbt; if (oldcyl != tank) { - struct gasmix *mix = &cur_dive->cylinder[tank].gasmix; + struct gasmix mix = cur_dive->cylinder[tank].gasmix; int o2 = get_o2(mix); int he = get_he(mix); diff --git a/core/parse-xml.c b/core/parse-xml.c index ae779e1f8..1f31d69d7 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -652,7 +652,7 @@ void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int second if (idx < 0 || idx >= MAX_CYLINDERS) return; /* The gas switch event format is insane for historical reasons */ - struct gasmix *mix = &dive->cylinder[idx].gasmix; + struct gasmix mix = dive->cylinder[idx].gasmix; int o2 = get_o2(mix); int he = get_he(mix); struct event *ev; @@ -665,7 +665,7 @@ void add_gas_switch_event(struct dive *dive, struct divecomputer *dc, int second ev = add_event(dc, seconds, he ? SAMPLE_EVENT_GASCHANGE2 : SAMPLE_EVENT_GASCHANGE, 0, value, "gaschange"); if (ev) { ev->gas.index = idx; - ev->gas.mix = *mix; + ev->gas.mix = mix; } } @@ -1654,7 +1654,7 @@ static timestamp_t parse_dlf_timestamp(unsigned char *buffer) return offset + 946684800; } -int parse_dlf_buffer(unsigned char *buffer, size_t size) +int parse_dlf_buffer(unsigned char *buffer, size_t size, struct dive_table *table) { unsigned char *ptr = buffer; unsigned char event; @@ -1663,7 +1663,7 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size) int i; char serial[6]; - target_table = &dive_table; + target_table = table; // Check for the correct file magic if (ptr[0] != 'D' || ptr[1] != 'i' || ptr[2] != 'v' || ptr[3] != 'E') diff --git a/core/parse.h b/core/parse.h index affffcfb0..2a666ec4d 100644 --- a/core/parse.h +++ b/core/parse.h @@ -59,8 +59,6 @@ extern int diveid; int trimspace(char *buffer); void clear_table(struct dive_table *table); -void record_dive_to_table(struct dive *dive, struct dive_table *table); -void record_dive(struct dive *dive); void start_match(const char *type, const char *name, char *buffer); void nonmatch(const char *type, const char *name, char *buffer); typedef void (*matchfn_t)(char *buffer, void *); diff --git a/core/planner.c b/core/planner.c index eefa94143..1077fb313 100644 --- a/core/planner.c +++ b/core/planner.c @@ -81,22 +81,6 @@ bool diveplan_empty(struct diveplan *diveplan) return true; } -/* get the gas at a certain time during the dive */ -void get_gas_at_time(struct dive *dive, struct divecomputer *dc, duration_t time, struct gasmix *gas) -{ - // we always start with the first gas, so that's our gas - // unless an event tells us otherwise - struct event *event = dc->events; - *gas = dive->cylinder[0].gasmix; - while (event && event->time.seconds <= time.seconds) { - if (!strcmp(event->name, "gaschange")) { - int cylinder_idx = get_cylinder_index(dive, event); - *gas = dive->cylinder[cylinder_idx].gasmix; - } - event = event->next; - } -} - /* get the cylinder index at a certain time during the dive */ int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, duration_t time) { @@ -111,12 +95,12 @@ int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, duration_ return cylinder_idx; } -int get_gasidx(struct dive *dive, struct gasmix *mix) +int get_gasidx(struct dive *dive, struct gasmix mix) { return find_best_gasmix_match(mix, dive->cylinder, 0); } -void interpolate_transition(struct deco_state *ds, struct dive *dive, duration_t t0, duration_t t1, depth_t d0, depth_t d1, const struct gasmix *gasmix, o2pressure_t po2, enum divemode_t divemode) +void interpolate_transition(struct deco_state *ds, struct dive *dive, duration_t t0, duration_t t1, depth_t d0, depth_t d1, struct gasmix gasmix, o2pressure_t po2, enum divemode_t divemode) { int32_t j; @@ -152,7 +136,7 @@ int tissue_at_end(struct deco_state *ds, struct dive *dive, struct deco_state ** return 0; psample = sample = dc->sample; - struct event *evdm = NULL; + const struct event *evdm = NULL; enum divemode_t divemode = UNDEF_COMP_TYPE; for (i = 0; i < dc->samples; i++, sample++) { @@ -164,7 +148,7 @@ int tissue_at_end(struct deco_state *ds, struct dive *dive, struct deco_state ** setpoint = sample[0].setpoint; t1 = sample->time; - get_gas_at_time(dive, dc, t0, &gas); + gas = get_gasmix_at_time(dive, dc, t0); if (i > 0) lastdepth = psample->depth; @@ -192,7 +176,7 @@ int tissue_at_end(struct deco_state *ds, struct dive *dive, struct deco_state ** } divemode = get_current_divemode(&dive->dc, t0.seconds + 1, &evdm, &divemode); - interpolate_transition(ds, dive, t0, t1, lastdepth, sample->depth, &gas, setpoint, divemode); + interpolate_transition(ds, dive, t0, t1, lastdepth, sample->depth, gas, setpoint, divemode); psample = sample; t0 = t1; } @@ -227,7 +211,7 @@ void fill_default_cylinder(cylinder_t *cyl) cyl->type.size.mliter = lrint(cuft_to_l(ti->cuft) * 1000 / bar_to_atm(psi_to_bar(ti->psi))); } // MOD of air - cyl->depth = gas_mod(&cyl->gasmix, pO2, &displayed_dive, 1); + cyl->depth = gas_mod(cyl->gasmix, pO2, &displayed_dive, 1); } /* calculate the new end pressure of the cylinder, based on its current end pressure and the @@ -250,7 +234,7 @@ static void update_cylinder_pressure(struct dive *d, int old_depth, int new_dept if (in_deco) cyl->deco_gas_used.mliter += gas_used.mliter; if (cyl->type.size.mliter) { - delta_p.mbar = lrint(gas_used.mliter * 1000.0 / cyl->type.size.mliter * gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0)); + delta_p.mbar = lrint(gas_used.mliter * 1000.0 / cyl->type.size.mliter * gas_compressibility_factor(cyl->gasmix, cyl->end.mbar / 1000.0)); cyl->end.mbar -= delta_p.mbar; } } @@ -566,7 +550,7 @@ void track_ascent_gas(int depth, cylinder_t *cylinder, int avg_depth, int bottom } // Determine whether ascending to the next stop will break the ceiling. Return true if the ascent is ok, false if it isn't. -bool trial_ascent(struct deco_state *ds, int wait_time, int trial_depth, int stoplevel, int avg_depth, int bottom_time, struct gasmix *gasmix, int po2, double surface_pressure, struct dive *dive, enum divemode_t divemode) +bool trial_ascent(struct deco_state *ds, int wait_time, int trial_depth, int stoplevel, int avg_depth, int bottom_time, struct gasmix gasmix, int po2, double surface_pressure, struct dive *dive, enum divemode_t divemode) { bool clear_to_ascend = true; @@ -631,7 +615,7 @@ bool enough_gas(int current_cylinder) * So we always test at the upper bundary, not in the middle! */ -int wait_until(struct deco_state *ds, struct dive *dive, int clock, int min, int leap, int stepsize, int depth, int target_depth, int avg_depth, int bottom_time, struct gasmix *gasmix, int po2, double surface_pressure, enum divemode_t divemode) +int wait_until(struct deco_state *ds, struct dive *dive, int clock, int min, int leap, int stepsize, int depth, int target_depth, int avg_depth, int bottom_time, struct gasmix gasmix, int po2, double surface_pressure, enum divemode_t divemode) { // When a deco stop exceeds two days, there is something wrong... if (min >= 48 * 3600) @@ -732,7 +716,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i current_cylinder = get_cylinderid_at_time(dive, &dive->dc, sample->time); // FIXME: This needs a function to find the divemode at the end of the dive like in - struct event *ev = NULL; + const struct event *ev = NULL; divemode = UNDEF_COMP_TYPE; divemode = get_current_divemode(&dive->dc, bottom_time, &ev, &divemode); gas = dive->cylinder[current_cylinder].gasmix; @@ -790,11 +774,11 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i // How long can we stay at the current depth and still directly ascent to the surface? do { add_segment(ds, depth_to_bar(depth, dive), - &dive->cylinder[current_cylinder].gasmix, + dive->cylinder[current_cylinder].gasmix, timestep, po2, divemode, prefs.bottomsac); update_cylinder_pressure(dive, depth, depth, timestep, prefs.bottomsac, &dive->cylinder[current_cylinder], false, divemode); clock += timestep; - } while (trial_ascent(ds, 0, depth, 0, avg_depth, bottom_time, &dive->cylinder[current_cylinder].gasmix, + } while (trial_ascent(ds, 0, depth, 0, avg_depth, bottom_time, dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, dive, divemode) && enough_gas(current_cylinder) && clock < 6 * 3600); @@ -885,12 +869,12 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i last_ascend_rate = ascent_velocity(depth, avg_depth, bottom_time); /* Always prefer the best_first_ascend_cylinder if it has the right gasmix. * Otherwise take first cylinder from list with rightgasmix */ - if (same_gasmix(&gas, &dive->cylinder[best_first_ascend_cylinder].gasmix)) + if (same_gasmix(gas, dive->cylinder[best_first_ascend_cylinder].gasmix)) current_cylinder = best_first_ascend_cylinder; else - current_cylinder = get_gasidx(dive, &gas); + current_cylinder = get_gasidx(dive, gas); if (current_cylinder == -1) { - report_error(translate("gettextFromC", "Can't find gas %s"), gasname(&gas)); + report_error(translate("gettextFromC", "Can't find gas %s"), gasname(gas)); current_cylinder = 0; } reset_regression(); @@ -910,7 +894,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i deltad = depth - stoplevels[stopidx]; add_segment(ds, depth_to_bar(depth, dive), - &dive->cylinder[current_cylinder].gasmix, + dive->cylinder[current_cylinder].gasmix, TIMESTEP, po2, divemode, prefs.decosac); last_segment_min_switch = false; clock += TIMESTEP; @@ -939,7 +923,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i if (current_cylinder != gaschanges[gi].gasidx) { if (!prefs.switch_at_req_stop || !trial_ascent(ds, 0, depth, stoplevels[stopidx - 1], avg_depth, bottom_time, - &dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, dive, divemode) || get_o2(&dive->cylinder[current_cylinder].gasmix) < 160) { + dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, dive, divemode) || get_o2(dive->cylinder[current_cylinder].gasmix) < 160) { current_cylinder = gaschanges[gi].gasidx; gas = dive->cylinder[current_cylinder].gasmix; #if DEBUG_PLAN & 16 @@ -947,9 +931,9 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i (get_o2(&gas) + 5) / 10, (get_he(&gas) + 5) / 10, gaschanges[gi].depth / 1000.0); #endif /* Stop for the minimum duration to switch gas unless we switch to o2 */ - if (!last_segment_min_switch && get_o2(&dive->cylinder[current_cylinder].gasmix) != 1000) { + if (!last_segment_min_switch && get_o2(dive->cylinder[current_cylinder].gasmix) != 1000) { add_segment(ds, depth_to_bar(depth, dive), - &dive->cylinder[current_cylinder].gasmix, + dive->cylinder[current_cylinder].gasmix, prefs.min_switch_duration, po2, divemode, prefs.decosac); clock += prefs.min_switch_duration; last_segment_min_switch = true; @@ -969,7 +953,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i while (1) { /* Check if ascending to next stop is clear, go back and wait if we hit the ceiling on the way */ if (trial_ascent(ds, 0, depth, stoplevels[stopidx], avg_depth, bottom_time, - &dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, dive, divemode)) { + dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, dive, divemode)) { decostoptable[decostopcounter].depth = depth; decostoptable[decostopcounter].time = 0; decostopcounter++; @@ -1001,9 +985,9 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i (get_o2(&gas) + 5) / 10, (get_he(&gas) + 5) / 10, gaschanges[gi + 1].depth / 1000.0); #endif /* Stop for the minimum duration to switch gas unless we switch to o2 */ - if (!last_segment_min_switch && get_o2(&dive->cylinder[current_cylinder].gasmix) != 1000) { + if (!last_segment_min_switch && get_o2(dive->cylinder[current_cylinder].gasmix) != 1000) { add_segment(ds, depth_to_bar(depth, dive), - &dive->cylinder[current_cylinder].gasmix, + dive->cylinder[current_cylinder].gasmix, prefs.min_switch_duration, po2, divemode, prefs.decosac); clock += prefs.min_switch_duration; last_segment_min_switch = true; @@ -1012,7 +996,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i } int new_clock = wait_until(ds, dive, clock, clock, laststoptime * 2 + 1, timestep, depth, stoplevels[stopidx], avg_depth, - bottom_time, &dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, divemode); + bottom_time, dive->cylinder[current_cylinder].gasmix, po2, diveplan->surface_pressure / 1000.0, divemode); laststoptime = new_clock - clock; /* Finish infinite deco */ if (laststoptime >= 48 * 3600 && depth >= 6000) { @@ -1027,12 +1011,12 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i * backgas. This could be customized if there were demand. */ if (break_cylinder == -1) { - if (get_o2(&dive->cylinder[best_first_ascend_cylinder].gasmix) <= 320) + if (get_o2(dive->cylinder[best_first_ascend_cylinder].gasmix) <= 320) break_cylinder = best_first_ascend_cylinder; else break_cylinder = 0; } - if (get_o2(&dive->cylinder[current_cylinder].gasmix) == 1000) { + if (get_o2(dive->cylinder[current_cylinder].gasmix) == 1000) { if (laststoptime >= 12 * 60) { laststoptime = 12 * 60; new_clock = clock + laststoptime; @@ -1059,7 +1043,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i } } } - add_segment(ds, depth_to_bar(depth, dive), &dive->cylinder[stop_cylinder].gasmix, + add_segment(ds, depth_to_bar(depth, dive), dive->cylinder[stop_cylinder].gasmix, laststoptime, po2, divemode, prefs.decosac); last_segment_min_switch = false; decostoptable[decostopcounter].depth = depth; diff --git a/core/planner.h b/core/planner.h index 741f83c02..fb5338c8f 100644 --- a/core/planner.h +++ b/core/planner.h @@ -17,9 +17,8 @@ extern void set_verbatim(bool verbatim); extern void set_display_runtime(bool display); extern void set_display_duration(bool display); extern void set_display_transitions(bool display); -extern void get_gas_at_time(struct dive *dive, struct divecomputer *dc, duration_t time, struct gasmix *gas); extern int get_cylinderid_at_time(struct dive *dive, struct divecomputer *dc, duration_t time); -extern int get_gasidx(struct dive *dive, struct gasmix *mix); +extern int get_gasidx(struct dive *dive, struct gasmix mix); extern bool diveplan_empty(struct diveplan *diveplan); extern void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_disclaimer, int error); diff --git a/core/plannernotes.c b/core/plannernotes.c index c7d443324..133f9a591 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -42,7 +42,7 @@ static int diveplan_duration(struct diveplan *diveplan) * 5) Pointers to gas mixes in the gas change: gas-from and gas-to. * Returns: The size of the output buffer that has been used after the new results have been added. */ -static void add_icd_entry(struct membuffer *b, struct icd_data *icdvalues, bool printheader, int time_seconds, int ambientpressure_mbar, struct gasmix *gas_from, struct gasmix *gas_to) +static void add_icd_entry(struct membuffer *b, struct icd_data *icdvalues, bool printheader, int time_seconds, int ambientpressure_mbar, struct gasmix gas_from, struct gasmix gas_to) { if (printheader) { // Create a table description and a table header if no icd data have been written yet. put_format(b, "<div>%s:", translate("gettextFromC","Isobaric counterdiffusion information")); @@ -179,8 +179,8 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d nextdp = nextdp->next; if (nextdp) newgasmix = dive->cylinder[nextdp->cylinderid].gasmix; - gaschange_after = (nextdp && (gasmix_distance(&gasmix, &newgasmix))); - gaschange_before = (gasmix_distance(&lastprintgasmix, &gasmix)); + gaschange_after = (nextdp && (gasmix_distance(gasmix, newgasmix))); + gaschange_before = (gasmix_distance(lastprintgasmix, gasmix)); rebreatherchange_after = (nextdp && (dp->setpoint != nextdp->setpoint || dp->divemode != nextdp->divemode)); rebreatherchange_before = lastprintsetpoint != dp->setpoint || lastdivemode != dp->divemode; /* do we want to skip this leg as it is devoid of anything useful? */ @@ -215,7 +215,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), FRACTION(dp->time, 60), - gasname(&gasmix), + gasname(gasmix), (double) dp->setpoint / 1000.0); } else { put_format_loc(&buf, translate("gettextFromC", "%s to %.*f %s in %d:%02d min - runtime %d:%02u on %s"), @@ -223,7 +223,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), FRACTION(dp->time, 60), - gasname(&gasmix)); + gasname(gasmix)); } put_string(&buf, "<br>"); @@ -237,14 +237,14 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), FRACTION(dp->time, 60), - gasname(&gasmix), + gasname(gasmix), (double) dp->setpoint / 1000.0); } else { put_format_loc(&buf, translate("gettextFromC", "Stay at %.*f %s for %d:%02d min - runtime %d:%02u on %s %s"), decimals, depthvalue, depth_unit, FRACTION(dp->time - lasttime, 60), FRACTION(dp->time, 60), - gasname(&gasmix), + gasname(gasmix), translate("gettextFromC", divemode_text_ui[dp->divemode])); } put_string(&buf, "<br>"); @@ -308,16 +308,16 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d if (dp->setpoint) { asprintf_loc(&temp, translate("gettextFromC", "(SP = %.1fbar CCR)"), dp->setpoint / 1000.0); put_format(&buf, "<td style='padding-left: 10px; color: red; float: left;'><b>%s %s</b></td>", - gasname(&newgasmix), temp); + gasname(newgasmix), temp); free(temp); } else { put_format(&buf, "<td style='padding-left: 10px; color: red; float: left;'><b>%s %s</b></td>", - gasname(&newgasmix), lastdivemode == UNDEF_COMP_TYPE || lastdivemode == dp->divemode ? "" : translate("gettextFromC", divemode_text_ui[dp->divemode])); - if (isascent && (get_he(&lastprintgasmix) > 0)) { // For a trimix gas change on ascent, save ICD info if previous cylinder had helium - if (isobaric_counterdiffusion(&lastprintgasmix, &newgasmix, &icdvalues)) // Do icd calulations + gasname(newgasmix), lastdivemode == UNDEF_COMP_TYPE || lastdivemode == dp->divemode ? "" : translate("gettextFromC", divemode_text_ui[dp->divemode])); + if (isascent && (get_he(lastprintgasmix) > 0)) { // For a trimix gas change on ascent, save ICD info if previous cylinder had helium + if (isobaric_counterdiffusion(lastprintgasmix, newgasmix, &icdvalues)) // Do icd calulations icdwarning = true; if (icdvalues.dN2 > 0) { // If the gas change involved helium as well as an increase in nitrogen.. - add_icd_entry(&icdbuf, &icdvalues, icdtableheader, dp->time, depth_to_mbar(dp->depth.mm, dive), &lastprintgasmix, &newgasmix); // .. then print calculations to buffer. + add_icd_entry(&icdbuf, &icdvalues, icdtableheader, dp->time, depth_to_mbar(dp->depth.mm, dive), lastprintgasmix, newgasmix); // .. then print calculations to buffer. icdtableheader = false; } } @@ -330,16 +330,16 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d // If a new gas has been used for this segment, now is the time to show it if (dp->setpoint) { asprintf_loc(&temp, translate("gettextFromC", "(SP = %.1fbar CCR)"), (double) dp->setpoint / 1000.0); - put_format(&buf, "<td style='padding-left: 10px; color: red; float: left;'><b>%s %s</b></td>", gasname(&gasmix), temp); + put_format(&buf, "<td style='padding-left: 10px; color: red; float: left;'><b>%s %s</b></td>", gasname(gasmix), temp); free(temp); } else { - put_format(&buf, "<td style='padding-left: 10px; color: red; float: left;'><b>%s %s</b></td>", gasname(&gasmix), + put_format(&buf, "<td style='padding-left: 10px; color: red; float: left;'><b>%s %s</b></td>", gasname(gasmix), lastdivemode == UNDEF_COMP_TYPE || lastdivemode == dp->divemode ? "" : translate("gettextFromC", divemode_text_ui[dp->divemode])); - if (get_he(&lastprintgasmix) > 0) { // For a trimix gas change, save ICD info if previous cylinder had helium - if (isobaric_counterdiffusion(&lastprintgasmix, &gasmix, &icdvalues)) // Do icd calculations + if (get_he(lastprintgasmix) > 0) { // For a trimix gas change, save ICD info if previous cylinder had helium + if (isobaric_counterdiffusion(lastprintgasmix, gasmix, &icdvalues)) // Do icd calculations icdwarning = true; if (icdvalues.dN2 > 0) { // If the gas change involved helium as well as an increase in nitrogen.. - add_icd_entry(&icdbuf, &icdvalues, icdtableheader, lasttime, depth_to_mbar(dp->depth.mm, dive), &lastprintgasmix, &gasmix); // .. then print data to buffer. + add_icd_entry(&icdbuf, &icdvalues, icdtableheader, lasttime, depth_to_mbar(dp->depth.mm, dive), lastprintgasmix, gasmix); // .. then print data to buffer. icdtableheader = false; } } @@ -362,14 +362,14 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d if (plan_verbatim) { if (lastsetpoint >= 0) { if (nextdp && nextdp->setpoint) { - put_format_loc(&buf, translate("gettextFromC", "Switch gas to %s (SP = %.1fbar)"), gasname(&newgasmix), (double) nextdp->setpoint / 1000.0); + put_format_loc(&buf, translate("gettextFromC", "Switch gas to %s (SP = %.1fbar)"), gasname(newgasmix), (double) nextdp->setpoint / 1000.0); } else { - put_format(&buf, translate("gettextFromC", "Switch gas to %s"), gasname(&newgasmix)); - if ((isascent) && (get_he(&lastprintgasmix) > 0)) { // For a trimix gas change on ascent: - if (isobaric_counterdiffusion(&lastprintgasmix, &newgasmix, &icdvalues)) // Do icd calculations + put_format(&buf, translate("gettextFromC", "Switch gas to %s"), gasname(newgasmix)); + if ((isascent) && (get_he(lastprintgasmix) > 0)) { // For a trimix gas change on ascent: + if (isobaric_counterdiffusion(lastprintgasmix, newgasmix, &icdvalues)) // Do icd calculations icdwarning = true; if (icdvalues.dN2 > 0) { // If the gas change involved helium as well as an increase in nitrogen.. - add_icd_entry(&icdbuf, &icdvalues, icdtableheader, dp->time, depth_to_mbar(dp->depth.mm, dive), &lastprintgasmix, &newgasmix); // ... then print data to buffer. + add_icd_entry(&icdbuf, &icdvalues, icdtableheader, dp->time, depth_to_mbar(dp->depth.mm, dive), lastprintgasmix, newgasmix); // ... then print data to buffer. icdtableheader = false; } } @@ -451,8 +451,8 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d volume = get_volume_units(cyl->gas_used.mliter, NULL, &unit); deco_volume = get_volume_units(cyl->deco_gas_used.mliter, NULL, &unit); if (cyl->type.size.mliter) { - int remaining_gas = lrint((double)cyl->end.mbar * cyl->type.size.mliter / 1000.0 / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0)); - double deco_pressure_mbar = isothermal_pressure(&cyl->gasmix, 1.0, remaining_gas + cyl->deco_gas_used.mliter, + int remaining_gas = lrint((double)cyl->end.mbar * cyl->type.size.mliter / 1000.0 / gas_compressibility_factor(cyl->gasmix, cyl->end.mbar / 1000.0)); + double deco_pressure_mbar = isothermal_pressure(cyl->gasmix, 1.0, remaining_gas + cyl->deco_gas_used.mliter, cyl->type.size.mliter) * 1000 - cyl->end.mbar; deco_pressure = get_pressure_units(lrint(deco_pressure_mbar), &pressure_unit); pressure = get_pressure_units(cyl->start.mbar - cyl->end.mbar, &pressure_unit); @@ -464,7 +464,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d translate("gettextFromC", "Warning:"), translate("gettextFromC", "this is more gas than available in the specified cylinder!")); else - if (cyl->end.mbar / 1000.0 * cyl->type.size.mliter / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0) + if (cyl->end.mbar / 1000.0 * cyl->type.size.mliter / gas_compressibility_factor(cyl->gasmix, cyl->end.mbar / 1000.0) < cyl->deco_gas_used.mliter) snprintf(warning, sizeof(warning), "<br> — <span style='color: red;'>%s </span> %s", translate("gettextFromC", "Warning:"), @@ -481,7 +481,7 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d * depth_to_bar(lastbottomdp->depth.mm, dive) + prefs.sacfactor / 100.0 * cyl->deco_gas_used.mliter); /* Calculate minimum gas pressure for cyclinder. */ - lastbottomdp->minimum_gas.mbar = lrint(isothermal_pressure(&cyl->gasmix, 1.0, + lastbottomdp->minimum_gas.mbar = lrint(isothermal_pressure(cyl->gasmix, 1.0, mingasv.mliter, cyl->type.size.mliter) * 1000); /* Translate all results into correct units */ mingas_volume = get_volume_units(mingasv.mliter, NULL, &unit); @@ -513,18 +513,18 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d /* Print the gas consumption for every cylinder here to temp buffer. */ if (lrint(volume) > 0) { asprintf_loc(&temp, translate("gettextFromC", "%.0f%s/%.0f%s of <span style='color: red;'><b>%s</b></span> (%.0f%s/%.0f%s in planned ascent)"), - volume, unit, pressure, pressure_unit, gasname(&cyl->gasmix), deco_volume, unit, deco_pressure, pressure_unit); + volume, unit, pressure, pressure_unit, gasname(cyl->gasmix), deco_volume, unit, deco_pressure, pressure_unit); } else { asprintf_loc(&temp, translate("gettextFromC", "%.0f%s/%.0f%s of <span style='color: red;'><b>%s</b></span>"), - volume, unit, pressure, pressure_unit, gasname(&cyl->gasmix)); + volume, unit, pressure, pressure_unit, gasname(cyl->gasmix)); } } else { if (lrint(volume) > 0) { asprintf_loc(&temp, translate("gettextFromC", "%.0f%s of <span style='color: red;'><b>%s</b></span> (%.0f%s during planned ascent)"), - volume, unit, gasname(&cyl->gasmix), deco_volume, unit); + volume, unit, gasname(cyl->gasmix), deco_volume, unit); } else { asprintf_loc(&temp, translate("gettextFromC", "%.0f%s of <span style='color: red;'><b>%s</b></span>"), - volume, unit, gasname(&cyl->gasmix)); + volume, unit, gasname(cyl->gasmix)); } } /* Gas consumption: Now finally print all strings to output */ @@ -551,18 +551,18 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d bool o2warning_exist = false; enum divemode_t current_divemode; double amb; - struct event *evd = NULL; + const struct event *evd = NULL; current_divemode = UNDEF_COMP_TYPE; if (dive->dc.divemode != CCR) { while (dp) { if (dp->time != 0) { struct gas_pressures pressures; - struct gasmix *gasmix = &dive->cylinder[dp->cylinderid].gasmix; + struct gasmix gasmix = dive->cylinder[dp->cylinderid].gasmix; current_divemode = get_current_divemode(&dive->dc, dp->time, &evd, ¤t_divemode); amb = depth_to_atm(dp->depth.mm, dive); - fill_pressures(&pressures, amb, gasmix, (current_divemode == OC) ? 0.0 : amb * gasmix->o2.permille / 1000.0, current_divemode); + fill_pressures(&pressures, amb, gasmix, (current_divemode == OC) ? 0.0 : amb * gasmix.o2.permille / 1000.0, current_divemode); if (pressures.o2 > (dp->entered ? prefs.bottompo2 : prefs.decopo2) / 1000.0) { const char *depth_unit; diff --git a/core/pref.h b/core/pref.h index f317a795c..895006f7e 100644 --- a/core/pref.h +++ b/core/pref.h @@ -44,11 +44,18 @@ enum deco_mode { VPMB }; +enum def_file_behavior { + UNDEFINED_DEFAULT_FILE, + LOCAL_DEFAULT_FILE, + NO_DEFAULT_FILE, + CLOUD_DEFAULT_FILE +}; + typedef struct { bool dont_check_for_updates; bool dont_check_exists; const char *last_version_used; - const char *next_check; + int next_check; } update_manager_prefs_t; typedef struct { @@ -102,7 +109,6 @@ struct preferences { const char *divelist_font; double font_size; bool show_developer; - const char *theme; // ********** Facebook ********** facebook_prefs_t facebook; @@ -115,7 +121,7 @@ struct preferences { int defaultsetpoint; // default setpoint in mbar const char *default_cylinder; const char *default_filename; - short default_file_behavior; + enum def_file_behavior default_file_behavior; int o2consumption; // ml per min int pscr_ratio; // dump ratio times 1000 bool use_default_file; @@ -209,13 +215,6 @@ struct preferences { update_manager_prefs_t update_manager; }; -enum def_file_behavior { - UNDEFINED_DEFAULT_FILE, - LOCAL_DEFAULT_FILE, - NO_DEFAULT_FILE, - CLOUD_DEFAULT_FILE -}; - extern struct preferences prefs, default_prefs, git_prefs; extern const char *system_divelist_default_font; diff --git a/core/prefs-macros.h b/core/prefs-macros.h deleted file mode 100644 index ca5b1c7d9..000000000 --- a/core/prefs-macros.h +++ /dev/null @@ -1,108 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef PREFSMACROS_H -#define PREFSMACROS_H - -#include "core/qthelper.h" -#include "subsurface-string.h" - -#define SB(V, B) s.setValue(V, (int)(B->isChecked() ? 1 : 0)) - -#define GET_UNIT(name, field, f, t) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.units.field = (v.toInt() == (t)) ? (t) : (f); \ - else \ - prefs.units.field = default_prefs.units.field; \ - } - -#define GET_UNIT3(name, field, f, l, type) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid() && v.toInt() >= (f) && v.toInt() <= (l)) \ - prefs.units.field = (type)v.toInt(); \ - else \ - prefs.units.field = default_prefs.units.field; \ - } - -#define GET_UNIT_BOOL(name, field) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.units.field = v.toBool(); \ - else \ - prefs.units.field = default_prefs.units.field; \ - } - -#define GET_BOOL(name, field) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.field = v.toBool(); \ - else \ - prefs.field = default_prefs.field; \ - } - -#define GET_DOUBLE(name, field) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.field = v.toDouble(); \ - else \ - prefs.field = default_prefs.field; \ - } - -#define GET_INT(name, field) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.field = v.toInt(); \ - else \ - prefs.field = default_prefs.field; \ - } - -#define GET_ENUM(name, type, field) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.field = (enum type)v.toInt(); \ - else \ - prefs.field = default_prefs.field; \ - } - -#define GET_INT_DEF(name, field, defval) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.field = v.toInt(); \ - else \ - prefs.field = defval; \ - } - -#define GET_TXT(name, field) \ - { \ - v = s.value(QString(name)); \ - if (v.isValid()) \ - prefs.field = copy_qstring(v.toString()); \ - else \ - prefs.field = copy_string(default_prefs.field); \ - } - -#define SAVE_OR_REMOVE_SPECIAL(_setting, _default, _compare, _value) \ - { \ - if (_compare != _default) \ - s.setValue(_setting, _value); \ - else \ - s.remove(_setting); \ - } - -#define SAVE_OR_REMOVE(_setting, _default, _value) \ - { \ - if (_value != _default) \ - s.setValue(_setting, _value); \ - else \ - s.remove(_setting); \ - } - -#endif // PREFSMACROS_H - diff --git a/core/profile.c b/core/profile.c index 113f62845..47fc97723 100644 --- a/core/profile.c +++ b/core/profile.c @@ -316,10 +316,10 @@ struct plot_info *analyze_plot_info(struct plot_info *pi) * Some dive computers give cylinder indexes, some * give just the gas mix. */ -int get_cylinder_index(struct dive *dive, struct event *ev) +int get_cylinder_index(const struct dive *dive, const struct event *ev) { int best; - struct gasmix *mix; + struct gasmix mix; if (ev->gas.index >= 0) return ev->gas.index; @@ -337,7 +337,7 @@ int get_cylinder_index(struct dive *dive, struct event *ev) return best < 0 ? 0 : best; } -struct event *get_next_event(struct event *event, const char *name) +struct event *get_next_event_mutable(struct event *event, const char *name) { if (!name || !*name) return NULL; @@ -349,6 +349,11 @@ struct event *get_next_event(struct event *event, const char *name) return event; } +const struct event *get_next_event(const struct event *event, const char *name) +{ + return get_next_event_mutable((struct event *)event, name); +} + static int count_events(struct divecomputer *dc) { int result = 0; @@ -372,13 +377,13 @@ static int set_setpoint(struct plot_info *pi, int i, int setpoint, int end) return i; } -static void check_setpoint_events(struct dive *dive, struct divecomputer *dc, struct plot_info *pi) +static void check_setpoint_events(const struct dive *dive, struct divecomputer *dc, struct plot_info *pi) { UNUSED(dive); int i = 0; pressure_t setpoint; setpoint.mbar = 0; - struct event *ev = get_next_event(dc->events, "SP change"); + const struct event *ev = get_next_event(dc->events, "SP change"); if (!ev) return; @@ -760,14 +765,14 @@ static void fill_sac(struct dive *dive, struct plot_info *pi, int idx, unsigned /* * Create a bitmap of cylinders that match our current gasmix */ -static unsigned int matching_gases(struct dive *dive, struct gasmix *gasmix) +static unsigned int matching_gases(struct dive *dive, struct gasmix gasmix) { int i; unsigned int gases = 0; for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = dive->cylinder + i; - if (same_gasmix(gasmix, &cyl->gasmix)) + if (same_gasmix(gasmix, cyl->gasmix)) gases |= 1 << i; } return gases; @@ -775,14 +780,14 @@ static unsigned int matching_gases(struct dive *dive, struct gasmix *gasmix) static void calculate_sac(struct dive *dive, struct divecomputer *dc, struct plot_info *pi) { - struct gasmix *gasmix = NULL; - struct event *ev = NULL; + struct gasmix gasmix = { 0 }; + const struct event *ev = NULL; unsigned int gases = 0; for (int i = 0; i < pi->nr; i++) { struct plot_data *entry = pi->entry + i; - struct gasmix *newmix = get_gasmix(dive, dc, entry->sec, &ev, gasmix); - if (newmix != gasmix) { + struct gasmix newmix = get_gasmix(dive, dc, entry->sec, &ev, gasmix); + if (!same_gasmix(newmix, gasmix)) { gasmix = newmix; gases = matching_gases(dive, newmix); } @@ -791,7 +796,7 @@ static void calculate_sac(struct dive *dive, struct divecomputer *dc, struct plo } } -static void populate_secondary_sensor_data(struct divecomputer *dc, struct plot_info *pi) +static void populate_secondary_sensor_data(const struct divecomputer *dc, struct plot_info *pi) { UNUSED(dc); UNUSED(pi); @@ -818,14 +823,14 @@ static void add_plot_pressure(struct plot_info *pi, int time, int cyl, pressure_ SENSOR_PRESSURE(entry, cyl) = p.mbar; } -static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc, struct plot_info *pi) +static void setup_gas_sensor_pressure(const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi) { int prev, i; - struct event *ev; + const struct event *ev; int seen[MAX_CYLINDERS] = { 0, }; unsigned int first[MAX_CYLINDERS] = { 0, }; unsigned int last[MAX_CYLINDERS] = { 0, }; - struct divecomputer *secondary; + const struct divecomputer *secondary; prev = explicit_first_cylinder(dive, dc); seen[prev] = 1; @@ -854,7 +859,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc // Fill in "seen[]" array - mark cylinders we're not interested // in as negative. for (i = 0; i < MAX_CYLINDERS; i++) { - cylinder_t *cyl = dive->cylinder + i; + const cylinder_t *cyl = dive->cylinder + i; int start = cyl->start.mbar; int end = cyl->end.mbar; @@ -885,7 +890,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc for (i = 0; i < MAX_CYLINDERS; i++) { if (seen[i] >= 0) { - cylinder_t *cyl = dive->cylinder + i; + const cylinder_t *cyl = dive->cylinder + i; add_plot_pressure(pi, first[i], i, cyl->start); add_plot_pressure(pi, last[i], i, cyl->end); @@ -907,7 +912,7 @@ static void setup_gas_sensor_pressure(struct dive *dive, struct divecomputer *dc #ifndef SUBSURFACE_MOBILE /* calculate DECO STOP / TTS / NDL */ -static void calculate_ndl_tts(struct deco_state *ds, struct dive *dive, struct plot_data *entry, struct gasmix *gasmix, double surface_pressure,enum divemode_t divemode) +static void calculate_ndl_tts(struct deco_state *ds, const struct dive *dive, struct plot_data *entry, struct gasmix gasmix, double surface_pressure,enum divemode_t divemode) { /* FIXME: This should be configurable */ /* ascent speed up to first deco stop */ @@ -990,7 +995,7 @@ static void calculate_ndl_tts(struct deco_state *ds, struct dive *dive, struct p /* Let's try to do some deco calculations. */ -void calculate_deco_information(struct deco_state *ds, struct deco_state *planner_ds, struct dive *dive, struct divecomputer *dc, struct plot_info *pi, bool print_mode) +void calculate_deco_information(struct deco_state *ds, const struct deco_state *planner_ds, const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi, bool print_mode) { int i, count_iteration = 0; double surface_pressure = (dc->surface_pressure.mbar ? dc->surface_pressure.mbar : get_surface_pressure_in_mbar(dive, true)) / 1000.0; @@ -1016,8 +1021,8 @@ void calculate_deco_information(struct deco_state *ds, struct deco_state *planne int last_ndl_tts_calc_time = 0, first_ceiling = 0, current_ceiling, last_ceiling = 0, final_tts = 0 , time_clear_ceiling = 0; if (decoMode() == VPMB) ds->first_ceiling_pressure.mbar = depth_to_mbar(first_ceiling, dive); - struct gasmix *gasmix = NULL; - struct event *ev = NULL, *evd = NULL; + struct gasmix gasmix = { 0 }; + const struct event *ev = NULL, *evd = NULL; enum divemode_t current_divemode = UNDEF_COMP_TYPE; for (i = 1; i < pi->nr; i++) { @@ -1205,8 +1210,8 @@ static void calculate_gas_information_new(struct dive *dive, struct divecomputer { int i; double amb_pressure; - struct gasmix *gasmix = NULL; - struct event *evg = NULL, *evd = NULL; + struct gasmix gasmix = { 0 }; + const struct event *evg = NULL, *evd = NULL; enum divemode_t current_divemode = UNDEF_COMP_TYPE; for (i = 1; i < pi->nr; i++) { @@ -1219,8 +1224,10 @@ static void calculate_gas_information_new(struct dive *dive, struct divecomputer fill_pressures(&entry->pressures, amb_pressure, gasmix, (current_divemode == OC) ? 0.0 : entry->o2pressure.mbar / 1000.0, current_divemode); fn2 = (int)(1000.0 * entry->pressures.n2 / amb_pressure); fhe = (int)(1000.0 * entry->pressures.he / amb_pressure); - if (dc->divemode == PSCR) // OC pO2 is calulated for PSCR with or without external PO2 monitoring. - entry->scr_OC_pO2.mbar = (int) depth_to_mbar(entry->depth, dive) * get_o2(get_gasmix(dive, dc, entry->sec, &evg, gasmix)) / 1000; + if (dc->divemode == PSCR) { // OC pO2 is calulated for PSCR with or without external PO2 monitoring. + struct gasmix gasmix2 = get_gasmix(dive, dc, entry->sec, &evg, gasmix); + entry->scr_OC_pO2.mbar = (int) depth_to_mbar(entry->depth, dive) * get_o2(gasmix2) / 1000; + } /* Calculate MOD, EAD, END and EADD based on partial pressures calculated before * so there is no difference in calculating between OC and CC @@ -1385,11 +1392,10 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me depthvalue = get_depth_units(entry->depth, NULL, &depth_unit); put_format_loc(b, translate("gettextFromC", "@: %d:%02d\nD: %.1f%s\n"), FRACTION(entry->sec, 60), depthvalue, depth_unit); for (cyl = 0; cyl < MAX_CYLINDERS; cyl++) { - struct gasmix *mix; int mbar = GET_PRESSURE(entry, cyl); if (!mbar) continue; - mix = &displayed_dive.cylinder[cyl].gasmix; + struct gasmix mix = displayed_dive.cylinder[cyl].gasmix; pressurevalue = get_pressure_units(mbar, &pressure_unit); put_format_loc(b, translate("gettextFromC", "P: %d%s (%s)\n"), pressurevalue, pressure_unit, gasname(mix)); } diff --git a/core/profile.h b/core/profile.h index 58c44d955..9e714a806 100644 --- a/core/profile.h +++ b/core/profile.h @@ -77,7 +77,7 @@ void compare_samples(struct plot_data *e1, struct plot_data *e2, char *buf, int struct plot_data *populate_plot_entries(struct dive *dive, struct divecomputer *dc, struct plot_info *pi); struct plot_info *analyze_plot_info(struct plot_info *pi); void create_plot_info_new(struct dive *dive, struct divecomputer *dc, struct plot_info *pi, bool fast, struct deco_state *planner_ds); -void calculate_deco_information(struct deco_state *ds, struct deco_state *planner_de, struct dive *dive, struct divecomputer *dc, struct plot_info *pi, bool print_mode); +void calculate_deco_information(struct deco_state *ds, const struct deco_state *planner_de, const struct dive *dive, const struct divecomputer *dc, struct plot_info *pi, bool print_mode); struct plot_data *get_plot_details_new(struct plot_info *pi, int time, struct membuffer *); /* diff --git a/core/qt-init.cpp b/core/qt-init.cpp index 5596b3f95..b2d178e8e 100644 --- a/core/qt-init.cpp +++ b/core/qt-init.cpp @@ -5,7 +5,7 @@ #include <QLibraryInfo> #include <QTextCodec> #include "qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPref.h" char *settings_suffix = NULL; static QTranslator *qtTranslator, *ssrfTranslator; @@ -49,7 +49,7 @@ void init_qt_late() QCoreApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton); #endif // find plugins installed in the application directory (without this SVGs don't work on Windows) - SettingsObjectWrapper::instance()->load(); + qPref::load(); QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath()); QLocale loc; diff --git a/core/qthelper.cpp b/core/qthelper.cpp index fd9a8212b..fd7934885 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "qthelper.h" +#include "core/settings/qPrefLanguage.h" +#include "core/settings/qPrefUpdateManager.h" #include "subsurface-string.h" #include "subsurface-string.h" #include "gettextfromc.h" @@ -15,12 +17,10 @@ #include "exif.h" #include "file.h" #include "imagedownloader.h" -#include "prefs-macros.h" #include <QFile> #include <QRegExp> #include <QDir> #include <QDebug> -#include <QSettings> #include <QStandardPaths> #include <QJsonDocument> #include <QNetworkReply> @@ -400,7 +400,7 @@ void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsedOrdered) get_gas_used(d, diveGases); for (j = 0; j < MAX_CYLINDERS; j++) if (diveGases[j].mliter) { - QString gasName = gasname(&d->cylinder[j].gasmix); + QString gasName = gasname(d->cylinder[j].gasmix); gasUsed[gasName] += diveGases[j].mliter; } } @@ -445,16 +445,20 @@ QString uiLanguage(QLocale *callerLoc) QString shortDateFormat; QString dateFormat; QString timeFormat; - QSettings s; - QVariant v; - s.beginGroup("Language"); - GET_BOOL("UseSystemLanguage", locale.use_system_language); - if (!prefs.locale.use_system_language) { - loc = QLocale(s.value("UiLangLocale", QLocale().uiLanguages().first()).toString()); + // Language settings are already loaded, see qPref::load() + // so no need to reload them + + // remark this method used "useSystemLanguage", which is not set + // instead use_system_language is loaded from disk + + // set loc as system language or selected language + if (!qPrefLanguage::use_system_language()) { + loc = QLocale(qPrefLanguage::lang_locale()); } else { loc = QLocale(QLocale().uiLanguages().first()); } + QStringList languages = loc.uiLanguages(); QString uiLang; if (languages[0].contains('-')) @@ -465,13 +469,8 @@ QString uiLanguage(QLocale *callerLoc) uiLang = languages[2]; else uiLang = languages[0]; + prefs.locale.lang_locale = copy_qstring(uiLang); - GET_BOOL("time_format_override", time_format_override); - GET_BOOL("date_format_override", date_format_override); - GET_TXT("time_format", time_format); - GET_TXT("date_format", date_format); - GET_TXT("date_format_short", date_format_short); - s.endGroup(); // there's a stupid Qt bug on MacOS where uiLanguages doesn't give us the country info if (!uiLang.contains('-') && uiLang != loc.bcp47Name()) { @@ -1228,8 +1227,8 @@ extern "C" char *picturedir_string() QString get_gas_string(struct gasmix gas) { - uint o2 = (get_o2(&gas) + 5) / 10, he = (get_he(&gas) + 5) / 10; - QString result = gasmix_is_air(&gas) ? gettextFromC::tr("AIR") : he == 0 ? (o2 == 100 ? gettextFromC::tr("OXYGEN") : QString("EAN%1").arg(o2, 2, 10, QChar('0'))) : QString("%1/%2").arg(o2).arg(he); + uint o2 = (get_o2(gas) + 5) / 10, he = (get_he(gas) + 5) / 10; + QString result = gasmix_is_air(gas) ? gettextFromC::tr("AIR") : he == 0 ? (o2 == 100 ? gettextFromC::tr("OXYGEN") : QString("EAN%1").arg(o2, 2, 10, QChar('0'))) : QString("%1/%2").arg(o2).arg(he); return result; } @@ -1455,19 +1454,12 @@ void init_proxy() QString getUUID() { - // This is a correct usage of QSettings, - // it's not a setting per se - the user cannot change it - // and thus, don't need to be on the prefs structure - // and this is the *only* point of access from it, QString uuidString; - QSettings settings; - settings.beginGroup("UpdateManager"); - if (settings.contains("UUID")) { - uuidString = settings.value("UUID").toString(); - } else { + uuidString = qPrefUpdateManager::uuidString(); + if (uuidString != "") { QUuid uuid = QUuid::createUuid(); uuidString = uuid.toString(); - settings.setValue("UUID", uuidString); + qPrefUpdateManager::set_uuidString(uuidString); } uuidString.replace("{", "").replace("}", ""); return uuidString; diff --git a/core/save-git.c b/core/save-git.c index fcfbd93d1..2824b22ca 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -126,10 +126,10 @@ static void save_extra_data(struct membuffer *b, struct extra_data *ed) } } -static void put_gasmix(struct membuffer *b, struct gasmix *mix) +static void put_gasmix(struct membuffer *b, struct gasmix mix) { - int o2 = mix->o2.permille; - int he = mix->he.permille; + int o2 = mix.o2.permille; + int he = mix.he.permille; if (o2) { put_format(b, " o2=%u.%u%%", FRACTION(o2, 10)); @@ -154,7 +154,7 @@ static void save_cylinder_info(struct membuffer *b, struct dive *dive) put_pressure(b, cylinder->type.workingpressure, " workpressure=", "bar"); show_utf8(b, " description=", description, ""); strip_mb(b); - put_gasmix(b, &cylinder->gasmix); + put_gasmix(b, cylinder->gasmix); put_pressure(b, cylinder->start, " start=", "bar"); put_pressure(b, cylinder->end, " end=", "bar"); if (cylinder->cylinder_use != OC_GAS) @@ -382,7 +382,7 @@ static void save_one_event(struct membuffer *b, struct dive *dive, struct event show_index(b, ev->value, "value=", ""); show_utf8(b, " name=", ev->name, ""); if (event_is_gaschange(ev)) { - struct gasmix *mix = get_gasmix_from_event(dive, ev); + struct gasmix mix = get_gasmix_from_event(dive, ev); if (ev->gas.index >= 0) show_integer(b, ev->gas.index, "cylinder=", ""); put_gasmix(b, mix); diff --git a/core/save-html.c b/core/save-html.c index 2081b2eab..38f48e8c4 100644 --- a/core/save-html.c +++ b/core/save-html.c @@ -30,7 +30,9 @@ void save_photos(struct membuffer *b, const char *photos_dir, struct dive *dive) put_string(b, separator); separator = ", "; char *fname = get_file_name(local_file_path(pic)); - put_format(b, "{\"filename\":\"%s\"}", fname); + put_string(b, "{\"filename\":\""); + put_quoted(b, fname, 1, 0); + put_string(b, "\"}"); copy_image_and_overwrite(local_file_path(pic), photos_dir, fname); free(fname); pic = pic->next; @@ -79,7 +81,9 @@ void put_HTML_bookmarks(struct membuffer *b, struct dive *dive) do { put_string(b, separator); separator = ", "; - put_format(b, "{\"name\":\"%s\",", ev->name); + put_string(b, "{\"name\":\""); + put_quoted(b, ev->name, 1, 0); + put_string(b, "\","); put_format(b, "\"value\":\"%d\",", ev->value); put_format(b, "\"type\":\"%d\",", ev->type); put_format(b, "\"time\":\"%d\"}", ev->time.seconds); @@ -413,7 +417,7 @@ void write_trip(struct membuffer *b, dive_trip_t *trip, int *dive_no, bool selec found_sel_dive = 1; put_format(b, "%c {", *sep); (*sep) = ','; - put_format(b, "\"name\":\"%s\",", trip->location); + write_attribute(b, "name", trip->location, ", "); put_format(b, "\"dives\":["); } put_string(b, separator); diff --git a/core/save-xml.c b/core/save-xml.c index e3af000a4..fea2b1430 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -127,10 +127,10 @@ static void save_overview(struct membuffer *b, struct dive *dive) show_utf8(b, dive->suit, " <suit>", "</suit>\n", 0); } -static void put_gasmix(struct membuffer *b, struct gasmix *mix) +static void put_gasmix(struct membuffer *b, struct gasmix mix) { - int o2 = mix->o2.permille; - int he = mix->he.permille; + int o2 = mix.o2.permille; + int he = mix.he.permille; if (o2) { put_format(b, " o2='%u.%u%%'", FRACTION(o2, 10)); @@ -155,7 +155,7 @@ static void save_cylinder_info(struct membuffer *b, struct dive *dive) put_milli(b, " size='", volume, " l'"); put_pressure(b, cylinder->type.workingpressure, " workpressure='", " bar'"); show_utf8(b, description, " description='", "'", 1); - put_gasmix(b, &cylinder->gasmix); + put_gasmix(b, cylinder->gasmix); put_pressure(b, cylinder->start, " start='", " bar'"); put_pressure(b, cylinder->end, " end='", " bar'"); if (cylinder->cylinder_use != OC_GAS) @@ -307,7 +307,7 @@ static void save_one_event(struct membuffer *b, struct dive *dive, struct event show_index(b, ev->value, "value='", "'"); show_utf8(b, ev->name, " name='", "'", 1); if (event_is_gaschange(ev)) { - struct gasmix *mix = get_gasmix_from_event(dive, ev); + struct gasmix mix = get_gasmix_from_event(dive, ev); if (ev->gas.index >= 0) show_integer(b, ev->gas.index, "cylinder='", "'"); put_gasmix(b, mix); diff --git a/core/serial_ftdi.c b/core/serial_ftdi.c index d6c97f577..86d27c9ff 100644 --- a/core/serial_ftdi.c +++ b/core/serial_ftdi.c @@ -127,11 +127,11 @@ static int serial_ftdi_open_device (struct ftdi_context *ftdi_ctx) { INFO(0, "serial_ftdi_open_device called"); int accepted_pids[] = { - 24577, 24592, 24593, // 0x6001, 0x6010, 0x6011x - Suunto (Smart Interface), Heinrichs Weikamp - 24597, // 0x6015 - possibly Aqualung - 62560, // 0xF460, Oceanic - 63104, // 0xF680, Suunto - 34768, // 0x87D0, Cressi (Leonardo) + 0x6001, 0x6010, 0x6011, // Suunto (Smart Interface), Heinrichs Weikamp + 0x6015, // possibly Aqualung + 0xF460, // Oceanic + 0xF680, // Suunto + 0x87D0, // Cressi (Leonardo) }; int num_accepted_pids = 6; int i, pid, ret; diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp index 90aaa8fea..90aedd925 100644 --- a/core/settings/qPref.cpp +++ b/core/settings/qPref.cpp @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "qPref.h" #include "qPrefPrivate.h" -#include "ssrf-version.h" qPref::qPref(QObject *parent) : QObject(parent) { @@ -14,25 +13,21 @@ qPref *qPref::instance() void qPref::loadSync(bool doSync) { - qPrefAnimations::instance()->loadSync(doSync); + if (!doSync) + uiLanguage(NULL); + qPrefCloudStorage::instance()->loadSync(doSync); qPrefDisplay::instance()->loadSync(doSync); qPrefDiveComputer::instance()->loadSync(doSync); qPrefDivePlanner::instance()->loadSync(doSync); // qPrefFaceook does not use disk. + qPrefGeneral::instance()->loadSync(doSync); + qPrefGeocoding::instance()->loadSync(doSync); + qPrefLanguage::instance()->loadSync(doSync); qPrefLocationService::instance()->loadSync(doSync); + qPrefPartialPressureGas::instance()->loadSync(doSync); qPrefProxy::instance()->loadSync(doSync); qPrefTechnicalDetails::instance()->loadSync(doSync); qPrefUnits::instance()->loadSync(doSync); qPrefUpdateManager::instance()->loadSync(doSync); } - -const QString qPref::canonical_version() const -{ - return QString(CANONICAL_VERSION_STRING); -} - -const QString qPref::mobile_version() const -{ - return QString(MOBILE_VERSION_STRING); -} diff --git a/core/settings/qPref.h b/core/settings/qPref.h index 89e0b0951..036b3c6b2 100644 --- a/core/settings/qPref.h +++ b/core/settings/qPref.h @@ -1,17 +1,21 @@ // SPDX-License-Identifier: GPL-2.0 #ifndef QPREF_H #define QPREF_H - #include "core/pref.h" +#include "ssrf-version.h" + #include <QObject> -#include "qPrefAnimations.h" #include "qPrefCloudStorage.h" #include "qPrefDisplay.h" #include "qPrefDiveComputer.h" #include "qPrefDivePlanner.h" #include "qPrefFacebook.h" +#include "qPrefGeneral.h" +#include "qPrefGeocoding.h" +#include "qPrefLanguage.h" #include "qPrefLocationService.h" +#include "qPrefPartialPressureGas.h" #include "qPrefProxy.h" #include "qPrefTechnicalDetails.h" #include "qPrefUnit.h" @@ -28,9 +32,8 @@ public: static qPref *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: enum cloud_status { @@ -41,8 +44,11 @@ public: CS_NOCLOUD }; - const QString canonical_version() const; - const QString mobile_version() const; + static const QString canonical_version() { return QString(CANONICAL_VERSION_STRING); } + static const QString mobile_version() { return QString(MOBILE_VERSION_STRING); } + +private: + static void loadSync(bool doSync); }; #endif diff --git a/core/settings/qPrefAnimations.cpp b/core/settings/qPrefAnimations.cpp deleted file mode 100644 index 9be8900c5..000000000 --- a/core/settings/qPrefAnimations.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" -#include "qPrefPrivate.h" - -static const QString group = QStringLiteral("Animations"); - -qPrefAnimations::qPrefAnimations(QObject *parent) : QObject(parent) -{ -} -qPrefAnimations *qPrefAnimations::instance() -{ - static qPrefAnimations *self = new qPrefAnimations; - return self; -} - -void qPrefAnimations::loadSync(bool doSync) -{ - disk_animation_speed(doSync); -} - -HANDLE_PREFERENCE_INT(Animations, "/animation_speed", animation_speed); diff --git a/core/settings/qPrefAnimations.h b/core/settings/qPrefAnimations.h deleted file mode 100644 index c24a6590e..000000000 --- a/core/settings/qPrefAnimations.h +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef QPREFANIMATIONS_H -#define QPREFANIMATIONS_H -#include "core/pref.h" - -#include <QObject> - -class qPrefAnimations : public QObject { - Q_OBJECT - Q_PROPERTY(int animation_speed READ animation_speed WRITE set_animation_speed NOTIFY animation_speed_changed); - -public: - qPrefAnimations(QObject *parent = NULL); - static qPrefAnimations *instance(); - - // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } - -public: - static int animation_speed() { return prefs.animation_speed; } - -public slots: - void set_animation_speed(int value); - -signals: - void animation_speed_changed(int value); - -private: - // functions to load/sync variable with disk - void disk_animation_speed(bool doSync); -}; - -#endif diff --git a/core/settings/qPrefCloudStorage.cpp b/core/settings/qPrefCloudStorage.cpp index c3e9c60a7..9392a24c0 100644 --- a/core/settings/qPrefCloudStorage.cpp +++ b/core/settings/qPrefCloudStorage.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefCloudStorage.h" #include "qPrefPrivate.h" static const QString group = QStringLiteral("CloudStorage"); @@ -7,7 +7,6 @@ static const QString group = QStringLiteral("CloudStorage"); qPrefCloudStorage::qPrefCloudStorage(QObject *parent) : QObject(parent) { } - qPrefCloudStorage *qPrefCloudStorage::instance() { static qPrefCloudStorage *self = new qPrefCloudStorage; @@ -40,15 +39,15 @@ void qPrefCloudStorage::set_cloud_base_url(const QString &value) } disk_cloud_base_url(true); - emit cloud_base_url_changed(value); + emit instance()->cloud_base_url_changed(value); } } void qPrefCloudStorage::disk_cloud_base_url(bool doSync) { if (doSync) { - qPrefPrivate::instance()->setting.setValue(group + "/cloud_base_url", prefs.cloud_base_url); + qPrefPrivate::propSetValue(group + "/cloud_base_url", prefs.cloud_base_url); } else { - prefs.cloud_base_url = copy_qstring(qPrefPrivate::instance()->setting.value(group + "/cloud_base_url", default_prefs.cloud_base_url).toString()); + prefs.cloud_base_url = copy_qstring(qPrefPrivate::propValue(group + "/cloud_base_url", default_prefs.cloud_base_url).toString()); qPrefPrivate::copy_txt(&prefs.cloud_git_url, QString(prefs.cloud_base_url) + "/git"); } } @@ -65,7 +64,7 @@ void qPrefCloudStorage::set_cloud_storage_newpassword(const QString &value) qPrefPrivate::copy_txt(&prefs.cloud_storage_newpassword, value); // NOT saved on disk, because it is only temporary - emit cloud_storage_newpassword_changed(value); + emit instance()->cloud_storage_newpassword_changed(value); } void qPrefCloudStorage::set_cloud_storage_password(const QString &value) @@ -73,16 +72,16 @@ void qPrefCloudStorage::set_cloud_storage_password(const QString &value) if (value != prefs.cloud_storage_password) { qPrefPrivate::copy_txt(&prefs.cloud_storage_password, value); disk_cloud_storage_password(true); - emit cloud_storage_password_changed(value); + emit instance()->cloud_storage_password_changed(value); } } void qPrefCloudStorage::disk_cloud_storage_password(bool doSync) { if (doSync) { if (prefs.save_password_local) - qPrefPrivate::instance()->setting.setValue(group + "/password", prefs.cloud_storage_password); + qPrefPrivate::propSetValue(group + "/password", prefs.cloud_storage_password); } else { - prefs.cloud_storage_password = copy_qstring(qPrefPrivate::instance()->setting.value(group + "/password", default_prefs.cloud_storage_password).toString()); + prefs.cloud_storage_password = copy_qstring(qPrefPrivate::propValue(group + "/password", default_prefs.cloud_storage_password).toString()); } } @@ -103,14 +102,23 @@ void qPrefCloudStorage::disk_userid(bool doSync) { if (doSync) { // always save in new position (part of cloud storage group) - qPrefPrivate::instance()->setting.setValue(group + "subsurface_webservice_uid", prefs.userid); + qPrefPrivate::propSetValue(group + "subsurface_webservice_uid", prefs.userid); } else { //WARNING: UserId was stored outside of any group. // try to read from new location, if it fails read from old location - prefs.userid = copy_qstring(qPrefPrivate::instance()->setting.value(group + "subsurface_webservice_uid", "NoUserIdHere").toString()); + prefs.userid = copy_qstring(qPrefPrivate::propValue(group + "subsurface_webservice_uid", "NoUserIdHere").toString()); if (QString(prefs.userid) == "NoUserIdHere") { const QString group = QStringLiteral(""); - prefs.userid = copy_qstring(qPrefPrivate::instance()->setting.value(group + "subsurface_webservice_uid", default_prefs.userid).toString()); + prefs.userid = copy_qstring(qPrefPrivate::propValue(group + "subsurface_webservice_uid", default_prefs.userid).toString()); } } } + +bool qPrefCloudStorage::loadFromCloud(const QString& email) +{ + return qPrefPrivate::propValue(QString("loadFromCloud") + email, false).toBool(); +} +void qPrefCloudStorage::set_loadFromCloud(const QString& email, bool done) +{ + qPrefPrivate::propSetValue(QString("loadFromCloud") + email, done); +} diff --git a/core/settings/qPrefCloudStorage.h b/core/settings/qPrefCloudStorage.h index 6f32aef95..4684399a0 100644 --- a/core/settings/qPrefCloudStorage.h +++ b/core/settings/qPrefCloudStorage.h @@ -26,9 +26,9 @@ public: static qPrefCloudStorage *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: static QString cloud_base_url() { return prefs.cloud_base_url; } @@ -45,19 +45,23 @@ public: static bool save_userid_local() { return prefs.save_userid_local; } static QString userid() { return prefs.userid; } + static bool loadFromCloud(const QString& email); + public slots: - void set_cloud_base_url(const QString &value); - void set_cloud_storage_email(const QString &value); - void set_cloud_storage_email_encoded(const QString &value); - void set_cloud_storage_newpassword(const QString &value); - void set_cloud_storage_password(const QString &value); - void set_cloud_storage_pin(const QString &value); - void set_cloud_timeout(int value); - void set_cloud_verification_status(int value); - void set_git_local_only(bool value); - void set_save_password_local(bool value); - void set_save_userid_local(bool value); - void set_userid(const QString &value); + static void set_cloud_base_url(const QString &value); + static void set_cloud_storage_email(const QString &value); + static void set_cloud_storage_email_encoded(const QString &value); + static void set_cloud_storage_newpassword(const QString &value); + static void set_cloud_storage_password(const QString &value); + static void set_cloud_storage_pin(const QString &value); + static void set_cloud_timeout(int value); + static void set_cloud_verification_status(int value); + static void set_git_local_only(bool value); + static void set_save_password_local(bool value); + static void set_save_userid_local(bool value); + static void set_userid(const QString &value); + + static void set_loadFromCloud(const QString& email, bool done); signals: void cloud_base_url_changed(const QString &value); @@ -75,18 +79,18 @@ signals: private: // functions to load/sync variable with disk - void disk_cloud_base_url(bool doSync); - void disk_cloud_storage_email(bool doSync); - void disk_cloud_storage_email_encoded(bool doSync); - void disk_cloud_storage_newpassword(bool doSync); - void disk_cloud_storage_password(bool doSync); - void disk_cloud_storage_pin(bool doSync); - void disk_cloud_timeout(bool doSync); - void disk_cloud_verification_status(bool doSync); - void disk_git_local_only(bool doSync); - void disk_save_password_local(bool doSync); - void disk_save_userid_local(bool doSync); - void disk_userid(bool doSync); + static void disk_cloud_base_url(bool doSync); + static void disk_cloud_storage_email(bool doSync); + static void disk_cloud_storage_email_encoded(bool doSync); + static void disk_cloud_storage_newpassword(bool doSync); + static void disk_cloud_storage_password(bool doSync); + static void disk_cloud_storage_pin(bool doSync); + static void disk_cloud_timeout(bool doSync); + static void disk_cloud_verification_status(bool doSync); + static void disk_git_local_only(bool doSync); + static void disk_save_password_local(bool doSync); + static void disk_save_userid_local(bool doSync); + static void disk_userid(bool doSync); }; #endif diff --git a/core/settings/qPrefDisplay.cpp b/core/settings/qPrefDisplay.cpp index 809a4fe77..680fdc923 100644 --- a/core/settings/qPrefDisplay.cpp +++ b/core/settings/qPrefDisplay.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include "core/subsurface-string.h" -#include "qPref.h" +#include "qPrefDisplay.h" #include "qPrefPrivate.h" #include <QApplication> @@ -8,6 +8,39 @@ static const QString group = QStringLiteral("Display"); +QPointF qPrefDisplay::st_tooltip_position; +static const QPointF st_tooltip_position_default = QPointF(0,0); + +QString qPrefDisplay::st_lastDir; +static const QString st_lastDir_default = ""; + +QString qPrefDisplay::st_theme; +static const QString st_theme_default = "Blue"; + +QString qPrefDisplay::st_UserSurvey; +static const QString st_UserSurvey_default = ""; + +QByteArray qPrefDisplay::st_mainSplitter; +static const QByteArray st_mainSplitter_default = ""; + +QByteArray qPrefDisplay::st_topSplitter; +static const QByteArray st_topSplitter_default = ""; + +QByteArray qPrefDisplay::st_bottomSplitter; +static const QByteArray st_bottomSplitter_default = ""; + +bool qPrefDisplay::st_maximized; +static bool st_maximized_default = false; + +QByteArray qPrefDisplay::st_geometry; +static const QByteArray st_geometry_default = 0; + +QByteArray qPrefDisplay::st_windowState; +static const QByteArray st_windowState_default = 0; + +int qPrefDisplay::st_lastState; +static int st_lastState_default = false; + qPrefDisplay::qPrefDisplay(QObject *parent) : QObject(parent) { } @@ -19,11 +52,16 @@ qPrefDisplay *qPrefDisplay::instance() void qPrefDisplay::loadSync(bool doSync) { + disk_animation_speed(doSync); disk_divelist_font(doSync); disk_font_size(doSync); disk_display_invalid_dives(doSync); disk_show_developer(doSync); - disk_theme(doSync); + if (!doSync) { + load_tooltip_position(); + load_theme(); + load_UserSurvey(); + } } void qPrefDisplay::set_divelist_font(const QString &value) @@ -38,13 +76,13 @@ void qPrefDisplay::set_divelist_font(const QString &value) disk_divelist_font(true); qApp->setFont(QFont(newValue)); - emit divelist_font_changed(value); + emit instance()->divelist_font_changed(value); } } void qPrefDisplay::disk_divelist_font(bool doSync) { if (doSync) - qPrefPrivate::instance()->setting.setValue(group + "/divelist_font", prefs.divelist_font); + qPrefPrivate::propSetValue(group + "/divelist_font", prefs.divelist_font); else setCorrectFont(); } @@ -58,38 +96,35 @@ void qPrefDisplay::set_font_size(double value) QFont defaultFont = qApp->font(); defaultFont.setPointSizeF(prefs.font_size); qApp->setFont(defaultFont); - emit font_size_changed(value); + emit instance()->font_size_changed(value); } } void qPrefDisplay::disk_font_size(bool doSync) { if (doSync) - qPrefPrivate::instance()->setting.setValue(group + "/font_size", prefs.font_size); + qPrefPrivate::propSetValue(group + "/font_size", prefs.font_size); else setCorrectFont(); } +//JAN static const QString group = QStringLiteral("Animations"); +HANDLE_PREFERENCE_INT(Display, "/animation_speed", animation_speed); + HANDLE_PREFERENCE_BOOL(Display, "/displayinvalid", display_invalid_dives); HANDLE_PREFERENCE_BOOL(Display, "/show_developer", show_developer); -HANDLE_PREFERENCE_TXT(Display, "/theme", theme); - - void qPrefDisplay::setCorrectFont() { - QSettings s; - QVariant v; - // get the font from the settings or our defaults // respect the system default font size if none is explicitly set - QFont defaultFont = s.value(group + "/divelist_font", prefs.divelist_font).value<QFont>(); + QFont defaultFont = qPrefPrivate::propValue(group + "/divelist_font", prefs.divelist_font).value<QFont>(); if (IS_FP_SAME(system_divelist_default_font_size, -1.0)) { prefs.font_size = qApp->font().pointSizeF(); system_divelist_default_font_size = prefs.font_size; // this way we don't save it on exit } - prefs.font_size = s.value(group + "/font_size", prefs.font_size).toFloat(); + prefs.font_size = qPrefPrivate::propValue(group + "/font_size", prefs.font_size).toFloat(); // painful effort to ignore previous default fonts on Windows - ridiculous QString fontName = defaultFont.toString(); if (fontName.contains(",")) @@ -103,5 +138,27 @@ void qPrefDisplay::setCorrectFont() defaultFont.setPointSizeF(prefs.font_size); qApp->setFont(defaultFont); - prefs.display_invalid_dives = qPrefPrivate::instance()->setting.value(group + "/displayinvalid", default_prefs.display_invalid_dives).toBool(); + prefs.display_invalid_dives = qPrefPrivate::propValue(group + "/displayinvalid", default_prefs.display_invalid_dives).toBool(); } + +HANDLE_PROP_QSTRING(Display, "FileDialog/LastDir", lastDir); + +HANDLE_PROP_QSTRING(Display, "Theme/currentTheme", theme); + +HANDLE_PROP_QPOINTF(Display, "ProfileMap/tooltip_position", tooltip_position); + +HANDLE_PROP_QSTRING(Display, "UserSurvey/SurveyDone", UserSurvey); + +HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/mainSplitter", mainSplitter); + +HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/topSplitter", topSplitter); + +HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/bottomSplitter", bottomSplitter); + +HANDLE_PROP_BOOL(Display, "MainWindow/maximized", maximized); + +HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/geometry", geometry); + +HANDLE_PROP_QBYTEARRAY(Display, "MainWindow/windowState", windowState); + +HANDLE_PROP_INT(Display, "MainWindow/lastState", lastState); diff --git a/core/settings/qPrefDisplay.h b/core/settings/qPrefDisplay.h index 804f4a258..5a7eb7aac 100644 --- a/core/settings/qPrefDisplay.h +++ b/core/settings/qPrefDisplay.h @@ -4,54 +4,125 @@ #include "core/pref.h" #include <QObject> +#include <QPointF> class qPrefDisplay : public QObject { Q_OBJECT + Q_PROPERTY(int animation_speed READ animation_speed WRITE set_animation_speed NOTIFY animation_speed_changed); Q_PROPERTY(QString divelist_font READ divelist_font WRITE set_divelist_font NOTIFY divelist_font_changed); Q_PROPERTY(double font_size READ font_size WRITE set_font_size NOTIFY font_size_changed); Q_PROPERTY(bool display_invalid_dives READ display_invalid_dives WRITE set_display_invalid_dives NOTIFY display_invalid_dives_changed); + Q_PROPERTY(QString lastDir READ lastDir WRITE set_lastDir NOTIFY lastDir_changed); Q_PROPERTY(bool show_developer READ show_developer WRITE set_show_developer NOTIFY show_developer_changed); Q_PROPERTY(QString theme READ theme WRITE set_theme NOTIFY theme_changed); + Q_PROPERTY(QPointF tooltip_position READ tooltip_position WRITE set_tooltip_position NOTIFY tooltip_position_changed); + Q_PROPERTY(QString UserSurvey READ UserSurvey WRITE set_UserSurvey NOTIFY UserSurvey_changed); + Q_PROPERTY(QByteArray mainSplitter READ mainSplitter WRITE set_mainSplitter NOTIFY mainSplitter_changed); + Q_PROPERTY(QByteArray topSplitter READ topSplitter WRITE set_topSplitter NOTIFY topSplitter_changed); + Q_PROPERTY(QByteArray bottomSplitter READ bottomSplitter WRITE set_bottomSplitter NOTIFY bottomSplitter_changed); + Q_PROPERTY(bool maximized READ maximized WRITE set_maximized NOTIFY maximized_changed); + Q_PROPERTY(QByteArray geometry READ geometry WRITE set_geometry NOTIFY geometry_changed); + Q_PROPERTY(QByteArray windowState READ windowState WRITE set_windowState NOTIFY windowState_changed); + Q_PROPERTY(int lastState READ lastState WRITE set_lastState NOTIFY lastState_changed); public: qPrefDisplay(QObject *parent = NULL); static qPrefDisplay *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: + static int animation_speed() { return prefs.animation_speed; } static QString divelist_font() { return prefs.divelist_font; } static double font_size() { return prefs.font_size; } static bool display_invalid_dives() { return prefs.display_invalid_dives; } + static QString lastDir() { return st_lastDir; ; } static bool show_developer() { return prefs.show_developer; } - static QString theme() { return prefs.theme; } + static QString theme() { return st_theme; } + static QPointF tooltip_position() { return st_tooltip_position; } + static QString UserSurvey() { return st_UserSurvey; } + static QByteArray mainSplitter() { return st_mainSplitter; } + static QByteArray topSplitter() { return st_topSplitter; } + static QByteArray bottomSplitter() { return st_bottomSplitter; } + static bool maximized() { return st_maximized; } + static QByteArray geometry() { return st_geometry; } + static QByteArray windowState() { return st_windowState; } + static int lastState() { return st_lastState; } public slots: - void set_divelist_font(const QString &value); - void set_font_size(double value); - void set_display_invalid_dives(bool value); - void set_show_developer(bool value); - void set_theme(const QString &value); + static void set_animation_speed(int value); + static void set_divelist_font(const QString &value); + static void set_font_size(double value); + static void set_display_invalid_dives(bool value); + static void set_lastDir(const QString &value); + static void set_show_developer(bool value); + static void set_theme(const QString &value); + static void set_tooltip_position(const QPointF &value); + static void set_UserSurvey(const QString &value); + static void set_mainSplitter(const QByteArray &value); + static void set_topSplitter(const QByteArray &value); + static void set_bottomSplitter(const QByteArray &value); + static void set_maximized(bool value); + static void set_geometry(const QByteArray& value); + static void set_windowState(const QByteArray& value); + static void set_lastState(int value); signals: + void animation_speed_changed(int value); void divelist_font_changed(const QString &value); void font_size_changed(double value); void display_invalid_dives_changed(bool value); + void lastDir_changed(const QString &value); void show_developer_changed(bool value); void theme_changed(const QString &value); + void tooltip_position_changed(const QPointF &value); + void UserSurvey_changed(const QString &value); + void mainSplitter_changed(const QByteArray &value); + void topSplitter_changed(const QByteArray &value); + void bottomSplitter_changed(const QByteArray &value); + void maximized_changed(bool value); + void geometry_changed(const QByteArray& value); + void windowState_changed(const QByteArray& value); + void lastState_changed(int value); private: // functions to load/sync variable with disk - void disk_divelist_font(bool doSync); - void disk_font_size(bool doSync); - void disk_display_invalid_dives(bool doSync); - void disk_show_developer(bool doSync); - void disk_theme(bool doSync); + static void disk_animation_speed(bool doSync); + static void disk_divelist_font(bool doSync); + static void disk_font_size(bool doSync); + static void disk_display_invalid_dives(bool doSync); + static void disk_show_developer(bool doSync); + + // functions to handle class variables + static void load_lastDir(); + static void load_theme(); + static void load_tooltip_position(); + static void load_UserSurvey(); + static void load_mainSplitter(); + static void load_topSplitter(); + static void load_bottomSplitter(); + static void load_maximized(); + static void load_geometry(); + static void load_windowState(); + static void load_lastState(); // font helper function - void setCorrectFont(); + static void setCorrectFont(); + + // Class variables not present in structure preferences + static QString st_lastDir; + static QString st_theme; + static QPointF st_tooltip_position; + static QString st_UserSurvey; + static QByteArray st_mainSplitter; + static QByteArray st_topSplitter; + static QByteArray st_bottomSplitter; + static bool st_maximized; + static QByteArray st_geometry; + static QByteArray st_windowState; + static int st_lastState; }; #endif diff --git a/core/settings/qPrefDiveComputer.cpp b/core/settings/qPrefDiveComputer.cpp index 04928dbfb..105ab96b7 100644 --- a/core/settings/qPrefDiveComputer.cpp +++ b/core/settings/qPrefDiveComputer.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefDiveComputer.h" #include "qPrefPrivate.h" static const QString group = QStringLiteral("DiveComputer"); diff --git a/core/settings/qPrefDiveComputer.h b/core/settings/qPrefDiveComputer.h index dda0b9500..99ff6575b 100644 --- a/core/settings/qPrefDiveComputer.h +++ b/core/settings/qPrefDiveComputer.h @@ -18,9 +18,9 @@ public: static qPrefDiveComputer *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: static QString device() { return prefs.dive_computer.device; } @@ -30,11 +30,11 @@ public: static QString vendor() { return prefs.dive_computer.vendor; } public slots: - void set_device(const QString &device); - void set_device_name(const QString &device_name); - void set_download_mode(int mode); - void set_product(const QString &product); - void set_vendor(const QString &vendor); + static void set_device(const QString &device); + static void set_device_name(const QString &device_name); + static void set_download_mode(int mode); + static void set_product(const QString &product); + static void set_vendor(const QString &vendor); signals: void device_changed(const QString &device); @@ -45,11 +45,11 @@ signals: private: // functions to load/sync variable with disk - void disk_device(bool doSync); - void disk_device_name(bool doSync); - void disk_download_mode(bool doSync); - void disk_product(bool doSync); - void disk_vendor(bool doSync); + static void disk_device(bool doSync); + static void disk_device_name(bool doSync); + static void disk_download_mode(bool doSync); + static void disk_product(bool doSync); + static void disk_vendor(bool doSync); }; #endif diff --git a/core/settings/qPrefDivePlanner.cpp b/core/settings/qPrefDivePlanner.cpp index abeb4f402..02e39f535 100644 --- a/core/settings/qPrefDivePlanner.cpp +++ b/core/settings/qPrefDivePlanner.cpp @@ -1,9 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #include "core/subsurface-string.h" +#include "qPrefDivePlanner.h" #include "qPrefPrivate.h" -#include "qPref.h" - -#include <QSettings> static const QString group = QStringLiteral("Planner"); diff --git a/core/settings/qPrefDivePlanner.h b/core/settings/qPrefDivePlanner.h index 77af1b8b9..fa6ecb80c 100644 --- a/core/settings/qPrefDivePlanner.h +++ b/core/settings/qPrefDivePlanner.h @@ -38,9 +38,9 @@ public: static qPrefDivePlanner *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: static int ascratelast6m() { return prefs.ascratelast6m; } @@ -70,31 +70,31 @@ public: static bool verbatim_plan() { return prefs.verbatim_plan; } public slots: - void set_ascratelast6m(int value); - void set_ascratestops(int value); - void set_ascrate50(int value); - void set_ascrate75(int value); - void set_bestmixend(depth_t value); - void set_bottompo2(int value); - void set_bottomsac(int value); - void set_decopo2(int value); - void set_decosac(int value); - void set_descrate(int value); - void set_display_duration(bool value); - void set_display_runtime(bool value); - void set_display_transitions(bool value); - void set_display_variations(bool value); - void set_doo2breaks(bool value); - void set_drop_stone_mode(bool value); - void set_last_stop(bool value); - void set_min_switch_duration(int value); - void set_planner_deco_mode(deco_mode value); - void set_problemsolvingtime(int value); - void set_reserve_gas(int value); - void set_sacfactor(int value); - void set_safetystop(bool value); - void set_switch_at_req_stop(bool value); - void set_verbatim_plan(bool value); + static void set_ascratelast6m(int value); + static void set_ascratestops(int value); + static void set_ascrate50(int value); + static void set_ascrate75(int value); + static void set_bestmixend(depth_t value); + static void set_bottompo2(int value); + static void set_bottomsac(int value); + static void set_decopo2(int value); + static void set_decosac(int value); + static void set_descrate(int value); + static void set_display_duration(bool value); + static void set_display_runtime(bool value); + static void set_display_transitions(bool value); + static void set_display_variations(bool value); + static void set_doo2breaks(bool value); + static void set_drop_stone_mode(bool value); + static void set_last_stop(bool value); + static void set_min_switch_duration(int value); + static void set_planner_deco_mode(deco_mode value); + static void set_problemsolvingtime(int value); + static void set_reserve_gas(int value); + static void set_sacfactor(int value); + static void set_safetystop(bool value); + static void set_switch_at_req_stop(bool value); + static void set_verbatim_plan(bool value); signals: void ascratelast6m_changed(int value); @@ -124,32 +124,32 @@ signals: void verbatim_plan_changed(bool value); private: - void disk_ascratelast6m(bool doSync); - void disk_ascratestops(bool doSync); - void disk_ascrate50(bool doSync); - void disk_ascrate75(bool doSync); - void disk_bestmixend(bool doSync); - void disk_bottompo2(bool doSync); - void disk_bottomsac(bool doSync); - void disk_decopo2(bool doSync); - void disk_decosac(bool doSync); - void disk_descrate(bool doSync); - void disk_display_deco_mode(bool doSync); - void disk_display_duration(bool doSync); - void disk_display_runtime(bool doSync); - void disk_display_transitions(bool doSync); - void disk_display_variations(bool doSync); - void disk_doo2breaks(bool doSync); - void disk_drop_stone_mode(bool doSync); - void disk_last_stop(bool doSync); - void disk_min_switch_duration(bool doSync); - void disk_planner_deco_mode(bool doSync); - void disk_problemsolvingtime(bool doSync); - void disk_reserve_gas(bool doSync); - void disk_sacfactor(bool doSync); - void disk_safetystop(bool doSync); - void disk_switch_at_req_stop(bool doSync); - void disk_verbatim_plan(bool doSync); + static void disk_ascratelast6m(bool doSync); + static void disk_ascratestops(bool doSync); + static void disk_ascrate50(bool doSync); + static void disk_ascrate75(bool doSync); + static void disk_bestmixend(bool doSync); + static void disk_bottompo2(bool doSync); + static void disk_bottomsac(bool doSync); + static void disk_decopo2(bool doSync); + static void disk_decosac(bool doSync); + static void disk_descrate(bool doSync); + static void disk_display_deco_mode(bool doSync); + static void disk_display_duration(bool doSync); + static void disk_display_runtime(bool doSync); + static void disk_display_transitions(bool doSync); + static void disk_display_variations(bool doSync); + static void disk_doo2breaks(bool doSync); + static void disk_drop_stone_mode(bool doSync); + static void disk_last_stop(bool doSync); + static void disk_min_switch_duration(bool doSync); + static void disk_planner_deco_mode(bool doSync); + static void disk_problemsolvingtime(bool doSync); + static void disk_reserve_gas(bool doSync); + static void disk_sacfactor(bool doSync); + static void disk_safetystop(bool doSync); + static void disk_switch_at_req_stop(bool doSync); + static void disk_verbatim_plan(bool doSync); }; #endif diff --git a/core/settings/qPrefFacebook.cpp b/core/settings/qPrefFacebook.cpp index b96008920..8728313ab 100644 --- a/core/settings/qPrefFacebook.cpp +++ b/core/settings/qPrefFacebook.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefFacebook.h" #include "qPrefPrivate.h" static const QString group = QStringLiteral("WebApps/Facebook"); @@ -21,23 +21,23 @@ void qPrefFacebook::loadSync(bool doSync) void qPrefFacebook::set_access_token(const QString &value) { if (value != prefs.facebook.access_token) { - qPrefPrivate::instance()->copy_txt(&prefs.facebook.access_token, value); - emit access_token_changed(value); + qPrefPrivate::copy_txt(&prefs.facebook.access_token, value); + emit instance()->access_token_changed(value); } } void qPrefFacebook::set_album_id(const QString &value) { if (value != prefs.facebook.album_id) { - qPrefPrivate::instance()->copy_txt(&prefs.facebook.album_id, value); - emit album_id_changed(value); + qPrefPrivate::copy_txt(&prefs.facebook.album_id, value); + emit instance()->album_id_changed(value); } } void qPrefFacebook::set_user_id(const QString &value) { if (value != prefs.facebook.user_id) { - qPrefPrivate::instance()->copy_txt(&prefs.facebook.user_id, value); - emit access_token_changed(value); + qPrefPrivate::copy_txt(&prefs.facebook.user_id, value); + emit instance()->access_token_changed(value); } } diff --git a/core/settings/qPrefFacebook.h b/core/settings/qPrefFacebook.h index 60c037583..0493b8ca9 100644 --- a/core/settings/qPrefFacebook.h +++ b/core/settings/qPrefFacebook.h @@ -17,9 +17,9 @@ public: static qPrefFacebook *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() {loadSync(false); } - void sync() {loadSync(true); } + static void loadSync(bool doSync); + static void load() {loadSync(false); } + static void sync() {loadSync(true); } public: static QString access_token() { return prefs.facebook.access_token; } @@ -27,9 +27,9 @@ public: static QString user_id() { return prefs.facebook.user_id; } public slots: - void set_access_token(const QString& value); - void set_album_id(const QString& value); - void set_user_id(const QString& value); + static void set_access_token(const QString& value); + static void set_album_id(const QString& value); + static void set_user_id(const QString& value); signals: void access_token_changed(const QString& value); @@ -37,9 +37,9 @@ signals: void user_id_changed(const QString& value); private: - void disk_access_token(bool doSync); - void disk_album_id(bool doSync); - void disk_user_id(bool doSync); + static void disk_access_token(bool doSync); + static void disk_album_id(bool doSync); + static void disk_user_id(bool doSync); }; #endif diff --git a/core/settings/qPrefGeneral.cpp b/core/settings/qPrefGeneral.cpp new file mode 100644 index 000000000..8dfe67668 --- /dev/null +++ b/core/settings/qPrefGeneral.cpp @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qPrefGeneral.h" +#include "qPrefPrivate.h" + + +static const QString group = QStringLiteral("GeneralSettings"); + +QString qPrefGeneral::st_diveshareExport_uid; +static const QString st_diveshareExport_uid_default = ""; + +bool qPrefGeneral::st_diveshareExport_private; +static const bool st_diveshareExport_private_default = false; + +qPrefGeneral::qPrefGeneral(QObject *parent) : QObject(parent) +{ +} +qPrefGeneral *qPrefGeneral::instance() +{ + static qPrefGeneral *self = new qPrefGeneral; + return self; +} + + +void qPrefGeneral::loadSync(bool doSync) +{ + disk_auto_recalculate_thumbnails(doSync); + disk_auto_recalculate_thumbnails(doSync); + disk_default_cylinder(doSync); + disk_default_filename(doSync); + disk_default_file_behavior(doSync); + disk_defaultsetpoint(doSync); + disk_extract_video_thumbnails(doSync); + disk_extract_video_thumbnails_position(doSync); + disk_ffmpeg_executable(doSync); + disk_o2consumption(doSync); + disk_pscr_ratio(doSync); + disk_use_default_file(doSync); + if (!doSync) { + load_diveshareExport_uid(); + load_diveshareExport_private(); + } +} + +HANDLE_PREFERENCE_BOOL(General, "/auto_recalculate_thumbnails", auto_recalculate_thumbnails); + +HANDLE_PREFERENCE_TXT(General, "/default_cylinder", default_cylinder); + +HANDLE_PREFERENCE_TXT(General, "default_filename", default_filename); + + +void qPrefGeneral::set_default_file_behavior(enum def_file_behavior value) +{ + if (value != prefs.default_file_behavior || + prefs.default_file_behavior != UNDEFINED_DEFAULT_FILE) { + + if (value == UNDEFINED_DEFAULT_FILE) { + // undefined, so check if there's a filename set and + // use that, otherwise go with no default file + prefs.default_file_behavior = QString(prefs.default_filename).isEmpty() ? NO_DEFAULT_FILE : LOCAL_DEFAULT_FILE; + } else { + prefs.default_file_behavior = value; + } + disk_default_file_behavior(true); + emit qPrefGeneral::instance()->default_file_behavior_changed(value); + } +} +void qPrefGeneral::disk_default_file_behavior(bool doSync) +{ + if (doSync) { + qPrefPrivate::propSetValue(group + "/default_file_behavior", prefs.default_file_behavior); + } else { + prefs.default_file_behavior = (enum def_file_behavior)qPrefPrivate::propValue(group + "/default_file_behavior", default_prefs.default_file_behavior).toInt(); + if (prefs.default_file_behavior == UNDEFINED_DEFAULT_FILE) + // undefined, so check if there's a filename set and + // use that, otherwise go with no default file + prefs.default_file_behavior = QString(prefs.default_filename).isEmpty() ? NO_DEFAULT_FILE : LOCAL_DEFAULT_FILE; + } +} + +HANDLE_PREFERENCE_INT(General, "/defaultsetpoint", defaultsetpoint); + +HANDLE_PREFERENCE_BOOL(General, "/extract_video_thumbnails", extract_video_thumbnails); + +HANDLE_PREFERENCE_INT(General, "/extract_video_thumbnails_position", extract_video_thumbnails_position); + +HANDLE_PREFERENCE_TXT(General, "/ffmpeg_executable", ffmpeg_executable); + +HANDLE_PREFERENCE_INT(General, "/o2consumption", o2consumption); + +HANDLE_PREFERENCE_INT(General, "/pscr_ratio", pscr_ratio); + +HANDLE_PREFERENCE_BOOL(General, "/use_default_file", use_default_file); + +HANDLE_PROP_QSTRING(General, "diveshareExport/uid", diveshareExport_uid); + +HANDLE_PROP_BOOL(General, "diveshareExport/private", diveshareExport_private); diff --git a/core/settings/qPrefGeneral.h b/core/settings/qPrefGeneral.h new file mode 100644 index 000000000..4d35c3817 --- /dev/null +++ b/core/settings/qPrefGeneral.h @@ -0,0 +1,100 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef QPREFGENERAL_H +#define QPREFGENERAL_H +#include "core/pref.h" + +#include <QObject> + +class qPrefGeneral : public QObject { + Q_OBJECT + Q_PROPERTY(bool auto_recalculate_thumbnails READ auto_recalculate_thumbnails WRITE set_auto_recalculate_thumbnails NOTIFY auto_recalculate_thumbnails_changed); + Q_PROPERTY(QString default_cylinder READ default_cylinder WRITE set_default_cylinder NOTIFY default_cylinder_changed); + Q_PROPERTY(QString default_filename READ default_filename WRITE set_default_filename NOTIFY default_filename_changed); + Q_PROPERTY(enum def_file_behavior default_file_behavior READ default_file_behavior WRITE set_default_file_behavior NOTIFY default_file_behavior_changed); + Q_PROPERTY(int defaultsetpoint READ defaultsetpoint WRITE set_defaultsetpoint NOTIFY defaultsetpoint_changed); + Q_PROPERTY(bool extract_video_thumbnails READ extract_video_thumbnails WRITE set_extract_video_thumbnails NOTIFY extract_video_thumbnails_changed); + Q_PROPERTY(int extract_video_thumbnails_position READ extract_video_thumbnails_position WRITE set_extract_video_thumbnails_position NOTIFY extract_video_thumbnails_position_changed); + Q_PROPERTY(QString ffmpeg_executable READ ffmpeg_executable WRITE set_ffmpeg_executable NOTIFY ffmpeg_executable_changed); + Q_PROPERTY(int o2consumption READ o2consumption WRITE set_o2consumption NOTIFY o2consumption_changed); + Q_PROPERTY(int pscr_ratio READ pscr_ratio WRITE set_pscr_ratio NOTIFY pscr_ratio_changed); + Q_PROPERTY(bool use_default_file READ use_default_file WRITE set_use_default_file NOTIFY use_default_file_changed); + Q_PROPERTY(QString diveshareExport_uid READ diveshareExport_uid WRITE set_diveshareExport_uid NOTIFY diveshareExport_uid_changed); + Q_PROPERTY(bool diveshareExport_private READ diveshareExport_private WRITE set_diveshareExport_private NOTIFY diveshareExport_private_changed); + +public: + qPrefGeneral(QObject *parent = NULL); + static qPrefGeneral *instance(); + + // Load/Sync local settings (disk) and struct preference + static void loadSync(bool doSync); + static void load() { return loadSync(false); } + static void sync() { return loadSync(true); } + +public: + static bool auto_recalculate_thumbnails() { return prefs.auto_recalculate_thumbnails; } + static QString default_cylinder() { return prefs.default_cylinder; } + static QString default_filename() { return prefs.default_filename; } + static enum def_file_behavior default_file_behavior() { return prefs.default_file_behavior; } + static int defaultsetpoint() { return prefs.defaultsetpoint; } + static bool extract_video_thumbnails() { return prefs.extract_video_thumbnails; } + static int extract_video_thumbnails_position() { return prefs.extract_video_thumbnails_position; } + static QString ffmpeg_executable() { return prefs.ffmpeg_executable; } + static int o2consumption() { return prefs.o2consumption; } + static int pscr_ratio() { return prefs.pscr_ratio; } + static bool use_default_file() { return prefs.use_default_file; } + static QString diveshareExport_uid() { return st_diveshareExport_uid; } + static bool diveshareExport_private() { return st_diveshareExport_private; } + +public slots: + static void set_auto_recalculate_thumbnails(bool value); + static void set_default_cylinder(const QString& value); + static void set_default_filename(const QString& value); + static void set_default_file_behavior(enum def_file_behavior value); + static void set_defaultsetpoint(int value); + static void set_extract_video_thumbnails(bool value); + static void set_extract_video_thumbnails_position(int value); + static void set_ffmpeg_executable(const QString& value); + static void set_o2consumption(int value); + static void set_pscr_ratio(int value); + static void set_use_default_file(bool value); + static void set_diveshareExport_uid(const QString& value); + static void set_diveshareExport_private(bool value); + +signals: + void auto_recalculate_thumbnails_changed(bool value); + void default_cylinder_changed(const QString& value); + void default_filename_changed(const QString& value); + void default_file_behavior_changed(enum def_file_behavior value); + void defaultsetpoint_changed(int value); + void extract_video_thumbnails_changed(bool value); + void extract_video_thumbnails_position_changed(int value); + void ffmpeg_executable_changed(const QString& value); + void o2consumption_changed(int value); + void pscr_ratio_changed(int value); + void use_default_file_changed(bool value); + void diveshareExport_uid_changed(const QString& value); + void diveshareExport_private_changed(bool value); + +private: + static void disk_auto_recalculate_thumbnails(bool doSync); + static void disk_default_cylinder(bool doSync); + static void disk_default_filename(bool doSync); + static void disk_default_file_behavior(bool doSync); + static void disk_defaultsetpoint(bool doSync); + static void disk_extract_video_thumbnails(bool doSync); + static void disk_extract_video_thumbnails_position(bool doSync); + static void disk_ffmpeg_executable(bool doSync); + static void disk_o2consumption(bool doSync); + static void disk_pscr_ratio(bool doSync); + static void disk_use_default_file(bool doSync); + + // class variables are load only + static void load_diveshareExport_uid(); + static void load_diveshareExport_private(); + + // class variables + static QString st_diveshareExport_uid; + static bool st_diveshareExport_private; +}; + +#endif diff --git a/core/settings/qPrefGeocoding.cpp b/core/settings/qPrefGeocoding.cpp new file mode 100644 index 000000000..7bb043e0f --- /dev/null +++ b/core/settings/qPrefGeocoding.cpp @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qPrefGeocoding.h" +#include "qPrefPrivate.h" + +static const QString group = QStringLiteral("geocoding"); + +qPrefGeocoding::qPrefGeocoding(QObject *parent) : QObject(parent) +{ +} +qPrefGeocoding *qPrefGeocoding::instance() +{ + static qPrefGeocoding *self = new qPrefGeocoding; + return self; +} + +void qPrefGeocoding::loadSync(bool doSync) +{ + disk_first_taxonomy_category(doSync); + disk_second_taxonomy_category(doSync); + disk_third_taxonomy_category(doSync); +} + + +void qPrefGeocoding::set_first_taxonomy_category(taxonomy_category value) +{ + if (value != prefs.geocoding.category[0]) { + prefs.geocoding.category[0] = value; + disk_first_taxonomy_category(true); + emit instance()->first_taxonomy_category_changed(value); + } +} +void qPrefGeocoding::disk_first_taxonomy_category(bool doSync) +{ + if (doSync) + qPrefPrivate::propSetValue(group + "/cat0", prefs.geocoding.category[0]); + else + prefs.geocoding.category[0] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat0", default_prefs.geocoding.category[0]).toInt(); +} + + +void qPrefGeocoding::set_second_taxonomy_category(taxonomy_category value) +{ + if (value != prefs.geocoding.category[1]) { + prefs.geocoding.category[1] = value; + disk_second_taxonomy_category(true); + emit instance()->second_taxonomy_category_changed(value); + } +} +void qPrefGeocoding::disk_second_taxonomy_category(bool doSync) +{ + if (doSync) + qPrefPrivate::propSetValue(group + "/cat1", prefs.geocoding.category[1]); + else + prefs.geocoding.category[1] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat1", default_prefs.geocoding.category[1]).toInt(); +} + + +void qPrefGeocoding::set_third_taxonomy_category(taxonomy_category value) +{ + if (value != prefs.geocoding.category[2]) { + prefs.geocoding.category[2] = value; + disk_third_taxonomy_category(true); + emit instance()->third_taxonomy_category_changed(value); + } +} +void qPrefGeocoding::disk_third_taxonomy_category(bool doSync) +{ + if (doSync) + qPrefPrivate::propSetValue(group + "/cat2", prefs.geocoding.category[2]); + else + prefs.geocoding.category[2] = (enum taxonomy_category)qPrefPrivate::propValue(group + "/cat2", default_prefs.geocoding.category[2]).toInt(); +} diff --git a/core/settings/qPrefGeocoding.h b/core/settings/qPrefGeocoding.h new file mode 100644 index 000000000..03c9f59c8 --- /dev/null +++ b/core/settings/qPrefGeocoding.h @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef QPREFGEOCODING_H +#define QPREFGEOCODING_H +#include "core/pref.h" + +#include <QObject> + + +class qPrefGeocoding : public QObject { + Q_OBJECT + Q_PROPERTY(taxonomy_category first_taxonomy_category READ first_taxonomy_category WRITE set_first_taxonomy_category NOTIFY first_taxonomy_category_changed); + Q_PROPERTY(taxonomy_category second_taxonomy_category READ second_taxonomy_category WRITE set_second_taxonomy_category NOTIFY second_taxonomy_category_changed); + Q_PROPERTY(taxonomy_category third_taxonomy_category READ third_taxonomy_category WRITE set_third_taxonomy_category NOTIFY third_taxonomy_category_changed); + +public: + qPrefGeocoding(QObject *parent = NULL); + static qPrefGeocoding *instance(); + + // Load/Sync local settings (disk) and struct preference + void loadSync(bool doSync); + void load() { loadSync(false); } + void sync() { loadSync(true); } + +public: + taxonomy_category first_taxonomy_category() { return prefs.geocoding.category[0]; } + taxonomy_category second_taxonomy_category() { return prefs.geocoding.category[1]; } + taxonomy_category third_taxonomy_category() { return prefs.geocoding.category[2]; } + +public slots: + static void set_first_taxonomy_category(taxonomy_category value); + static void set_second_taxonomy_category(taxonomy_category value); + static void set_third_taxonomy_category(taxonomy_category value); + +signals: + void first_taxonomy_category_changed(taxonomy_category value); + void second_taxonomy_category_changed(taxonomy_category value); + void third_taxonomy_category_changed(taxonomy_category value); + +private: + static void disk_first_taxonomy_category(bool doSync); + static void disk_second_taxonomy_category(bool doSync); + static void disk_third_taxonomy_category(bool doSync); +}; + +#endif diff --git a/core/settings/qPrefLanguage.cpp b/core/settings/qPrefLanguage.cpp new file mode 100644 index 000000000..75327ce32 --- /dev/null +++ b/core/settings/qPrefLanguage.cpp @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qPrefLanguage.h" +#include "qPrefPrivate.h" + +static const QString group = QStringLiteral("Language"); + +qPrefLanguage::qPrefLanguage(QObject *parent) : QObject(parent) +{ +} + +qPrefLanguage *qPrefLanguage::instance() +{ + static qPrefLanguage *self = new qPrefLanguage; + return self; +} + +void qPrefLanguage::loadSync(bool doSync) +{ + disk_date_format(doSync); + disk_date_format_override(doSync); + disk_date_format_short(doSync); + disk_language(doSync); + disk_lang_locale(doSync); + disk_time_format(doSync); + disk_time_format_override(doSync); + disk_use_system_language(doSync); +} + +HANDLE_PREFERENCE_TXT(Language, "/date_format", date_format); + +HANDLE_PREFERENCE_BOOL(Language,"/date_format_override", date_format_override); + +HANDLE_PREFERENCE_TXT(Language, "/date_format_short", date_format_short); + +HANDLE_PREFERENCE_TXT_EXT(Language, "/UiLanguage", language, locale.); + +HANDLE_PREFERENCE_TXT_EXT(Language, "/UiLangLocale", lang_locale, locale.); + +HANDLE_PREFERENCE_TXT(Language, "/time_format", time_format); + +HANDLE_PREFERENCE_BOOL(Language, "/time_format_override", time_format_override); + +HANDLE_PREFERENCE_BOOL_EXT(Language, "/UseSystemLanguage", use_system_language, locale.); diff --git a/core/settings/qPrefLanguage.h b/core/settings/qPrefLanguage.h new file mode 100644 index 000000000..e004f79d3 --- /dev/null +++ b/core/settings/qPrefLanguage.h @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef QPREFLANGUAGE_H +#define QPREFLANGUAGE_H +#include "core/pref.h" + +#include <QObject> + +class qPrefLanguage : public QObject { + Q_OBJECT + Q_PROPERTY(QString date_format READ date_format WRITE set_date_format NOTIFY date_format_changed); + Q_PROPERTY(bool date_format_override READ date_format_override WRITE set_date_format_override NOTIFY date_format_override_changed); + Q_PROPERTY(QString date_format_short READ date_format_short WRITE set_date_format_short NOTIFY date_format_short_changed); + Q_PROPERTY(QString language READ language WRITE set_language NOTIFY language_changed); + Q_PROPERTY(QString lang_locale READ lang_locale WRITE set_lang_locale NOTIFY lang_locale_changed); + Q_PROPERTY(QString time_format READ time_format WRITE set_time_format NOTIFY time_format_changed); + Q_PROPERTY(bool time_format_override READ time_format_override WRITE set_time_format_override NOTIFY time_format_override_changed); + Q_PROPERTY(bool use_system_language READ use_system_language WRITE set_use_system_language NOTIFY use_system_language_changed); + +public: + qPrefLanguage(QObject *parent = NULL); + static qPrefLanguage *instance(); + + // Load/Sync local settings (disk) and struct preference + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } + +public: + static const QString date_format() { return prefs.date_format; } + static bool date_format_override() { return prefs.date_format_override; } + static const QString date_format_short() { return prefs.date_format_short; } + static const QString language() { return prefs.locale.language; } + static const QString lang_locale() { return prefs.locale.lang_locale; } + static const QString time_format() { return prefs.time_format; } + static bool time_format_override() { return prefs.time_format_override; } + static bool use_system_language() { return prefs.locale.use_system_language; } + +public slots: + static void set_date_format(const QString& value); + static void set_date_format_override(bool value); + static void set_date_format_short(const QString& value); + static void set_language(const QString& value); + static void set_lang_locale(const QString& value); + static void set_time_format(const QString& value); + static void set_time_format_override(bool value); + static void set_use_system_language(bool value); + +signals: + void date_format_changed(const QString& value); + void date_format_override_changed(bool value); + void date_format_short_changed(const QString& value); + void language_changed(const QString& value); + void lang_locale_changed(const QString& value); + void time_format_changed(const QString& value); + void time_format_override_changed(bool value); + void use_system_language_changed(bool value); + +private: + static void disk_date_format(bool doSync); + static void disk_date_format_override(bool doSync); + static void disk_date_format_short(bool doSync); + static void disk_language(bool doSync); + static void disk_lang_locale(bool doSync); + static void disk_time_format(bool doSync); + static void disk_time_format_override(bool doSync); + static void disk_use_system_language(bool doSync); +}; + +#endif diff --git a/core/settings/qPrefLocationService.cpp b/core/settings/qPrefLocationService.cpp index 84ebcc321..01f4ffb9a 100644 --- a/core/settings/qPrefLocationService.cpp +++ b/core/settings/qPrefLocationService.cpp @@ -1,6 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 #include "qPrefLocationService.h" -#include "qPref.h" #include "qPrefPrivate.h" static const QString group = QStringLiteral("LocationService"); diff --git a/core/settings/qPrefLocationService.h b/core/settings/qPrefLocationService.h index e3aa43c29..676f2bbf8 100644 --- a/core/settings/qPrefLocationService.h +++ b/core/settings/qPrefLocationService.h @@ -16,17 +16,17 @@ public: static qPrefLocationService *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: - int distance_threshold() { return prefs.distance_threshold; } - int time_threshold() { return prefs.time_threshold; } + static int distance_threshold() { return prefs.distance_threshold; } + static int time_threshold() { return prefs.time_threshold; } public slots: - void set_distance_threshold(int value); - void set_time_threshold(int value); + static void set_distance_threshold(int value); + static void set_time_threshold(int value); signals: void distance_threshold_changed(int value); @@ -34,8 +34,8 @@ signals: private: - void disk_distance_threshold(bool doSync); - void disk_time_threshold(bool doSync); + static void disk_distance_threshold(bool doSync); + static void disk_time_threshold(bool doSync); }; #endif diff --git a/core/settings/qPrefPartialPressureGas.cpp b/core/settings/qPrefPartialPressureGas.cpp new file mode 100644 index 000000000..8d86899dc --- /dev/null +++ b/core/settings/qPrefPartialPressureGas.cpp @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "qPrefPartialPressureGas.h" +#include "qPrefPrivate.h" + +static const QString group = QStringLiteral("TecDetails"); + +qPrefPartialPressureGas::qPrefPartialPressureGas(QObject *parent) : QObject(parent) +{ +} +qPrefPartialPressureGas *qPrefPartialPressureGas::instance() +{ + static qPrefPartialPressureGas *self = new qPrefPartialPressureGas; + return self; +} + +void qPrefPartialPressureGas::loadSync(bool doSync) +{ + disk_phe(doSync); + disk_phe_threshold(doSync); + disk_pn2(doSync); + disk_pn2_threshold(doSync); + disk_po2(doSync); + disk_po2_threshold_min(doSync); + disk_po2_threshold_max(doSync); +} + + +HANDLE_PREFERENCE_BOOL_EXT(PartialPressureGas, "/phegraph", phe, pp_graphs.); + +HANDLE_PREFERENCE_DOUBLE_EXT(PartialPressureGas, "/phethreshold", phe_threshold, pp_graphs.); + +HANDLE_PREFERENCE_BOOL_EXT(PartialPressureGas, "/pn2graph", pn2, pp_graphs.); + +HANDLE_PREFERENCE_DOUBLE_EXT(PartialPressureGas, "/pn2threshold", pn2_threshold, pp_graphs.); + +HANDLE_PREFERENCE_BOOL_EXT(PartialPressureGas, "/po2graph", po2, pp_graphs.); + +HANDLE_PREFERENCE_DOUBLE_EXT(PartialPressureGas, "/po2thresholdmax", po2_threshold_max, pp_graphs.); + +HANDLE_PREFERENCE_DOUBLE_EXT(PartialPressureGas, "/po2thresholdmin", po2_threshold_min, pp_graphs.); diff --git a/core/settings/qPrefPartialPressureGas.h b/core/settings/qPrefPartialPressureGas.h new file mode 100644 index 000000000..c87711658 --- /dev/null +++ b/core/settings/qPrefPartialPressureGas.h @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef QPREFPARTICULARPRESSUREGAS_H +#define QPREFPARTICULARPRESSUREGAS_H +#include "core/pref.h" + +#include <QObject> + +class qPrefPartialPressureGas : public QObject { + Q_OBJECT + Q_PROPERTY(bool phe READ phe WRITE set_phe NOTIFY phe_changed); + Q_PROPERTY(double phe_threshold READ phe_threshold WRITE set_phe_threshold NOTIFY phe_threshold_changed); + Q_PROPERTY(bool pn2 READ pn2 WRITE set_pn2 NOTIFY pn2_changed); + Q_PROPERTY(double pn2_threshold READ pn2_threshold WRITE set_pn2_threshold NOTIFY pn2_threshold_changed); + Q_PROPERTY(bool po2 READ po2 WRITE set_po2 NOTIFY po2_changed); + Q_PROPERTY(double po2_threshold_max READ po2_threshold_max WRITE set_po2_threshold_max NOTIFY po2_threshold_max_changed); + Q_PROPERTY(double po2_threshold_min READ po2_threshold_min WRITE set_po2_threshold_min NOTIFY po2_threshold_min_changed); + +public: + qPrefPartialPressureGas(QObject *parent = NULL); + static qPrefPartialPressureGas *instance(); + + // Load/Sync local settings (disk) and struct preference + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } + +public: + static bool phe() { return prefs.pp_graphs.phe; } + static double phe_threshold() { return prefs.pp_graphs.phe_threshold; } + static bool pn2() { return prefs.pp_graphs.pn2; } + static double pn2_threshold() { return prefs.pp_graphs.pn2_threshold; } + static bool po2() { return prefs.pp_graphs.po2; } + static double po2_threshold_max() { return prefs.pp_graphs.po2_threshold_max; } + static double po2_threshold_min() { return prefs.pp_graphs.po2_threshold_min; } + +public slots: + static void set_phe(bool value); + static void set_phe_threshold(double value); + static void set_pn2(bool value); + static void set_pn2_threshold(double value); + static void set_po2(bool value); + static void set_po2_threshold_min(double value); + static void set_po2_threshold_max(double value); + +signals: + void phe_changed(bool value); + void phe_threshold_changed(double value); + void pn2_changed(bool value); + void pn2_threshold_changed(double value); + void po2_changed(bool value); + void po2_threshold_max_changed(double value); + void po2_threshold_min_changed(double value); + +private: + static void disk_phe(bool doSync); + static void disk_phe_threshold(bool doSync); + static void disk_pn2(bool doSync); + static void disk_pn2_threshold(bool doSync); + static void disk_po2(bool doSync); + static void disk_po2_threshold_min(bool doSync); + static void disk_po2_threshold_max(bool doSync); +}; + +#endif diff --git a/core/settings/qPrefPrivate.cpp b/core/settings/qPrefPrivate.cpp index 0275791cf..ff335a94f 100644 --- a/core/settings/qPrefPrivate.cpp +++ b/core/settings/qPrefPrivate.cpp @@ -1,17 +1,30 @@ // SPDX-License-Identifier: GPL-2.0 #include "qPrefPrivate.h" -qPrefPrivate::qPrefPrivate(QObject *parent) : QObject(parent) +#include <QSettings> + +void qPrefPrivate::copy_txt(const char **name, const QString &string) { + free((void *)*name); + *name = copy_qstring(string); } -qPrefPrivate *qPrefPrivate::instance() + +void qPrefPrivate::propSetValue(const QString &key, const QVariant &value) { - static qPrefPrivate *self = new qPrefPrivate; - return self; + // REMARK: making s static (which would be logical) does NOT work + // because it gets initialized too early. + // Having it as a local variable is light weight, because it is an + // interface class. + QSettings s; + s.setValue(key, value); } -void qPrefPrivate::copy_txt(const char **name, const QString &string) +QVariant qPrefPrivate::propValue(const QString &key, const QVariant &defaultValue) { - free((void *)*name); - *name = copy_qstring(string); + // REMARK: making s static (which would be logical) does NOT work + // because it gets initialized too early. + // Having it as a local variable is light weight, because it is an + // interface class. + QSettings s; + return s.value(key, defaultValue); } diff --git a/core/settings/qPrefPrivate.h b/core/settings/qPrefPrivate.h index efaa5382c..e3376a3a2 100644 --- a/core/settings/qPrefPrivate.h +++ b/core/settings/qPrefPrivate.h @@ -6,216 +6,201 @@ #include "core/qthelper.h" #include "qPref.h" #include <QObject> -#include <QSettings> #include <QVariant> // implementation class of the interface classes -class qPrefPrivate : public QObject { - Q_OBJECT +class qPrefPrivate { public: - friend class qPrefAnimations; - friend class qPrefCloudStorage; - friend class qPrefDisplay; - friend class qPrefDiveComputer; - friend class qPrefDivePlanner; - friend class qPrefFacebook; - friend class qPrefLocationService; - friend class qPrefProxy; - friend class qPrefTechnicalDetails; - friend class qPrefUnits; - friend class qPrefUpdateManager; - -private: - static qPrefPrivate *instance(); - - QSettings setting; - // Helper functions static void copy_txt(const char **name, const QString &string); - qPrefPrivate(QObject *parent = NULL); + static void propSetValue(const QString &key, const QVariant &value); + static QVariant propValue(const QString &key, const QVariant &defaultValue); + +private: + qPrefPrivate() {} }; //******* Macros to generate disk function -#define DISK_LOADSYNC_BOOL_EXT(usegroup, name, field, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field); \ - else \ - prefs.usestruct field = qPrefPrivate::instance()->setting.value(group + name, default_prefs.usestruct field).toBool(); \ +#define DISK_LOADSYNC_BOOL_EXT(usegroup, name, field, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field); \ + else \ + prefs.usestruct field = qPrefPrivate::propValue(group + name, default_prefs.usestruct field).toBool(); \ } #define DISK_LOADSYNC_BOOL(usegroup, name, field) \ DISK_LOADSYNC_BOOL_EXT(usegroup, name, field, ) -#define DISK_LOADSYNC_DOUBLE_EXT(usegroup, name, field, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field); \ - else \ - prefs.usestruct field = qPrefPrivate::instance()->setting.value(group + name, default_prefs.usestruct field).toDouble(); \ +#define DISK_LOADSYNC_DOUBLE_EXT(usegroup, name, field, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field); \ + else \ + prefs.usestruct field = qPrefPrivate::propValue(group + name, default_prefs.usestruct field).toDouble(); \ } #define DISK_LOADSYNC_DOUBLE(usegroup, name, field) \ DISK_LOADSYNC_DOUBLE_EXT(usegroup, name, field, ) -#define DISK_LOADSYNC_ENUM_EXT(usegroup, name, type, field, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field); \ - else \ - prefs.usestruct field = (enum type)qPrefPrivate::instance()->setting.value(group + name, default_prefs.usestruct field).toInt(); \ +#define DISK_LOADSYNC_ENUM_EXT(usegroup, name, type, field, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field); \ + else \ + prefs.usestruct field = (enum type)qPrefPrivate::propValue(group + name, default_prefs.usestruct field).toInt(); \ } #define DISK_LOADSYNC_ENUM(usegroup, name, type, field) \ DISK_LOADSYNC_ENUM_EXT(usegroup, name, type, field, ) -#define DISK_LOADSYNC_INT_EXT(usegroup, name, field, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field); \ - else \ - prefs.usestruct field = qPrefPrivate::instance()->setting.value(group + name, default_prefs.usestruct field).toInt(); \ +#define DISK_LOADSYNC_INT_EXT(usegroup, name, field, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field); \ + else \ + prefs.usestruct field = qPrefPrivate::propValue(group + name, default_prefs.usestruct field).toInt(); \ } #define DISK_LOADSYNC_INT(usegroup, name, field) \ DISK_LOADSYNC_INT_EXT(usegroup, name, field, ) -#define DISK_LOADSYNC_INT_DEF_EXT(usegroup, name, field, defval, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field); \ - else \ - prefs.usestruct field = qPrefPrivate::instance()->setting.value(group + name, defval).toInt(); \ +#define DISK_LOADSYNC_INT_DEF_EXT(usegroup, name, field, defval, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field); \ + else \ + prefs.usestruct field = qPrefPrivate::propValue(group + name, defval).toInt(); \ } #define DISK_LOADSYNC_INT_DEF(usegroup, name, field, defval) \ DISK_LOADSYNC_INT_DEF_EXT(usegroup, name, field, defval, ) -#define DISK_LOADSYNC_STRUCT_EXT(usegroup, name, field, var, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field . var); \ - else \ - prefs.usestruct field . var = qPrefPrivate::instance()->setting.value(group + name, default_prefs.usestruct field . var).toInt(); \ +#define DISK_LOADSYNC_STRUCT_EXT(usegroup, name, field, var, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field . var); \ + else \ + prefs.usestruct field . var = qPrefPrivate::propValue(group + name, default_prefs.usestruct field . var).toInt(); \ } #define DISK_LOADSYNC_STRUCT(usegroup, name, field, var) \ DISK_LOADSYNC_STRUCT_EXT(usegroup, name, field, var, ) -#define DISK_LOADSYNC_TXT_EXT(usegroup, name, field, usestruct) \ - void qPref##usegroup::disk_##field(bool doSync) \ - { \ - if (doSync) \ - qPrefPrivate::instance()->setting.setValue(group + name, prefs.usestruct field); \ - else \ - prefs.usestruct field = copy_qstring(qPrefPrivate::instance()->setting.value(group + name, default_prefs.usestruct field).toString()); \ +#define DISK_LOADSYNC_TXT_EXT(usegroup, name, field, usestruct) \ + void qPref##usegroup::disk_##field(bool doSync) \ + { \ + if (doSync) \ + qPrefPrivate::propSetValue(group + name, prefs.usestruct field); \ + else \ + prefs.usestruct field = copy_qstring(qPrefPrivate::propValue(group + name, default_prefs.usestruct field).toString()); \ } #define DISK_LOADSYNC_TXT(usegroup, name, field) \ DISK_LOADSYNC_TXT_EXT(usegroup, name, field, ) //******* Macros to generate set function #define SET_PREFERENCE_BOOL_EXT(usegroup, field, usestruct) \ - void qPref##usegroup::set_##field(bool value) \ - { \ - if (value != prefs.usestruct field) { \ - prefs.usestruct field = value; \ - disk_##field(true); \ - emit field##_changed(value); \ - } \ + void qPref##usegroup::set_##field(bool value) \ + { \ + if (value != prefs.usestruct field) { \ + prefs.usestruct field = value; \ + disk_##field(true); \ + emit qPref##usegroup::instance()->field##_changed(value); \ + } \ } #define SET_PREFERENCE_BOOL(usegroup, field) \ SET_PREFERENCE_BOOL_EXT(usegroup, field, ) #define SET_PREFERENCE_DOUBLE_EXT(usegroup, field, usestruct) \ - void qPref##usegroup::set_##field(double value) \ - { \ - if (value != prefs.usestruct field) { \ - prefs.usestruct field = value; \ - disk_##field(true); \ - emit field##_changed(value); \ - } \ + void qPref##usegroup::set_##field(double value) \ + { \ + if (value != prefs.usestruct field) { \ + prefs.usestruct field = value; \ + disk_##field(true); \ + emit qPref##usegroup::instance()->field##_changed(value); \ + } \ } #define SET_PREFERENCE_DOUBLE(usegroup, field) \ SET_PREFERENCE_DOUBLE_EXT(usegroup, field, ) #define SET_PREFERENCE_ENUM_EXT(usegroup, type, field, usestruct) \ - void qPref##usegroup::set_##field(type value) \ - { \ - if (value != prefs.usestruct field) { \ - prefs.usestruct field = value; \ - disk_##field(true); \ - emit field##_changed(value); \ - } \ + void qPref##usegroup::set_##field(type value) \ + { \ + if (value != prefs.usestruct field) { \ + prefs.usestruct field = value; \ + disk_##field(true); \ + emit qPref##usegroup::instance()->field##_changed(value); \ + } \ } #define SET_PREFERENCE_ENUM(usegroup, type, field) \ SET_PREFERENCE_ENUM_EXT(usegroup, type, field, ) #define SET_PREFERENCE_INT_EXT(usegroup, field, usestruct) \ - void qPref##usegroup::set_##field(int value) \ - { \ - if (value != prefs.usestruct field) { \ - prefs.usestruct field = value; \ - disk_##field(true); \ - emit field##_changed(value); \ - } \ + void qPref##usegroup::set_##field(int value) \ + { \ + if (value != prefs.usestruct field) { \ + prefs.usestruct field = value; \ + disk_##field(true); \ + emit qPref##usegroup::instance()->field##_changed(value); \ + } \ } #define SET_PREFERENCE_INT(usegroup, field) \ SET_PREFERENCE_INT_EXT(usegroup, field, ) #define SET_PREFERENCE_STRUCT_EXT(usegroup, type, field, var, usestruct) \ - void qPref##usegroup::set_##field(type value) \ - { \ - if (value. var != prefs.usestruct field . var) { \ - prefs.usestruct field . var = value . var; \ - disk_##field(true); \ - emit field##_changed(value); \ - } \ + void qPref##usegroup::set_##field(type value) \ + { \ + if (value. var != prefs.usestruct field . var) { \ + prefs.usestruct field . var = value . var; \ + disk_##field(true); \ + emit qPref##usegroup::instance()->field##_changed(value); \ + } \ } #define SET_PREFERENCE_STRUCT(usegroup, type, field, var) \ SET_PREFERENCE_STRUCT_EXT(usegroup, type, field, var, ) -#define SET_PREFERENCE_TXT_EXT(usegroup, field, usestruct) \ - void qPref##usegroup::set_##field(const QString &value) \ - { \ - if (value != prefs.usestruct field) { \ - qPrefPrivate::instance()->copy_txt(&prefs.usestruct field, value); \ - disk_##field(true); \ - emit field##_changed(value); \ - } \ +#define SET_PREFERENCE_TXT_EXT(usegroup, field, usestruct) \ + void qPref##usegroup::set_##field(const QString &value) \ + { \ + if (value != prefs.usestruct field) { \ + qPrefPrivate::copy_txt(&prefs.usestruct field, value); \ + disk_##field(true); \ + emit qPref##usegroup::instance()->field##_changed(value); \ + } \ } #define SET_PREFERENCE_TXT(usegroup, field) \ SET_PREFERENCE_TXT_EXT(usegroup, field, ) //******* Macros to generate set/set/loadsync combined #define HANDLE_PREFERENCE_BOOL_EXT(usegroup, name, field, usestruct) \ - SET_PREFERENCE_BOOL_EXT(usegroup, field, usestruct); \ + SET_PREFERENCE_BOOL_EXT(usegroup, field, usestruct); \ DISK_LOADSYNC_BOOL_EXT(usegroup, name, field, usestruct); #define HANDLE_PREFERENCE_BOOL(usegroup, name, field) \ HANDLE_PREFERENCE_BOOL_EXT(usegroup, name, field, ) #define HANDLE_PREFERENCE_DOUBLE_EXT(usegroup, name, field, usestruct) \ - SET_PREFERENCE_DOUBLE_EXT(usegroup, field, usestruct); \ + SET_PREFERENCE_DOUBLE_EXT(usegroup, field, usestruct); \ DISK_LOADSYNC_DOUBLE_EXT(usegroup, name, field, usestruct); #define HANDLE_PREFERENCE_DOUBLE(usegroup, name, field) \ HANDLE_PREFERENCE_DOUBLE_EXT(usegroup, name, field, ) #define HANDLE_PREFERENCE_ENUM_EXT(usegroup, type, name, field, usestruct) \ - SET_PREFERENCE_ENUM_EXT(usegroup, type, field, usestruct); \ + SET_PREFERENCE_ENUM_EXT(usegroup, type, field, usestruct); \ DISK_LOADSYNC_ENUM_EXT(usegroup, name, type, field, usestruct); #define HANDLE_PREFERENCE_ENUM(usegroup, type, name, field) \ HANDLE_PREFERENCE_ENUM_EXT(usegroup, type, name, field, ) #define HANDLE_PREFERENCE_INT_EXT(usegroup, name, field, usestruct) \ - SET_PREFERENCE_INT_EXT(usegroup, field, usestruct); \ + SET_PREFERENCE_INT_EXT(usegroup, field, usestruct); \ DISK_LOADSYNC_INT_EXT(usegroup, name, field, usestruct); #define HANDLE_PREFERENCE_INT(usegroup, name, field) \ HANDLE_PREFERENCE_INT_EXT(usegroup, name, field, ) #define HANDLE_PREFERENCE_INT_DEF_EXT(usegroup, name, field, defval, usestruct) \ - SET_PREFERENCE_INT_EXT(usegroup, field, usestruct); \ + SET_PREFERENCE_INT_EXT(usegroup, field, usestruct); \ DISK_LOADSYNC_INT_DEF_EXT(usegroup, name, field, defval, usestruct); #define HANDLE_PREFERENCE_INT_DEF(usegroup, name, field, defval) \ HANDLE_PREFERENCE_INT_DEF_EXT(usegroup, name, field, defval, ) @@ -227,9 +212,92 @@ private: HANDLE_PREFERENCE_STRUCT_EXT(usegroup, type, name, field, var, ) #define HANDLE_PREFERENCE_TXT_EXT(usegroup, name, field, usestruct) \ - SET_PREFERENCE_TXT_EXT(usegroup, field, usestruct); \ + SET_PREFERENCE_TXT_EXT(usegroup, field, usestruct); \ DISK_LOADSYNC_TXT_EXT(usegroup, name, field, usestruct); #define HANDLE_PREFERENCE_TXT(usegroup, name, field) \ HANDLE_PREFERENCE_TXT_EXT(usegroup, name, field, ) +#define HANDLE_PROP_QPOINTF(useclass, name, field) \ + void qPref##useclass::set_##field(const QPointF& value) \ + { \ + if (value != st_##field) { \ + st_##field = value; \ + qPrefPrivate::propSetValue(name, st_##field); \ + emit qPref##useclass::instance()->field##_changed(value); \ + } \ + } \ + void qPref##useclass::load_##field() \ + { \ + st_##field = qPrefPrivate::propValue(name, st_##field##_default).toPointF(); \ + } + +#define HANDLE_PROP_QSTRING(useclass, name, field) \ + void qPref##useclass::set_##field(const QString& value) \ + { \ + if (value != st_##field) { \ + st_##field = value; \ + qPrefPrivate::propSetValue(name, st_##field); \ + emit qPref##useclass::instance()->field##_changed(value); \ + } \ + } \ + void qPref##useclass::load_##field() \ + { \ + st_##field = qPrefPrivate::propValue(name, st_##field##_default).toString(); \ + } + +#define HANDLE_PROP_BOOL(useclass, name, field) \ + void qPref##useclass::set_##field(bool value) \ + { \ + if (value != st_##field) { \ + st_##field = value; \ + qPrefPrivate::propSetValue(name, st_##field); \ + emit qPref##useclass::instance()->field##_changed(value); \ + } \ + } \ + void qPref##useclass::load_##field() \ + { \ + st_##field = qPrefPrivate::propValue(name, st_##field##_default).toBool(); \ + } + +#define HANDLE_PROP_DOUBLE(useclass, name, field) \ + void qPref##useclass::set_##field(double value) \ + { \ + if (value != st_##field) { \ + st_##field = value; \ + qPrefPrivate::propSetValue(name, st_##field); \ + emit qPref##useclass::instance()->field##_changed(value); \ + } \ + } \ + void qPref##useclass::load_##field() \ + { \ + st_##field = qPrefPrivate::propValue(name, st_##field##_default).toDouble(); \ + } + +#define HANDLE_PROP_INT(useclass, name, field) \ + void qPref##useclass::set_##field(int value) \ + { \ + if (value != st_##field) { \ + st_##field = value; \ + qPrefPrivate::propSetValue(name, st_##field); \ + emit qPref##useclass::instance()->field##_changed(value); \ + } \ + } \ + void qPref##useclass::load_##field() \ + { \ + st_##field = qPrefPrivate::propValue(name, st_##field##_default).toInt(); \ + } + +#define HANDLE_PROP_QBYTEARRAY(useclass, name, field) \ + void qPref##useclass::set_##field(const QByteArray& value) \ + { \ + if (value != st_##field) { \ + st_##field = value; \ + qPrefPrivate::propSetValue(name, st_##field); \ + emit qPref##useclass::instance()->field##_changed(value); \ + } \ + } \ + void qPref##useclass::load_##field() \ + { \ + st_##field = qPrefPrivate::propValue(name, st_##field##_default).toByteArray(); \ + } #endif diff --git a/core/settings/qPrefProxy.cpp b/core/settings/qPrefProxy.cpp index 540d64dde..a1b491c10 100644 --- a/core/settings/qPrefProxy.cpp +++ b/core/settings/qPrefProxy.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefProxy.h" #include "qPrefPrivate.h" #include <QNetworkProxy> diff --git a/core/settings/qPrefProxy.h b/core/settings/qPrefProxy.h index abca19c06..e1ead178e 100644 --- a/core/settings/qPrefProxy.h +++ b/core/settings/qPrefProxy.h @@ -20,9 +20,9 @@ public: static qPrefProxy *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: static bool proxy_auth() { return prefs.proxy_auth; } @@ -33,12 +33,12 @@ public: static QString proxy_user() { return prefs.proxy_user; } public slots: - void set_proxy_auth(bool value); - void set_proxy_host(const QString &value); - void set_proxy_pass(const QString &value); - void set_proxy_port(int value); - void set_proxy_type(int value); - void set_proxy_user(const QString &value); + static void set_proxy_auth(bool value); + static void set_proxy_host(const QString &value); + static void set_proxy_pass(const QString &value); + static void set_proxy_port(int value); + static void set_proxy_type(int value); + static void set_proxy_user(const QString &value); signals: void proxy_auth_changed(bool value); @@ -49,12 +49,12 @@ signals: void proxy_user_changed(const QString &value); private: - void disk_proxy_auth(bool doSync); - void disk_proxy_host(bool doSync); - void disk_proxy_pass(bool doSync); - void disk_proxy_port(bool doSync); - void disk_proxy_type(bool doSync); - void disk_proxy_user(bool doSync); + static void disk_proxy_auth(bool doSync); + static void disk_proxy_host(bool doSync); + static void disk_proxy_pass(bool doSync); + static void disk_proxy_port(bool doSync); + static void disk_proxy_type(bool doSync); + static void disk_proxy_user(bool doSync); }; #endif diff --git a/core/settings/qPrefTechnicalDetails.cpp b/core/settings/qPrefTechnicalDetails.cpp index 9482ba54d..038b5a9fc 100644 --- a/core/settings/qPrefTechnicalDetails.cpp +++ b/core/settings/qPrefTechnicalDetails.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefTechnicalDetails.h" #include "qPrefPrivate.h" diff --git a/core/settings/qPrefTechnicalDetails.h b/core/settings/qPrefTechnicalDetails.h index 44981c2dc..b9a58c3c9 100644 --- a/core/settings/qPrefTechnicalDetails.h +++ b/core/settings/qPrefTechnicalDetails.h @@ -41,10 +41,11 @@ public: static qPrefTechnicalDetails *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } +public: static bool calcalltissues() { return prefs.calcalltissues; } static bool calcceiling() { return prefs.calcceiling; } static bool calcceiling3m() { return prefs.calcceiling3m; } @@ -74,33 +75,33 @@ public: static bool zoomed_plot() { return prefs.zoomed_plot; } public slots: - void set_calcalltissues(bool value); - void set_calcceiling(bool value); - void set_calcceiling3m(bool value); - void set_calcndltts(bool value); - void set_dcceiling(bool value); - void set_display_deco_mode(deco_mode value); - void set_display_unused_tanks(bool value); - void set_ead(bool value); - void set_gfhigh(int value); - void set_gflow(int value); - void set_gf_low_at_maxdepth(bool value); - void set_hrgraph(bool value); - void set_mod(bool value); - void set_modpO2(double value); - void set_percentagegraph(bool value); - void set_redceiling(bool value); - void set_rulergraph(bool value); - void set_show_average_depth(bool value); - void set_show_ccr_sensors(bool value); - void set_show_ccr_setpoint(bool value); - void set_show_icd(bool value); - void set_show_pictures_in_profile(bool value); - void set_show_sac(bool value); - void set_show_scr_ocpo2(bool value); - void set_tankbar(bool value); - void set_vpmb_conservatism(int value); - void set_zoomed_plot(bool value); + static void set_calcalltissues(bool value); + static void set_calcceiling(bool value); + static void set_calcceiling3m(bool value); + static void set_calcndltts(bool value); + static void set_dcceiling(bool value); + static void set_display_deco_mode(deco_mode value); + static void set_display_unused_tanks(bool value); + static void set_ead(bool value); + static void set_gfhigh(int value); + static void set_gflow(int value); + static void set_gf_low_at_maxdepth(bool value); + static void set_hrgraph(bool value); + static void set_mod(bool value); + static void set_modpO2(double value); + static void set_percentagegraph(bool value); + static void set_redceiling(bool value); + static void set_rulergraph(bool value); + static void set_show_average_depth(bool value); + static void set_show_ccr_sensors(bool value); + static void set_show_ccr_setpoint(bool value); + static void set_show_icd(bool value); + static void set_show_pictures_in_profile(bool value); + static void set_show_sac(bool value); + static void set_show_scr_ocpo2(bool value); + static void set_tankbar(bool value); + static void set_vpmb_conservatism(int value); + static void set_zoomed_plot(bool value); signals: void calcalltissues_changed(bool value); @@ -132,33 +133,33 @@ signals: void zoomed_plot_changed(bool value); private: - void disk_calcalltissues(bool doSync); - void disk_calcceiling(bool doSync); - void disk_calcceiling3m(bool doSync); - void disk_calcndltts(bool doSync); - void disk_dcceiling(bool doSync); - void disk_display_deco_mode(bool doSync); - void disk_display_unused_tanks(bool doSync); - void disk_ead(bool doSync); - void disk_gfhigh(bool doSync); - void disk_gflow(bool doSync); - void disk_gf_low_at_maxdepth(bool doSync); - void disk_hrgraph(bool doSync); - void disk_mod(bool doSync); - void disk_modpO2(bool doSync); - void disk_percentagegraph(bool doSync); - void disk_redceiling(bool doSync); - void disk_rulergraph(bool doSync); - void disk_show_average_depth(bool doSync); - void disk_show_ccr_sensors(bool doSync); - void disk_show_ccr_setpoint(bool doSync); - void disk_show_icd(bool doSync); - void disk_show_pictures_in_profile(bool doSync); - void disk_show_sac(bool doSync); - void disk_show_scr_ocpo2(bool doSync); - void disk_tankbar(bool doSync); - void disk_vpmb_conservatism(bool doSync); - void disk_zoomed_plot(bool doSync); + static void disk_calcalltissues(bool doSync); + static void disk_calcceiling(bool doSync); + static void disk_calcceiling3m(bool doSync); + static void disk_calcndltts(bool doSync); + static void disk_dcceiling(bool doSync); + static void disk_display_deco_mode(bool doSync); + static void disk_display_unused_tanks(bool doSync); + static void disk_ead(bool doSync); + static void disk_gfhigh(bool doSync); + static void disk_gflow(bool doSync); + static void disk_gf_low_at_maxdepth(bool doSync); + static void disk_hrgraph(bool doSync); + static void disk_mod(bool doSync); + static void disk_modpO2(bool doSync); + static void disk_percentagegraph(bool doSync); + static void disk_redceiling(bool doSync); + static void disk_rulergraph(bool doSync); + static void disk_show_average_depth(bool doSync); + static void disk_show_ccr_sensors(bool doSync); + static void disk_show_ccr_setpoint(bool doSync); + static void disk_show_icd(bool doSync); + static void disk_show_pictures_in_profile(bool doSync); + static void disk_show_sac(bool doSync); + static void disk_show_scr_ocpo2(bool doSync); + static void disk_tankbar(bool doSync); + static void disk_vpmb_conservatism(bool doSync); + static void disk_zoomed_plot(bool doSync); }; #endif diff --git a/core/settings/qPrefUnit.cpp b/core/settings/qPrefUnit.cpp index b0b45a881..c48421fd4 100644 --- a/core/settings/qPrefUnit.cpp +++ b/core/settings/qPrefUnit.cpp @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefUnit.h" #include "qPrefPrivate.h" @@ -63,7 +63,7 @@ void qPrefUnits::set_unit_system(const QString& value) prefs.unit_system = PERSONALIZE; } disk_unit_system(true); - emit unit_system_changed(value); + emit instance()->unit_system_changed(value); } } DISK_LOADSYNC_ENUM(Units, "/unit_system", unit_system_values, unit_system); diff --git a/core/settings/qPrefUnit.h b/core/settings/qPrefUnit.h index 70ccadadd..bc4273546 100644 --- a/core/settings/qPrefUnit.h +++ b/core/settings/qPrefUnit.h @@ -24,9 +24,9 @@ public: static qPrefUnits *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: static bool coordinates_traditional() { return prefs.coordinates_traditional; } @@ -41,16 +41,16 @@ public: static units::WEIGHT weight() { return prefs.units.weight; } public slots: - void set_coordinates_traditional(bool value); - void set_duration_units(units::DURATION value); - void set_length(units::LENGTH value); - void set_pressure(units::PRESSURE value); - void set_show_units_table(bool value); - void set_temperature(units::TEMPERATURE value); - void set_unit_system(const QString& value); - void set_vertical_speed_time(units::TIME value); - void set_volume(units::VOLUME value); - void set_weight(units::WEIGHT value); + static void set_coordinates_traditional(bool value); + static void set_duration_units(units::DURATION value); + static void set_length(units::LENGTH value); + static void set_pressure(units::PRESSURE value); + static void set_show_units_table(bool value); + static void set_temperature(units::TEMPERATURE value); + static void set_unit_system(const QString& value); + static void set_vertical_speed_time(units::TIME value); + static void set_volume(units::VOLUME value); + static void set_weight(units::WEIGHT value); signals: void coordinates_traditional_changed(bool value); @@ -65,16 +65,16 @@ signals: void weight_changed(int value); private: - void disk_coordinates_traditional(bool doSync); - void disk_duration_units(bool doSync); - void disk_length(bool doSync); - void disk_pressure(bool doSync); - void disk_show_units_table(bool doSync); - void disk_temperature(bool doSync); - void disk_unit_system(bool doSync); - void disk_vertical_speed_time(bool doSync); - void disk_volume(bool doSync); - void disk_weight(bool doSync); + static void disk_coordinates_traditional(bool doSync); + static void disk_duration_units(bool doSync); + static void disk_length(bool doSync); + static void disk_pressure(bool doSync); + static void disk_show_units_table(bool doSync); + static void disk_temperature(bool doSync); + static void disk_unit_system(bool doSync); + static void disk_vertical_speed_time(bool doSync); + static void disk_volume(bool doSync); + static void disk_weight(bool doSync); }; #endif diff --git a/core/settings/qPrefUpdateManager.cpp b/core/settings/qPrefUpdateManager.cpp index 2c8b8d70e..709631519 100644 --- a/core/settings/qPrefUpdateManager.cpp +++ b/core/settings/qPrefUpdateManager.cpp @@ -1,10 +1,13 @@ // SPDX-License-Identifier: GPL-2.0 -#include "qPref.h" +#include "qPrefUpdateManager.h" #include "qPrefPrivate.h" static const QString group = QStringLiteral("UpdateManager"); +QString qPrefUpdateManager::st_uuidString; +static const QString st_uuidString_default = ""; + qPrefUpdateManager::qPrefUpdateManager(QObject *parent) : QObject(parent) { } @@ -21,6 +24,9 @@ void qPrefUpdateManager::loadSync(bool doSync) disk_dont_check_for_updates(doSync); disk_last_version_used(doSync); disk_next_check(doSync); + if (!doSync) { + load_uuidString(); + } } @@ -30,7 +36,7 @@ void qPrefUpdateManager::set_dont_check_exists(bool value) { if (value != prefs.update_manager.dont_check_exists) { prefs.update_manager.dont_check_exists = value; - emit dont_check_exists_changed(value); + emit instance()->dont_check_exists_changed(value); } // DO NOT STORE ON DISK } @@ -41,12 +47,19 @@ HANDLE_PREFERENCE_TXT_EXT(UpdateManager, "/LastVersionUsed", last_version_used, void qPrefUpdateManager::set_next_check(const QDate& value) { - QString valueString = value.toString("dd/MM/yyyy"); - if (valueString != prefs.update_manager.next_check) { - qPrefPrivate::copy_txt(&prefs.update_manager.next_check, valueString); + long time_value = value.toJulianDay(); + if (time_value != prefs.update_manager.next_check) { + prefs.update_manager.next_check = time_value; disk_next_check(true); - emit next_check_changed(value); + emit instance()->next_check_changed(value); } } -DISK_LOADSYNC_TXT_EXT(UpdateManager, "/NextCheck", next_check, update_manager.); +void qPrefUpdateManager::disk_next_check(bool doSync) +{ + if (doSync) + qPrefPrivate::propSetValue(group + "/NextCheck", prefs.update_manager.next_check); + else + prefs.update_manager.next_check = qPrefPrivate::propValue(group + "/NextCheck", 0).toInt(); +} +HANDLE_PROP_QSTRING(UpdateManager, "UodateManager/UUID", uuidString); diff --git a/core/settings/qPrefUpdateManager.h b/core/settings/qPrefUpdateManager.h index 19943d2b7..151c2edc4 100644 --- a/core/settings/qPrefUpdateManager.h +++ b/core/settings/qPrefUpdateManager.h @@ -12,38 +12,48 @@ class qPrefUpdateManager : public QObject { Q_PROPERTY(bool dont_check_exists READ dont_check_exists WRITE set_dont_check_exists NOTIFY dont_check_exists_changed); Q_PROPERTY(const QString last_version_used READ last_version_used WRITE set_last_version_used NOTIFY last_version_used_changed); Q_PROPERTY(const QDate next_check READ next_check WRITE set_next_check NOTIFY next_check_changed); + Q_PROPERTY(const QString uuidString READ uuidString WRITE set_uuidString NOTIFY uuidString_changed); public: qPrefUpdateManager(QObject *parent = NULL); static qPrefUpdateManager *instance(); // Load/Sync local settings (disk) and struct preference - void loadSync(bool doSync); - void load() { loadSync(false); } - void sync() { loadSync(true); } + static void loadSync(bool doSync); + static void load() { loadSync(false); } + static void sync() { loadSync(true); } public: - bool dont_check_for_updates() { return prefs.update_manager.dont_check_for_updates; } - bool dont_check_exists() { return prefs.update_manager.dont_check_exists; } - const QString last_version_used() { return prefs.update_manager.last_version_used; } - const QDate next_check() { return QDate::fromString(QString(prefs.update_manager.next_check), "dd/MM/yyyy"); } + static bool dont_check_for_updates() { return prefs.update_manager.dont_check_for_updates; } + static bool dont_check_exists() { return prefs.update_manager.dont_check_exists; } + static const QString last_version_used() { return prefs.update_manager.last_version_used; } + static const QDate next_check() { return QDate::fromJulianDay(prefs.update_manager.next_check); } + static const QString uuidString() { return st_uuidString; } public slots: - void set_dont_check_for_updates(bool value); - void set_dont_check_exists(bool value); - void set_last_version_used(const QString& value); - void set_next_check(const QDate& value); + static void set_dont_check_for_updates(bool value); + static void set_dont_check_exists(bool value); + static void set_last_version_used(const QString& value); + static void set_next_check(const QDate& value); + static void set_uuidString(const QString& value); signals: void dont_check_for_updates_changed(bool value); void dont_check_exists_changed(bool value); void last_version_used_changed(const QString& value); void next_check_changed(const QDate& value); + void uuidString_changed(const QString& value); private: - void disk_dont_check_for_updates(bool doSync); - void disk_last_version_used(bool doSync); - void disk_next_check(bool doSync); + static void disk_dont_check_for_updates(bool doSync); + static void disk_last_version_used(bool doSync); + static void disk_next_check(bool doSync); + + // load only for class variables + static void load_uuidString(); + + // class variables not present in structure preferences + static QString st_uuidString; }; #endif diff --git a/core/statistics.c b/core/statistics.c index 58d851611..beeb258a6 100644 --- a/core/statistics.c +++ b/core/statistics.c @@ -236,10 +236,10 @@ void process_selected_dives(void) #define SOME_GAS 5000 // 5bar drop in cylinder pressure makes cylinder used -bool has_gaschange_event(struct dive *dive, struct divecomputer *dc, int idx) +bool has_gaschange_event(const struct dive *dive, const struct divecomputer *dc, int idx) { bool first_gas_explicit = false; - struct event *event = get_next_event(dc->events, "gaschange"); + const struct event *event = get_next_event(dc->events, "gaschange"); while (event) { if (dc->sample && (event->time.seconds == 0 || (dc->samples && dc->sample[0].time.seconds == event->time.seconds))) @@ -257,9 +257,9 @@ bool has_gaschange_event(struct dive *dive, struct divecomputer *dc, int idx) return !first_gas_explicit && idx == 0; } -bool is_cylinder_used(struct dive *dive, int idx) +bool is_cylinder_used(const struct dive *dive, int idx) { - struct divecomputer *dc; + const struct divecomputer *dc; if (cylinder_none(&dive->cylinder[idx])) return false; @@ -276,9 +276,9 @@ bool is_cylinder_used(struct dive *dive, int idx) return false; } -bool is_cylinder_prot(struct dive *dive, int idx) +bool is_cylinder_prot(const struct dive *dive, int idx) { - struct divecomputer *dc; + const struct divecomputer *dc; if (cylinder_none(&dive->cylinder[idx])) return false; @@ -309,14 +309,14 @@ static void get_gas_parts(struct gasmix mix, volume_t vol, int o2_in_topup, volu { volume_t air = {}; - if (gasmix_is_air(&mix)) { + if (gasmix_is_air(mix)) { o2->mliter = 0; he->mliter = 0; return; } - air.mliter = lrint(((double)vol.mliter * (1000 - get_he(&mix) - get_o2(&mix))) / (1000 - o2_in_topup)); - he->mliter = lrint(((double)vol.mliter * get_he(&mix)) / 1000.0); + air.mliter = lrint(((double)vol.mliter * (1000 - get_he(mix) - get_o2(mix))) / (1000 - o2_in_topup)); + he->mliter = lrint(((double)vol.mliter * get_he(mix)) / 1000.0); o2->mliter += vol.mliter - he->mliter - air.mliter; } diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 15291554d..a69c73ddc 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -207,7 +207,7 @@ QString DiveObjectHelper::gas() const gas = m_dive->cylinder[i].type.description; if (!gas.isEmpty()) gas += QChar(' '); - gas += gasname(&m_dive->cylinder[i].gasmix); + gas += gasname(m_dive->cylinder[i].gasmix); // if has a description and if such gas is not already present if (!gas.isEmpty() && gases.indexOf(gas) == -1) { if (!gases.isEmpty()) diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp deleted file mode 100644 index 84ffc5a26..000000000 --- a/core/subsurface-qt/SettingsObjectWrapper.cpp +++ /dev/null @@ -1,625 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "SettingsObjectWrapper.h" -#include <QSettings> -#include <QApplication> -#include <QFont> -#include <QDate> - -#include "core/qthelper.h" -#include "core/prefs-macros.h" - -PartialPressureGasSettings::PartialPressureGasSettings(QObject* parent): - QObject(parent) -{ - -} - -bool PartialPressureGasSettings::showPo2() const -{ - return prefs.pp_graphs.po2; -} - -bool PartialPressureGasSettings::showPn2() const -{ - return prefs.pp_graphs.pn2; -} - -bool PartialPressureGasSettings::showPhe() const -{ - return prefs.pp_graphs.phe; -} - -double PartialPressureGasSettings::po2ThresholdMin() const -{ - return prefs.pp_graphs.po2_threshold_min; -} - -double PartialPressureGasSettings::po2ThresholdMax() const -{ - return prefs.pp_graphs.po2_threshold_max; -} - - -double PartialPressureGasSettings::pn2Threshold() const -{ - return prefs.pp_graphs.pn2_threshold; -} - -double PartialPressureGasSettings::pheThreshold() const -{ - return prefs.pp_graphs.phe_threshold; -} - -void PartialPressureGasSettings::setShowPo2(bool value) -{ - if (value == prefs.pp_graphs.po2) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("po2graph", value); - prefs.pp_graphs.po2 = value; - emit showPo2Changed(value); -} - -void PartialPressureGasSettings::setShowPn2(bool value) -{ - if (value == prefs.pp_graphs.pn2) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("pn2graph", value); - prefs.pp_graphs.pn2 = value; - emit showPn2Changed(value); -} - -void PartialPressureGasSettings::setShowPhe(bool value) -{ - if (value == prefs.pp_graphs.phe) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("phegraph", value); - prefs.pp_graphs.phe = value; - emit showPheChanged(value); -} - -void PartialPressureGasSettings::setPo2ThresholdMin(double value) -{ - if (value == prefs.pp_graphs.po2_threshold_min) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("po2thresholdmin", value); - prefs.pp_graphs.po2_threshold_min = value; - emit po2ThresholdMinChanged(value); -} - -void PartialPressureGasSettings::setPo2ThresholdMax(double value) -{ - if (value == prefs.pp_graphs.po2_threshold_max) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("po2thresholdmax", value); - prefs.pp_graphs.po2_threshold_max = value; - emit po2ThresholdMaxChanged(value); -} - -void PartialPressureGasSettings::setPn2Threshold(double value) -{ - if (value == prefs.pp_graphs.pn2_threshold) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("pn2threshold", value); - prefs.pp_graphs.pn2_threshold = value; - emit pn2ThresholdChanged(value); -} - -void PartialPressureGasSettings::setPheThreshold(double value) -{ - if (value == prefs.pp_graphs.phe_threshold) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("phethreshold", value); - prefs.pp_graphs.phe_threshold = value; - emit pheThresholdChanged(value); -} - -GeocodingPreferences::GeocodingPreferences(QObject *parent) : - QObject(parent) -{ - -} - -taxonomy_category GeocodingPreferences::firstTaxonomyCategory() const -{ - return prefs.geocoding.category[0]; -} - -taxonomy_category GeocodingPreferences::secondTaxonomyCategory() const -{ - return prefs.geocoding.category[1]; -} - -taxonomy_category GeocodingPreferences::thirdTaxonomyCategory() const -{ - return prefs.geocoding.category[2]; -} - -void GeocodingPreferences::setFirstTaxonomyCategory(taxonomy_category value) -{ - if (value == prefs.geocoding.category[0]) - return; - QSettings s; - s.beginGroup(group); - s.setValue("cat0", value); - prefs.geocoding.category[0] = value; - emit firstTaxonomyCategoryChanged(value); -} - -void GeocodingPreferences::setSecondTaxonomyCategory(taxonomy_category value) -{ - if (value == prefs.geocoding.category[1]) - return; - QSettings s; - s.beginGroup(group); - s.setValue("cat1", value); - prefs.geocoding.category[1]= value; - emit secondTaxonomyCategoryChanged(value); -} - -void GeocodingPreferences::setThirdTaxonomyCategory(taxonomy_category value) -{ - if (value == prefs.geocoding.category[2]) - return; - QSettings s; - s.beginGroup(group); - s.setValue("cat2", value); - prefs.geocoding.category[2] = value; - emit thirdTaxonomyCategoryChanged(value); -} - -GeneralSettingsObjectWrapper::GeneralSettingsObjectWrapper(QObject *parent) : - QObject(parent) -{ -} - -QString GeneralSettingsObjectWrapper::defaultFilename() const -{ - return prefs.default_filename; -} - -QString GeneralSettingsObjectWrapper::defaultCylinder() const -{ - return prefs.default_cylinder; -} - -short GeneralSettingsObjectWrapper::defaultFileBehavior() const -{ - return prefs.default_file_behavior; -} - -bool GeneralSettingsObjectWrapper::useDefaultFile() const -{ - return prefs.use_default_file; -} - -int GeneralSettingsObjectWrapper::defaultSetPoint() const -{ - return prefs.defaultsetpoint; -} - -int GeneralSettingsObjectWrapper::o2Consumption() const -{ - return prefs.o2consumption; -} - -int GeneralSettingsObjectWrapper::pscrRatio() const -{ - return prefs.pscr_ratio; -} - -bool GeneralSettingsObjectWrapper::autoRecalculateThumbnails() const -{ - return prefs.auto_recalculate_thumbnails; -} - -bool GeneralSettingsObjectWrapper::extractVideoThumbnails() const -{ - return prefs.extract_video_thumbnails; -} - -int GeneralSettingsObjectWrapper::extractVideoThumbnailsPosition() const -{ - return prefs.extract_video_thumbnails_position; -} - -QString GeneralSettingsObjectWrapper::ffmpegExecutable() const -{ - return prefs.ffmpeg_executable; -} - -void GeneralSettingsObjectWrapper::setDefaultFilename(const QString& value) -{ - if (value == prefs.default_filename) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("default_filename", value); - free((void *)prefs.default_filename); - prefs.default_filename = copy_qstring(value); - emit defaultFilenameChanged(value); -} - -void GeneralSettingsObjectWrapper::setDefaultCylinder(const QString& value) -{ - if (value == prefs.default_cylinder) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("default_cylinder", value); - free((void *)prefs.default_cylinder); - prefs.default_cylinder = copy_qstring(value); - emit defaultCylinderChanged(value); -} - -void GeneralSettingsObjectWrapper::setDefaultFileBehavior(short value) -{ - if (value == prefs.default_file_behavior && prefs.default_file_behavior != UNDEFINED_DEFAULT_FILE) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("default_file_behavior", value); - - prefs.default_file_behavior = value; - if (prefs.default_file_behavior == UNDEFINED_DEFAULT_FILE) { - // undefined, so check if there's a filename set and - // use that, otherwise go with no default file - if (QString(prefs.default_filename).isEmpty()) - prefs.default_file_behavior = NO_DEFAULT_FILE; - else - prefs.default_file_behavior = LOCAL_DEFAULT_FILE; - } - emit defaultFileBehaviorChanged(value); -} - -void GeneralSettingsObjectWrapper::setUseDefaultFile(bool value) -{ - if (value == prefs.use_default_file) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("use_default_file", value); - prefs.use_default_file = value; - emit useDefaultFileChanged(value); -} - -void GeneralSettingsObjectWrapper::setDefaultSetPoint(int value) -{ - if (value == prefs.defaultsetpoint) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("defaultsetpoint", value); - prefs.defaultsetpoint = value; - emit defaultSetPointChanged(value); -} - -void GeneralSettingsObjectWrapper::setO2Consumption(int value) -{ - if (value == prefs.o2consumption) - return; - QSettings s; - s.beginGroup(group); - s.setValue("o2consumption", value); - prefs.o2consumption = value; - emit o2ConsumptionChanged(value); -} - -void GeneralSettingsObjectWrapper::setPscrRatio(int value) -{ - if (value == prefs.pscr_ratio) - return; - QSettings s; - s.beginGroup(group); - s.setValue("pscr_ratio", value); - prefs.pscr_ratio = value; - emit pscrRatioChanged(value); -} - -void GeneralSettingsObjectWrapper::setAutoRecalculateThumbnails(bool value) -{ - if (value == prefs.auto_recalculate_thumbnails) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("auto_recalculate_thumbnails", value); - prefs.auto_recalculate_thumbnails = value; - emit autoRecalculateThumbnailsChanged(value); -} - -void GeneralSettingsObjectWrapper::setExtractVideoThumbnails(bool value) -{ - if (value == prefs.extract_video_thumbnails) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("extract_video_thumbnails", value); - prefs.extract_video_thumbnails = value; - emit extractVideoThumbnailsChanged(value); -} - -void GeneralSettingsObjectWrapper::setExtractVideoThumbnailsPosition(int value) -{ - if (value == prefs.extract_video_thumbnails_position) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("extract_video_thumbnails_position", value); - prefs.extract_video_thumbnails_position = value; - emit extractVideoThumbnailsPositionChanged(value); -} - -void GeneralSettingsObjectWrapper::setFfmpegExecutable(const QString &value) -{ - if (value == prefs.ffmpeg_executable) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("ffmpeg_executable", value); - free((void *)prefs.ffmpeg_executable); - prefs.ffmpeg_executable = copy_qstring(value); - emit ffmpegExecutableChanged(value); -} - -LanguageSettingsObjectWrapper::LanguageSettingsObjectWrapper(QObject *parent) : - QObject(parent) -{ -} - -QString LanguageSettingsObjectWrapper::language() const -{ - return prefs.locale.language; -} - -QString LanguageSettingsObjectWrapper::timeFormat() const -{ - return prefs.time_format; -} - -QString LanguageSettingsObjectWrapper::dateFormat() const -{ - return prefs.date_format; -} - -QString LanguageSettingsObjectWrapper::dateFormatShort() const -{ - return prefs.date_format_short; -} - -bool LanguageSettingsObjectWrapper::timeFormatOverride() const -{ - return prefs.time_format_override; -} - -bool LanguageSettingsObjectWrapper::dateFormatOverride() const -{ - return prefs.date_format_override; -} - -bool LanguageSettingsObjectWrapper::useSystemLanguage() const -{ - return prefs.locale.use_system_language; -} - -QString LanguageSettingsObjectWrapper::langLocale() const -{ - return prefs.locale.lang_locale; -} - -void LanguageSettingsObjectWrapper::setUseSystemLanguage(bool value) -{ - if (value == prefs.locale.use_system_language) - return; - QSettings s; - s.beginGroup(group); - s.setValue("UseSystemLanguage", value); - prefs.locale.use_system_language = value; - emit useSystemLanguageChanged(value); -} - -void LanguageSettingsObjectWrapper::setLangLocale(const QString &value) -{ - if (value == prefs.locale.lang_locale) - return; - QSettings s; - s.beginGroup(group); - s.setValue("UiLangLocale", value); - free((void *)prefs.locale.lang_locale); - prefs.locale.lang_locale = copy_qstring(value); - emit langLocaleChanged(value); -} - -void LanguageSettingsObjectWrapper::setLanguage(const QString& value) -{ - if (value == prefs.locale.language) - return; - QSettings s; - s.beginGroup(group); - s.setValue("UiLanguage", value); - free((void *)prefs.locale.language); - prefs.locale.language = copy_qstring(value); - emit languageChanged(value); -} - -void LanguageSettingsObjectWrapper::setTimeFormat(const QString& value) -{ - if (value == prefs.time_format) - return; - QSettings s; - s.beginGroup(group); - s.setValue("time_format", value); - free((void *)prefs.time_format); - prefs.time_format = copy_qstring(value); - emit timeFormatChanged(value); -} - -void LanguageSettingsObjectWrapper::setDateFormat(const QString& value) -{ - if (value == prefs.date_format) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("date_format", value); - free((void *)prefs.date_format); - prefs.date_format = copy_qstring(value); - emit dateFormatChanged(value); -} - -void LanguageSettingsObjectWrapper::setDateFormatShort(const QString& value) -{ - if (value == prefs.date_format_short) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("date_format_short", value); - free((void *)prefs.date_format_short); - prefs.date_format_short = copy_qstring(value); - emit dateFormatShortChanged(value); -} - -void LanguageSettingsObjectWrapper::setTimeFormatOverride(bool value) -{ - if (value == prefs.time_format_override) - return; - QSettings s; - s.beginGroup(group); - s.setValue("time_format_override", value); - prefs.time_format_override = value; - emit timeFormatOverrideChanged(value); -} - -void LanguageSettingsObjectWrapper::setDateFormatOverride(bool value) -{ - if (value == prefs.date_format_override) - return; - - QSettings s; - s.beginGroup(group); - s.setValue("date_format_override", value); - prefs.date_format_override = value; - emit dateFormatOverrideChanged(value); -} - - -SettingsObjectWrapper::SettingsObjectWrapper(QObject* parent): -QObject(parent), - techDetails(new qPrefTechnicalDetails(this)), - pp_gas(new PartialPressureGasSettings(this)), - facebook(new qPrefFacebook(this)), - geocoding(new GeocodingPreferences(this)), - proxy(new qPrefProxy(this)), - cloud_storage(new qPrefCloudStorage(this)), - planner_settings(new qPrefDivePlanner(this)), - unit_settings(new qPrefUnits(this)), - general_settings(new GeneralSettingsObjectWrapper(this)), - display_settings(new qPrefDisplay(this)), - language_settings(new LanguageSettingsObjectWrapper(this)), - animation_settings(new qPrefAnimations(this)), - location_settings(new qPrefLocationService(this)), - update_manager_settings(new qPrefUpdateManager(this)), - dive_computer_settings(new qPrefDiveComputer(this)) -{ -} - -void SettingsObjectWrapper::load() -{ - QSettings s; - QVariant v; - - uiLanguage(NULL); - - qPrefUnits::instance()->load(); - qPrefTechnicalDetails::instance()->load(); - - s.beginGroup("GeneralSettings"); - GET_TXT("default_filename", default_filename); - GET_INT("default_file_behavior", default_file_behavior); - if (prefs.default_file_behavior == UNDEFINED_DEFAULT_FILE) { - // undefined, so check if there's a filename set and - // use that, otherwise go with no default file - if (QString(prefs.default_filename).isEmpty()) - prefs.default_file_behavior = NO_DEFAULT_FILE; - else - prefs.default_file_behavior = LOCAL_DEFAULT_FILE; - } - GET_TXT("default_cylinder", default_cylinder); - GET_BOOL("use_default_file", use_default_file); - GET_INT("defaultsetpoint", defaultsetpoint); - GET_INT("o2consumption", o2consumption); - GET_INT("pscr_ratio", pscr_ratio); - GET_BOOL("auto_recalculate_thumbnails", auto_recalculate_thumbnails); - s.endGroup(); - - qPrefAnimations::instance()->load(); - qPrefCloudStorage::instance()->load(); - qPrefDisplay::instance()->load(); - qPrefProxy::instance()->load(); - - // GeoManagement - s.beginGroup("geocoding"); - - GET_ENUM("cat0", taxonomy_category, geocoding.category[0]); - GET_ENUM("cat1", taxonomy_category, geocoding.category[1]); - GET_ENUM("cat2", taxonomy_category, geocoding.category[2]); - s.endGroup(); - - // GPS service time and distance thresholds - qPrefLocationService::instance()->load(); - - qPrefDivePlanner::instance()->load(); - qPrefDiveComputer::instance()->load(); - qPrefUpdateManager::instance()->load(); - - s.beginGroup("Language"); - GET_BOOL("UseSystemLanguage", locale.use_system_language); - GET_TXT("UiLanguage", locale.language); - GET_TXT("UiLangLocale", locale.lang_locale); - GET_TXT("time_format", time_format); - GET_TXT("date_format", date_format); - GET_TXT("date_format_short", date_format_short); - GET_BOOL("time_format_override", time_format_override); - GET_BOOL("date_format_override", date_format_override); - s.endGroup(); -} - -void SettingsObjectWrapper::sync() -{ - qPrefDisplay::instance()->sync(); -} - -SettingsObjectWrapper* SettingsObjectWrapper::instance() -{ - static SettingsObjectWrapper settings; - return &settings; -} diff --git a/core/subsurface-qt/SettingsObjectWrapper.h b/core/subsurface-qt/SettingsObjectWrapper.h deleted file mode 100644 index 3af79404e..000000000 --- a/core/subsurface-qt/SettingsObjectWrapper.h +++ /dev/null @@ -1,230 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef SETTINGSOBJECTWRAPPER_H -#define SETTINGSOBJECTWRAPPER_H - -#include <QObject> -#include <QDate> - -#include "core/pref.h" -#include "core/settings/qPref.h" - -/* Wrapper class for the Settings. This will allow - * seamlessy integration of the settings with the QML - * and QWidget frontends. This class will be huge, since - * I need tons of properties, one for each option. */ - -/* Control the state of the Partial Pressure Graphs preferences */ -class PartialPressureGasSettings : public QObject { - Q_OBJECT - Q_PROPERTY(bool show_po2 READ showPo2 WRITE setShowPo2 NOTIFY showPo2Changed) - Q_PROPERTY(bool show_pn2 READ showPn2 WRITE setShowPn2 NOTIFY showPn2Changed) - Q_PROPERTY(bool show_phe READ showPhe WRITE setShowPhe NOTIFY showPheChanged) - Q_PROPERTY(double po2_threshold_min READ po2ThresholdMin WRITE setPo2ThresholdMin NOTIFY po2ThresholdMinChanged) - Q_PROPERTY(double po2_threshold_max READ po2ThresholdMax WRITE setPo2ThresholdMax NOTIFY po2ThresholdMaxChanged) - Q_PROPERTY(double pn2_threshold READ pn2Threshold WRITE setPn2Threshold NOTIFY pn2ThresholdChanged) - Q_PROPERTY(double phe_threshold READ pheThreshold WRITE setPheThreshold NOTIFY pheThresholdChanged) - -public: - PartialPressureGasSettings(QObject *parent); - bool showPo2() const; - bool showPn2() const; - bool showPhe() const; - double po2ThresholdMin() const; - double po2ThresholdMax() const; - double pn2Threshold() const; - double pheThreshold() const; - -public slots: - void setShowPo2(bool value); - void setShowPn2(bool value); - void setShowPhe(bool value); - void setPo2ThresholdMin(double value); - void setPo2ThresholdMax(double value); - void setPn2Threshold(double value); - void setPheThreshold(double value); - -signals: - void showPo2Changed(bool value); - void showPn2Changed(bool value); - void showPheChanged(bool value); - void po2ThresholdMaxChanged(double value); - void po2ThresholdMinChanged(double value); - void pn2ThresholdChanged(double value); - void pheThresholdChanged(double value); - -private: - const QString group = QStringLiteral("TecDetails"); -}; - -/* Control the state of the Geocoding preferences */ -class GeocodingPreferences : public QObject { - Q_OBJECT - Q_PROPERTY(taxonomy_category first_category READ firstTaxonomyCategory WRITE setFirstTaxonomyCategory NOTIFY firstTaxonomyCategoryChanged) - Q_PROPERTY(taxonomy_category second_category READ secondTaxonomyCategory WRITE setSecondTaxonomyCategory NOTIFY secondTaxonomyCategoryChanged) - Q_PROPERTY(taxonomy_category third_category READ thirdTaxonomyCategory WRITE setThirdTaxonomyCategory NOTIFY thirdTaxonomyCategoryChanged) -public: - GeocodingPreferences(QObject *parent); - taxonomy_category firstTaxonomyCategory() const; - taxonomy_category secondTaxonomyCategory() const; - taxonomy_category thirdTaxonomyCategory() const; - -public slots: - void setFirstTaxonomyCategory(taxonomy_category value); - void setSecondTaxonomyCategory(taxonomy_category value); - void setThirdTaxonomyCategory(taxonomy_category value); - -signals: - void firstTaxonomyCategoryChanged(taxonomy_category value); - void secondTaxonomyCategoryChanged(taxonomy_category value); - void thirdTaxonomyCategoryChanged(taxonomy_category value); -private: - const QString group = QStringLiteral("geocoding"); -}; - -class GeneralSettingsObjectWrapper : public QObject { - Q_OBJECT - Q_PROPERTY(QString default_filename READ defaultFilename WRITE setDefaultFilename NOTIFY defaultFilenameChanged) - Q_PROPERTY(QString default_cylinder READ defaultCylinder WRITE setDefaultCylinder NOTIFY defaultCylinderChanged) - Q_PROPERTY(short default_file_behavior READ defaultFileBehavior WRITE setDefaultFileBehavior NOTIFY defaultFileBehaviorChanged) - Q_PROPERTY(bool use_default_file READ useDefaultFile WRITE setUseDefaultFile NOTIFY useDefaultFileChanged) - Q_PROPERTY(int defaultsetpoint READ defaultSetPoint WRITE setDefaultSetPoint NOTIFY defaultSetPointChanged) - Q_PROPERTY(int o2consumption READ o2Consumption WRITE setO2Consumption NOTIFY o2ConsumptionChanged) - Q_PROPERTY(int pscr_ratio READ pscrRatio WRITE setPscrRatio NOTIFY pscrRatioChanged) - Q_PROPERTY(bool auto_recalculate_thumbnails READ autoRecalculateThumbnails WRITE setAutoRecalculateThumbnails NOTIFY autoRecalculateThumbnailsChanged) - Q_PROPERTY(bool extract_video_thumbnails READ extractVideoThumbnails WRITE setExtractVideoThumbnails NOTIFY extractVideoThumbnailsChanged) - Q_PROPERTY(int extract_video_thumbnails_position READ extractVideoThumbnailsPosition WRITE setExtractVideoThumbnailsPosition NOTIFY extractVideoThumbnailsPositionChanged) - Q_PROPERTY(QString ffmpeg_executable READ ffmpegExecutable WRITE setFfmpegExecutable NOTIFY ffmpegExecutableChanged) - -public: - GeneralSettingsObjectWrapper(QObject *parent); - QString defaultFilename() const; - QString defaultCylinder() const; - short defaultFileBehavior() const; - bool useDefaultFile() const; - int defaultSetPoint() const; - int o2Consumption() const; - int pscrRatio() const; - bool autoRecalculateThumbnails() const; - bool extractVideoThumbnails() const; - int extractVideoThumbnailsPosition() const; - QString ffmpegExecutable() const; - -public slots: - void setDefaultFilename (const QString& value); - void setDefaultCylinder (const QString& value); - void setDefaultFileBehavior (short value); - void setUseDefaultFile (bool value); - void setDefaultSetPoint (int value); - void setO2Consumption (int value); - void setPscrRatio (int value); - void setAutoRecalculateThumbnails (bool value); - void setExtractVideoThumbnails (bool value); - void setExtractVideoThumbnailsPosition (int value); - void setFfmpegExecutable (const QString &value); - -signals: - void defaultFilenameChanged(const QString& value); - void defaultCylinderChanged(const QString& value); - void defaultFileBehaviorChanged(short value); - void useDefaultFileChanged(bool value); - void defaultSetPointChanged(int value); - void o2ConsumptionChanged(int value); - void pscrRatioChanged(int value); - void autoRecalculateThumbnailsChanged(int value); - void extractVideoThumbnailsChanged(bool value); - void extractVideoThumbnailsPositionChanged(int value); - void ffmpegExecutableChanged(const QString &value); -private: - const QString group = QStringLiteral("GeneralSettings"); -}; - -class LanguageSettingsObjectWrapper : public QObject { - Q_OBJECT - Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY languageChanged) - Q_PROPERTY(QString time_format READ timeFormat WRITE setTimeFormat NOTIFY timeFormatChanged) - Q_PROPERTY(QString date_format READ dateFormat WRITE setDateFormat NOTIFY dateFormatChanged) - Q_PROPERTY(QString date_format_short READ dateFormatShort WRITE setDateFormatShort NOTIFY dateFormatShortChanged) - Q_PROPERTY(QString lang_locale READ langLocale WRITE setLangLocale NOTIFY langLocaleChanged) - Q_PROPERTY(bool time_format_override READ timeFormatOverride WRITE setTimeFormatOverride NOTIFY timeFormatOverrideChanged) - Q_PROPERTY(bool date_format_override READ dateFormatOverride WRITE setDateFormatOverride NOTIFY dateFormatOverrideChanged) - Q_PROPERTY(bool use_system_language READ useSystemLanguage WRITE setUseSystemLanguage NOTIFY useSystemLanguageChanged) - -public: - LanguageSettingsObjectWrapper(QObject *parent); - QString language() const; - QString langLocale() const; - QString timeFormat() const; - QString dateFormat() const; - QString dateFormatShort() const; - bool timeFormatOverride() const; - bool dateFormatOverride() const; - bool useSystemLanguage() const; - -public slots: - void setLangLocale (const QString& value); - void setLanguage (const QString& value); - void setTimeFormat (const QString& value); - void setDateFormat (const QString& value); - void setDateFormatShort (const QString& value); - void setTimeFormatOverride (bool value); - void setDateFormatOverride (bool value); - void setUseSystemLanguage (bool value); -signals: - void languageChanged(const QString& value); - void langLocaleChanged(const QString& value); - void timeFormatChanged(const QString& value); - void dateFormatChanged(const QString& value); - void dateFormatShortChanged(const QString& value); - void timeFormatOverrideChanged(bool value); - void dateFormatOverrideChanged(bool value); - void useSystemLanguageChanged(bool value); - -private: - const QString group = QStringLiteral("Language"); -}; - -class SettingsObjectWrapper : public QObject { - Q_OBJECT - - Q_PROPERTY(qPrefTechnicalDetails* techical_details MEMBER techDetails CONSTANT) - Q_PROPERTY(PartialPressureGasSettings* pp_gas MEMBER pp_gas CONSTANT) - Q_PROPERTY(qPrefFacebook* facebook MEMBER facebook CONSTANT) - Q_PROPERTY(GeocodingPreferences* geocoding MEMBER geocoding CONSTANT) - Q_PROPERTY(qPrefProxy* proxy MEMBER proxy CONSTANT) - Q_PROPERTY(qPrefCloudStorage* cloud_storage MEMBER cloud_storage CONSTANT) - Q_PROPERTY(qPrefDivePlanner* planner MEMBER planner_settings CONSTANT) - Q_PROPERTY(qPrefUnits* units MEMBER unit_settings CONSTANT) - Q_PROPERTY(GeneralSettingsObjectWrapper* general MEMBER general_settings CONSTANT) - Q_PROPERTY(qPrefDisplay* display MEMBER display_settings CONSTANT) - Q_PROPERTY(LanguageSettingsObjectWrapper* language MEMBER language_settings CONSTANT) - Q_PROPERTY(qPrefAnimations* animation MEMBER animation_settings CONSTANT) - Q_PROPERTY(qPrefLocationService* Location MEMBER location_settings CONSTANT) - - Q_PROPERTY(qPrefUpdateManager* update MEMBER update_manager_settings CONSTANT) - Q_PROPERTY(qPrefDiveComputer* dive_computer MEMBER dive_computer_settings CONSTANT) -public: - static SettingsObjectWrapper *instance(); - - qPrefTechnicalDetails *techDetails; - PartialPressureGasSettings *pp_gas; - qPrefFacebook *facebook; - GeocodingPreferences *geocoding; - qPrefProxy *proxy; - qPrefCloudStorage *cloud_storage; - qPrefDivePlanner *planner_settings; - qPrefUnits *unit_settings; - GeneralSettingsObjectWrapper *general_settings; - qPrefDisplay *display_settings; - LanguageSettingsObjectWrapper *language_settings; - qPrefAnimations *animation_settings; - qPrefLocationService *location_settings; - qPrefUpdateManager *update_manager_settings; - qPrefDiveComputer *dive_computer_settings; - - void sync(); - void load(); -private: - SettingsObjectWrapper(QObject *parent = NULL); -}; - -#endif diff --git a/core/unix.c b/core/unix.c index 963d25ac5..a75bcd792 100644 --- a/core/unix.c +++ b/core/unix.c @@ -48,7 +48,8 @@ void subsurface_user_info(struct user_info *user) struct membuffer mb = {}; gethostname(hostname, sizeof(hostname)); put_format(&mb, "%s@%s", username, hostname); - user->email = mb_cstring(&mb); // 'email' is heap allocated + mb_cstring(&mb); + user->email = detach_buffer(&mb); } } diff --git a/desktop-widgets/configuredivecomputerdialog.cpp b/desktop-widgets/configuredivecomputerdialog.cpp index 137859388..cb7ec8371 100644 --- a/desktop-widgets/configuredivecomputerdialog.cpp +++ b/desktop-widgets/configuredivecomputerdialog.cpp @@ -3,7 +3,7 @@ #include "core/display.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefDiveComputer.h" #include "desktop-widgets/mainwindow.h" // For fill_computer_list, descriptorLookup #include "core/downloadfromdcthread.h" @@ -132,9 +132,8 @@ ConfigureDiveComputerDialog::ConfigureDiveComputerDialog(QWidget *parent) : QDia memset(&device_data, 0, sizeof(device_data)); fill_computer_list(); - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - if (!dc->device().isEmpty()) - ui.device->setEditText(dc->device()); + if (!qPrefDiveComputer::device().isEmpty()) + ui.device->setEditText(qPrefDiveComputer::device()); ui.DiveComputerList->setCurrentRow(0); on_DiveComputerList_currentRowChanged(0); @@ -912,11 +911,10 @@ void ConfigureDiveComputerDialog::getDeviceData() device_data.descriptor = descriptorLookup.value(selected_vendor + selected_product); device_data.deviceid = device_data.diveid = 0; - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - dc->set_device(device_data.devname); + qPrefDiveComputer::set_device(device_data.devname); #ifdef BT_SUPPORT if (ui.bluetoothMode && btDeviceSelectionDialog) - dc->set_device_name(btDeviceSelectionDialog->getSelectedDeviceName()); + qPrefDiveComputer::set_device_name(btDeviceSelectionDialog->getSelectedDeviceName()); #endif } diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp index bf01b0e9f..2dbbe3817 100644 --- a/desktop-widgets/divelogexportdialog.cpp +++ b/desktop-widgets/divelogexportdialog.cpp @@ -12,6 +12,7 @@ #include "desktop-widgets/subsurfacewebservices.h" #include "core/worldmap-save.h" #include "core/save-html.h" +#include "core/settings/qPrefDisplay.h" #include "desktop-widgets/mainwindow.h" #include "profile-widget/profilewidget2.h" #include "core/dive.h" // Allows access to helper functions in TeX export. @@ -121,15 +122,10 @@ void DiveLogExportDialog::on_buttonBox_accepted() { QString filename; QString stylesheet; - QSettings settings; QString lastDir = QDir::homePath(); - settings.beginGroup("FileDialog"); - if (settings.contains("LastDir")) { - if (QDir(settings.value("LastDir").toString()).exists()) - lastDir = settings.value("LastDir").toString(); - } - settings.endGroup(); + if (QDir(qPrefDisplay::lastDir()).exists()) + lastDir = qPrefDisplay::lastDir(); switch (ui->tabWidget->currentIndex()) { case 0: @@ -184,9 +180,7 @@ void DiveLogExportDialog::on_buttonBox_accepted() if (!filename.isNull() && !filename.isEmpty()) { // remember the last export path QFileInfo fileInfo(filename); - settings.beginGroup("FileDialog"); - settings.setValue("LastDir", fileInfo.dir().path()); - settings.endGroup(); + qPrefDisplay::set_lastDir(fileInfo.dir().path()); // the non XSLT exports are called directly above, the XSLT based ons are called here if (!stylesheet.isEmpty()) { future = QtConcurrent::run(export_dives_xslt, filename.toUtf8(), ui->exportSelected->isChecked(), ui->CSVUnits_2->currentIndex(), stylesheet.toUtf8()); @@ -351,10 +345,10 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o if (is_cylinder_used(dive, i) || (prefs.display_unused_tanks && dive->cylinder[i].type.description)){ put_format(&buf, "\\def\\cyl%cdescription{%s}\n", 'a' + i, dive->cylinder[i].type.description); - put_format(&buf, "\\def\\cyl%cgasname{%s}\n", 'a' + i, gasname(&dive->cylinder[i].gasmix)); - put_format(&buf, "\\def\\cyl%cmixO2{%.1f\\%%}\n", 'a' + i, get_o2(&dive->cylinder[i].gasmix)/10.0); - put_format(&buf, "\\def\\cyl%cmixHe{%.1f\\%%}\n", 'a' + i, get_he(&dive->cylinder[i].gasmix)/10.0); - put_format(&buf, "\\def\\cyl%cmixN2{%.1f\\%%}\n", 'a' + i, (100.0 - (get_o2(&dive->cylinder[i].gasmix)/10.0) - (get_he(&dive->cylinder[i].gasmix)/10.0))); + put_format(&buf, "\\def\\cyl%cgasname{%s}\n", 'a' + i, gasname(dive->cylinder[i].gasmix)); + put_format(&buf, "\\def\\cyl%cmixO2{%.1f\\%%}\n", 'a' + i, get_o2(dive->cylinder[i].gasmix)/10.0); + put_format(&buf, "\\def\\cyl%cmixHe{%.1f\\%%}\n", 'a' + i, get_he(dive->cylinder[i].gasmix)/10.0); + put_format(&buf, "\\def\\cyl%cmixN2{%.1f\\%%}\n", 'a' + i, (100.0 - (get_o2(dive->cylinder[i].gasmix)/10.0) - (get_he(dive->cylinder[i].gasmix)/10.0))); delta_p.mbar += dive->cylinder[i].start.mbar - dive->cylinder[i].end.mbar; put_format(&buf, "\\def\\cyl%cstartpress{%.1f\\pressureunit}\n", 'a' + i, get_pressure_units(dive->cylinder[i].start.mbar, &unit)/1.0); put_format(&buf, "\\def\\cyl%cendpress{%.1f\\pressureunit}\n", 'a' + i, get_pressure_units(dive->cylinder[i].end.mbar, &unit)/1.0); diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index e2f192f8e..63c3a97ec 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -4,7 +4,7 @@ #include "desktop-widgets/mainwindow.h" #include "core/planner.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefDivePlanner.h" #include "core/gettextfromc.h" #include "qt-models/cylindermodel.h" @@ -14,7 +14,6 @@ #include <QGraphicsSceneMouseEvent> #include <QMessageBox> -#include <QSettings> #include <QShortcut> #define TIME_INITIAL_MAX 30 diff --git a/desktop-widgets/diveshareexportdialog.cpp b/desktop-widgets/diveshareexportdialog.cpp index 2689eaca8..fc26e0ced 100644 --- a/desktop-widgets/diveshareexportdialog.cpp +++ b/desktop-widgets/diveshareexportdialog.cpp @@ -6,9 +6,9 @@ #include "desktop-widgets/subsurfacewebservices.h" #include "core/qthelper.h" #include "core/cloudstorage.h" +#include "core/settings/qPrefGeneral.h" #include <QDesktopServices> -#include <QSettings> DiveShareExportDialog::DiveShareExportDialog(QWidget *parent) : QDialog(parent), @@ -43,12 +43,11 @@ void DiveShareExportDialog::prepareDivesForUpload(bool selected) ui->frameConfigure->setVisible(true); ui->frameResults->setVisible(false); - QSettings settings; - if (settings.contains("diveshareExport/uid")) - ui->txtUID->setText(settings.value("diveshareExport/uid").toString()); + if (qPrefGeneral::diveshareExport_uid() != "") + ui->txtUID->setText(qPrefGeneral::diveshareExport_uid()); - if (settings.contains("diveshareExport/private")) - ui->chkPrivate->setChecked(settings.value("diveshareExport/private").toBool()); + if (qPrefGeneral::diveshareExport_private()) + ui->chkPrivate->setChecked(qPrefGeneral::diveshareExport_private()); show(); } @@ -108,9 +107,8 @@ void DiveShareExportDialog::finishedSlot() void DiveShareExportDialog::doUpload() { //Store current settings - QSettings settings; - settings.setValue("diveshareExport/uid", ui->txtUID->text()); - settings.setValue("diveshareExport/private", ui->chkPrivate->isChecked()); + qPrefGeneral::set_diveshareExport_uid(ui->txtUID->text()); + qPrefGeneral::set_diveshareExport_private(ui->chkPrivate->isChecked()); //Change UI into results mode ui->frameConfigure->setVisible(false); diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp index 4b5a0c917..4d86958af 100644 --- a/desktop-widgets/downloadfromdivecomputer.cpp +++ b/desktop-widgets/downloadfromdivecomputer.cpp @@ -2,7 +2,7 @@ #include "desktop-widgets/downloadfromdivecomputer.h" #include "core/display.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefDiveComputer.h" #include "core/subsurface-string.h" #include "core/uemis.h" #include "desktop-widgets/divelistview.h" @@ -71,12 +71,11 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : MainWindow *w = MainWindow::instance(); connect(&thread, SIGNAL(finished()), w, SLOT(refreshDisplay())); - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - if (!dc->vendor().isEmpty()) { - ui.vendor->setCurrentIndex(ui.vendor->findText(dc->vendor())); - productModel.setStringList(productList[dc->vendor()]); - if (!dc->product().isEmpty()) - ui.product->setCurrentIndex(ui.product->findText(dc->product())); + if (!qPrefDiveComputer::vendor().isEmpty()) { + ui.vendor->setCurrentIndex(ui.vendor->findText(qPrefDiveComputer::vendor())); + productModel.setStringList(productList[qPrefDiveComputer::vendor()]); + if (!qPrefDiveComputer::product().isEmpty()) + ui.product->setCurrentIndex(ui.product->findText(qPrefDiveComputer::product())); } updateState(INITIAL); @@ -84,16 +83,16 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget *parent, Qt::WindowFlags f) : ui.downloadCancelRetryButton->setEnabled(true); ui.downloadCancelRetryButton->setText(tr("Download")); - QString deviceText = dc->device(); + QString deviceText = qPrefDiveComputer::device(); #if defined(BT_SUPPORT) ui.bluetoothMode->setText(tr("Choose Bluetooth download mode")); - ui.bluetoothMode->setChecked(dc->download_mode() == DC_TRANSPORT_BLUETOOTH); + ui.bluetoothMode->setChecked(qPrefDiveComputer::download_mode() == DC_TRANSPORT_BLUETOOTH); btDeviceSelectionDialog = 0; connect(ui.bluetoothMode, SIGNAL(stateChanged(int)), this, SLOT(enableBluetoothMode(int))); connect(ui.chooseBluetoothDevice, SIGNAL(clicked()), this, SLOT(selectRemoteBluetoothDevice())); ui.chooseBluetoothDevice->setEnabled(ui.bluetoothMode->isChecked()); if (ui.bluetoothMode->isChecked()) - deviceText = BtDeviceSelectionDialog::formatDeviceText(dc->device(), dc->device_name()); + deviceText = BtDeviceSelectionDialog::formatDeviceText(qPrefDiveComputer::device(), qPrefDiveComputer::device_name()); #else ui.bluetoothMode->hide(); ui.chooseBluetoothDevice->hide(); @@ -288,9 +287,8 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() data->setDevName(btDeviceSelectionDialog->getSelectedDeviceAddress()); data->setDevBluetoothName(btDeviceSelectionDialog->getSelectedDeviceName()); } else { - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - data->setDevName(dc->device()); - data->setDevBluetoothName(dc->device_name()); + data->setDevName(qPrefDiveComputer::device()); + data->setDevBluetoothName(qPrefDiveComputer::device_name()); } } else // this breaks an "else if" across lines... not happy... @@ -313,13 +311,12 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked() data->setSaveLog(ui.logToFile->isChecked()); data->setSaveDump(ui.dumpToFile->isChecked()); - auto dc = SettingsObjectWrapper::instance()->dive_computer_settings; - dc->set_vendor(data->vendor()); - dc->set_product(data->product()); - dc->set_device(data->devName()); + qPrefDiveComputer::set_vendor(data->vendor()); + qPrefDiveComputer::set_product(data->product()); + qPrefDiveComputer::set_device(data->devName()); #if defined(BT_SUPPORT) - dc->set_download_mode(ui.bluetoothMode->isChecked() ? DC_TRANSPORT_BLUETOOTH : DC_TRANSPORT_SERIAL); + qPrefDiveComputer::set_download_mode(ui.bluetoothMode->isChecked() ? DC_TRANSPORT_BLUETOOTH : DC_TRANSPORT_SERIAL); #endif // before we start, remember where the dive_table ended diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index cc3bc7c54..f45f27b71 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -61,7 +61,6 @@ #include "core/color.h" #include "core/isocialnetworkintegration.h" #include "core/pluginmanager.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" #if defined(FBSUPPORT) #include "plugins/facebook/facebook_integration.h" @@ -284,47 +283,48 @@ MainWindow::MainWindow() : QMainWindow(), set_error_cb(&showErrorFromC); // Toolbar Connections related to the Profile Update - SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance(); - connect(ui.profCalcAllTissues, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcalltissues); - connect(ui.profCalcCeiling, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcceiling); - connect(ui.profDcCeiling, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_dcceiling); - connect(ui.profEad, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_ead); - connect(ui.profIncrement3m, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcceiling3m); - connect(ui.profMod, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_mod); - connect(ui.profNdl_tts, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_calcndltts); - connect(ui.profHR, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_hrgraph); - connect(ui.profRuler, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_rulergraph); - connect(ui.profSAC, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_show_sac); - connect(ui.profScaled, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_zoomed_plot); - connect(ui.profTogglePicture, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_show_pictures_in_profile); - connect(ui.profTankbar, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_tankbar); - connect(ui.profTissues, &QAction::triggered, sWrapper->techDetails, &qPrefTechnicalDetails::set_percentagegraph); + auto tec = qPrefTechnicalDetails::instance(); + connect(ui.profCalcAllTissues, &QAction::triggered, tec, &qPrefTechnicalDetails::set_calcalltissues); + connect(ui.profCalcCeiling, &QAction::triggered, tec, &qPrefTechnicalDetails::set_calcceiling); + connect(ui.profDcCeiling, &QAction::triggered, tec, &qPrefTechnicalDetails::set_dcceiling); + connect(ui.profEad, &QAction::triggered, tec, &qPrefTechnicalDetails::set_ead); + connect(ui.profIncrement3m, &QAction::triggered, tec, &qPrefTechnicalDetails::set_calcceiling3m); + connect(ui.profMod, &QAction::triggered, tec, &qPrefTechnicalDetails::set_mod); + connect(ui.profNdl_tts, &QAction::triggered, tec, &qPrefTechnicalDetails::set_calcndltts); + connect(ui.profHR, &QAction::triggered, tec, &qPrefTechnicalDetails::set_hrgraph); + connect(ui.profRuler, &QAction::triggered, tec, &qPrefTechnicalDetails::set_rulergraph); + connect(ui.profSAC, &QAction::triggered, tec, &qPrefTechnicalDetails::set_show_sac); + connect(ui.profScaled, &QAction::triggered, tec, &qPrefTechnicalDetails::set_zoomed_plot); + connect(ui.profTogglePicture, &QAction::triggered, tec, &qPrefTechnicalDetails::set_show_pictures_in_profile); + connect(ui.profTankbar, &QAction::triggered, tec, &qPrefTechnicalDetails::set_tankbar); + connect(ui.profTissues, &QAction::triggered, tec, &qPrefTechnicalDetails::set_percentagegraph); connect(ui.profTissues, &QAction::triggered, this, &MainWindow::unsetProfHR); connect(ui.profHR, &QAction::triggered, this, &MainWindow::unsetProfTissues); - connect(ui.profPhe, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPhe); - connect(ui.profPn2, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPn2); - connect(ui.profPO2, &QAction::triggered, sWrapper->pp_gas, &PartialPressureGasSettings::setShowPo2); - - connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcalltissues_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcceiling_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::dcceiling_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::ead_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcceiling3m_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::mod_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::calcndltts_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::hrgraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::rulergraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::show_sac_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::zoomed_plot_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::show_pictures_in_profile_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::tankbar_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->techDetails, &qPrefTechnicalDetails::percentagegraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot); - - connect(sWrapper->pp_gas, &PartialPressureGasSettings::showPheChanged, graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->pp_gas, &PartialPressureGasSettings::showPn2Changed, graphics(), &ProfileWidget2::actionRequestedReplot); - connect(sWrapper->pp_gas, &PartialPressureGasSettings::showPo2Changed, graphics(), &ProfileWidget2::actionRequestedReplot); + auto pp_gas = qPrefPartialPressureGas::instance(); + connect(ui.profPhe, &QAction::triggered, pp_gas, &qPrefPartialPressureGas::set_phe); + connect(ui.profPn2, &QAction::triggered, pp_gas, &qPrefPartialPressureGas::set_pn2); + connect(ui.profPO2, &QAction::triggered, pp_gas, &qPrefPartialPressureGas::set_po2); + + connect(tec, &qPrefTechnicalDetails::calcalltissues_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::calcceiling_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::dcceiling_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::ead_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::calcceiling3m_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::mod_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::calcndltts_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::hrgraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::rulergraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::show_sac_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::zoomed_plot_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::show_pictures_in_profile_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::tankbar_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + connect(tec, &qPrefTechnicalDetails::percentagegraph_changed , graphics(), &ProfileWidget2::actionRequestedReplot); + + connect(pp_gas, &qPrefPartialPressureGas::phe_changed, graphics(), &ProfileWidget2::actionRequestedReplot); + connect(pp_gas, &qPrefPartialPressureGas::pn2_changed, graphics(), &ProfileWidget2::actionRequestedReplot); + connect(pp_gas, &qPrefPartialPressureGas::po2_changed, graphics(), &ProfileWidget2::actionRequestedReplot); // now let's set up some connections connect(graphics(), &ProfileWidget2::enableToolbar ,this, &MainWindow::setEnabledToolbar); @@ -336,23 +336,23 @@ MainWindow::MainWindow() : QMainWindow(), connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), graphics(), SLOT(settingsChanged())); - ui.profCalcAllTissues->setChecked(sWrapper->techDetails->calcalltissues()); - ui.profCalcCeiling->setChecked(sWrapper->techDetails->calcceiling()); - ui.profDcCeiling->setChecked(sWrapper->techDetails->dcceiling()); - ui.profEad->setChecked(sWrapper->techDetails->ead()); - ui.profIncrement3m->setChecked(sWrapper->techDetails->calcceiling3m()); - ui.profMod->setChecked(sWrapper->techDetails->mod()); - ui.profNdl_tts->setChecked(sWrapper->techDetails->calcndltts()); - ui.profPhe->setChecked(sWrapper->pp_gas->showPhe()); - ui.profPn2->setChecked(sWrapper->pp_gas->showPn2()); - ui.profPO2->setChecked(sWrapper->pp_gas->showPo2()); - ui.profHR->setChecked(sWrapper->techDetails->hrgraph()); - ui.profRuler->setChecked(sWrapper->techDetails->rulergraph()); - ui.profSAC->setChecked(sWrapper->techDetails->show_sac()); - ui.profTogglePicture->setChecked(sWrapper->techDetails->show_pictures_in_profile()); - ui.profTankbar->setChecked(sWrapper->techDetails->tankbar()); - ui.profTissues->setChecked(sWrapper->techDetails->percentagegraph()); - ui.profScaled->setChecked(sWrapper->techDetails->zoomed_plot()); + ui.profCalcAllTissues->setChecked(qPrefTechnicalDetails::calcalltissues()); + ui.profCalcCeiling->setChecked(qPrefTechnicalDetails::calcceiling()); + ui.profDcCeiling->setChecked(qPrefTechnicalDetails::dcceiling()); + ui.profEad->setChecked(qPrefTechnicalDetails::ead()); + ui.profIncrement3m->setChecked(qPrefTechnicalDetails::calcceiling3m()); + ui.profMod->setChecked(qPrefTechnicalDetails::mod()); + ui.profNdl_tts->setChecked(qPrefTechnicalDetails::calcndltts()); + ui.profPhe->setChecked(pp_gas->phe()); + ui.profPn2->setChecked(pp_gas->pn2()); + ui.profPO2->setChecked(pp_gas->po2()); + ui.profHR->setChecked(qPrefTechnicalDetails::hrgraph()); + ui.profRuler->setChecked(qPrefTechnicalDetails::rulergraph()); + ui.profSAC->setChecked(qPrefTechnicalDetails::show_sac()); + ui.profTogglePicture->setChecked(qPrefTechnicalDetails::show_pictures_in_profile()); + ui.profTankbar->setChecked(qPrefTechnicalDetails::tankbar()); + ui.profTissues->setChecked(qPrefTechnicalDetails::percentagegraph()); + ui.profScaled->setChecked(qPrefTechnicalDetails::zoomed_plot()); // full screen support is buggy on Windows and Ubuntu. // require the FULLSCREEN_SUPPORT macro to enable it! @@ -549,13 +549,10 @@ void MainWindow::on_actionNew_triggered() static QString lastUsedDir() { - QSettings settings; QString lastDir = QDir::homePath(); - settings.beginGroup("FileDialog"); - if (settings.contains("LastDir")) - if (QDir(settings.value("LastDir").toString()).exists()) - lastDir = settings.value("LastDir").toString(); + if (QDir(qPrefDisplay::lastDir()).exists()) + lastDir = qPrefDisplay::lastDir(); return lastDir; } @@ -620,7 +617,7 @@ void MainWindow::on_actionCloudstorageopen_triggered() showProgressBar(); QByteArray fileNamePtr = QFile::encodeName(filename); - if (!parse_file(fileNamePtr.data())) + if (!parse_file(fileNamePtr.data(), &dive_table)) setCurrentFile(fileNamePtr.data()); process_dives(false, false); hideProgressBar(); @@ -773,9 +770,7 @@ void MainWindow::on_actionClose_triggered() void MainWindow::updateLastUsedDir(const QString &dir) { - QSettings s; - s.beginGroup("FileDialog"); - s.setValue("LastDir", dir); + qPrefDisplay::set_lastDir(dir); } void MainWindow::on_actionPrint_triggered() @@ -1187,12 +1182,10 @@ void MainWindow::on_actionViewAll_triggered() listGlobeSizes.append(lrint(appW * 0.3)); } - QSettings settings; - settings.beginGroup("MainWindow"); - if (settings.value("mainSplitter").isValid()) { - ui.mainSplitter->restoreState(settings.value("mainSplitter").toByteArray()); - ui.topSplitter->restoreState(settings.value("topSplitter").toByteArray()); - ui.bottomSplitter->restoreState(settings.value("bottomSplitter").toByteArray()); + if (qPrefDisplay::mainSplitter() != "") { + ui.mainSplitter->restoreState(qPrefDisplay::mainSplitter()); + ui.topSplitter->restoreState(qPrefDisplay::topSplitter()); + ui.bottomSplitter->restoreState(qPrefDisplay::bottomSplitter()); if (ui.mainSplitter->sizes().first() == 0 || ui.mainSplitter->sizes().last() == 0) ui.mainSplitter->setSizes(mainSizes); if (ui.topSplitter->sizes().first() == 0 || ui.topSplitter->sizes().last() == 0) @@ -1225,10 +1218,8 @@ void MainWindow::enterEditState() int appW = qApp->desktop()->size().width(); QList<int> infoProfileSizes { (int)lrint(appW * 0.3), (int)lrint(appW * 0.7) }; - QSettings settings; - settings.beginGroup("MainWindow"); - if (settings.value("mainSplitter").isValid()) { - ui.topSplitter->restoreState(settings.value("topSplitter").toByteArray()); + if (qPrefDisplay::mainSplitter() != "") { + ui.topSplitter->restoreState(qPrefDisplay::topSplitter()); if (ui.topSplitter->sizes().first() == 0 || ui.topSplitter->sizes().last() == 0) ui.topSplitter->setSizes(infoProfileSizes); } else { @@ -1278,11 +1269,9 @@ void MainWindow::beginChangeState(CurrentState s) void MainWindow::saveSplitterSizes() { - QSettings settings; - settings.beginGroup("MainWindow"); - settings.setValue("mainSplitter", ui.mainSplitter->saveState()); - settings.setValue("topSplitter", ui.topSplitter->saveState()); - settings.setValue("bottomSplitter", ui.bottomSplitter->saveState()); + qPrefDisplay::set_mainSplitter(ui.mainSplitter->saveState()); + qPrefDisplay::set_topSplitter(ui.topSplitter->saveState()); + qPrefDisplay::set_bottomSplitter(ui.bottomSplitter->saveState()); } void MainWindow::on_actionPreviousDC_triggered() @@ -1469,17 +1458,14 @@ bool MainWindow::askSaveChanges() void MainWindow::initialUiSetup() { - QSettings settings; - settings.beginGroup("MainWindow"); - if (settings.value("maximized", isMaximized()).value<bool>()) { + if (qPrefDisplay::maximized()) { showMaximized(); } else { - restoreGeometry(settings.value("geometry").toByteArray()); - restoreState(settings.value("windowState", 0).toByteArray()); + restoreGeometry(qPrefDisplay::geometry()); + restoreState(qPrefDisplay::windowState()); } - enterState((CurrentState)settings.value("lastState", 0).toInt()); - settings.endGroup(); + enterState((CurrentState)qPrefDisplay::lastState()); show(); } @@ -1511,7 +1497,7 @@ void MainWindow::checkSurvey() // wait a week for production versions, but not at all for non-tagged builds int waitTime = 7; QDate firstUse42 = s.value("FirstUse42").toDate(); - if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && !s.contains("SurveyDone"))) { + if (run_survey || (firstUse42.daysTo(QDate().currentDate()) > waitTime && qPrefDisplay::UserSurvey() == "")) { if (!survey) survey = new UserSurvey(this); survey->show(); @@ -1521,16 +1507,12 @@ void MainWindow::checkSurvey() void MainWindow::writeSettings() { - QSettings settings; - - settings.beginGroup("MainWindow"); - settings.setValue("geometry", saveGeometry()); - settings.setValue("windowState", saveState()); - settings.setValue("maximized", isMaximized()); - settings.setValue("lastState", (int)state); + qPrefDisplay::set_geometry(saveGeometry()); + qPrefDisplay::set_windowState(saveState()); + qPrefDisplay::set_maximized(isMaximized()); + qPrefDisplay::set_lastState((int)state); if (state == VIEWALL) saveSplitterSizes(); - settings.endGroup(); } void MainWindow::closeEvent(QCloseEvent *event) @@ -1776,7 +1758,7 @@ void MainWindow::importFiles(const QStringList fileNames) for (int i = 0; i < fileNames.size(); ++i) { fileNamePtr = QFile::encodeName(fileNames.at(i)); - parse_file(fileNamePtr.data()); + parse_file(fileNamePtr.data(), &dive_table); } process_dives(true, false); refreshDisplay(); @@ -1823,7 +1805,7 @@ void MainWindow::loadFiles(const QStringList fileNames) showProgressBar(); for (int i = 0; i < fileNames.size(); ++i) { fileNamePtr = QFile::encodeName(fileNames.at(i)); - if (!parse_file(fileNamePtr.data())) { + if (!parse_file(fileNamePtr.data(), &dive_table)) { setCurrentFile(fileNamePtr.data()); addRecentFile(fileNamePtr, false); } @@ -1910,7 +1892,7 @@ void MainWindow::editCurrentDive() void MainWindow::turnOffNdlTts() { - SettingsObjectWrapper::instance()->techDetails->set_calcndltts(false); + qPrefTechnicalDetails::set_calcndltts(false); } #undef TOOLBOX_PREF_PROFILE @@ -2046,16 +2028,12 @@ void MainWindow::hideProgressBar() void MainWindow::unsetProfHR() { - SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance(); - ui.profHR->setChecked(false); - sWrapper->techDetails->set_hrgraph(false); + qPrefTechnicalDetails::set_hrgraph(false); } void MainWindow::unsetProfTissues() { - SettingsObjectWrapper *sWrapper = SettingsObjectWrapper::instance(); - ui.profTissues->setChecked(false); - sWrapper->techDetails->set_percentagegraph(false); + qPrefTechnicalDetails::set_percentagegraph(false); } diff --git a/desktop-widgets/mainwindow.h b/desktop-widgets/mainwindow.h index 06365a8e6..7bd33cbf0 100644 --- a/desktop-widgets/mainwindow.h +++ b/desktop-widgets/mainwindow.h @@ -27,7 +27,6 @@ class QItemSelection; class DiveListView; class MainTab; class QWebView; -class QSettings; class UpdateManager; class UserManual; class DivePlannerWidget; diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp index d76cc88cd..37410d2d6 100644 --- a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp +++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp @@ -27,7 +27,7 @@ #include "core/pref.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefFacebook.h" #include "ui_socialnetworksdialog.h" #include "ui_facebookconnectwidget.h" @@ -88,18 +88,16 @@ void FacebookManager::tryLogin(const QUrl& loginResponse) int to = result.indexOf("&expires_in"); QString securityToken = result.mid(from, to-from); - auto fb = qPrefFacebook::instance(); - fb->set_access_token(securityToken); + qPrefFacebook::set_access_token(securityToken); qCDebug(lcFacebook) << "Got securityToken" << securityToken; requestUserId(); } void FacebookManager::logout() { - auto fb = qPrefFacebook::instance(); - fb->set_access_token(QString()); - fb->set_user_id(QString()); - fb->set_album_id(QString()); + qPrefFacebook::set_access_token(QString()); + qPrefFacebook::set_user_id(QString()); + qPrefFacebook::set_album_id(QString()); emit justLoggedOut(true); } @@ -116,15 +114,14 @@ void FacebookManager::albumListReceived() QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender()); QJsonDocument albumsDoc = QJsonDocument::fromJson(reply->readAll()); QJsonArray albumObj = albumsDoc.object().value("data").toArray(); - auto fb = qPrefFacebook::instance(); reply->deleteLater(); foreach(const QJsonValue &v, albumObj){ QJsonObject obj = v.toObject(); if (obj.value("name").toString() == fbInfo.albumName) { - fb->set_album_id(obj.value("id").toString()); + qPrefFacebook::set_album_id(obj.value("id").toString()); qCDebug(lcFacebook) << "Album" << fbInfo.albumName << "already exists, using id" << obj.value("id").toString(); - emit albumIdReceived(fb->album_id()); + emit albumIdReceived(qPrefFacebook::album_id()); return; } } @@ -158,9 +155,8 @@ void FacebookManager::facebookAlbumCreated() if (album.contains("id")) { qCDebug(lcFacebook) << "Album" << fbInfo.albumName << "created successfully with id" << album.value("id").toString(); - auto fb = qPrefFacebook::instance(); - fb->set_album_id(album.value("id").toString()); - emit albumIdReceived(fb->album_id()); + qPrefFacebook::set_album_id(album.value("id").toString()); + emit albumIdReceived(qPrefFacebook::album_id()); return; } else { qCDebug(lcFacebook) << "It was not possible to create the album with name" << fbInfo.albumName; @@ -168,8 +164,7 @@ void FacebookManager::facebookAlbumCreated() // FIXME: we are lacking 'user_photos' facebook permission to create an album, // but we are able to upload the image to Facebook (album will be named 'Subsurface Photos') qCDebug(lcFacebook) << "But we are still able to upload data. Album name will be 'Subsurface Photos'"; - auto fb = qPrefFacebook::instance(); - emit albumIdReceived(fb->album_id()); + emit albumIdReceived(qPrefFacebook::album_id()); } } @@ -189,7 +184,7 @@ void FacebookManager::userIdReceived() QJsonObject obj = jsonDoc.object(); if (obj.keys().contains("id")) { qCDebug(lcFacebook) << "User id requested successfully:" << obj.value("id").toString(); - qPrefFacebook::instance()->set_user_id(obj.value("id").toString()); + qPrefFacebook::set_user_id(obj.value("id").toString()); emit sendMessage(tr("Facebook logged in successfully")); emit justLoggedIn(true); } else { diff --git a/desktop-widgets/preferences/preferences_defaults.cpp b/desktop-widgets/preferences/preferences_defaults.cpp index 4d8aef610..b8af84b91 100644 --- a/desktop-widgets/preferences/preferences_defaults.cpp +++ b/desktop-widgets/preferences/preferences_defaults.cpp @@ -2,7 +2,6 @@ #include "preferences_defaults.h" #include "ui_preferences_defaults.h" #include "core/dive.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" #include "core/settings/qPref.h" #include <QFileDialog> @@ -61,24 +60,24 @@ void PreferencesDefaults::on_extractVideoThumbnails_toggled(bool toggled) void PreferencesDefaults::refreshSettings() { - ui->font->setCurrentFont(QString(prefs.divelist_font)); - ui->fontsize->setValue(prefs.font_size); - ui->defaultfilename->setText(prefs.default_filename); - ui->noDefaultFile->setChecked(prefs.default_file_behavior == NO_DEFAULT_FILE); - ui->cloudDefaultFile->setChecked(prefs.default_file_behavior == CLOUD_DEFAULT_FILE); - ui->localDefaultFile->setChecked(prefs.default_file_behavior == LOCAL_DEFAULT_FILE); + ui->font->setCurrentFont(qPrefDisplay::divelist_font()); + ui->fontsize->setValue(qPrefDisplay::font_size()); + ui->defaultfilename->setText(qPrefGeneral::default_filename()); + ui->noDefaultFile->setChecked(qPrefGeneral::default_file_behavior() == NO_DEFAULT_FILE); + ui->cloudDefaultFile->setChecked(qPrefGeneral::default_file_behavior() == CLOUD_DEFAULT_FILE); + ui->localDefaultFile->setChecked(qPrefGeneral::default_file_behavior() == LOCAL_DEFAULT_FILE); ui->default_cylinder->clear(); for (int i = 0; tank_info[i].name != NULL && i < MAX_TANK_INFO; i++) { ui->default_cylinder->addItem(tank_info[i].name); - if (prefs.default_cylinder && strcmp(tank_info[i].name, prefs.default_cylinder) == 0) + if (qPrefGeneral::default_cylinder() == tank_info[i].name) ui->default_cylinder->setCurrentIndex(i); } - ui->displayinvalid->setChecked(prefs.display_invalid_dives); - ui->velocitySlider->setValue(prefs.animation_speed); - ui->btnUseDefaultFile->setChecked(prefs.use_default_file); + ui->displayinvalid->setChecked(qPrefDisplay::display_invalid_dives()); + ui->velocitySlider->setValue(qPrefDisplay::animation_speed()); + ui->btnUseDefaultFile->setChecked(qPrefGeneral::use_default_file()); - if (prefs.cloud_verification_status == qPref::CS_VERIFIED) { + if (qPrefCloudStorage::cloud_verification_status() == qPref::CS_VERIFIED) { ui->cloudDefaultFile->setEnabled(true); } else { if (ui->cloudDefaultFile->isChecked()) @@ -86,40 +85,37 @@ void PreferencesDefaults::refreshSettings() ui->cloudDefaultFile->setEnabled(false); } - ui->defaultfilename->setEnabled(prefs.default_file_behavior == LOCAL_DEFAULT_FILE); - ui->btnUseDefaultFile->setEnabled(prefs.default_file_behavior == LOCAL_DEFAULT_FILE); - ui->chooseFile->setEnabled(prefs.default_file_behavior == LOCAL_DEFAULT_FILE); + ui->defaultfilename->setEnabled(qPrefGeneral::default_file_behavior() == LOCAL_DEFAULT_FILE); + ui->btnUseDefaultFile->setEnabled(qPrefGeneral::default_file_behavior() == LOCAL_DEFAULT_FILE); + ui->chooseFile->setEnabled(qPrefGeneral::default_file_behavior() == LOCAL_DEFAULT_FILE); - ui->videoThumbnailPosition->setEnabled(prefs.extract_video_thumbnails); - ui->ffmpegExecutable->setEnabled(prefs.extract_video_thumbnails); - ui->ffmpegFile->setEnabled(prefs.extract_video_thumbnails); + ui->videoThumbnailPosition->setEnabled(qPrefGeneral::extract_video_thumbnails()); + ui->ffmpegExecutable->setEnabled(qPrefGeneral::extract_video_thumbnails()); + ui->ffmpegFile->setEnabled(qPrefGeneral::extract_video_thumbnails()); - ui->extractVideoThumbnails->setChecked(prefs.extract_video_thumbnails); - ui->videoThumbnailPosition->setValue(prefs.extract_video_thumbnails_position); - ui->ffmpegExecutable->setText(prefs.ffmpeg_executable); + ui->extractVideoThumbnails->setChecked(qPrefGeneral::extract_video_thumbnails()); + ui->videoThumbnailPosition->setValue(qPrefGeneral::extract_video_thumbnails_position()); + ui->ffmpegExecutable->setText(qPrefGeneral::ffmpeg_executable()); } void PreferencesDefaults::syncSettings() { - auto general = SettingsObjectWrapper::instance()->general_settings; - general->setDefaultFilename(ui->defaultfilename->text()); - general->setDefaultCylinder(ui->default_cylinder->currentText()); - general->setUseDefaultFile(ui->btnUseDefaultFile->isChecked()); + auto general = qPrefGeneral::instance(); + general->set_default_filename(ui->defaultfilename->text()); + general->set_default_cylinder(ui->default_cylinder->currentText()); + general->set_use_default_file(ui->btnUseDefaultFile->isChecked()); if (ui->noDefaultFile->isChecked()) - general->setDefaultFileBehavior(NO_DEFAULT_FILE); + general->set_default_file_behavior(NO_DEFAULT_FILE); else if (ui->localDefaultFile->isChecked()) - general->setDefaultFileBehavior(LOCAL_DEFAULT_FILE); + general->set_default_file_behavior(LOCAL_DEFAULT_FILE); else if (ui->cloudDefaultFile->isChecked()) - general->setDefaultFileBehavior(CLOUD_DEFAULT_FILE); - general->setExtractVideoThumbnails(ui->extractVideoThumbnails->isChecked()); - general->setExtractVideoThumbnailsPosition(ui->videoThumbnailPosition->value()); - general->setFfmpegExecutable(ui->ffmpegExecutable->text()); - - auto display = qPrefDisplay::instance(); - display->set_divelist_font(ui->font->currentFont().toString()); - display->set_font_size(ui->fontsize->value()); - display->set_display_invalid_dives(ui->displayinvalid->isChecked()); - - auto animation = qPrefAnimations::instance(); - animation->set_animation_speed(ui->velocitySlider->value()); + general->set_default_file_behavior(CLOUD_DEFAULT_FILE); + general->set_extract_video_thumbnails(ui->extractVideoThumbnails->isChecked()); + general->set_extract_video_thumbnails_position(ui->videoThumbnailPosition->value()); + general->set_ffmpeg_executable(ui->ffmpegExecutable->text()); + + qPrefDisplay::set_divelist_font(ui->font->currentFont().toString()); + qPrefDisplay::set_font_size(ui->fontsize->value()); + qPrefDisplay::set_display_invalid_dives(ui->displayinvalid->isChecked()); + qPrefDisplay::set_animation_speed(ui->velocitySlider->value()); } diff --git a/desktop-widgets/preferences/preferences_georeference.cpp b/desktop-widgets/preferences/preferences_georeference.cpp index cb75cb646..40196e44f 100644 --- a/desktop-widgets/preferences/preferences_georeference.cpp +++ b/desktop-widgets/preferences/preferences_georeference.cpp @@ -2,7 +2,7 @@ #include "preferences_georeference.h" #include "ui_preferences_georeference.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefGeocoding.h" #include "qt-models/divelocationmodel.h" #include <ctime> @@ -30,8 +30,7 @@ void PreferencesGeoreference::refreshSettings() void PreferencesGeoreference::syncSettings() { - auto geocoding = SettingsObjectWrapper::instance()->geocoding; - geocoding->setFirstTaxonomyCategory((taxonomy_category) ui->first_item->currentIndex()); - geocoding->setSecondTaxonomyCategory((taxonomy_category) ui->second_item->currentIndex()); - geocoding->setThirdTaxonomyCategory((taxonomy_category) ui->third_item->currentIndex()); + qPrefGeocoding::set_first_taxonomy_category((taxonomy_category) ui->first_item->currentIndex()); + qPrefGeocoding::set_second_taxonomy_category((taxonomy_category) ui->second_item->currentIndex()); + qPrefGeocoding::set_third_taxonomy_category((taxonomy_category) ui->third_item->currentIndex()); } diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index 6ddd7250a..29b749b4e 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -1,7 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 #include "preferences_graph.h" #include "ui_preferences_graph.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefGeneral.h" +#include "core/settings/qPrefTechnicalDetails.h" +#include "core/settings/qPrefPartialPressureGas.h" #include <QMessageBox> #include "qt-models/models.h" @@ -52,32 +54,29 @@ void PreferencesGraph::refreshSettings() void PreferencesGraph::syncSettings() { - auto general = SettingsObjectWrapper::instance()->general_settings; - general->setDefaultSetPoint(lrint(ui->defaultSetpoint->value() * 1000.0)); - general->setO2Consumption(lrint(ui->psro2rate->value() *1000.0)); - general->setPscrRatio(lrint(1000.0 / ui->pscrfactor->value())); - general->setAutoRecalculateThumbnails(ui->auto_recalculate_thumbnails->isChecked()); + qPrefGeneral::set_defaultsetpoint(lrint(ui->defaultSetpoint->value() * 1000.0)); + qPrefGeneral::set_o2consumption(lrint(ui->psro2rate->value() *1000.0)); + qPrefGeneral::set_pscr_ratio(lrint(1000.0 / ui->pscrfactor->value())); + qPrefGeneral::set_auto_recalculate_thumbnails(ui->auto_recalculate_thumbnails->isChecked()); - auto pp_gas = SettingsObjectWrapper::instance()->pp_gas; - pp_gas->setPheThreshold(ui->pheThreshold->value()); - pp_gas->setPo2ThresholdMax(ui->po2ThresholdMax->value()); - pp_gas->setPo2ThresholdMin(ui->po2ThresholdMin->value()); - pp_gas->setPn2Threshold(ui->pn2Threshold->value()); + qPrefPartialPressureGas::set_phe_threshold(ui->pheThreshold->value()); + qPrefPartialPressureGas::set_po2_threshold_max(ui->po2ThresholdMax->value()); + qPrefPartialPressureGas::set_po2_threshold_min(ui->po2ThresholdMin->value()); + qPrefPartialPressureGas::set_pn2_threshold(ui->pn2Threshold->value()); - auto tech = qPrefTechnicalDetails::instance(); - tech->set_modpO2(ui->maxpo2->value()); - tech->set_redceiling(ui->red_ceiling->isChecked()); + qPrefTechnicalDetails::set_modpO2(ui->maxpo2->value()); + qPrefTechnicalDetails::set_redceiling(ui->red_ceiling->isChecked()); prefs.planner_deco_mode = ui->buehlmann->isChecked() ? BUEHLMANN : VPMB; - tech->set_gflow(ui->gflow->value()); - tech->set_gfhigh(ui->gfhigh->value()); - tech->set_vpmb_conservatism(ui->vpmb_conservatism->value()); - tech->set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked()); - tech->set_show_ccr_sensors(ui->show_ccr_sensors->isChecked()); - tech->set_show_scr_ocpo2(ui->show_scr_ocpo2->isChecked()); - tech->set_display_unused_tanks(ui->display_unused_tanks->isChecked()); - tech->set_show_average_depth(ui->show_average_depth->isChecked()); - tech->set_show_icd(ui->show_icd->isChecked()); - tech->set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN); + qPrefTechnicalDetails::set_gflow(ui->gflow->value()); + qPrefTechnicalDetails::set_gfhigh(ui->gfhigh->value()); + qPrefTechnicalDetails::set_vpmb_conservatism(ui->vpmb_conservatism->value()); + qPrefTechnicalDetails::set_show_ccr_setpoint(ui->show_ccr_setpoint->isChecked()); + qPrefTechnicalDetails::set_show_ccr_sensors(ui->show_ccr_sensors->isChecked()); + qPrefTechnicalDetails::set_show_scr_ocpo2(ui->show_scr_ocpo2->isChecked()); + qPrefTechnicalDetails::set_display_unused_tanks(ui->display_unused_tanks->isChecked()); + qPrefTechnicalDetails::set_show_average_depth(ui->show_average_depth->isChecked()); + qPrefTechnicalDetails::set_show_icd(ui->show_icd->isChecked()); + qPrefTechnicalDetails::set_display_deco_mode(ui->vpmb->isChecked() ? VPMB : BUEHLMANN); } #define DANGER_GF (gf > 100) ? "* { color: red; }" : "" diff --git a/desktop-widgets/preferences/preferences_language.cpp b/desktop-widgets/preferences/preferences_language.cpp index e4a63ae9e..76763be14 100644 --- a/desktop-widgets/preferences/preferences_language.cpp +++ b/desktop-widgets/preferences/preferences_language.cpp @@ -2,7 +2,7 @@ #include "preferences_language.h" #include "ui_preferences_language.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefLanguage.h" #include <QApplication> #include <QMessageBox> @@ -81,16 +81,14 @@ void PreferencesLanguage::syncSettings() if (languages.count()) currentLocale = m->data(languages.first(),Qt::UserRole).toString(); - - auto lang = SettingsObjectWrapper::instance()->language_settings; - lang->setLanguage(currentText); - lang->setLangLocale(currentLocale); - lang->setUseSystemLanguage(ui->languageSystemDefault->isChecked()); - lang->setTimeFormatOverride(!ui->timeFormatSystemDefault->isChecked()); - lang->setDateFormatOverride(!ui->dateFormatSystemDefault->isChecked()); - lang->setTimeFormat(ui->timeFormatEntry->currentText()); - lang->setDateFormat(ui->dateFormatEntry->currentText()); - lang->setDateFormatShort(ui->shortDateFormatEntry->text()); + qPrefLanguage::set_language(currentText); + qPrefLanguage::set_lang_locale(currentLocale); + qPrefLanguage::set_use_system_language(ui->languageSystemDefault->isChecked()); + qPrefLanguage::set_time_format_override(!ui->timeFormatSystemDefault->isChecked()); + qPrefLanguage::set_date_format_override(!ui->dateFormatSystemDefault->isChecked()); + qPrefLanguage::set_time_format(ui->timeFormatEntry->currentText()); + qPrefLanguage::set_date_format(ui->dateFormatEntry->currentText()); + qPrefLanguage::set_date_format_short(ui->shortDateFormatEntry->text()); uiLanguage(NULL); QString qDateTimeWeb = tr("These will be used as is. This might not be what you intended.\nSee http://doc.qt.io/qt-5/qdatetime.html#toString"); diff --git a/desktop-widgets/preferences/preferences_network.cpp b/desktop-widgets/preferences/preferences_network.cpp index bb72bef19..cb827f578 100644 --- a/desktop-widgets/preferences/preferences_network.cpp +++ b/desktop-widgets/preferences/preferences_network.cpp @@ -4,7 +4,6 @@ #include "subsurfacewebservices.h" #include "core/cloudstorage.h" #include "core/dive.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" #include "core/settings/qPref.h" #include <QNetworkProxy> diff --git a/desktop-widgets/preferences/preferences_units.cpp b/desktop-widgets/preferences/preferences_units.cpp index 7985ffb0c..eaef36b39 100644 --- a/desktop-widgets/preferences/preferences_units.cpp +++ b/desktop-widgets/preferences/preferences_units.cpp @@ -2,7 +2,7 @@ #include "preferences_units.h" #include "ui_preferences_units.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefUnit.h" PreferencesUnits::PreferencesUnits(): AbstractPreferencesWidget(tr("Units"),QIcon(":units-icon"),1), ui(new Ui::PreferencesUnits()) { @@ -47,18 +47,17 @@ void PreferencesUnits::refreshSettings() void PreferencesUnits::syncSettings() { - auto units = SettingsObjectWrapper::instance()->unit_settings; QString unitSystem[] = {"metric", "imperial", "personal"}; short unitValue = ui->metric->isChecked() ? METRIC : (ui->imperial->isChecked() ? IMPERIAL : PERSONALIZE); - units->set_unit_system(unitSystem[unitValue]); - units->set_temperature(ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS); - units->set_length(ui->feet->isChecked() ? units::FEET : units::METERS); - units->set_pressure(ui->psi->isChecked() ? units::PSI : units::BAR); - units->set_volume(ui->cuft->isChecked() ? units::CUFT : units::LITER); - units->set_weight(ui->lbs->isChecked() ? units::LBS : units::KG); - units->set_vertical_speed_time(ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS); - units->set_coordinates_traditional(ui->gpsTraditional->isChecked()); - units->set_duration_units(ui->duration_mixed->isChecked() ? units::MIXED : (ui->duration_no_hours->isChecked() ? units::MINUTES_ONLY : units::ALWAYS_HOURS)); - units->set_show_units_table(ui->show_units_table->isChecked()); + qPrefUnits::set_unit_system(unitSystem[unitValue]); + qPrefUnits::set_temperature(ui->fahrenheit->isChecked() ? units::FAHRENHEIT : units::CELSIUS); + qPrefUnits::set_length(ui->feet->isChecked() ? units::FEET : units::METERS); + qPrefUnits::set_pressure(ui->psi->isChecked() ? units::PSI : units::BAR); + qPrefUnits::set_volume(ui->cuft->isChecked() ? units::CUFT : units::LITER); + qPrefUnits::set_weight(ui->lbs->isChecked() ? units::LBS : units::KG); + qPrefUnits::set_vertical_speed_time(ui->vertical_speed_minutes->isChecked() ? units::MINUTES : units::SECONDS); + qPrefUnits::set_coordinates_traditional(ui->gpsTraditional->isChecked()); + qPrefUnits::set_duration_units(ui->duration_mixed->isChecked() ? units::MIXED : (ui->duration_no_hours->isChecked() ? units::MINUTES_ONLY : units::ALWAYS_HOURS)); + qPrefUnits::set_show_units_table(ui->show_units_table->isChecked()); } diff --git a/desktop-widgets/preferences/preferencesdialog.cpp b/desktop-widgets/preferences/preferencesdialog.cpp index 49b1f87bd..3b16260d2 100644 --- a/desktop-widgets/preferences/preferencesdialog.cpp +++ b/desktop-widgets/preferences/preferencesdialog.cpp @@ -32,12 +32,6 @@ void PreferencesDialog::emitSettingsChanged() PreferencesDialog::PreferencesDialog() { - //FIXME: This looks wrong. - //QSettings s; - //s.beginGroup("GeneralSettings"); - //s.setValue("default_directory", system_default_directory()); - //s.endGroup(); - setWindowIcon(QIcon(":subsurface-icon")); pagesList = new QListWidget(); pagesStack = new QStackedWidget(); diff --git a/desktop-widgets/printer.cpp b/desktop-widgets/printer.cpp index 64acf81c0..780dce2ba 100644 --- a/desktop-widgets/printer.cpp +++ b/desktop-widgets/printer.cpp @@ -3,6 +3,7 @@ #include "templatelayout.h" #include "core/statistics.h" #include "core/qthelper.h" +#include "core/settings/qPrefDisplay.h" #include <algorithm> #include <QPainter> @@ -135,7 +136,7 @@ void Printer::render(int Pages = 0) // keep original preferences QPointer<ProfileWidget2> profile = MainWindow::instance()->graphics(); int profileFrameStyle = profile->frameStyle(); - int animationOriginal = prefs.animation_speed; + int animationOriginal = qPrefDisplay::animation_speed(); double fontScale = profile->getFontPrintScale(); double printFontScale = 1.0; @@ -143,7 +144,7 @@ void Printer::render(int Pages = 0) profile->setFrameStyle(QFrame::NoFrame); profile->setPrintMode(true, !printOptions->color_selected); profile->setToolTipVisibile(false); - prefs.animation_speed = 0; + qPrefDisplay::set_animation_speed(0); // render the Qwebview QPainter painter; @@ -201,7 +202,7 @@ void Printer::render(int Pages = 0) #else profile->resize(originalSize); #endif - prefs.animation_speed = animationOriginal; + qPrefDisplay::set_animation_speed(animationOriginal); //replot the dive after returning the settings profile->plotDive(0, true, true); diff --git a/desktop-widgets/subsurfacewebservices.cpp b/desktop-widgets/subsurfacewebservices.cpp index d1af7715d..4d795237c 100644 --- a/desktop-widgets/subsurfacewebservices.cpp +++ b/desktop-widgets/subsurfacewebservices.cpp @@ -986,7 +986,7 @@ void DivelogsDeWebServices::buttonClicked(QAbstractButton *button) break; } /* parse file and import dives */ - parse_file(QFile::encodeName(zipFile.fileName())); + parse_file(QFile::encodeName(zipFile.fileName()), &dive_table); process_dives(true, false); MainWindow::instance()->refreshDisplay(); diff --git a/desktop-widgets/tab-widgets/TabDiveInformation.cpp b/desktop-widgets/tab-widgets/TabDiveInformation.cpp index 09f180cb1..a4f8f455f 100644 --- a/desktop-widgets/tab-widgets/TabDiveInformation.cpp +++ b/desktop-widgets/tab-widgets/TabDiveInformation.cpp @@ -62,7 +62,7 @@ void TabDiveInformation::updateData() gaslist.append(separator); volumes.append(separator); SACs.append(separator); separator = "\n"; - gaslist.append(gasname(&displayed_dive.cylinder[i].gasmix)); + gaslist.append(gasname(displayed_dive.cylinder[i].gasmix)); if (!gases[i].mliter) continue; volumes.append(get_volume_string(gases[i], true)); diff --git a/desktop-widgets/updatemanager.cpp b/desktop-widgets/updatemanager.cpp index ccf70a67c..ee209474c 100644 --- a/desktop-widgets/updatemanager.cpp +++ b/desktop-widgets/updatemanager.cpp @@ -8,23 +8,21 @@ #include "core/version.h" #include "desktop-widgets/mainwindow.h" #include "core/cloudstorage.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefUpdateManager.h" UpdateManager::UpdateManager(QObject *parent) : QObject(parent), isAutomaticCheck(false) { - auto update_settings = qPrefUpdateManager::instance(); - - if (update_settings->dont_check_for_updates()) + if (qPrefUpdateManager::dont_check_for_updates()) return; - if (update_settings->last_version_used() == subsurface_git_version() && - update_settings->next_check() > QDate::currentDate()) + if (qPrefUpdateManager::last_version_used() == subsurface_git_version() && + qPrefUpdateManager::next_check() > QDate::currentDate()) return; - update_settings->set_last_version_used(subsurface_git_version()); - update_settings->set_next_check(QDate::currentDate().addDays(14)); + qPrefUpdateManager::set_last_version_used(subsurface_git_version()); + qPrefUpdateManager::set_next_check(QDate::currentDate().addDays(14)); checkForUpdates(true); } diff --git a/desktop-widgets/usersurvey.cpp b/desktop-widgets/usersurvey.cpp index 326a51f9e..fdf3e7f95 100644 --- a/desktop-widgets/usersurvey.cpp +++ b/desktop-widgets/usersurvey.cpp @@ -1,7 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <QShortcut> #include <QMessageBox> -#include <QSettings> #include "desktop-widgets/usersurvey.h" #include "ui_usersurvey.h" @@ -11,6 +10,7 @@ #include "core/qthelper.h" #include "core/subsurfacesysinfo.h" +#include "core/settings/qPrefDisplay.h" UserSurvey::UserSurvey(QWidget *parent) : QDialog(parent), ui(new Ui::UserSurvey) @@ -88,9 +88,7 @@ void UserSurvey::on_buttonBox_rejected() // nothing to do here, we'll just ask again the next time they start break; case QDialog::Rejected: - QSettings s; - s.beginGroup("UserSurvey"); - s.setValue("SurveyDone", "declined"); + qPrefDisplay::set_UserSurvey("declined"); break; } hide(); @@ -116,9 +114,7 @@ void UserSurvey::requestReceived() if (responseBody == "OK") { msgText = tr("Survey successfully submitted."); - QSettings s; - s.beginGroup("UserSurvey"); - s.setValue("SurveyDone", "submitted"); + qPrefDisplay::set_UserSurvey("submitted"); } else { msgText = tr("There was an error while trying to check for updates.<br/><br/>%1").arg(responseBody); msgbox.setIcon(QMessageBox::Warning); diff --git a/export-html.cpp b/export-html.cpp index 2371d5551..07159c16b 100644 --- a/export-html.cpp +++ b/export-html.cpp @@ -41,7 +41,7 @@ int main(int argc, char **argv) qDebug() << "need --source and --output"; exit(1); } - int ret = parse_file(qPrintable(source)); + int ret = parse_file(qPrintable(source, &dive_table)); if (ret) { fprintf(stderr, "parse_file returned %d\n", ret); exit(1); diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp index 76a3f5097..0b1f7cb2a 100644 --- a/map-widget/qmlmapwidgethelper.cpp +++ b/map-widget/qmlmapwidgethelper.cpp @@ -116,12 +116,13 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds) void MapWidgetHelper::reloadMapLocations() { - struct dive_site *ds; int idx; + struct dive *dive; QMap<QString, MapLocation *> locationNameMap; m_mapLocationModel->clear(); MapLocation *location; QVector<MapLocation *> locationList; + QVector<uint32_t> locationUuids; qreal latitude, longitude; if (displayed_dive_site.uuid && dive_site_has_gps_location(&displayed_dive_site)) { @@ -132,8 +133,11 @@ void MapWidgetHelper::reloadMapLocations() locationList.append(location); locationNameMap[QString(displayed_dive_site.name)] = location; } - for_each_dive_site(idx, ds) { - if (!dive_site_has_gps_location(ds) || ds->uuid == displayed_dive_site.uuid) + for_each_dive(idx, dive) { + if (dive->hidden_by_filter) + continue; + struct dive_site *ds = get_dive_site_for_dive(dive); + if (!dive_site_has_gps_location(ds) || ds->uuid == displayed_dive_site.uuid || locationUuids.contains(ds->uuid)) continue; latitude = ds->latitude.udeg * 0.000001; longitude = ds->longitude.udeg * 0.000001; @@ -149,6 +153,7 @@ void MapWidgetHelper::reloadMapLocations() } location = new MapLocation(ds->uuid, dsCoord, name); locationList.append(location); + locationUuids.append(ds->uuid); locationNameMap[name] = location; } m_mapLocationModel->addList(locationList); diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index d7a857f6f..45b588c93 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -10,6 +10,9 @@ import org.subsurfacedivelog.mobile 1.0 Kirigami.ScrollablePage { objectName: "Settings" id: settingsPage + property alias defaultCylinderModel: defaultCylinderBox.model + property alias defaultCylinderIndex: defaultCylinderBox.currentIndex + title: qsTr("Settings") background: Rectangle { color: subsurfaceTheme.backgroundColor } @@ -307,6 +310,41 @@ Kirigami.ScrollablePage { Layout.fillWidth: true } GridLayout { + id: defaultCylinder + columns: 2 + width: parent.width - Kirigami.Units.gridUnit + + Kirigami.Heading { + text: qsTr("Default Cylinder") + color: subsurfaceTheme.textColor + level: 4 + Layout.topMargin: Kirigami.Units.largeSpacing + Layout.bottomMargin: Kirigami.Units.largeSpacing / 2 + Layout.columnSpan: 2 + } + Controls.Label { + Layout.alignment: Qt.AlignRight + text: qsTr("Cylinder:") + font.pointSize: subsurfaceTheme.smallPointSize + } + Controls.ComboBox { + id: defaultCylinderBox + flat: true + inputMethodHints: Qt.ImhNoPredictiveText + Layout.fillWidth: true + onActivated: { + general.set_default_cylinder(defaultCylinderBox.currentText) + } + } + } + + Rectangle { + color: subsurfaceTheme.darkerPrimaryColor + height: 1 + opacity: 0.5 + Layout.fillWidth: true + } + GridLayout { id: developer columns: 2 width: parent.width - Kirigami.Units.gridUnit diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 6e9b98ce7..930740a93 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -27,6 +27,7 @@ Kirigami.ApplicationWindow { property alias locationServiceEnabled: manager.locationServiceEnabled property alias pluggedInDeviceName: manager.pluggedInDeviceName property alias showPin: prefs.showPin + property alias defaultCylinderIndex: settingsWindow.defaultCylinderIndex onNotificationTextChanged: { if (notificationText != "") { // there's a risk that we have a >5 second gap in update events; @@ -101,7 +102,7 @@ Kirigami.ApplicationWindow { detailsWindow.cylinderModel2 = manager.cylinderInit detailsWindow.cylinderModel3 = manager.cylinderInit detailsWindow.cylinderModel4 = manager.cylinderInit - detailsWindow.cylinderIndex0 = -1 + detailsWindow.cylinderIndex0 = general.default_cylinder == "" ? -1 : detailsWindow.cylinderModel0.indexOf(general.default_cylinder) detailsWindow.usedCyl = ["",] detailsWindow.weight = "" detailsWindow.usedGas = [] @@ -371,6 +372,8 @@ if you have network connectivity and want to sync your data to cloud storage."), text: qsTr("Settings") onTriggered: { globalDrawer.close() + settingsWindow.defaultCylinderModel = manager.cylinderInit + general.default_cylinder === "" ? defaultCylinderIndex = "-1" : defaultCylinderIndex = settingsWindow.defaultCylinderModel.indexOf(general.default_cylinder) stackView.push(settingsWindow) detailsWindow.endEditMode() } @@ -619,6 +622,10 @@ if you have network connectivity and want to sync your data to cloud storage."), visible: false } + SsrfGeneralPrefs { + id: general + } + onPluggedInDeviceNameChanged: { if (detailsWindow.state === 'edit' || detailsWindow.state === 'add') { /* we're in the middle of editing / adding a dive */ diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 5ede64152..91beb3c84 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -2,7 +2,6 @@ #include "qmlmanager.h" #include "qmlprefs.h" #include <QUrl> -#include <QSettings> #include <QDebug> #include <QNetworkAccessManager> #include <QAuthenticator> @@ -33,7 +32,7 @@ #include "core/downloadfromdcthread.h" #include "core/subsurface-string.h" #include "core/pref.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPref.h" #include "core/ssrf.h" @@ -253,10 +252,10 @@ void QMLManager::openLocalThenRemote(QString url) clear_dive_file_data(); setNotificationText(tr("Open local dive data file")); QByteArray fileNamePrt = QFile::encodeName(url); - bool glo = prefs.git_local_only; + bool glo = qPrefCloudStorage::git_local_only(); prefs.git_local_only = true; - int error = parse_file(fileNamePrt.data()); - prefs.git_local_only = glo; + int error = parse_file(fileNamePrt.data(), &dive_table); + qPrefCloudStorage::set_git_local_only(glo); if (error) { appendTextToLog(QStringLiteral("loading dives from cache failed %1").arg(error)); setNotificationText(tr("Opening local data file failed")); @@ -277,16 +276,16 @@ void QMLManager::openLocalThenRemote(QString url) if (QMLPrefs::instance()->credentialStatus() == qPref::CS_UNKNOWN) QMLPrefs::instance()->setCredentialStatus(qPref::CS_VERIFIED); prefs.unit_system = git_prefs.unit_system; - if (git_prefs.unit_system == IMPERIAL) + if (qPrefUnits::unit_system() == IMPERIAL) git_prefs.units = IMPERIAL_units; else if (git_prefs.unit_system == METRIC) git_prefs.units = SI_units; prefs.units = git_prefs.units; - prefs.tankbar = git_prefs.tankbar; - prefs.dcceiling = git_prefs.dcceiling; - prefs.show_ccr_setpoint = git_prefs.show_ccr_setpoint; - prefs.show_ccr_sensors = git_prefs.show_ccr_sensors; - prefs.pp_graphs.po2 = git_prefs.pp_graphs.po2; + qPrefTechnicalDetails::set_tankbar(git_prefs.tankbar); + qPrefTechnicalDetails::set_dcceiling(git_prefs.dcceiling); + qPrefTechnicalDetails::set_show_ccr_setpoint(git_prefs.show_ccr_setpoint); + qPrefTechnicalDetails::set_show_ccr_sensors(git_prefs.show_ccr_sensors); + qPrefPartialPressureGas::set_po2(git_prefs.pp_graphs.po2); process_dives(false, false); DiveListModel::instance()->clear(); DiveListModel::instance()->addAllDives(); @@ -299,11 +298,11 @@ void QMLManager::openLocalThenRemote(QString url) } if (QMLPrefs::instance()->oldStatus() == qPref::CS_NOCLOUD) { // if we switch to credentials from CS_NOCLOUD, we take things online temporarily - prefs.git_local_only = false; + qPrefCloudStorage::set_git_local_only(false); appendTextToLog(QStringLiteral("taking things online to be able to switch to cloud account")); } set_filename(fileNamePrt.data()); - if (prefs.git_local_only) { + if (qPrefCloudStorage::git_local_only()) { appendTextToLog(QStringLiteral("have cloud credentials, but user asked not to connect to network")); alreadySaving = false; } else { @@ -324,7 +323,7 @@ void QMLManager::updateAllGlobalLists() void QMLManager::mergeLocalRepo() { char *filename = NOCLOUD_LOCALSTORAGE; - parse_file(filename); + parse_file(filename, &dive_table); process_dives(true, false); } @@ -371,9 +370,9 @@ void QMLManager::copyAppLogToClipboard() void QMLManager::finishSetup() { // Initialize cloud credentials. - QMLPrefs::instance()->setCloudUserName(prefs.cloud_storage_email); - QMLPrefs::instance()->setCloudPassword(prefs.cloud_storage_password); - setSyncToCloud(!prefs.git_local_only); + QMLPrefs::instance()->setCloudUserName(qPrefCloudStorage::cloud_storage_email()); + QMLPrefs::instance()->setCloudPassword(qPrefCloudStorage::cloud_storage_password()); + setSyncToCloud(!qPrefCloudStorage::git_local_only()); QMLPrefs::instance()->setCredentialStatus((qPref::cloud_status) prefs.cloud_verification_status); // if the cloud credentials are valid, we should get the GPS Webservice ID as well QString url; @@ -389,7 +388,7 @@ void QMLManager::finishSetup() QMLPrefs::instance()->setCredentialStatus(qPref::CS_NOCLOUD); saveCloudCredentials(); appendTextToLog(tr("working in no-cloud mode")); - int error = parse_file(existing_filename); + int error = parse_file(existing_filename, &dive_table); if (error) { // we got an error loading the local file setNotificationText(tr("Error parsing local storage, giving up")); @@ -404,8 +403,8 @@ void QMLManager::finishSetup() appendTextToLog(tr("no cloud credentials")); setStartPageText(RED_FONT + tr("Please enter valid cloud credentials.") + END_FONT); } - QMLPrefs::instance()->setDistanceThreshold(prefs.distance_threshold); - QMLPrefs::instance()->setTimeThreshold(prefs.time_threshold / 60); + QMLPrefs::instance()->setDistanceThreshold(qPrefLocationService::distance_threshold()); + QMLPrefs::instance()->setTimeThreshold(qPrefLocationService::time_threshold() / 60); } QMLManager::~QMLManager() @@ -424,9 +423,8 @@ QMLManager *QMLManager::instance() void QMLManager::savePreferences() { - auto location = SettingsObjectWrapper::instance()->location_settings; - location->set_time_threshold(QMLPrefs::instance()->timeThreshold() * 60); - location->set_distance_threshold(QMLPrefs::instance()->distanceThreshold()); + qPrefLocationService::set_time_threshold(QMLPrefs::instance()->timeThreshold() * 60); + qPrefLocationService::set_distance_threshold(QMLPrefs::instance()->distanceThreshold()); } #define CLOUDURL QString(prefs.cloud_base_url) @@ -434,7 +432,6 @@ void QMLManager::savePreferences() void QMLManager::saveCloudCredentials() { - QSettings s; bool cloudCredentialsChanged = false; // make sure we only have letters, numbers, and +-_. in password and email address QRegularExpression regExp("^[a-zA-Z0-9@.+_-]+$"); @@ -453,11 +450,9 @@ void QMLManager::saveCloudCredentials() return; } } - s.beginGroup("CloudStorage"); - s.setValue("email", QMLPrefs::instance()->cloudUserName()); - s.setValue("password", QMLPrefs::instance()->cloudPassword()); - s.setValue("cloud_verification_status", QMLPrefs::instance()->credentialStatus()); - s.sync(); + qPrefCloudStorage::set_cloud_storage_email(QMLPrefs::instance()->cloudUserName()); + qPrefCloudStorage::set_cloud_storage_password(QMLPrefs::instance()->cloudPassword()); + qPrefCloudStorage::set_cloud_verification_status(QMLPrefs::instance()->credentialStatus()); if (!same_string(prefs.cloud_storage_email, qPrintable(QMLPrefs::instance()->cloudUserName()))) { free((void *)prefs.cloud_storage_email); @@ -638,9 +633,7 @@ void QMLManager::retrieveUserid() // overwrite the existing userid free((void *)prefs.userid); prefs.userid = copy_qstring(userid); - QSettings s; - s.setValue("subsurface_webservice_uid", prefs.userid); - s.sync(); + qPrefCloudStorage::set_userid(prefs.userid); } QMLPrefs::instance()->setCredentialStatus(qPref::CS_VERIFIED); setStartPageText(tr("Cloud credentials valid, loading dives...")); @@ -679,7 +672,7 @@ void QMLManager::loadDivesWithValidCredentials() error = git_load_dives(git, branch); } else { appendTextToLog(QString("didn't receive valid git repo, try again")); - error = parse_file(fileNamePrt.data()); + error = parse_file(fileNamePrt.data(), &dive_table); } if (!error) { report_error("filename is now %s", fileNamePrt.data()); @@ -1041,7 +1034,7 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q } // not sure what we'd do if there was more than one weight system // defined - for now just ignore that case - if (weightsystem_none((void *)&d->weightsystem[1])) { + if (weightsystem_none(&d->weightsystem[1])) { if (myDive->sumWeight() != weight) { diveChanged = true; d->weightsystem[0].weight.grams = parseWeightToGrams(weight); @@ -1210,9 +1203,9 @@ void QMLManager::openNoCloudRepo() if (git == dummy_git_repository) { git_create_local_repo(filename); set_filename(filename); - auto s = SettingsObjectWrapper::instance()->general_settings; - s->setDefaultFilename(filename); - s->setDefaultFileBehavior(LOCAL_DEFAULT_FILE); + auto s = qPrefGeneral::instance(); + s->set_default_filename(filename); + s->set_default_file_behavior(LOCAL_DEFAULT_FILE); } openLocalThenRemote(filename); @@ -1226,9 +1219,9 @@ void QMLManager::saveChangesLocal() char *filename = NOCLOUD_LOCALSTORAGE; git_create_local_repo(filename); set_filename(filename); - auto s = SettingsObjectWrapper::instance()->general_settings; - s->setDefaultFilename(filename); - s->setDefaultFileBehavior(LOCAL_DEFAULT_FILE); + auto s = qPrefGeneral::instance(); + s->set_default_filename(filename); + s->set_default_file_behavior(LOCAL_DEFAULT_FILE); } } else if (!m_loadFromCloud) { // this seems silly, but you need a common ancestor in the repository in @@ -1466,16 +1459,12 @@ void QMLManager::setVerboseEnabled(bool verboseMode) void QMLManager::syncLoadFromCloud() { - QSettings s; - QString cloudMarker = QLatin1Literal("loadFromCloud") + QString(prefs.cloud_storage_email); - m_loadFromCloud = s.contains(cloudMarker) && s.value(cloudMarker).toBool(); + m_loadFromCloud = qPrefCloudStorage::loadFromCloud(prefs.cloud_storage_email); } void QMLManager::setLoadFromCloud(bool done) { - QSettings s; - QString cloudMarker = QLatin1Literal("loadFromCloud") + QString(prefs.cloud_storage_email); - s.setValue(cloudMarker, done); + qPrefCloudStorage::set_loadFromCloud(prefs.cloud_storage_email, done); m_loadFromCloud = done; emit loadFromCloudChanged(); } @@ -1537,9 +1526,7 @@ void QMLManager::setSyncToCloud(bool status) { m_syncToCloud = status; prefs.git_local_only = !status; - QSettings s; - s.beginGroup("CloudStorage"); - s.setValue("git_local_only", prefs.git_local_only); + qPrefCloudStorage::set_git_local_only(prefs.git_local_only); emit syncToCloudChanged(); } @@ -1837,47 +1824,47 @@ void QMLManager::showDownloadPage(QString deviceString) .arg(productList["Atomic Aquatics"].indexOf("Cobalt")) .arg(connectionListModel.indexOf("USB device")); } - } else if (deviceString.contains("mVendorId=5267") && + } else if (deviceString.contains("mVendorId=5267") && // 0x1493 / 0x0030 deviceString.contains("mProductId=48")) { name = QString("%1;%2;%3") .arg(connectionListModel.indexOf("Suunto")) .arg(productList["Suunto"].indexOf("EON Steel")) .arg(connectionListModel.indexOf("USB device")); - } else if (deviceString.contains("mVendorId=5267") && + } else if (deviceString.contains("mVendorId=5267") && // 0x1493 / 0x0033 deviceString.contains("mProductId=51")) { name = QString("%1;%2;%3") .arg(connectionListModel.indexOf("Suunto")) .arg(productList["Suunto"].indexOf("EON Core")) .arg(connectionListModel.indexOf("USB device")); - } else if (deviceString.contains("mVendorId=11884") && + } else if (deviceString.contains("mVendorId=11884") && // 0x2e6c / 0x3201 deviceString.contains("mProductId=12801")) { name = QString("%1;%2;%3") .arg(connectionListModel.indexOf("Scubapro")) .arg(productList["Suunto"].indexOf("G2")) .arg(connectionListModel.indexOf("USB device")); - } else if (deviceString.contains("mVendorId=49745") && + } else if (deviceString.contains("mVendorId=49745") && // 0xc251 / 0x2006 deviceString.contains("mProductId=8198")) { name = QString("%1;%2;%3") .arg(connectionListModel.indexOf("Scubapro")) .arg(productList["Suunto"].indexOf("Aladin Square")) .arg(connectionListModel.indexOf("USB device")); - } else if (deviceString.contains("mVendorId=1027") && + } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0x6001,0x6010,0x6011,0x6015 (deviceString.contains("mProductId=24577") || deviceString.contains("mProductId=24592") || deviceString.contains("mProductId=24593") || deviceString.contains("mProductId=24597"))) { name = QString("-1;-1;%1").arg(connectionListModel.indexOf("FTDI")); - } else if (deviceString.contains("mVendorId=1027") && + } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0xf460 deviceString.contains("mProductId=62560")) { name = QString("%1;-1;%2") .arg(vendorList.indexOf("Oceanic")) .arg(connectionListModel.indexOf("FTDI")); - } else if (deviceString.contains("mVendorId=1027") && + } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0xf680 deviceString.contains("mProductId=63104")) { name = QString("%1;-1;%2") .arg(vendorList.indexOf("Suunto")) .arg(connectionListModel.indexOf("FTDI")); - } else if (deviceString.contains("mVendorId=1027") && + } else if (deviceString.contains("mVendorId=1027") && // 0x0403 / 0x87d0 deviceString.contains("mProductId=34768")) { name = QString("%1;-1;%2") .arg(vendorList.indexOf("Cressi")) diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp index 03f51f765..145ddf91f 100644 --- a/mobile-widgets/qmlprefs.cpp +++ b/mobile-widgets/qmlprefs.cpp @@ -3,7 +3,7 @@ #include "qmlmanager.h" #include "core/membuffer.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPref.h" #include "core/gpslocation.h" @@ -143,16 +143,12 @@ void QMLPrefs::setTimeThreshold(int time) const QString QMLPrefs::theme() const { - QSettings s; - s.beginGroup("Theme"); - return s.value("currentTheme", "Blue").toString(); + return qPrefDisplay::theme(); } void QMLPrefs::setTheme(QString theme) { - QSettings s; - s.beginGroup("Theme"); - s.setValue("currentTheme", theme); + qPrefDisplay::set_theme(theme); emit themeChanged(); } @@ -175,14 +171,11 @@ void QMLPrefs::cancelCredentialsPinSetup() * Notice that this function is also used to switch to a different * cloud account, so the name is not perfect. */ - QSettings s; setCredentialStatus(qPref::CS_UNKNOWN); - s.beginGroup("CloudStorage"); - s.setValue("email", m_cloudUserName); - s.setValue("password", m_cloudPassword); - s.setValue("cloud_verification_status", m_credentialStatus); - s.sync(); + qPrefCloudStorage::set_cloud_storage_email(m_cloudUserName); + qPrefCloudStorage::set_cloud_storage_password(m_cloudPassword); + qPrefCloudStorage::set_cloud_verification_status(m_credentialStatus); QMLManager::instance()->setStartPageText(tr("Starting...")); setShowPin(false); diff --git a/packaging/ios/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile.pro index 4107def06..352d3afa1 100644 --- a/packaging/ios/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile.pro @@ -78,13 +78,16 @@ SOURCES += ../../subsurface-mobile-main.cpp \ ../../core/connectionlistmodel.cpp \ ../../core/qt-ble.cpp \ ../../core/settings/qPref.cpp \ - ../../core/settings/qPrefAnimations.cpp \ ../../core/settings/qPrefCloudStorage.cpp \ ../../core/settings/qPrefDisplay.cpp \ ../../core/settings/qPrefDiveComputer.cpp \ ../../core/settings/qPrefDivePlanner.cpp \ ../../core/settings/qPrefFacebook.cpp \ + ../../core/settings/qPrefGeneral.cpp \ + ../../core/settings/qPrefGeocoding.cpp \ + ../../core/settings/qPrefLanguage.cpp \ ../../core/settings/qPrefLocationService.cpp \ + ../../core/settings/qPrefPartialPressureGas.cpp \ ../../core/settings/qPrefPrivate.cpp \ ../../core/settings/qPrefProxy.cpp \ ../../core/settings/qPrefTechnicalDetails.cpp \ @@ -92,7 +95,6 @@ SOURCES += ../../subsurface-mobile-main.cpp \ ../../core/settings/qPrefUpdateManager.cpp \ ../../core/subsurface-qt/CylinderObjectHelper.cpp \ ../../core/subsurface-qt/DiveObjectHelper.cpp \ - ../../core/subsurface-qt/SettingsObjectWrapper.cpp \ ../../mobile-widgets/qmlmanager.cpp \ ../../mobile-widgets/qmlprefs.cpp \ ../../qt-models/divelistmodel.cpp \ @@ -180,7 +182,6 @@ HEADERS += \ ../../core/membuffer.h \ ../../core/metrics.h \ ../../core/pluginmanager.h \ - ../../core/prefs-macros.h \ ../../core/qt-gui.h \ ../../core/sha1.h \ ../../core/strndup.h \ @@ -197,13 +198,16 @@ HEADERS += \ ../../core/connectionlistmodel.h \ ../../core/qt-ble.h \ ../../core/settings/qPref.h \ - ../../core/settings/qPrefAnimations.h \ ../../core/settings/qPrefCloudStorage.h \ ../../core/settings/qPrefDisplay.h \ ../../core/settings/qPrefDiveComputer.h \ ../../core/settings/qPrefDivePlanner.h \ ../../core/settings/qPrefFacebook.h \ + ../../core/settings/qPrefGeneral.h \ + ../../core/settings/qPrefGeocoding.h \ + ../../core/settings/qPrefLanguage.h \ ../../core/settings/qPrefLocationService.h \ + ../../core/settings/qPrefPartialPressureGas.h \ ../../core/settings/qPrefPrivate.h \ ../../core/settings/qPrefProxy.h \ ../../core/settings/qPrefTechnicalDetails.h \ @@ -211,7 +215,6 @@ HEADERS += \ ../../core/settings/qPrefUpdateManager.h \ ../../core/subsurface-qt/CylinderObjectHelper.h \ ../../core/subsurface-qt/DiveObjectHelper.h \ - ../../core/subsurface-qt/SettingsObjectWrapper.h \ ../../mobile-widgets/qmlmanager.h \ ../../mobile-widgets/qmlprefs.h \ ../../map-widget/qmlmapwidgethelper.h \ diff --git a/profile-widget/animationfunctions.cpp b/profile-widget/animationfunctions.cpp index 13534bf41..89779e3a8 100644 --- a/profile-widget/animationfunctions.cpp +++ b/profile-widget/animationfunctions.cpp @@ -1,13 +1,14 @@ // SPDX-License-Identifier: GPL-2.0 #include "profile-widget/animationfunctions.h" #include "core/pref.h" +#include "core/settings/qPrefDisplay.h" #include <QPropertyAnimation> namespace Animations { void hide(QObject *obj) { - if (prefs.animation_speed != 0) { + if (qPrefDisplay::animation_speed() != 0) { QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity"); animation->setStartValue(1); animation->setEndValue(0); @@ -19,7 +20,7 @@ namespace Animations { void show(QObject *obj) { - if (prefs.animation_speed != 0) { + if (qPrefDisplay::animation_speed() != 0) { QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity"); animation->setStartValue(0); animation->setEndValue(1); @@ -31,7 +32,7 @@ namespace Animations { void animDelete(QObject *obj) { - if (prefs.animation_speed != 0) { + if (qPrefDisplay::animation_speed() != 0) { QPropertyAnimation *animation = new QPropertyAnimation(obj, "opacity"); obj->connect(animation, &QPropertyAnimation::finished, &QObject::deleteLater); animation->setStartValue(1); @@ -44,7 +45,7 @@ namespace Animations { void moveTo(QObject *obj, qreal x, qreal y) { - if (prefs.animation_speed != 0) { + if (qPrefDisplay::animation_speed() != 0) { QPropertyAnimation *animation = new QPropertyAnimation(obj, "pos"); animation->setDuration(prefs.animation_speed); animation->setStartValue(obj->property("pos").toPointF()); @@ -57,7 +58,7 @@ namespace Animations { void scaleTo(QObject *obj, qreal scale) { - if (prefs.animation_speed != 0) { + if (qPrefDisplay::animation_speed() != 0) { QPropertyAnimation *animation = new QPropertyAnimation(obj, "scale"); animation->setDuration(prefs.animation_speed); animation->setStartValue(obj->property("scale").toReal()); diff --git a/profile-widget/divecartesianaxis.cpp b/profile-widget/divecartesianaxis.cpp index 29a4165b1..e37c311d3 100644 --- a/profile-widget/divecartesianaxis.cpp +++ b/profile-widget/divecartesianaxis.cpp @@ -3,7 +3,6 @@ #include "profile-widget/divetextitem.h" #include "core/qthelper.h" #include "core/subsurface-string.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" #ifndef SUBSURFACE_MOBILE #include "desktop-widgets/preferences/preferencesdialog.h" #endif diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp index 13ab3770b..64de02436 100644 --- a/profile-widget/diveeventitem.cpp +++ b/profile-widget/diveeventitem.cpp @@ -51,7 +51,7 @@ struct event *DiveEventItem::getEvent() return internalEvent; } -void DiveEventItem::setEvent(struct event *ev, struct gasmix *lastgasmix) +void DiveEventItem::setEvent(struct event *ev, struct gasmix lastgasmix) { if (!ev) return; @@ -63,7 +63,7 @@ void DiveEventItem::setEvent(struct event *ev, struct gasmix *lastgasmix) recalculatePos(true); } -void DiveEventItem::setupPixmap(struct gasmix *lastgasmix) +void DiveEventItem::setupPixmap(struct gasmix lastgasmix) { const IconMetrics& metrics = defaultIconMetrics(); #ifndef SUBSURFACE_MOBILE @@ -92,10 +92,10 @@ void DiveEventItem::setupPixmap(struct gasmix *lastgasmix) } else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) { setPixmap(EVENT_PIXMAP(":dive-bookmark-icon")); } else if (event_is_gaschange(internalEvent)) { - struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent); + struct gasmix mix = get_gasmix_from_event(&displayed_dive, internalEvent); struct icd_data icd_data; bool icd = isobaric_counterdiffusion(lastgasmix, mix, &icd_data); - if (mix->he.permille) { + if (mix.he.permille) { if (icd) setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-trimix-ICD-icon")); else @@ -105,7 +105,7 @@ void DiveEventItem::setupPixmap(struct gasmix *lastgasmix) setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-air-ICD-icon")); else setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-air-icon")); - } else if (mix->o2.permille == 1000) { + } else if (mix.o2.permille == 1000) { if (icd) setPixmap(EVENT_PIXMAP_BIGGER(":gaschange-oxygen-ICD-icon")); else @@ -165,7 +165,7 @@ void DiveEventItem::setupPixmap(struct gasmix *lastgasmix) #undef EVENT_PIXMAP_BIGGER } -void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix) +void DiveEventItem::setupToolTipString(struct gasmix lastgasmix) { // we display the event on screen - so translate QString name = gettextFromC::tr(internalEvent->name); @@ -174,7 +174,7 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix) if (event_is_gaschange(internalEvent)) { struct icd_data icd_data; - struct gasmix *mix = get_gasmix_from_event(&displayed_dive, internalEvent); + struct gasmix mix = get_gasmix_from_event(&displayed_dive, internalEvent); struct membuffer mb = {}; name += ": "; name += gasname(mix); @@ -192,7 +192,7 @@ void DiveEventItem::setupToolTipString(struct gasmix *lastgasmix) name += QString::fromUtf8(mb.buffer, mb.len); free_buffer(&mb); } - *lastgasmix = *mix; + lastgasmix = mix; } else if (same_string(internalEvent->name, "modechange")) { name += QString(": %1").arg(gettextFromC::tr(divemode_text_ui[internalEvent->value])); } else if (value) { diff --git a/profile-widget/diveeventitem.h b/profile-widget/diveeventitem.h index a3535f8aa..6547fa716 100644 --- a/profile-widget/diveeventitem.h +++ b/profile-widget/diveeventitem.h @@ -13,7 +13,7 @@ class DiveEventItem : public DivePixmapItem { public: DiveEventItem(QGraphicsItem *parent = 0); ~DiveEventItem(); - void setEvent(struct event *ev, struct gasmix *lastgasmix); + void setEvent(struct event *ev, struct gasmix lastgasmix); struct event *getEvent(); void eventVisibilityChanged(const QString &eventName, bool visible); void setVerticalAxis(DiveCartesianAxis *axis); @@ -25,8 +25,8 @@ slots: void recalculatePos(bool instant = false); private: - void setupToolTipString(struct gasmix *lastgasmix); - void setupPixmap(struct gasmix *lastgasmix); + void setupToolTipString(struct gasmix lastgasmix); + void setupPixmap(struct gasmix lastgasmix); DiveCartesianAxis *vAxis; DiveCartesianAxis *hAxis; DivePlotDataModel *dataModel; diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 2c17b67ad..932586f12 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -10,7 +10,7 @@ #endif #include "qt-models/diveplannermodel.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefTechnicalDetails.h" #include "libdivecomputer/parser.h" #include "profile-widget/profilewidget2.h" @@ -112,8 +112,8 @@ void AbstractProfilePolygonItem::modelDataChanged(const QModelIndex&, const QMod DiveProfileItem::DiveProfileItem() : show_reported_ceiling(0), reported_ceiling_in_red(0) { - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::dcceiling_changed, this, &DiveProfileItem::settingsToggled); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::redceiling_changed, this, &DiveProfileItem::settingsToggled); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::dcceiling_changed, this, &DiveProfileItem::settingsToggled); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::redceiling_changed, this, &DiveProfileItem::settingsToggled); } void DiveProfileItem::settingsToggled(bool) @@ -267,7 +267,7 @@ DiveHeartrateItem::DiveHeartrateItem() pen.setCosmetic(true); pen.setWidth(1); setPen(pen); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::hrgraph_changed, this, &DiveHeartrateItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::hrgraph_changed, this, &DiveHeartrateItem::setVisible); } void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) @@ -348,7 +348,7 @@ void DiveHeartrateItem::paint(QPainter *painter, const QStyleOptionGraphicsItem* DivePercentageItem::DivePercentageItem(int i) { - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::percentagegraph_changed, this, &DivePercentageItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::percentagegraph_changed, this, &DivePercentageItem::setVisible); tissueIndex = i; settingsChanged(); } @@ -410,8 +410,8 @@ void DivePercentageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem for (int i = 1, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) { if (i < poly.count()) { double value = dataModel->index(i, vDataColumn).data().toDouble(); - struct gasmix *gasmix = NULL; - struct event *ev = NULL; + struct gasmix gasmix = { 0 }; + const struct event *ev = NULL; int sec = dataModel->index(i, DivePlotDataModel::TIME).data().toInt(); gasmix = get_gasmix(&displayed_dive, displayed_dc, sec, &ev, gasmix); int inert = 1000 - get_o2(gasmix); @@ -465,7 +465,7 @@ void DiveAmbPressureItem::paint(QPainter *painter, const QStyleOptionGraphicsIte painter->setPen(pen()); painter->drawPolyline(polygon()); painter->restore(); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::percentagegraph_changed, this, &DiveAmbPressureItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::percentagegraph_changed, this, &DiveAmbPressureItem::setVisible); } DiveGFLineItem::DiveGFLineItem() @@ -510,7 +510,7 @@ void DiveGFLineItem::paint(QPainter *painter, const QStyleOptionGraphicsItem*, Q painter->setPen(pen()); painter->drawPolyline(polygon()); painter->restore(); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::percentagegraph_changed, this, &DiveAmbPressureItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::percentagegraph_changed, this, &DiveAmbPressureItem::setVisible); } DiveTemperatureItem::DiveTemperatureItem() @@ -635,7 +635,7 @@ void DiveMeanDepthItem::paint(QPainter *painter, const QStyleOptionGraphicsItem* painter->setPen(pen()); painter->drawPolyline(polygon()); painter->restore(); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_average_depth_changed, this, &DiveAmbPressureItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_average_depth_changed, this, &DiveAmbPressureItem::setVisible); } void DiveMeanDepthItem::createTextItem() { @@ -821,7 +821,7 @@ DiveCalculatedCeiling::DiveCalculatedCeiling(ProfileWidget2 *widget) : profileWidget(widget), is3mIncrement(false) { - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::calcceiling_changed, this, &DiveCalculatedCeiling::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::calcceiling_changed, this, &DiveCalculatedCeiling::setVisible); setVisible(prefs.calcceiling); settingsChanged(); } @@ -862,8 +862,8 @@ void DiveCalculatedCeiling::paint(QPainter *painter, const QStyleOptionGraphicsI DiveCalculatedTissue::DiveCalculatedTissue(ProfileWidget2 *widget) : DiveCalculatedCeiling(widget) { settingsChanged(); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::calcalltissues_changed, this, &DiveCalculatedTissue::setVisible); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::calcceiling_changed, this, &DiveCalculatedTissue::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::calcalltissues_changed, this, &DiveCalculatedTissue::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::calcceiling_changed, this, &DiveCalculatedTissue::setVisible); } void DiveCalculatedTissue::setVisible(bool) @@ -878,7 +878,7 @@ void DiveCalculatedTissue::settingsChanged() DiveReportedCeiling::DiveReportedCeiling() { - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::dcceiling_changed, this, &DiveReportedCeiling::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::dcceiling_changed, this, &DiveReportedCeiling::setVisible); setVisible(prefs.dcceiling); settingsChanged(); } diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp index 09719c0ec..d1bda0a01 100644 --- a/profile-widget/divetooltipitem.cpp +++ b/profile-widget/divetooltipitem.cpp @@ -4,8 +4,8 @@ #include "core/profile.h" #include "core/membuffer.h" #include "core/metrics.h" +#include "core/settings/qPrefDisplay.h" #include <QPropertyAnimation> -#include <QSettings> #include <QGraphicsView> #include <QStyleOptionGraphicsItem> #include "core/qthelper.h" @@ -61,7 +61,7 @@ void ToolTipItem::collapse() { int dim = defaultIconMetrics().sz_small; - if (prefs.animation_speed) { + if (qPrefDisplay::animation_speed()) { QPropertyAnimation *animation = new QPropertyAnimation(this, "rect"); animation->setDuration(100); animation->setStartValue(nextRectangle); @@ -119,7 +119,7 @@ void ToolTipItem::expand() nextRectangle.setHeight(height); if (nextRectangle != rect()) { - if (prefs.animation_speed) { + if (qPrefDisplay::animation_speed()) { QPropertyAnimation *animation = new QPropertyAnimation(this, "rect", this); animation->setDuration(prefs.animation_speed); animation->setStartValue(rect()); @@ -206,17 +206,12 @@ void ToolTipItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio void ToolTipItem::persistPos() { - QSettings s; - s.beginGroup("ProfileMap"); - s.setValue("tooltip_position", pos()); - s.endGroup(); + qPrefDisplay::set_tooltip_position(pos()); } void ToolTipItem::readPos() { - QSettings s; - s.beginGroup("ProfileMap"); - QPointF value = s.value("tooltip_position").toPoint(); + QPointF value = qPrefDisplay::tooltip_position(); if (!scene()->sceneRect().contains(value)) { value = QPointF(0, 0); } diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 7c70b15f9..ac1af3951 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -4,6 +4,9 @@ #include "core/subsurface-string.h" #include "core/qthelper.h" #include "core/profile.h" +#include "core/settings/qPrefDisplay.h" +#include "core/settings/qPrefTechnicalDetails.h" +#include "core/settings/qPrefPartialPressureGas.h" #include "profile-widget/diveeventitem.h" #include "profile-widget/divetextitem.h" #include "profile-widget/divetooltipitem.h" @@ -16,7 +19,6 @@ #include "qt-models/models.h" #include "qt-models/divepicturemodel.h" #include "core/divelist.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" #ifndef SUBSURFACE_MOBILE #include "desktop-widgets/diveplanner.h" #include "desktop-widgets/simplewidgets.h" @@ -34,7 +36,6 @@ #include <QInputDialog> #include <QDebug> #include <QWheelEvent> -#include <QSettings> #include <QMenu> #include <QElapsedTimer> @@ -341,17 +342,16 @@ void ProfileWidget2::setupItemOnScene() #ifndef SUBSURFACE_MOBILE // Visibility Connections - connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPheChanged, pheGasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPo2Changed, po2GasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->pp_gas, &PartialPressureGasSettings::showPn2Changed, pn2GasItem, &PartialPressureGasItem::setVisible); + connect(qPrefPartialPressureGas::instance(), &qPrefPartialPressureGas::phe_changed, pheGasItem, &PartialPressureGasItem::setVisible); + connect(qPrefPartialPressureGas::instance(), &qPrefPartialPressureGas::po2_changed, po2GasItem, &PartialPressureGasItem::setVisible); + connect(qPrefPartialPressureGas::instance(), &qPrefPartialPressureGas::pn2_changed, pn2GasItem, &PartialPressureGasItem::setVisible); - //WARNING: The old code was broken, I'm not sure what should trigger the visibility of those graphs, since the old code didn't triggered them // because it was using a wrong settings. - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_setpoint_changed, o2SetpointGasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_scr_ocpo2_changed, ocpo2GasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor1GasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor2GasItem, &PartialPressureGasItem::setVisible); - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor3GasItem, &PartialPressureGasItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_ccr_setpoint_changed, o2SetpointGasItem, &PartialPressureGasItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_scr_ocpo2_changed, ocpo2GasItem, &PartialPressureGasItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor1GasItem, &PartialPressureGasItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor2GasItem, &PartialPressureGasItem::setVisible); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_ccr_sensors_changed, ccrsensor3GasItem, &PartialPressureGasItem::setVisible); heartBeatAxis->setTextVisible(true); heartBeatAxis->setLinesVisible(true); @@ -595,8 +595,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) // special handling for the first time we display things int animSpeedBackup = 0; if (firstCall && haveFilesOnCommandLine()) { - animSpeedBackup = prefs.animation_speed; - prefs.animation_speed = 0; + animSpeedBackup = qPrefDisplay::animation_speed(); + qPrefDisplay::set_animation_speed(0); firstCall = false; } @@ -757,8 +757,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) qDeleteAll(eventItems); eventItems.clear(); struct event *event = currentdc->events; - struct event *ev; - struct gasmix lastgasmix = *get_gasmix(&displayed_dive, current_dc, 1, &ev, NULL); + struct gasmix lastgasmix = get_gasmix_at_time(&displayed_dive, current_dc, duration_t{1}); while (event) { #ifndef SUBSURFACE_MOBILE @@ -781,7 +780,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) item->setHorizontalAxis(timeAxis); item->setVerticalAxis(profileYAxis); item->setModel(dataModel); - item->setEvent(event, &lastgasmix); + item->setEvent(event, lastgasmix); item->setZValue(2); scene()->addItem(item); eventItems.push_back(item); @@ -806,7 +805,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) #endif diveComputerText->setText(dcText); if (haveFilesOnCommandLine() && animSpeedBackup != 0) { - prefs.animation_speed = animSpeedBackup; + qPrefDisplay::set_animation_speed(animSpeedBackup); } #ifndef SUBSURFACE_MOBILE @@ -825,7 +824,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) // so if we are calculation TTS / NDL then let's force that off. #ifndef SUBSURFACE_MOBILE if (measureDuration.elapsed() > 1000 && prefs.calcndltts) { - SettingsObjectWrapper::instance()->techDetails->set_calcndltts(false); + qPrefTechnicalDetails::set_calcndltts(false); report_error(qPrintable(tr("Show NDL / TTS was disabled because of excessive processing time"))); } #endif @@ -1452,7 +1451,7 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event) action->setData(event->globalPos()); QAction *splitAction = m.addAction(tr("Split dive into two"), this, SLOT(splitDive())); splitAction->setData(event->globalPos()); - struct event *ev = NULL; + const struct event *ev = NULL; enum divemode_t divemode = UNDEF_COMP_TYPE; QPointF scenePos = mapToScene(mapFromGlobal(event->globalPos())); QString gas = action->text(); @@ -1695,7 +1694,7 @@ void ProfileWidget2::changeGas() // if there is a gas change at this time stamp, remove it before adding the new one struct event *gasChangeEvent = current_dc->events; - while ((gasChangeEvent = get_next_event(gasChangeEvent, "gaschange")) != NULL) { + while ((gasChangeEvent = get_next_event_mutable(gasChangeEvent, "gaschange")) != NULL) { if (gasChangeEvent->time.seconds == seconds) { remove_event(gasChangeEvent); gasChangeEvent = current_dc->events; @@ -1710,7 +1709,7 @@ void ProfileWidget2::changeGas() tank = rx.cap(1).toInt() - 1; // we display the tank 1 based } else { qDebug() << "failed to parse tank number"; - tank = get_gasidx(&displayed_dive, &gasmix); + tank = get_gasidx(&displayed_dive, gasmix); } // add this both to the displayed dive and the current dive add_gas_switch_event(current_dive, current_dc, seconds, tank); diff --git a/profile-widget/ruleritem.cpp b/profile-widget/ruleritem.cpp index 4c49bdc9e..f736f3ac3 100644 --- a/profile-widget/ruleritem.cpp +++ b/profile-widget/ruleritem.cpp @@ -5,7 +5,7 @@ #endif #include "profile-widget/profilewidget2.h" #include "core/display.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefTechnicalDetails.h" #include <qgraphicssceneevent.h> @@ -83,7 +83,7 @@ RulerItem2::RulerItem2() : source(new RulerNodeItem2()), textItemBack->setFlag(QGraphicsItem::ItemIgnoresTransformations); setPen(QPen(QColor(Qt::black), 0.0)); #ifndef SUBSURFACE_MOBILE - connect(SettingsObjectWrapper::instance()->techDetails, &qPrefTechnicalDetails::rulergraph_changed, this, &RulerItem2::settingsChanged); + connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::rulergraph_changed, this, &RulerItem2::settingsChanged); #endif } diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp index 22e5d3d21..2bbcdc1a7 100644 --- a/profile-widget/tankitem.cpp +++ b/profile-widget/tankitem.cpp @@ -57,15 +57,15 @@ void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, str modelDataChanged(); } -void TankItem::createBar(qreal x, qreal w, struct gasmix *gas) +void TankItem::createBar(qreal x, qreal w, struct gasmix gas) { // pick the right gradient, size, position and text QGraphicsRectItem *rect = new QGraphicsRectItem(x, 0, w, height, this); if (gasmix_is_air(gas)) rect->setBrush(air); - else if (gas->he.permille) + else if (gas.he.permille) rect->setBrush(trimix); - else if (gas->o2.permille == 1000) + else if (gas.o2.permille == 1000) rect->setBrush(oxygen); else rect->setBrush(nitrox); @@ -104,11 +104,11 @@ void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&) // start with the first gasmix and at the start of the dive int cyl = explicit_first_cylinder(&displayed_dive, dc); - struct gasmix *gasmix = &displayed_dive.cylinder[cyl].gasmix; + struct gasmix gasmix = displayed_dive.cylinder[cyl].gasmix; int startTime = 0; // work through all the gas changes and add the rectangle for each gas while it was used - struct event *ev = get_next_event(dc->events, "gaschange"); + const struct event *ev = get_next_event(dc->events, "gaschange"); while (ev && (int)ev->time.seconds < last_entry->sec) { width = hAxis->posAtValue(ev->time.seconds) - hAxis->posAtValue(startTime); left = hAxis->posAtValue(startTime); diff --git a/profile-widget/tankitem.h b/profile-widget/tankitem.h index 8ccfcb5bb..433b1444f 100644 --- a/profile-widget/tankitem.h +++ b/profile-widget/tankitem.h @@ -25,7 +25,7 @@ public slots: void modelDataChanged(const QModelIndex &topLeft = QModelIndex(), const QModelIndex &bottomRight = QModelIndex()); private: - void createBar(qreal x, qreal w, struct gasmix *gas); + void createBar(qreal x, qreal w, struct gasmix gas); DivePlotDataModel *dataModel; DiveCartesianAxis *hAxis; struct dive diveCylinderStore; diff --git a/qt-models/cylindermodel.cpp b/qt-models/cylindermodel.cpp index 9a093112c..11d4595ee 100644 --- a/qt-models/cylindermodel.cpp +++ b/qt-models/cylindermodel.cpp @@ -100,7 +100,7 @@ static QVariant gas_volume_tooltip(cylinder_t *cyl, pressure_t p) if (!vol) return QVariant(); - Z = gas_compressibility_factor(&cyl->gasmix, p.mbar / 1000.0); + Z = gas_compressibility_factor(cyl->gasmix, p.mbar / 1000.0); return gas_volume_string(vol, "(Z=") + QString("%1)").arg(Z, 0, 'f', 3); } @@ -212,14 +212,14 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const } else { pressure_t modpO2; modpO2.mbar = prefs.bottompo2; - ret = get_depth_string(gas_mod(&cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(1,1)), true); + ret = get_depth_string(gas_mod(cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(1,1)), true); } break; case MND: if (cyl->bestmix_he) ret = QString("*"); else - ret = get_depth_string(gas_mnd(&cyl->gasmix, prefs.bestmixend, &displayed_dive, M_OR_FT(1,1)), true); + ret = get_depth_string(gas_mnd(cyl->gasmix, prefs.bestmixend, &displayed_dive, M_OR_FT(1,1)), true); break; case USE: ret = gettextFromC::tr(cylinderuse_text[cyl->cylinder_use]); @@ -353,15 +353,15 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in if (CHANGED()) { cyl->gasmix.o2 = string_to_fraction(qPrintable(vString)); // fO2 + fHe must not be greater than 1 - if (get_o2(&cyl->gasmix) + get_he(&cyl->gasmix) > 1000) - cyl->gasmix.he.permille = 1000 - get_o2(&cyl->gasmix); + if (get_o2(cyl->gasmix) + get_he(cyl->gasmix) > 1000) + cyl->gasmix.he.permille = 1000 - get_o2(cyl->gasmix); pressure_t modpO2; if (displayed_dive.dc.divemode == PSCR) - modpO2.mbar = prefs.decopo2 + (1000 - get_o2(&cyl->gasmix)) * SURFACE_PRESSURE * + modpO2.mbar = prefs.decopo2 + (1000 - get_o2(cyl->gasmix)) * SURFACE_PRESSURE * prefs.o2consumption / prefs.decosac / prefs.pscr_ratio; else modpO2.mbar = prefs.decopo2; - cyl->depth = gas_mod(&cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); + cyl->depth = gas_mod(cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); cyl->bestmix_o2 = false; changed = true; } @@ -370,8 +370,8 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in if (CHANGED()) { cyl->gasmix.he = string_to_fraction(qPrintable(vString)); // fO2 + fHe must not be greater than 1 - if (get_o2(&cyl->gasmix) + get_he(&cyl->gasmix) > 1000) - cyl->gasmix.o2.permille = 1000 - get_he(&cyl->gasmix); + if (get_o2(cyl->gasmix) + get_he(cyl->gasmix) > 1000) + cyl->gasmix.o2.permille = 1000 - get_he(cyl->gasmix); cyl->bestmix_he = false; changed = true; } @@ -395,7 +395,7 @@ bool CylindersModel::setData(const QModelIndex &index, const QVariant &value, in } pressure_t modpO2; modpO2.mbar = prefs.decopo2; - cyl->depth = gas_mod(&cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); + cyl->depth = gas_mod(cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); changed = true; } break; @@ -588,8 +588,8 @@ void CylindersModel::updateDecoDepths(pressure_t olddecopo2) cylinder_t *cyl = &displayed_dive.cylinder[i]; /* If the gas's deco MOD matches the old pO2, it will have been automatically calculated and should be updated. * If they don't match, we should leave the user entered depth as it is */ - if (cyl->depth.mm == gas_mod(&cyl->gasmix, olddecopo2, &displayed_dive, M_OR_FT(3, 10)).mm) { - cyl->depth = gas_mod(&cyl->gasmix, decopo2, &displayed_dive, M_OR_FT(3, 10)); + if (cyl->depth.mm == gas_mod(cyl->gasmix, olddecopo2, &displayed_dive, M_OR_FT(3, 10)).mm) { + cyl->depth = gas_mod(cyl->gasmix, decopo2, &displayed_dive, M_OR_FT(3, 10)); } } emit dataChanged(createIndex(0, 0), createIndex(MAX_CYLINDERS - 1, COLUMNS - 1)); @@ -609,18 +609,18 @@ bool CylindersModel::updateBestMixes() if (cyl->bestmix_o2) { cyl->gasmix.o2 = best_o2(displayed_dive.maxdepth, &displayed_dive); // fO2 + fHe must not be greater than 1 - if (get_o2(&cyl->gasmix) + get_he(&cyl->gasmix) > 1000) - cyl->gasmix.he.permille = 1000 - get_o2(&cyl->gasmix); + if (get_o2(cyl->gasmix) + get_he(cyl->gasmix) > 1000) + cyl->gasmix.he.permille = 1000 - get_o2(cyl->gasmix); pressure_t modpO2; modpO2.mbar = prefs.decopo2; - cyl->depth = gas_mod(&cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); + cyl->depth = gas_mod(cyl->gasmix, modpO2, &displayed_dive, M_OR_FT(3, 10)); gasUpdated = true; } if (cyl->bestmix_he) { cyl->gasmix.he = best_he(displayed_dive.maxdepth, &displayed_dive); // fO2 + fHe must not be greater than 1 - if (get_o2(&cyl->gasmix) + get_he(&cyl->gasmix) > 1000) - cyl->gasmix.o2.permille = 1000 - get_he(&cyl->gasmix); + if (get_o2(cyl->gasmix) + get_he(cyl->gasmix) > 1000) + cyl->gasmix.o2.permille = 1000 - get_he(cyl->gasmix); gasUpdated = true; } } diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index c26cac76a..32231ecca 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -6,7 +6,7 @@ #include "qt-models/models.h" #include "core/device.h" #include "core/qthelper.h" -#include "core/subsurface-qt/SettingsObjectWrapper.h" +#include "core/settings/qPrefDivePlanner.h" #include "core/gettextfromc.h" #include <QApplication> #include <QTextDocument> @@ -81,7 +81,7 @@ void DivePlannerPointsModel::loadFromDive(dive *d) o2pressure_t last_sp; bool oldRec = recalc; struct divecomputer *dc = &(d->dc); - struct event *evd = NULL; + const struct event *evd = NULL; enum divemode_t current_divemode = UNDEF_COMP_TYPE; recalc = false; CylindersModel::instance()->updateDive(); @@ -427,26 +427,26 @@ void DivePlannerPointsModel::emitDataChanged() void DivePlannerPointsModel::setBottomSac(double sac) { diveplan.bottomsac = units_to_sac(sac); - qPrefDivePlanner::instance()->set_bottomsac(diveplan.bottomsac); + qPrefDivePlanner::set_bottomsac(diveplan.bottomsac); emitDataChanged(); } void DivePlannerPointsModel::setDecoSac(double sac) { diveplan.decosac = units_to_sac(sac); - qPrefDivePlanner::instance()->set_decosac(diveplan.decosac); + qPrefDivePlanner::set_decosac(diveplan.decosac); emitDataChanged(); } void DivePlannerPointsModel::setSacFactor(double factor) { - qPrefDivePlanner::instance()->set_sacfactor((int) round(factor * 100)); + qPrefDivePlanner::set_sacfactor((int) round(factor * 100)); emitDataChanged(); } void DivePlannerPointsModel::setProblemSolvingTime(int minutes) { - qPrefDivePlanner::instance()->set_problemsolvingtime(minutes); + qPrefDivePlanner::set_problemsolvingtime(minutes); emitDataChanged(); } @@ -504,96 +504,95 @@ int DivePlannerPointsModel::getSurfacePressure() void DivePlannerPointsModel::setLastStop6m(bool value) { - qPrefDivePlanner::instance()->set_last_stop(value); + qPrefDivePlanner::set_last_stop(value); emitDataChanged(); } void DivePlannerPointsModel::setAscrate75(int rate) { - qPrefDivePlanner::instance()->set_ascrate75(lrint(rate * UNIT_FACTOR)); + qPrefDivePlanner::set_ascrate75(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } void DivePlannerPointsModel::setAscrate50(int rate) { - qPrefDivePlanner::instance()->set_ascrate50(lrint(rate * UNIT_FACTOR)); + qPrefDivePlanner::set_ascrate50(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } void DivePlannerPointsModel::setAscratestops(int rate) { - qPrefDivePlanner::instance()->set_ascratestops(lrint(rate * UNIT_FACTOR)); + qPrefDivePlanner::set_ascratestops(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } void DivePlannerPointsModel::setAscratelast6m(int rate) { - qPrefDivePlanner::instance()->set_ascratelast6m(lrint(rate * UNIT_FACTOR)); + qPrefDivePlanner::set_ascratelast6m(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } void DivePlannerPointsModel::setDescrate(int rate) { - qPrefDivePlanner::instance()->set_descrate(lrint(rate * UNIT_FACTOR)); + qPrefDivePlanner::set_descrate(lrint(rate * UNIT_FACTOR)); emitDataChanged(); } void DivePlannerPointsModel::setVerbatim(bool value) { - qPrefDivePlanner::instance()->set_verbatim_plan(value); + qPrefDivePlanner::set_verbatim_plan(value); emitDataChanged(); } void DivePlannerPointsModel::setDisplayRuntime(bool value) { - qPrefDivePlanner::instance()->set_display_runtime(value); + qPrefDivePlanner::set_display_runtime(value); emitDataChanged(); } void DivePlannerPointsModel::setDisplayDuration(bool value) { - qPrefDivePlanner::instance()->set_display_duration(value); + qPrefDivePlanner::set_display_duration(value); emitDataChanged(); } void DivePlannerPointsModel::setDisplayTransitions(bool value) { - qPrefDivePlanner::instance()->set_display_transitions(value); + qPrefDivePlanner::set_display_transitions(value); emitDataChanged(); } void DivePlannerPointsModel::setDisplayVariations(bool value) { - qPrefDivePlanner::instance()->set_display_variations(value); + qPrefDivePlanner::set_display_variations(value); emitDataChanged(); } void DivePlannerPointsModel::setDecoMode(int mode) { - qPrefDivePlanner::instance()->set_planner_deco_mode(deco_mode(mode)); + qPrefDivePlanner::set_planner_deco_mode(deco_mode(mode)); emit recreationChanged(mode == int(prefs.planner_deco_mode)); emitDataChanged(); } void DivePlannerPointsModel::setSafetyStop(bool value) { - qPrefDivePlanner::instance()->set_safetystop(value); + qPrefDivePlanner::set_safetystop(value); emitDataChanged(); } void DivePlannerPointsModel::setReserveGas(int reserve) { - auto planner = qPrefDivePlanner::instance(); if (prefs.units.pressure == units::BAR) - planner->set_reserve_gas(reserve * 1000); + qPrefDivePlanner::set_reserve_gas(reserve * 1000); else - planner->set_reserve_gas(psi_to_mbar(reserve)); + qPrefDivePlanner::set_reserve_gas(psi_to_mbar(reserve)); emitDataChanged(); } void DivePlannerPointsModel::setDropStoneMode(bool value) { - qPrefDivePlanner::instance()->set_drop_stone_mode(value); + qPrefDivePlanner::set_drop_stone_mode(value); if (prefs.drop_stone_mode) { /* Remove the first entry if we enable drop_stone_mode */ if (rowCount() >= 2) { @@ -615,13 +614,13 @@ void DivePlannerPointsModel::setDropStoneMode(bool value) void DivePlannerPointsModel::setSwitchAtReqStop(bool value) { - qPrefDivePlanner::instance()->set_switch_at_req_stop(value); + qPrefDivePlanner::set_switch_at_req_stop(value); emitDataChanged(); } void DivePlannerPointsModel::setMinSwitchDuration(int duration) { - qPrefDivePlanner::instance()->set_min_switch_duration(duration * 60); + qPrefDivePlanner::set_min_switch_duration(duration * 60); emitDataChanged(); } diff --git a/smtk-import/CMakeLists.txt b/smtk-import/CMakeLists.txt index 1720b2eb1..df15d8b0a 100644 --- a/smtk-import/CMakeLists.txt +++ b/smtk-import/CMakeLists.txt @@ -8,7 +8,6 @@ option(COMMANDLINE "Build command line version" OFF) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_BUILD_TYPE "Release") set(SSRF_PATH ../) set(CMAKE_MODULE_PATH ${SSRF_PATH}cmake/Modules) diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c index 826ad6a9d..ed4717287 100644 --- a/smtk-import/smartrak.c +++ b/smtk-import/smartrak.c @@ -506,16 +506,16 @@ static void merge_cylinder_type(cylinder_type_t *src, cylinder_type_t *dst) } } -static void merge_cylinder_mix(struct gasmix *src, struct gasmix *dst) +static void merge_cylinder_mix(struct gasmix src, struct gasmix *dst) { if (!dst->o2.permille) - *dst = *src; + *dst = src; } static void merge_cylinder_info(cylinder_t *src, cylinder_t *dst) { merge_cylinder_type(&src->type, &dst->type); - merge_cylinder_mix(&src->gasmix, &dst->gasmix); + merge_cylinder_mix(src->gasmix, &dst->gasmix); MERGE_MAX(dst, dst, src, start.mbar); MERGE_MIN(dst, dst, src, end.mbar); if (!dst->cylinder_use) @@ -550,63 +550,127 @@ static int smtk_clean_cylinders(struct dive *d) } /* - * Parses a relation table and fills a list with the relations for a dive idx. - * Returns the number of relations found for a given dive idx. + * List related functions + */ +struct types_list { + int idx; + char *text; + struct types_list *next; +}; + +/* Head insert types_list items in a list */ +static void smtk_head_insert(struct types_list **head, int index, char *txt) +{ + struct types_list *item = (struct types_list *) malloc(sizeof(struct types_list)); + + item->next = *head; + item->idx = index; + item->text = txt; + *head = item; + item = NULL; + free(item); +} + +/* Clean types_list lists */ +static void smtk_list_free(struct types_list *head) +{ + struct types_list *p = head; + while (p) { + struct types_list *nxt = p->next; + free(p->text); + free(p); + p = nxt; + } +} + +/* + * Build a list from a given table_name (Type, Gear, etc) + * Managed tables formats: Just consider Idx and Text + * Type: + * | Idx | Text | Default (bool) + * Activity: + * | Idx | Text | Default (bool) + * Gear: + * | Idx | Text | Vendor | Type | Typenum | Notes | Default (bool) | TrakId + * Fish: + * | Idx | Text | Name | Latin name | Typelength | Maxlength | Picture | Default (bool)| TrakId + * TODO: Although all divelogs I've seen use *only* the Text field, a concerned diver could + * be using some other like Vendor (in Gear) or Latin name (in Fish). I'll take a look at this + * in the future, may be something like Buddy table... + */ +static void smtk_build_list(MdbHandle *mdb, char *table_name, struct types_list **head) +{ + MdbTableDef *table; + MdbColumn *col[MDB_MAX_COLS]; + char *bound_values[MDB_MAX_COLS]; + struct types_list *p = NULL; + + table = smtk_open_table(mdb, table_name, col, bound_values); + if (!table) + return; + + /* Read the table items into an structured list */ + while (mdb_fetch_row(table)) + smtk_head_insert(&p, atoi(col[0]->bind_ptr), copy_string(col[1]->bind_ptr)); + *head = p; + + /* clean up and exit */ + p = NULL; + free(p); + smtk_free(bound_values, table->num_cols); + mdb_free_tabledef(table); +} + +/* + * Parses a relation table and returns a list with the relations for a dive idx. + * Use types_list items with text set to NULL. + * Returns a pointer to the list head. * Table relation format: * | Diveidx | Idx | */ -static int smtk_index_list(MdbHandle *mdb, char *table_name, char *dive_idx, int idx_list[]) +static struct types_list *smtk_index_list(MdbHandle *mdb, char *table_name, char *dive_idx) { - int n = 0, i = 0; MdbTableDef *table; MdbColumn *cols[MDB_MAX_COLS]; char *bounders[MDB_MAX_COLS]; + struct types_list *item, *head = NULL; table = smtk_open_table(mdb, table_name, cols, bounders); /* Sanity check */ if (!table) - return 0; + return NULL; /* Parse the table searching for dive_idx */ while (mdb_fetch_row(table)) { - if (!strcmp(dive_idx, cols[0]->bind_ptr)) { - idx_list[n] = atoi(cols[1]->bind_ptr); - n++; - } + if (!strcmp(dive_idx, cols[0]->bind_ptr)) + smtk_head_insert(&head, atoi(cols[1]->bind_ptr), NULL); } /* Clean up and exit */ smtk_free(bounders, table->num_cols); mdb_free_tabledef(table); - return n; + return head; } /* - * Returns string with buddies names as registered in smartrak (may be a nickname). + * "Buddy" is a bit special table that needs some extra work, so we can't just use smtk_build_list. * "Buddy" table is a buddies relation with lots and lots and lots of data (even buddy mother's * maiden name ;-) ) most of them useless for a dive log. Let's just consider the nickname as main * field and the full name if this exists and its construction is different from the nickname. * Buddy table format: * | Idx | Text (nickname) | Name | Firstname | Middlename | Title | Picture | Phone | ... */ -static char *smtk_locate_buddy(MdbHandle *mdb, char *dive_idx) -{ - char *str = NULL, *fullname = NULL, *bounder[MDB_MAX_COLS] = { NULL }, *buddies[256] = { NULL }; +static void smtk_build_buddies(MdbHandle *mdb, struct types_list **buddies_head) { MdbTableDef *table; MdbColumn *col[MDB_MAX_COLS]; - int i, n, rel[256] = { 0 }; + char *bound_values[MDB_MAX_COLS], *fullname = NULL, *str = NULL; + struct types_list *p = NULL; - n = smtk_index_list(mdb, "BuddyRelation", dive_idx, rel); - if (!n) - return str; - table = smtk_open_table(mdb, "Buddy", col, bounder); + table = smtk_open_table(mdb, "Buddy", col, bound_values); if (!table) - return str; - /* - * Buddies in a single dive aren't (usually) a big number, so probably - * it's not a good idea to use a complex data structure and algorithm. - */ + return; + while (mdb_fetch_row(table)) { if (!empty_string(col[3]->bind_ptr)) fullname = smtk_concat_str(fullname, " ", "%s", col[3]->bind_ptr); @@ -615,19 +679,46 @@ static char *smtk_locate_buddy(MdbHandle *mdb, char *dive_idx) if (!empty_string(col[2]->bind_ptr)) fullname = smtk_concat_str(fullname, " ", "%s", col[2]->bind_ptr); if (fullname && !same_string(col[1]->bind_ptr, fullname)) - buddies[atoi(col[0]->bind_ptr)] = smtk_concat_str(buddies[atoi(col[0]->bind_ptr)], "", "%s (%s)", col[1]->bind_ptr, fullname); + smtk_head_insert(&p, atoi(col[0]->bind_ptr), smtk_concat_str(str, "", "%s (%s)", col[1]->bind_ptr, fullname)); else - buddies[atoi(col[0]->bind_ptr)] = smtk_concat_str(buddies[atoi(col[0]->bind_ptr)], "", "%s", col[1]->bind_ptr); + smtk_head_insert(&p, atoi(col[0]->bind_ptr), smtk_concat_str(str, "", "%s", col[1]->bind_ptr)); free(fullname); fullname = NULL; } - for (i = 0; i < n; i++) - str = smtk_concat_str(str, ", ", "%s", buddies[rel[i]]); + *buddies_head = p; - /* Clean up and exit */ - smtk_free(buddies, 256); - smtk_free(bounder, MDB_MAX_COLS); + p = NULL; + free(p); + free(str); + smtk_free(bound_values, table->num_cols); mdb_free_tabledef(table); +} + +/* + * Returns string with buddies names as registered in smartrak (may be a nickname). + */ +static char *smtk_locate_buddy(MdbHandle *mdb, char *dive_idx, struct types_list *buddies_head) +{ + char *str = NULL; + struct types_list *rel, *rel_head, *bud; + + rel_head = smtk_index_list(mdb, "BuddyRelation", dive_idx); + if (!rel_head) + return str; + + for (rel = rel_head; rel; ) { + for (bud = buddies_head; bud; ) { + if (bud->idx == rel->idx) { + str = smtk_concat_str(str, ", ", "%s", bud->text); + break; + } + bud = bud->next; + } + rel = rel->next; + } + + /* Clean up and exit */ + smtk_list_free(rel_head); return str; } @@ -636,50 +727,37 @@ static char *smtk_locate_buddy(MdbHandle *mdb, char *dive_idx) * (SCR, CCR or so), set the dive mode too. * The "tag" parameter is used to mark if we want this table to be imported * into tags or into notes. - * Managed tables formats: Just consider Idx and Text - * Type: - * | Idx | Text | Default (bool) - * Activity: - * | Idx | Text | Default (bool) - * Gear: - * | Idx | Text | Vendor | Type | Typenum | Notes | Default (bool) | TrakId - * Fish: - * | Idx | Text | Name | Latin name | Typelength | Maxlength | Picture | Default (bool)| TrakId */ -static void smtk_parse_relations(MdbHandle *mdb, struct dive *dive, char *dive_idx, char *table_name, char *rel_table_name, bool tag) +static void smtk_parse_relations(MdbHandle *mdb, struct dive *dive, char *dive_idx, char *table_name, char *rel_table_name, struct types_list *list, bool tag) { - MdbTableDef *table; - MdbColumn *col[MDB_MAX_COLS]; - char *bound_values[MDB_MAX_COLS], *tmp = NULL, *types[64] = { NULL }; - int i = 0, n = 0, rels[256] = { 0 }; + char *tmp = NULL; + struct types_list *diverel_head, *d_runner, *t_runner; - n = smtk_index_list(mdb, rel_table_name, dive_idx, rels); - if (!n) - return; - table = smtk_open_table(mdb, table_name, col, bound_values); - if (!table) + diverel_head = smtk_index_list(mdb, rel_table_name, dive_idx); + if (!diverel_head) return; - while (mdb_fetch_row(table)) - types[atoi(col[0]->bind_ptr)] = copy_string(col[1]->bind_ptr); - for (i = 0; i < n; i++) { - if (tag) - taglist_add_tag(&dive->tag_list, types[rels[i]]); - else - tmp = smtk_concat_str(tmp, ", ", "%s", types[rels[i]]); - if (strstr(types[rels[i]], "SCR")) - dive->dc.divemode = PSCR; - else if (strstr(types[rels[i]], "CCR")) - dive->dc.divemode = CCR; + /* Get the text associated with the relations */ + for (d_runner = diverel_head; d_runner; ) { + for (t_runner = list; t_runner; ) { + if (t_runner->idx == d_runner->idx) { + if (tag) + taglist_add_tag(&dive->tag_list, t_runner->text); + else + tmp = smtk_concat_str(tmp, ", ", "%s", t_runner->text); + if (strstr(t_runner->text, "SCR")) + dive->dc.divemode = PSCR; + else if (strstr(t_runner->text, "CCR")) + dive->dc.divemode = CCR; + break; + } + t_runner = t_runner->next; + } + d_runner = d_runner->next; } if (tmp) dive->notes = smtk_concat_str(dive->notes, "\n", "Smartrak %s: %s", table_name, tmp); free(tmp); - - /* clean up and exit */ - smtk_free(types, 64); - smtk_free(bound_values, table->num_cols); - mdb_free_tabledef(table); } /* @@ -840,6 +918,7 @@ void smartrak_import(const char *file, struct dive_table *divetable) MdbColumn *col[MDB_MAX_COLS]; char *bound_values[MDB_MAX_COLS], *ver; int i, dc_model; + struct types_list *type_list = NULL, *activity_list = NULL, *gear_list = NULL, *fish_list = NULL, *buddy_list=NULL; // Set an european style locale to work date/time conversion setlocale(LC_TIME, "POSIX"); @@ -861,6 +940,13 @@ void smartrak_import(const char *file, struct dive_table *divetable) free(ver); tanks = (smtk_version < 10213) ? 3 : 10; + /* Load auxiliary tables into lists */ + smtk_build_list(mdb_clon, "Type", &type_list); + smtk_build_list(mdb_clon, "Activity", &activity_list); + smtk_build_list(mdb_clon, "Gear", &gear_list); + smtk_build_list(mdb_clon, "Fish", &fish_list); + smtk_build_buddies(mdb_clon, &buddy_list); + mdb_table = smtk_open_table(mdb, "Dives", col, bound_values); if (!mdb_table) { report_error("[Error][smartrak_import]\tFile %s does not seem to be an SmartTrak file.", file); @@ -973,17 +1059,27 @@ void smartrak_import(const char *file, struct dive_table *divetable) smtkdive->weightsystem[0].weight.grams = lrint(strtod(col[coln(WEIGHT)]->bind_ptr, NULL) * 1000); smtkdive->suit = smtk_value_by_idx(mdb_clon, "Suit", 1, col[coln(SUITIDX)]->bind_ptr); smtk_build_location(mdb_clon, col[coln(SITEIDX)]->bind_ptr, smtkdive->when, &smtkdive->dive_site_uuid); - smtkdive->buddy = smtk_locate_buddy(mdb_clon, col[0]->bind_ptr); - smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Type", "TypeRelation", true); - smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Activity", "ActivityRelation", false); - smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Gear", "GearRelation", false); - smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Fish", "FishRelation", false); + if (buddy_list) + smtkdive->buddy = smtk_locate_buddy(mdb_clon, col[0]->bind_ptr, buddy_list); + if (type_list) + smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Type", "TypeRelation", type_list, true); + if (activity_list) + smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Activity", "ActivityRelation", activity_list, false); + if (gear_list) + smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Gear", "GearRelation", gear_list, false); + if (fish_list) + smtk_parse_relations(mdb_clon, smtkdive, col[0]->bind_ptr, "Fish", "FishRelation", fish_list, false); smtk_parse_bookmarks(mdb_clon, smtkdive, col[0]->bind_ptr); smtkdive->notes = smtk_concat_str(smtkdive->notes, "\n", "%s", col[coln(REMARKS)]->bind_ptr); record_dive_to_table(smtkdive, divetable); free(devdata); } + smtk_list_free(type_list); + smtk_list_free(activity_list); + smtk_list_free(gear_list); + smtk_list_free(fish_list); + smtk_list_free(buddy_list); smtk_free(bound_values, mdb_table->num_cols); mdb_free_tabledef(mdb_table); mdb_free_catalog(mdb_clon); diff --git a/smtk-import/smrtk2ssrfc_window.cpp b/smtk-import/smrtk2ssrfc_window.cpp index e44abe10c..16f2fbf6a 100644 --- a/smtk-import/smrtk2ssrfc_window.cpp +++ b/smtk-import/smrtk2ssrfc_window.cpp @@ -4,9 +4,9 @@ #include "qt-models/filtermodels.h" #include "core/dive.h" #include "core/divelist.h" +#include "core/settings/qPrefDisplay.h" #include <QFileDialog> #include <QFileInfo> -#include <QSettings> #include <QDebug> QStringList inputFiles; @@ -37,21 +37,16 @@ Smrtk2ssrfcWindow::~Smrtk2ssrfcWindow() static QString lastUsedDir() { - QSettings settings; QString lastDir = QDir::homePath(); - settings.beginGroup("FileDialog"); - if (settings.contains("LastDir")) - if (QDir(settings.value("LastDir").toString()).exists()) - lastDir = settings.value("LastDir").toString(); + if (QDir(qPrefDisplay::lastDir()).exists()) + lastDir = qPrefDisplay::lastDir(); return lastDir; } void Smrtk2ssrfcWindow::updateLastUsedDir(const QString &dir) { - QSettings s; - s.beginGroup("FileDialog"); - s.setValue("LastDir", dir); + qPrefDisplay::set_lastDir(dir); } void Smrtk2ssrfcWindow::on_inputFilesButton_clicked() diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp index 5ccd9951c..cec1a159b 100644 --- a/subsurface-desktop-main.cpp +++ b/subsurface-desktop-main.cpp @@ -11,6 +11,7 @@ #include "core/qt-gui.h" #include "core/qthelper.h" #include "core/subsurfacestartup.h" +#include "core/settings/qPref.h" #include "desktop-widgets/diveplanner.h" #include "desktop-widgets/mainwindow.h" #include "desktop-widgets/preferences/preferencesdialog.h" @@ -118,6 +119,10 @@ int main(int argc, char **argv) free((void *)default_directory); free((void *)default_filename); subsurface_console_exit(); + + // Sync struct preferences to disk + qPref::sync(); + free_prefs(); return 0; } diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index 99480c3ac..389d47cbf 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -156,13 +156,16 @@ void register_qml_types() { int rc; REGISTER_TYPE(qPref, "SsrfPrefs"); - REGISTER_TYPE(qPrefAnimations, "SsrfAnimationsPrefs"); REGISTER_TYPE(qPrefCloudStorage, "SsrfCloudStoragePrefs"); REGISTER_TYPE(qPrefDisplay, "SsrfDisplayPrefs"); REGISTER_TYPE(qPrefDiveComputer, "SsrfDiveComputerPrefs"); REGISTER_TYPE(qPrefDivePlanner, "SsrfDivePlannerPrefs"); REGISTER_TYPE(qPrefFacebook, "SsrfFacebookPrefs"); + REGISTER_TYPE(qPrefGeneral, "SsrfGeneralPrefs"); + REGISTER_TYPE(qPrefGeocoding, "SsrfGeocodingPrefs"); + REGISTER_TYPE(qPrefLanguage, "SsrfLanguagePrefs"); REGISTER_TYPE(qPrefLocationService, "SsrfLocationServicePrefs"); + REGISTER_TYPE(qPrefPartialPressureGas, "SsrfPartialPressureGasPrefs"); REGISTER_TYPE(qPrefProxy, "SsrfProxyPrefs"); REGISTER_TYPE(qPrefTechnicalDetails, "SsrfTechnicalDetailsPrefs"); REGISTER_TYPE(qPrefUnits, "SsrfUnitPrefs"); diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp index d62314e14..e700455f3 100644 --- a/subsurface-mobile-main.cpp +++ b/subsurface-mobile-main.cpp @@ -11,6 +11,7 @@ #include "core/qt-gui.h" #include "core/qthelper.h" #include "core/subsurfacestartup.h" +#include "core/settings/qPref.h" #include <QApplication> #include <QLocale> @@ -97,7 +98,7 @@ int main(int argc, char **argv) set_filename(NULL); // some hard coded settings - prefs.animation_speed = 0; // we render the profile to pixmap, no animations + qPrefDisplay::set_animation_speed(0); // we render the profile to pixmap, no animations // always show the divecomputer reported ceiling in red prefs.redceiling = 1; @@ -111,6 +112,10 @@ int main(int argc, char **argv) taglist_free(g_tag_list); parse_xml_exit(); subsurface_console_exit(); + + // Sync struct preferences to disk + qPref::sync(); + free_prefs(); return 0; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ecbcd4fc4..4d59536bd 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -96,18 +96,20 @@ TEST(TestPlan testplan.cpp) TEST(TestDiveSiteDuplication testdivesiteduplication.cpp) TEST(TestRenumber testrenumber.cpp) TEST(TestGitStorage testgitstorage.cpp) -TEST(TestPreferences testpreferences.cpp) TEST(TestPicture testpicture.cpp) TEST(TestMerge testmerge.cpp) TEST(TestTagList testtaglist.cpp) -TEST(TestQPrefAnimations testqPrefAnimations.cpp) TEST(TestQPrefCloudStorage testqPrefCloudStorage.cpp) TEST(TestQPrefDisplay testqPrefDisplay.cpp) TEST(TestQPrefDiveComputer testqPrefDiveComputer.cpp) TEST(TestQPrefDivePlanner testqPrefDivePlanner.cpp) TEST(TestQPrefFacebook testqPrefFacebook.cpp) +TEST(TestQPrefGeneral testqPrefGeneral.cpp) +TEST(TestQPrefGeocoding testqPrefGeocoding.cpp) +TEST(TestQPrefLanguage testqPrefLanguage.cpp) TEST(TestQPrefLocationService testqPrefLocationService.cpp) +TEST(TestQPrefPartialPressureGas testqPrefPartialPressureGas.cpp) TEST(TestQPrefProxy testqPrefProxy.cpp) TEST(TestQPrefTechnicalDetails testqPrefTechnicalDetails.cpp) TEST(TestQPrefUnits testqPrefUnits.cpp) @@ -124,19 +126,21 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} TestGitStorage TestPlan TestDiveSiteDuplication - TestPreferences TestRenumber TestPicture TestMerge TestTagList - TestQPrefAnimations TestQPrefCloudStorage TestQPrefDisplay TestQPrefDiveComputer TestQPrefDivePlanner TestQPrefFacebook + TestQPrefGeneral + TestQPrefGeocoding + TestQPrefLanguage TestQPrefLocationService + TestQPrefPartialPressureGas TestQPrefProxy TestQPrefTechnicalDetails TestQPrefUnits diff --git a/tests/testdivesiteduplication.cpp b/tests/testdivesiteduplication.cpp index 4e90c5175..250e407fc 100644 --- a/tests/testdivesiteduplication.cpp +++ b/tests/testdivesiteduplication.cpp @@ -5,7 +5,7 @@ void TestDiveSiteDuplication::testReadV2() { - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/TwoTimesTwo.ssrf"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/TwoTimesTwo.ssrf", &dive_table), 0); QCOMPARE(dive_site_table.nr, 2); } diff --git a/tests/testgitstorage.cpp b/tests/testgitstorage.cpp index 1448c60ac..5184aeb2a 100644 --- a/tests/testgitstorage.cpp +++ b/tests/testgitstorage.cpp @@ -5,13 +5,14 @@ #include "core/dive.h" #include "core/divelist.h" #include "core/file.h" -#include "core/prefs-macros.h" +#include "core/qthelper.h" #include "core/subsurfacestartup.h" +#include "core/settings/qPrefProxy.h" +#include "core/settings/qPrefCloudStorage.h" #include <QDir> #include <QTextStream> #include <QNetworkProxy> -#include <QSettings> #include <QTextCodec> #include <QDebug> @@ -28,23 +29,13 @@ void TestGitStorage::initTestCase() QCoreApplication::setOrganizationName("Subsurface"); QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); QCoreApplication::setApplicationName("Subsurface"); - QSettings s; - QVariant v; - s.beginGroup("Network"); - GET_INT_DEF("proxy_type", proxy_type, QNetworkProxy::DefaultProxy); - GET_TXT("proxy_host", proxy_host); - GET_INT("proxy_port", proxy_port); - GET_BOOL("proxy_auth", proxy_auth); - GET_TXT("proxy_user", proxy_user); - GET_TXT("proxy_pass", proxy_pass); - s.endGroup(); - s.beginGroup("CloudStorage"); - GET_TXT("cloud_base_url", cloud_base_url); + qPrefProxy::load(); + qPrefCloudStorage::load(); + QString gitUrl(prefs.cloud_base_url); if (gitUrl.right(1) != "/") gitUrl += "/"; prefs.cloud_git_url = copy_qstring(gitUrl + "git"); - s.endGroup(); prefs.cloud_storage_email_encoded = strdup("ssrftest@hohndel.org"); prefs.cloud_storage_password = strdup("geheim"); QNetworkProxy proxy; @@ -88,7 +79,7 @@ void TestGitStorage::testGitStorageLocal() // test writing and reading back from local git storage git_repository *repo; git_libgit2_init(); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf", &dive_table), 0); QFETCH(QString, testDirName); QFETCH(QString, prefixRead); QFETCH(QString, prefixWrite); @@ -101,7 +92,7 @@ void TestGitStorage::testGitStorageLocal() QCOMPARE(save_dives(qPrintable(repoNameWrite + "[test]")), 0); QCOMPARE(save_dives("./SampleDivesV3.ssrf"), 0); clear_dive_file_data(); - QCOMPARE(parse_file(qPrintable(repoNameRead + "[test]")), 0); + QCOMPARE(parse_file(qPrintable(repoNameRead + "[test]"), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesV3viagit.ssrf"), 0); QFile org("./SampleDivesV3.ssrf"); org.open(QFile::ReadOnly); @@ -120,10 +111,10 @@ void TestGitStorage::testGitStorageCloud() // connect to the ssrftest repository on the cloud server // and repeat the same test as before with the local git storage QString cloudTestRepo("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org[ssrftest@hohndel.org]"); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf", &dive_table), 0); QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0); clear_dive_file_data(); - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesV3viacloud.ssrf"), 0); QFile org("./SampleDivesV3.ssrf"); org.open(QFile::ReadOnly); @@ -144,8 +135,8 @@ void TestGitStorage::testGitStorageCloudOfflineSync() QString localCacheDir(get_local_dir("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org", "ssrftest@hohndel.org")); QString localCacheRepo = localCacheDir + "[ssrftest@hohndel.org]"; // read the local repo from the previous test and add dive 10 - QCOMPARE(parse_file(qPrintable(localCacheRepo)), 0); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test10.xml"), 0); + QCOMPARE(parse_file(qPrintable(localCacheRepo), &dive_table), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test10.xml", &dive_table), 0); // calling process_dive() sorts the table, but calling it with // is_imported == true causes it to try to update the window title... let's not do that process_dives(false, false); @@ -154,7 +145,7 @@ void TestGitStorage::testGitStorageCloudOfflineSync() QCOMPARE(save_dives("./SampleDivesV3plus10local.ssrf"), 0); clear_dive_file_data(); // open the cloud storage and compare - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesV3plus10viacloud.ssrf"), 0); QFile org("./SampleDivesV3plus10local.ssrf"); org.open(QFile::ReadOnly); @@ -172,7 +163,7 @@ void TestGitStorage::testGitStorageCloudOfflineSync() QDir localCacheDirectorySave(localCacheDir + "save"); QCOMPARE(localCacheDirectorySave.removeRecursively(), true); QCOMPARE(localCacheDirectory.rename(localCacheDir, localCacheDir + "save"), true); - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesV3plus10fromcloud.ssrf"), 0); org.close(); org.open(QFile::ReadOnly); @@ -193,15 +184,15 @@ void TestGitStorage::testGitStorageCloudMerge() QString cloudTestRepo("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org[ssrftest@hohndel.org]"); QString localCacheDir(get_local_dir("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org", "ssrftest@hohndel.org")); QString localCacheRepoSave = localCacheDir + "save[ssrftest@hohndel.org]"; - QCOMPARE(parse_file(qPrintable(localCacheRepoSave)), 0); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test11.xml"), 0); + QCOMPARE(parse_file(qPrintable(localCacheRepoSave), &dive_table), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test11.xml", &dive_table), 0); process_dives(false, false); QCOMPARE(save_dives(qPrintable(localCacheRepoSave)), 0); clear_dive_file_data(); // now we open the cloud storage repo and add a different dive to it - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test12.xml"), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test12.xml", &dive_table), 0); process_dives(false, false); QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0); clear_dive_file_data(); @@ -212,13 +203,13 @@ void TestGitStorage::testGitStorageCloudMerge() QCOMPARE(localCacheDirectory.removeRecursively(), true); QDir localCacheDirectorySave(localCacheDir + "save"); QCOMPARE(localCacheDirectory.rename(localCacheDir + "save", localCacheDir), true); - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesV3plus10-11-12-merged.ssrf"), 0); clear_dive_file_data(); - QCOMPARE(parse_file("./SampleDivesV3plus10local.ssrf"), 0); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test11.xml"), 0); + QCOMPARE(parse_file("./SampleDivesV3plus10local.ssrf", &dive_table), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test11.xml", &dive_table), 0); process_dives(false, false); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test12.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test12.xml", &dive_table), 0); process_dives(false, false); QCOMPARE(save_dives("./SampleDivesV3plus10-11-12.ssrf"), 0); QFile org("./SampleDivesV3plus10-11-12-merged.ssrf"); @@ -240,7 +231,7 @@ void TestGitStorage::testGitStorageCloudMerge2() QString cloudTestRepo("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org[ssrftest@hohndel.org]"); QString localCacheDir(get_local_dir("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org", "ssrftest@hohndel.org")); QString localCacheRepo = localCacheDir + "[ssrftest@hohndel.org]"; - QCOMPARE(parse_file(qPrintable(localCacheRepo)), 0); + QCOMPARE(parse_file(qPrintable(localCacheRepo), &dive_table), 0); process_dives(false, false); struct dive *dive = get_dive(1); delete_single_dive(1); @@ -256,7 +247,7 @@ void TestGitStorage::testGitStorageCloudMerge2() QCOMPARE(localCacheDirectory.rename(localCacheDir, localCacheDir + "save"), true); } // now we open the cloud storage repo and modify that first dive - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); process_dives(false, false); dive = get_dive(1); QVERIFY(dive != NULL); @@ -272,7 +263,7 @@ void TestGitStorage::testGitStorageCloudMerge2() QCOMPARE(localCacheDirectory.removeRecursively(), true); QCOMPARE(localCacheDirectorySave.rename(localCacheDir + "save", localCacheDir), true); - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesMinus1-merged.ssrf"), 0); QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0); QFile org("./SampleDivesMinus1-merged.ssrf"); @@ -296,7 +287,7 @@ void TestGitStorage::testGitStorageCloudMerge3() QString cloudTestRepo("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org[ssrftest@hohndel.org]"); QString localCacheDir(get_local_dir("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org", "ssrftest@hohndel.org")); QString localCacheRepo = localCacheDir + "[ssrftest@hohndel.org]"; - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); process_dives(false, false); struct dive *dive = get_dive(0); QVERIFY(dive != 0); @@ -308,7 +299,7 @@ void TestGitStorage::testGitStorageCloudMerge3() QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0); clear_dive_file_data(); - QCOMPARE(parse_file(qPrintable(localCacheRepo)), 0); + QCOMPARE(parse_file(qPrintable(localCacheRepo), &dive_table), 0); process_dives(false, false); dive = get_dive(0); dive->notes = strdup("Create multi line dive notes\nDifferent line 2 and removed 3-5\n\nThat should be enough"); @@ -327,7 +318,7 @@ void TestGitStorage::testGitStorageCloudMerge3() QCOMPARE(localCacheDirectory.rename(localCacheDir, localCacheDir + "save"), true); } // now we open the cloud storage repo and modify those first dive notes differently - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); process_dives(false, false); dive = get_dive(0); dive->notes = strdup("Completely different dive notes\nBut also multi line"); @@ -345,7 +336,7 @@ void TestGitStorage::testGitStorageCloudMerge3() QCOMPARE(localCacheDirectory.removeRecursively(), true); QCOMPARE(localCacheDirectorySave.rename(localCacheDir + "save", localCacheDir), true); - QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0); + QCOMPARE(parse_file(qPrintable(cloudTestRepo), &dive_table), 0); QCOMPARE(save_dives("./SampleDivesMerge3.ssrf"), 0); // we are not trying to compare this to a pre-determined result... what this test // checks is that there are no parsing errors with the merge diff --git a/tests/testmerge.cpp b/tests/testmerge.cpp index a664e1a35..b102e239f 100644 --- a/tests/testmerge.cpp +++ b/tests/testmerge.cpp @@ -21,9 +21,9 @@ void TestMerge::testMergeEmpty() /* * check that we correctly merge mixed cylinder dives */ - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &dive_table), 0); process_dives(true, false); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml", &dive_table), 0); process_dives(true, false); QCOMPARE(save_dives("./testmerge47+48.ssrf"), 0); QFile org(SUBSURFACE_TEST_DATA "/dives/test47+48.xml"); @@ -44,9 +44,9 @@ void TestMerge::testMergeBackwards() /* * check that we correctly merge mixed cylinder dives */ - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test48.xml", &dive_table), 0); process_dives(true, false); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &dive_table), 0); process_dives(true, false); QCOMPARE(save_dives("./testmerge47+48.ssrf"), 0); QFile org(SUBSURFACE_TEST_DATA "/dives/test47+48.xml"); diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 06e20cd5c..59531af70 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -127,13 +127,13 @@ int TestParse::parseDivingLog() int TestParse::parseV2NoQuestion() { // parsing of a V2 file should work - return parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml"); + return parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); } int TestParse::parseV3() { // parsing of a V3 files should succeed - return parse_file(SUBSURFACE_TEST_DATA "/dives/test42.xml"); + return parse_file(SUBSURFACE_TEST_DATA "/dives/test42.xml", &dive_table); } void TestParse::testParse() @@ -279,7 +279,7 @@ void TestParse::testParseDLD() QString filename = SUBSURFACE_TEST_DATA "/dives/TestDiveDivelogsDE.DLD"; QVERIFY(readfile(filename.toLatin1().data(), &mem) > 0); - QVERIFY(try_to_open_zip(filename.toLatin1().data()) > 0); + QVERIFY(try_to_open_zip(filename.toLatin1().data(), &dive_table) > 0); fprintf(stderr, "number of dives from DLD: %d \n", dive_table.nr); @@ -299,8 +299,8 @@ void TestParse::testParseMerge() /* * check that we correctly merge mixed cylinder dives */ - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/ostc.xml"), 0); - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/vyper.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/ostc.xml", &dive_table), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/vyper.xml", &dive_table), 0); QCOMPARE(save_dives("./testmerge.ssrf"), 0); FILE_COMPARE("./testmerge.ssrf", SUBSURFACE_TEST_DATA "/dives/mergedVyperOstc.xml"); @@ -371,7 +371,7 @@ int TestParse::parseCSVmanual(int units, std::string file) void TestParse::exportCSVDiveDetails() { - parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml"); + parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); export_dives_xslt("testcsvexportmanual.csv", 0, 0, "xml2manualcsv.xslt"); export_dives_xslt("testcsvexportmanualimperial.csv", 0, 1, "xml2manualcsv.xslt"); @@ -420,7 +420,7 @@ int TestParse::parseCSVprofile(int units, std::string file) void TestParse::exportCSVDiveProfile() { - parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml"); + parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); export_dives_xslt("testcsvexportprofile.csv", 0, 0, "xml2csv.xslt"); export_dives_xslt("testcsvexportprofileimperial.csv", 0, 1, "xml2csv.xslt"); @@ -438,13 +438,13 @@ void TestParse::exportCSVDiveProfile() void TestParse::exportUDDF() { - parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml"); + parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); export_dives_xslt("testuddfexport.uddf", 0, 1, "uddf-export.xslt"); clear_dive_file_data(); - parse_file("testuddfexport.uddf"); + parse_file("testuddfexport.uddf", &dive_table); export_dives_xslt("testuddfexport2.uddf", 0, 1, "uddf-export.xslt"); FILE_COMPARE("testuddfexport.uddf", diff --git a/tests/testpicture.cpp b/tests/testpicture.cpp index 507a3cf79..2209e479f 100644 --- a/tests/testpicture.cpp +++ b/tests/testpicture.cpp @@ -23,7 +23,7 @@ void TestPicture::addPicture() struct picture *pic1, *pic2; verbose = 1; - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test44.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test44.xml", &dive_table), 0); dive = get_dive(0); QVERIFY(dive != NULL); pic1 = dive->picture_list; diff --git a/tests/testplan.cpp b/tests/testplan.cpp index d7413f31f..dd62aa777 100644 --- a/tests/testplan.cpp +++ b/tests/testplan.cpp @@ -58,8 +58,8 @@ void setupPlan(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(79, 260) * 60 / M_OR_FT(23, 75); - plan_add_segment(dp, 0, gas_mod(&ean36, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean36, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(79, 260), 0, 0, 1, OC); plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(79, 260), 0, 0, 1, OC); } @@ -86,8 +86,8 @@ void setupPlanVpmb45m30mTx(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(45, 150) * 60 / M_OR_FT(23, 75); - plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(45, 150), 0, 0, 1, OC); plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(45, 150), 0, 0, 1, OC); } @@ -114,8 +114,8 @@ void setupPlanVpmb60m10mTx(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(23, 75); - plan_add_segment(dp, 0, gas_mod(&tx50_15, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(tx50_15, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC); plan_add_segment(dp, 10 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC); } @@ -159,7 +159,7 @@ void setupPlanVpmb60m30minEan50(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330); - plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC); plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC); } @@ -183,7 +183,7 @@ void setupPlanVpmb60m30minTx(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330); - plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC); plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC); } @@ -231,8 +231,8 @@ void setupPlanVpmb100m60min(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(99, 330); - plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC); plan_add_segment(dp, 60 * 60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC); } @@ -258,8 +258,8 @@ void setupPlanVpmb100m10min(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(99, 330); - plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC); plan_add_segment(dp, 10 * 60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC); } @@ -307,9 +307,9 @@ void setupPlanVpmb100mTo70m30min(struct diveplan *dp) free_dps(dp); int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(18, 60); - plan_add_segment(dp, 0, gas_mod(&tx21_35, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); - plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 3, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(tx21_35, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC); + plan_add_segment(dp, 0, gas_mod(oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 3, 0, 1, OC); plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC); plan_add_segment(dp, 20 * 60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC); plan_add_segment(dp, 3 * 60, M_OR_FT(70, 230), 0, 0, 1, OC); diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp deleted file mode 100644 index 0a4492c00..000000000 --- a/tests/testpreferences.cpp +++ /dev/null @@ -1,151 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "testpreferences.h" - -#include "core/subsurface-qt/SettingsObjectWrapper.h" - -#include <QDate> -#include <QtTest> - -#define TEST(METHOD, VALUE) \ - QCOMPARE(METHOD, VALUE); \ - pref->sync(); \ - pref->load(); \ - QCOMPARE(METHOD, VALUE); - -void TestPreferences::initTestCase() -{ - QCoreApplication::setOrganizationName("Subsurface"); - QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); - QCoreApplication::setApplicationName("SubsurfaceTestPreferences"); -} - -void TestPreferences::testPreferences() -{ - auto pref = SettingsObjectWrapper::instance(); - pref->load(); - - auto pp = pref->pp_gas; - pp->setShowPn2(false); - pp->setShowPhe(false); - pp->setShowPo2(false); - pp->setPo2ThresholdMin(1.0); - pp->setPo2ThresholdMax(2.0); - pp->setPn2Threshold(3.0); - pp->setPheThreshold(4.0); - - TEST(pp->showPn2(), false); - TEST(pp->showPhe(), false); - TEST(pp->showPo2(), false); - TEST(pp->pn2Threshold(), 3.0); - TEST(pp->pheThreshold(), 4.0); - TEST(pp->po2ThresholdMin(), 1.0); - TEST(pp->po2ThresholdMax(), 2.0); - - pp->setShowPn2(true); - pp->setShowPhe(true); - pp->setShowPo2(true); - pp->setPo2ThresholdMin(4.0); - pp->setPo2ThresholdMax(5.0); - pp->setPn2Threshold(6.0); - pp->setPheThreshold(7.0); - - TEST(pp->showPn2(), true); - TEST(pp->showPhe(), true); - TEST(pp->showPo2(), true); - TEST(pp->pn2Threshold(), 6.0); - TEST(pp->pheThreshold(), 7.0); - TEST(pp->po2ThresholdMin(), 4.0); - TEST(pp->po2ThresholdMax(), 5.0); - - auto geo = pref->geocoding; - geo->setFirstTaxonomyCategory(TC_NONE); - geo->setSecondTaxonomyCategory(TC_OCEAN); - geo->setThirdTaxonomyCategory(TC_COUNTRY); - - TEST(geo->firstTaxonomyCategory(), TC_NONE); - TEST(geo->secondTaxonomyCategory(), TC_OCEAN); - TEST(geo->thirdTaxonomyCategory(), TC_COUNTRY); - - geo->setFirstTaxonomyCategory(TC_OCEAN); - geo->setSecondTaxonomyCategory(TC_COUNTRY); - geo->setThirdTaxonomyCategory(TC_NONE); - - TEST(geo->firstTaxonomyCategory(), TC_OCEAN); - TEST(geo->secondTaxonomyCategory(), TC_COUNTRY); - TEST(geo->thirdTaxonomyCategory(), TC_NONE); - - auto general = pref->general_settings; - general->setDefaultFilename("filename"); - general->setDefaultCylinder("cylinder_2"); - //TODOl: Change this to a enum. // This is 'undefined', it will need to figure out later between no_file or use_deault file. - general->setDefaultFileBehavior(0); - general->setDefaultSetPoint(0); - general->setO2Consumption(0); - general->setPscrRatio(0); - general->setUseDefaultFile(true); - - TEST(general->defaultFilename(), QStringLiteral("filename")); - TEST(general->defaultCylinder(), QStringLiteral("cylinder_2")); - TEST(general->defaultFileBehavior(), (short)LOCAL_DEFAULT_FILE); // since we have a default file, here it returns - TEST(general->defaultSetPoint(), 0); - TEST(general->o2Consumption(), 0); - TEST(general->pscrRatio(), 0); - TEST(general->useDefaultFile(), true); - - general->setDefaultFilename("no_file_name"); - general->setDefaultCylinder("cylinder_1"); - //TODOl: Change this to a enum. - general->setDefaultFileBehavior(CLOUD_DEFAULT_FILE); - - general->setDefaultSetPoint(1); - general->setO2Consumption(1); - general->setPscrRatio(1); - general->setUseDefaultFile(false); - - TEST(general->defaultFilename(), QStringLiteral("no_file_name")); - TEST(general->defaultCylinder(), QStringLiteral("cylinder_1")); - TEST(general->defaultFileBehavior(), (short)CLOUD_DEFAULT_FILE); - TEST(general->defaultSetPoint(), 1); - TEST(general->o2Consumption(), 1); - TEST(general->pscrRatio(), 1); - TEST(general->useDefaultFile(), false); - - auto language = pref->language_settings; - language->setLangLocale("en_US"); - language->setLanguage("en"); - language->setTimeFormat("hh:mm"); - language->setDateFormat("dd/mm/yy"); - language->setDateFormatShort("dd/mm"); - language->setTimeFormatOverride(false); - language->setDateFormatOverride(false); - language->setUseSystemLanguage(false); - - TEST(language->langLocale(), QStringLiteral("en_US")); - TEST(language->language(), QStringLiteral("en")); - TEST(language->timeFormat(), QStringLiteral("hh:mm")); - TEST(language->dateFormat(), QStringLiteral("dd/mm/yy")); - TEST(language->dateFormatShort(), QStringLiteral("dd/mm")); - TEST(language->timeFormatOverride(), false); - TEST(language->dateFormatOverride(), false); - TEST(language->useSystemLanguage(), false); - - language->setLangLocale("en_EN"); - language->setLanguage("br"); - language->setTimeFormat("mm:hh"); - language->setDateFormat("yy/mm/dd"); - language->setDateFormatShort("dd/yy"); - language->setTimeFormatOverride(true); - language->setDateFormatOverride(true); - language->setUseSystemLanguage(true); - - TEST(language->langLocale(), QStringLiteral("en_EN")); - TEST(language->language(), QStringLiteral("br")); - TEST(language->timeFormat(), QStringLiteral("mm:hh")); - TEST(language->dateFormat(), QStringLiteral("yy/mm/dd")); - TEST(language->dateFormatShort(), QStringLiteral("dd/yy")); - TEST(language->timeFormatOverride(), true); - TEST(language->dateFormatOverride(), true); - TEST(language->useSystemLanguage(), true); -} - -QTEST_MAIN(TestPreferences) diff --git a/tests/testpreferences.h b/tests/testpreferences.h deleted file mode 100644 index 10c875484..000000000 --- a/tests/testpreferences.h +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#ifndef TESTPREFERENCES_H -#define TESTPREFERENCES_H - -#include <QTest> -#include <functional> - -class TestPreferences : public QObject { - Q_OBJECT -private slots: - void initTestCase(); - void testPreferences(); -}; - -#endif // TESTPREFERENCES_H diff --git a/tests/testprofile.cpp b/tests/testprofile.cpp index 1a63efa56..ce7702b3e 100644 --- a/tests/testprofile.cpp +++ b/tests/testprofile.cpp @@ -4,7 +4,7 @@ void TestProfile::testRedCeiling() { - parse_file("../dives/deep.xml"); + parse_file("../dives/deep.xml", &dive_table); } QTEST_GUILESS_MAIN(TestProfile) diff --git a/tests/testqPrefAnimations.cpp b/tests/testqPrefAnimations.cpp deleted file mode 100644 index 90292f28f..000000000 --- a/tests/testqPrefAnimations.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include "testqPrefAnimations.h" - -#include "core/pref.h" -#include "core/qthelper.h" -#include "core/settings/qPref.h" - -#include <QDate> -#include <QTest> - -void TestQPrefAnimations::initTestCase() -{ - QCoreApplication::setOrganizationName("Subsurface"); - QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); - QCoreApplication::setApplicationName("SubsurfaceTestQPrefAnimations"); -} - -void TestQPrefAnimations::test_struct_get() -{ - // Test struct pref -> get func. - - auto tst = qPrefAnimations::instance(); - - prefs.animation_speed = 17; - - QCOMPARE(tst->animation_speed(), prefs.animation_speed); -} - -void TestQPrefAnimations::test_set_struct() -{ - // Test set func -> struct pref - - auto tst = qPrefAnimations::instance(); - - tst->set_animation_speed(27); - - QCOMPARE(prefs.animation_speed, 27); -} - -void TestQPrefAnimations::test_set_load_struct() -{ - // test set func -> load -> struct pref - - auto tst = qPrefAnimations::instance(); - - tst->set_animation_speed(33); - - prefs.animation_speed = 17; - - tst->load(); - QCOMPARE(prefs.animation_speed, 33); -} - -void TestQPrefAnimations::test_struct_disk() -{ - // test struct prefs -> disk - - auto tst = qPrefAnimations::instance(); - - prefs.animation_speed = 27; - - tst->sync(); - prefs.animation_speed = 35; - - tst->load(); - QCOMPARE(prefs.animation_speed, 27); -} - -void TestQPrefAnimations::test_multiple() -{ - // test multiple instances have the same information - - prefs.animation_speed = 37; - auto tst_direct = new qPrefAnimations; - - prefs.animation_speed = 25; - auto tst = qPrefAnimations::instance(); - - QCOMPARE(tst->animation_speed(), tst_direct->animation_speed()); - QCOMPARE(tst_direct->animation_speed(), 25); -} - -QTEST_MAIN(TestQPrefAnimations) diff --git a/tests/testqPrefCloudStorage.cpp b/tests/testqPrefCloudStorage.cpp index 2ca2bb81a..2c6a4449f 100644 --- a/tests/testqPrefCloudStorage.cpp +++ b/tests/testqPrefCloudStorage.cpp @@ -266,4 +266,18 @@ void TestQPrefCloudStorage::test_oldPreferences() TEST(cloud->cloud_verification_status(), 1); } +void TestQPrefCloudStorage::test_loadFromCloud_var() +{ + auto cloud = qPrefCloudStorage::instance(); + + cloud->set_loadFromCloud("mail1", true); + cloud->set_loadFromCloud("mail2", false); + cloud->set_loadFromCloud("mail3", true); + + QCOMPARE(cloud->loadFromCloud("mail1"), true); + QCOMPARE(cloud->loadFromCloud("mail2"), false); + QCOMPARE(cloud->loadFromCloud("mail3"), true); + QCOMPARE(cloud->loadFromCloud("mail_unknown"), false); +} + QTEST_MAIN(TestQPrefCloudStorage) diff --git a/tests/testqPrefCloudStorage.h b/tests/testqPrefCloudStorage.h index 077ca74b6..e853c11ae 100644 --- a/tests/testqPrefCloudStorage.h +++ b/tests/testqPrefCloudStorage.h @@ -15,6 +15,7 @@ private slots: void test_struct_disk(); void test_multiple(); void test_oldPreferences(); + void test_loadFromCloud_var(); }; #endif // TESTQPREFCLOUDSTORAGE_H diff --git a/tests/testqPrefDisplay.cpp b/tests/testqPrefDisplay.cpp index 0f534c0da..ce4d627ed 100644 --- a/tests/testqPrefDisplay.cpp +++ b/tests/testqPrefDisplay.cpp @@ -21,17 +21,17 @@ void TestQPrefDisplay::test_struct_get() auto display = qPrefDisplay::instance(); + prefs.animation_speed = 17; prefs.display_invalid_dives = true; prefs.divelist_font = copy_qstring("comic"); prefs.font_size = 12.0; prefs.show_developer = false; - prefs.theme = copy_qstring("myTheme"); + QCOMPARE(display->animation_speed(), prefs.animation_speed); QCOMPARE(display->display_invalid_dives(), prefs.display_invalid_dives); QCOMPARE(display->divelist_font(), QString(prefs.divelist_font)); QCOMPARE(display->font_size(), prefs.font_size); QCOMPARE(display->show_developer(), prefs.show_developer); - QCOMPARE(display->theme(), QString(prefs.theme)); } void TestQPrefDisplay::test_set_struct() @@ -40,17 +40,39 @@ void TestQPrefDisplay::test_set_struct() auto display = qPrefDisplay::instance(); + display->set_animation_speed(27); display->set_display_invalid_dives(true); display->set_divelist_font("doNotCareAtAll"); display->set_font_size(12.0); display->set_show_developer(false); display->set_theme("myTheme"); - + display->set_lastDir("test1"); + display->set_tooltip_position(QPointF(512, 3)); + display->set_UserSurvey("my1"); + display->set_mainSplitter("main1"); + display->set_topSplitter("top1"); + display->set_bottomSplitter("bottom1"); + display->set_maximized(false); + display->set_geometry("geo1"); + display->set_windowState("win1"); + display->set_lastState(17); + + QCOMPARE(prefs.animation_speed, 27); QCOMPARE(prefs.display_invalid_dives, true); QCOMPARE(prefs.divelist_font, "doNotCareAtAll"); QCOMPARE(prefs.font_size, 12.0); QCOMPARE(prefs.show_developer, false); - QCOMPARE(prefs.theme, "myTheme"); + QCOMPARE(display->theme(), QString("myTheme")); + QCOMPARE(display->lastDir(), QString("test1")); + QCOMPARE(display->tooltip_position(), QPointF(512, 3)); + QCOMPARE(display->UserSurvey(), QString("my1")); + QCOMPARE(display->mainSplitter(), QByteArray("main1")); + QCOMPARE(display->topSplitter(), QByteArray("top1")); + QCOMPARE(display->bottomSplitter(), QByteArray("bottom1")); + QCOMPARE(display->maximized(), false); + QCOMPARE(display->geometry(), QByteArray("geo1")); + QCOMPARE(display->windowState(), QByteArray("win1")); + QCOMPARE(display->lastState(), 17); } void TestQPrefDisplay::test_set_load_struct() @@ -59,24 +81,46 @@ void TestQPrefDisplay::test_set_load_struct() auto display = qPrefDisplay::instance(); + display->set_animation_speed(33); display->set_display_invalid_dives(false); display->set_divelist_font("doNotCareString"); display->set_font_size(15.0); display->set_show_developer(true); display->set_theme("myTheme2"); - + display->set_lastDir("test2"); + display->set_tooltip_position(QPointF(612, 3)); + display->set_UserSurvey("my2"); + display->set_mainSplitter("main2"); + display->set_topSplitter("top2"); + display->set_bottomSplitter("bottom2"); + display->set_maximized(true); + display->set_geometry("geo2"); + display->set_windowState("win2"); + display->set_lastState(27); + + prefs.animation_speed = 17; prefs.display_invalid_dives = true; prefs.divelist_font = copy_qstring("doNotCareAtAll"); prefs.font_size = 12.0; prefs.show_developer = false; - prefs.theme = copy_qstring("myTheme"); display->load(); + QCOMPARE(prefs.animation_speed, 33); QCOMPARE(prefs.display_invalid_dives, false); QCOMPARE(prefs.divelist_font, "doNotCareString"); QCOMPARE(prefs.font_size, 15.0); QCOMPARE(prefs.show_developer, true); - QCOMPARE(prefs.theme, "myTheme2"); + QCOMPARE(display->theme(), QString("myTheme2")); + QCOMPARE(display->lastDir(), QString("test2")); + QCOMPARE(display->tooltip_position(), QPointF(612, 3)); + QCOMPARE(display->UserSurvey(), QString("my2")); + QCOMPARE(display->mainSplitter(), QByteArray("main2")); + QCOMPARE(display->topSplitter(), QByteArray("top2")); + QCOMPARE(display->bottomSplitter(), QByteArray("bottom2")); + QCOMPARE(display->maximized(), true); + QCOMPARE(display->geometry(), QByteArray("geo2")); + QCOMPARE(display->windowState(), QByteArray("win2")); + QCOMPARE(display->lastState(), 27); } void TestQPrefDisplay::test_struct_disk() @@ -85,25 +129,25 @@ void TestQPrefDisplay::test_struct_disk() auto display = qPrefDisplay::instance(); + prefs.animation_speed = 27; prefs.display_invalid_dives = true; prefs.divelist_font = copy_qstring("doNotCareAtAll"); prefs.font_size = 17.0; prefs.show_developer = false; - prefs.theme = copy_qstring("myTheme3"); display->sync(); + prefs.animation_speed = 35; prefs.display_invalid_dives = false; prefs.divelist_font = copy_qstring("noString"); prefs.font_size = 11.0; prefs.show_developer = true; - prefs.theme = copy_qstring("myTheme"); display->load(); + QCOMPARE(prefs.animation_speed, 27); QCOMPARE(prefs.display_invalid_dives, true); QCOMPARE(prefs.divelist_font, "doNotCareAtAll"); QCOMPARE(prefs.font_size, 17.0); QCOMPARE(prefs.show_developer, false); - QCOMPARE(prefs.theme, "myTheme3"); } void TestQPrefDisplay::test_multiple() diff --git a/tests/testqPrefGeneral.cpp b/tests/testqPrefGeneral.cpp new file mode 100644 index 000000000..c26616e90 --- /dev/null +++ b/tests/testqPrefGeneral.cpp @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "testqPrefGeneral.h" + +#include "core/pref.h" +#include "core/qthelper.h" +#include "core/settings/qPref.h" + +#include <QTest> + +void TestQPrefGeneral::initTestCase() +{ + QCoreApplication::setOrganizationName("Subsurface"); + QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); + QCoreApplication::setApplicationName("SubsurfaceTestQPrefGeneral"); +} + +void TestQPrefGeneral::test_struct_get() +{ + // Test struct pref -> get func. + + auto tst = qPrefGeneral::instance(); + + prefs.auto_recalculate_thumbnails = true; + prefs.default_cylinder = copy_qstring("new base11"); + prefs.default_filename = copy_qstring("new base12"); + prefs.default_file_behavior = UNDEFINED_DEFAULT_FILE; + prefs.defaultsetpoint = 14; + prefs.extract_video_thumbnails = true; + prefs.extract_video_thumbnails_position = 15; + prefs.ffmpeg_executable = copy_qstring("new base16"); + prefs.o2consumption = 17; + prefs.pscr_ratio = 18; + prefs.use_default_file = true; + + QCOMPARE(tst->auto_recalculate_thumbnails(), prefs.auto_recalculate_thumbnails); + QCOMPARE(tst->default_cylinder(), QString(prefs.default_cylinder)); + QCOMPARE(tst->default_filename(), QString(prefs.default_filename)); + QCOMPARE(tst->default_file_behavior(), prefs.default_file_behavior); + QCOMPARE(tst->defaultsetpoint(), prefs.defaultsetpoint); + QCOMPARE(tst->extract_video_thumbnails(), prefs.extract_video_thumbnails); + QCOMPARE(tst->extract_video_thumbnails_position(), prefs.extract_video_thumbnails_position); + QCOMPARE(tst->ffmpeg_executable(), QString(prefs.ffmpeg_executable)); + QCOMPARE(tst->o2consumption(), prefs.o2consumption); + QCOMPARE(tst->pscr_ratio(), prefs.pscr_ratio); + QCOMPARE(tst->use_default_file(), prefs.use_default_file); +} + +void TestQPrefGeneral::test_set_struct() +{ + // Test set func -> struct pref + + auto tst = qPrefGeneral::instance(); + + tst->set_auto_recalculate_thumbnails(false); + tst->set_default_cylinder("new base21"); + tst->set_default_filename("new base22"); + tst->set_default_file_behavior(LOCAL_DEFAULT_FILE); + tst->set_defaultsetpoint(24); + tst->set_extract_video_thumbnails(false); + tst->set_extract_video_thumbnails_position(25); + tst->set_ffmpeg_executable("new base26"); + tst->set_o2consumption(27); + tst->set_pscr_ratio(28); + tst->set_use_default_file(false); + tst->set_diveshareExport_uid("uid1"); + tst->set_diveshareExport_private(false); + + QCOMPARE(prefs.auto_recalculate_thumbnails, false); + QCOMPARE(QString(prefs.default_cylinder), QString("new base21")); + QCOMPARE(QString(prefs.default_filename), QString("new base22")); + QCOMPARE(prefs.default_file_behavior, LOCAL_DEFAULT_FILE); + QCOMPARE(prefs.defaultsetpoint, 24); + QCOMPARE(prefs.extract_video_thumbnails, false); + QCOMPARE(prefs.extract_video_thumbnails_position, 25); + QCOMPARE(QString(prefs.ffmpeg_executable), QString("new base26")); + QCOMPARE(prefs.o2consumption, 27); + QCOMPARE(prefs.pscr_ratio, 28); + QCOMPARE(prefs.use_default_file, false); + QCOMPARE(tst->diveshareExport_uid(), QString("uid1")); + QCOMPARE(tst->diveshareExport_private(), false); +} + +void TestQPrefGeneral::test_set_load_struct() +{ + // test set func -> load -> struct pref + + auto tst = qPrefGeneral::instance(); + + tst->set_auto_recalculate_thumbnails(true); + tst->set_default_cylinder("new base31"); + tst->set_default_filename("new base32"); + tst->set_default_file_behavior(NO_DEFAULT_FILE); + tst->set_defaultsetpoint(34); + tst->set_extract_video_thumbnails(true); + tst->set_extract_video_thumbnails_position(35); + tst->set_ffmpeg_executable("new base36"); + tst->set_o2consumption(37); + tst->set_pscr_ratio(38); + tst->set_use_default_file(true); + tst->set_diveshareExport_uid("uid2"); + tst->set_diveshareExport_private(true); + + prefs.auto_recalculate_thumbnails = false; + prefs.default_cylinder = copy_qstring("error"); + prefs.default_filename = copy_qstring("error"); + prefs.default_file_behavior = UNDEFINED_DEFAULT_FILE; + prefs.defaultsetpoint = 14; + prefs.extract_video_thumbnails = false; + prefs.extract_video_thumbnails_position = 15; + prefs.ffmpeg_executable = copy_qstring("error"); + prefs.o2consumption = 17; + prefs.pscr_ratio = 18; + prefs.use_default_file = false; + + tst->load(); + QCOMPARE(prefs.auto_recalculate_thumbnails, true); + QCOMPARE(QString(prefs.default_cylinder), QString("new base31")); + QCOMPARE(QString(prefs.default_filename), QString("new base32")); + QCOMPARE(prefs.default_file_behavior, NO_DEFAULT_FILE); + QCOMPARE(prefs.defaultsetpoint, 34); + QCOMPARE(prefs.extract_video_thumbnails, true); + QCOMPARE(prefs.extract_video_thumbnails_position, 35); + QCOMPARE(QString(prefs.ffmpeg_executable), QString("new base36")); + QCOMPARE(prefs.o2consumption, 37); + QCOMPARE(prefs.pscr_ratio, 38); + QCOMPARE(prefs.use_default_file, true); + QCOMPARE(tst->diveshareExport_uid(), QString("uid2")); + QCOMPARE(tst->diveshareExport_private(), true); +} + +void TestQPrefGeneral::test_struct_disk() +{ + // test struct prefs -> disk + + auto tst = qPrefGeneral::instance(); + + prefs.auto_recalculate_thumbnails = true; + prefs.default_cylinder = copy_qstring("base41"); + prefs.default_filename = copy_qstring("base42"); + prefs.default_file_behavior = CLOUD_DEFAULT_FILE; + prefs.defaultsetpoint = 44; + prefs.extract_video_thumbnails = true; + prefs.extract_video_thumbnails_position = 45; + prefs.ffmpeg_executable = copy_qstring("base46"); + prefs.o2consumption = 47; + prefs.pscr_ratio = 48; + prefs.use_default_file = true; + + tst->sync(); + prefs.auto_recalculate_thumbnails = false; + prefs.default_cylinder = copy_qstring("error"); + prefs.default_filename = copy_qstring("error"); + prefs.default_file_behavior = UNDEFINED_DEFAULT_FILE; + prefs.defaultsetpoint = 14; + prefs.extract_video_thumbnails = false; + prefs.extract_video_thumbnails_position = 15; + prefs.ffmpeg_executable = copy_qstring("error"); + prefs.o2consumption = 17; + prefs.pscr_ratio = 18; + prefs.use_default_file = false; + + tst->load(); + QCOMPARE(prefs.auto_recalculate_thumbnails, true); + QCOMPARE(QString(prefs.default_cylinder), QString("base41")); + QCOMPARE(QString(prefs.default_filename), QString("base42")); + QCOMPARE(prefs.default_file_behavior, CLOUD_DEFAULT_FILE); + QCOMPARE(prefs.defaultsetpoint, 44); + QCOMPARE(prefs.extract_video_thumbnails, true); + QCOMPARE(prefs.extract_video_thumbnails_position, 45); + QCOMPARE(QString(prefs.ffmpeg_executable), QString("base46")); + QCOMPARE(prefs.o2consumption, 47); + QCOMPARE(prefs.pscr_ratio, 48); + QCOMPARE(prefs.use_default_file, true); +} + +void TestQPrefGeneral::test_multiple() +{ + // test multiple instances have the same information + + prefs.o2consumption = 17; + auto tst_direct = new qPrefGeneral; + + prefs.pscr_ratio = 18; + auto tst = qPrefGeneral::instance(); + + QCOMPARE(tst->o2consumption(), tst_direct->o2consumption()); + QCOMPARE(tst->pscr_ratio(), tst_direct->pscr_ratio()); + QCOMPARE(tst_direct->o2consumption(), 17); + QCOMPARE(tst_direct->pscr_ratio(), 18); +} + +#define TEST(METHOD, VALUE) \ + QCOMPARE(METHOD, VALUE); \ + general->sync(); \ + general->load(); \ + QCOMPARE(METHOD, VALUE); + +void TestQPrefGeneral::test_oldPreferences() +{ + auto general = qPrefGeneral::instance(); + + general->set_default_filename("filename"); + general->set_default_cylinder("cylinder_2"); + general->set_default_file_behavior(LOCAL_DEFAULT_FILE); + general->set_defaultsetpoint(0); + general->set_o2consumption(0); + general->set_pscr_ratio(0); + general->set_use_default_file(true); + + TEST(general->default_filename(), QStringLiteral("filename")); + TEST(general->default_cylinder(), QStringLiteral("cylinder_2")); + TEST(general->default_file_behavior(), LOCAL_DEFAULT_FILE); // since we have a default file, here it returns + TEST(general->defaultsetpoint(), 0); + TEST(general->o2consumption(), 0); + TEST(general->pscr_ratio(), 0); + TEST(general->use_default_file(), true); + + general->set_default_filename("no_file_name"); + general->set_default_cylinder("cylinder_1"); + //TODOl: Change this to a enum. + general->set_default_file_behavior(CLOUD_DEFAULT_FILE); + + general->set_defaultsetpoint(1); + general->set_o2consumption(1); + general->set_pscr_ratio(1); + general->set_use_default_file(false); + + TEST(general->default_filename(), QStringLiteral("no_file_name")); + TEST(general->default_cylinder(), QStringLiteral("cylinder_1")); + TEST(general->default_file_behavior(), CLOUD_DEFAULT_FILE); + TEST(general->defaultsetpoint(), 1); + TEST(general->o2consumption(), 1); + TEST(general->pscr_ratio(), 1); + TEST(general->use_default_file(), false); +} + +QTEST_MAIN(TestQPrefGeneral) diff --git a/tests/testqPrefAnimations.h b/tests/testqPrefGeneral.h index f0ed4a195..73a223396 100644 --- a/tests/testqPrefAnimations.h +++ b/tests/testqPrefGeneral.h @@ -1,11 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 -#ifndef TESTQPREFANIMATIONS_H -#define TESTQPREFANIMATIONS_H +#ifndef TESTQPREFGENERAL_H +#define TESTQPREFGENERAL_H #include <QObject> -class TestQPrefAnimations : public QObject { +class TestQPrefGeneral : public QObject { Q_OBJECT + private slots: void initTestCase(); void test_struct_get(); @@ -13,6 +14,7 @@ private slots: void test_set_load_struct(); void test_struct_disk(); void test_multiple(); + void test_oldPreferences(); }; -#endif // TESTQPREFANIMATIONS_H +#endif // TESTQPREFGENERAL_H diff --git a/tests/testqPrefGeocoding.cpp b/tests/testqPrefGeocoding.cpp new file mode 100644 index 000000000..d7c311474 --- /dev/null +++ b/tests/testqPrefGeocoding.cpp @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "testqPrefGeocoding.h" + +#include "core/pref.h" +#include "core/qthelper.h" +#include "core/settings/qPref.h" + +#include <QTest> + +void TestQPrefGeocoding::initTestCase() +{ + QCoreApplication::setOrganizationName("Subsurface"); + QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); + QCoreApplication::setApplicationName("SubsurfaceTestQPrefGeocoding"); +} + +void TestQPrefGeocoding::test_struct_get() +{ + // Test struct pref -> get func. + + auto tst = qPrefGeocoding::instance(); + + prefs.geocoding.category[0] = TC_NONE; + prefs.geocoding.category[1] = TC_OCEAN; + prefs.geocoding.category[2] = TC_ADMIN_L1; + + QCOMPARE(tst->first_taxonomy_category(), prefs.geocoding.category[0]); + QCOMPARE(tst->second_taxonomy_category(), prefs.geocoding.category[1]); + QCOMPARE(tst->third_taxonomy_category(), prefs.geocoding.category[2]); +} + +void TestQPrefGeocoding::test_set_struct() +{ + // Test set func -> struct pref + + auto tst = qPrefGeocoding::instance(); + + tst->set_first_taxonomy_category(TC_COUNTRY); + tst->set_second_taxonomy_category(TC_ADMIN_L1); + tst->set_third_taxonomy_category(TC_ADMIN_L2); + + QCOMPARE(prefs.geocoding.category[0], TC_COUNTRY); + QCOMPARE(prefs.geocoding.category[1], TC_ADMIN_L1); + QCOMPARE(prefs.geocoding.category[2], TC_ADMIN_L2); +} + +void TestQPrefGeocoding::test_set_load_struct() +{ + // test set func -> load -> struct pref + + auto tst = qPrefGeocoding::instance(); + + tst->set_first_taxonomy_category(TC_LOCALNAME); + tst->set_second_taxonomy_category(TC_ADMIN_L3); + tst->set_third_taxonomy_category(TC_NR_CATEGORIES); + + prefs.geocoding.category[0] = TC_NONE; + prefs.geocoding.category[1] = TC_OCEAN; + prefs.geocoding.category[2] = TC_ADMIN_L1; + + tst->load(); + QCOMPARE(prefs.geocoding.category[0], TC_LOCALNAME); + QCOMPARE(prefs.geocoding.category[1], TC_ADMIN_L3); + QCOMPARE(prefs.geocoding.category[2], TC_NR_CATEGORIES); +} + +void TestQPrefGeocoding::test_struct_disk() +{ + // test struct prefs -> disk + + auto tst = qPrefGeocoding::instance(); + + prefs.geocoding.category[0] = TC_NONE; + prefs.geocoding.category[1] = TC_OCEAN; + prefs.geocoding.category[2] = TC_ADMIN_L1; + + tst->sync(); + prefs.geocoding.category[0] = TC_ADMIN_L2; + prefs.geocoding.category[1] = TC_ADMIN_L2; + prefs.geocoding.category[2] = TC_ADMIN_L2; + + tst->load(); + QCOMPARE(prefs.geocoding.category[0], TC_NONE); + QCOMPARE(prefs.geocoding.category[1], TC_OCEAN); + QCOMPARE(prefs.geocoding.category[2], TC_ADMIN_L1); +} + +void TestQPrefGeocoding::test_multiple() +{ + // test multiple instances have the same information + + prefs.geocoding.category[0] = TC_NONE; + auto tst_direct = new qPrefGeocoding; + + prefs.geocoding.category[1] = TC_OCEAN; + auto tst = qPrefGeocoding::instance(); + + QCOMPARE(tst->first_taxonomy_category(), tst_direct->first_taxonomy_category()); + QCOMPARE(tst->second_taxonomy_category(), tst_direct->second_taxonomy_category()); + QCOMPARE(tst->first_taxonomy_category(), TC_NONE); + QCOMPARE(tst->second_taxonomy_category(), TC_OCEAN); +} + +#define TEST(METHOD, VALUE) \ + QCOMPARE(METHOD, VALUE); \ + geo->sync(); \ + geo->load(); \ + QCOMPARE(METHOD, VALUE); + +void TestQPrefGeocoding::test_oldPreferences() +{ + auto geo = qPrefGeocoding::instance(); + geo->set_first_taxonomy_category(TC_NONE); + geo->set_second_taxonomy_category(TC_OCEAN); + geo->set_third_taxonomy_category(TC_COUNTRY); + + TEST(geo->first_taxonomy_category(), TC_NONE); + TEST(geo->second_taxonomy_category(), TC_OCEAN); + TEST(geo->third_taxonomy_category(), TC_COUNTRY); + + geo->set_first_taxonomy_category(TC_OCEAN); + geo->set_second_taxonomy_category(TC_COUNTRY); + geo->set_third_taxonomy_category(TC_NONE); + + TEST(geo->first_taxonomy_category(), TC_OCEAN); + TEST(geo->second_taxonomy_category(), TC_COUNTRY); + TEST(geo->third_taxonomy_category(), TC_NONE); +} + +QTEST_MAIN(TestQPrefGeocoding) diff --git a/tests/testqPrefGeocoding.h b/tests/testqPrefGeocoding.h new file mode 100644 index 000000000..deb02dc67 --- /dev/null +++ b/tests/testqPrefGeocoding.h @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef TESTQPREFGEOCODING_H +#define TESTQPREFGEOCODING_H + +#include <QObject> + +class TestQPrefGeocoding : public QObject { + Q_OBJECT + +private slots: + void initTestCase(); + void test_struct_get(); + void test_set_struct(); + void test_set_load_struct(); + void test_struct_disk(); + void test_multiple(); + void test_oldPreferences(); +}; + +#endif // TESTQPREFGEOCODING_H diff --git a/tests/testqPrefLanguage.cpp b/tests/testqPrefLanguage.cpp new file mode 100644 index 000000000..3f6db017e --- /dev/null +++ b/tests/testqPrefLanguage.cpp @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "testqPrefLanguage.h" + +#include "core/pref.h" +#include "core/qthelper.h" +#include "core/settings/qPref.h" + +#include <QTest> + +void TestQPrefLanguage::initTestCase() +{ + QCoreApplication::setOrganizationName("Subsurface"); + QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); + QCoreApplication::setApplicationName("SubsurfaceTestQPrefLanguage"); +} + +void TestQPrefLanguage::test_struct_get() +{ + // Test struct pref -> get func. + + auto tst = qPrefLanguage::instance(); + + prefs.date_format = copy_qstring("new date format"); + prefs.date_format_override = true; + prefs.date_format_short = copy_qstring("new short format"); + prefs.locale.language = copy_qstring("new lang format"); + prefs.locale.lang_locale = copy_qstring("new loc lang format"); + prefs.time_format = copy_qstring("new time format"); + prefs.time_format_override = true; + prefs.locale.use_system_language = true; + + QCOMPARE(tst->date_format(), QString(prefs.date_format)); + QCOMPARE(tst->date_format_override(), prefs.date_format_override); + QCOMPARE(tst->date_format_short(), QString(prefs.date_format_short)); + QCOMPARE(tst->language(), QString(prefs.locale.language)); + QCOMPARE(tst->lang_locale(), QString(prefs.locale.lang_locale)); + QCOMPARE(tst->time_format(), QString(prefs.time_format)); + QCOMPARE(tst->time_format_override(), prefs.time_format_override); + QCOMPARE(tst->use_system_language(), prefs.locale.use_system_language); +} + +void TestQPrefLanguage::test_set_struct() +{ + // Test set func -> struct pref + + auto tst = qPrefLanguage::instance(); + + tst->set_date_format("new date2"); + tst->set_date_format_override(false); + tst->set_date_format_short("new short2"); + tst->set_language("new lang format"); + tst->set_lang_locale("new loc lang2"); + tst->set_time_format("new time2"); + tst->set_time_format_override(false); + tst->set_use_system_language(false); + + QCOMPARE(tst->date_format(), QString("new date2")); + QCOMPARE(tst->date_format_override(), false); + QCOMPARE(tst->date_format_short(), QString("new short2")); + QCOMPARE(tst->language(), QString("new lang format")); + QCOMPARE(tst->lang_locale(), QString("new loc lang2")); + QCOMPARE(tst->time_format(), QString("new time2")); + QCOMPARE(tst->time_format_override(), false); + QCOMPARE(tst->use_system_language(), false); +} + +void TestQPrefLanguage::test_set_load_struct() +{ + // test set func -> load -> struct pref + + auto tst = qPrefLanguage::instance(); + + tst->set_date_format("new date3"); + tst->set_date_format_override(true); + tst->set_date_format_short("new short3"); + tst->set_language("new lang format3"); + tst->set_lang_locale("new loc lang3"); + tst->set_time_format("new time3"); + tst->set_time_format_override(true); + tst->set_use_system_language(true); + + prefs.date_format = copy_qstring("error3"); + prefs.date_format_override = false; + prefs.date_format_short = copy_qstring("error3"); + prefs.locale.language = copy_qstring("error3"); + prefs.locale.lang_locale = copy_qstring("error3"); + prefs.time_format = copy_qstring("error3"); + prefs.time_format_override = false; + prefs.locale.use_system_language = false; + + tst->load(); + QCOMPARE(QString(prefs.date_format), QString("new date3")); + QCOMPARE(prefs.date_format_override, true); + QCOMPARE(QString(prefs.date_format_short), QString("new short3")); + QCOMPARE(QString(prefs.locale.language), QString("new lang format3")); + QCOMPARE(QString(prefs.locale.lang_locale), QString("new loc lang3")); + QCOMPARE(QString(prefs.time_format), QString("new time3")); + QCOMPARE(prefs.time_format_override, true); + QCOMPARE(prefs.locale.use_system_language, true); +} + +void TestQPrefLanguage::test_struct_disk() +{ + // test struct prefs -> disk + + auto tst = qPrefLanguage::instance(); + + prefs.date_format = copy_qstring("new date format"); + prefs.date_format_override = true; + prefs.date_format_short = copy_qstring("new short format"); + prefs.locale.language = copy_qstring("new lang format"); + prefs.locale.lang_locale = copy_qstring("new loc lang format"); + prefs.time_format = copy_qstring("new time format"); + prefs.time_format_override = true; + prefs.locale.use_system_language = true; + + tst->sync(); + prefs.date_format = copy_qstring("error3"); + prefs.date_format_override = false; + prefs.date_format_short = copy_qstring("error3"); + prefs.locale.language = copy_qstring("error3"); + prefs.locale.lang_locale = copy_qstring("error3"); + prefs.time_format = copy_qstring("error3"); + prefs.time_format_override = false; + prefs.locale.use_system_language = false; + + tst->load(); + QCOMPARE(QString(prefs.date_format), QString("new date format")); + QCOMPARE(prefs.date_format_override, true); + QCOMPARE(QString(prefs.date_format_short), QString("new short format")); + QCOMPARE(QString(prefs.locale.language), QString("new lang format")); + QCOMPARE(QString(prefs.locale.lang_locale), QString("new loc lang format")); + QCOMPARE(QString(prefs.time_format), QString("new time format")); + QCOMPARE(prefs.time_format_override, true); + QCOMPARE(prefs.locale.use_system_language, true); +} + +void TestQPrefLanguage::test_multiple() +{ + // test multiple instances have the same information + + prefs.locale.use_system_language = false; + auto tst_direct = new qPrefLanguage; + + prefs.time_format_override = true; + auto tst = qPrefLanguage::instance(); + + QCOMPARE(tst->use_system_language(), tst_direct->use_system_language()); + QCOMPARE(tst->time_format_override(), tst_direct->time_format_override()); + QCOMPARE(tst_direct->use_system_language(), false); + QCOMPARE(tst_direct->time_format_override(), true); +} + +#define TEST(METHOD, VALUE) \ + QCOMPARE(METHOD, VALUE); \ + language->sync(); \ + language->load(); \ + QCOMPARE(METHOD, VALUE); + +void TestQPrefLanguage::test_oldPreferences() +{ + auto language = qPrefLanguage::instance(); + language->set_lang_locale("en_US"); + language->set_language("en"); + language->set_time_format("hh:mm"); + language->set_date_format("dd/mm/yy"); + language->set_date_format_short("dd/mm"); + language->set_time_format_override(false); + language->set_date_format_override(false); + language->set_use_system_language(false); + + TEST(language->lang_locale(), QStringLiteral("en_US")); + TEST(language->language(), QStringLiteral("en")); + TEST(language->time_format(), QStringLiteral("hh:mm")); + TEST(language->date_format(), QStringLiteral("dd/mm/yy")); + TEST(language->date_format_short(), QStringLiteral("dd/mm")); + TEST(language->time_format_override(), false); + TEST(language->date_format_override(), false); + TEST(language->use_system_language(), false); + + language->set_lang_locale("en_EN"); + language->set_language("br"); + language->set_time_format("mm:hh"); + language->set_date_format("yy/mm/dd"); + language->set_date_format_short("dd/yy"); + language->set_time_format_override(true); + language->set_date_format_override(true); + language->set_use_system_language(true); + + TEST(language->lang_locale(), QStringLiteral("en_EN")); + TEST(language->language(), QStringLiteral("br")); + TEST(language->time_format(), QStringLiteral("mm:hh")); + TEST(language->date_format(), QStringLiteral("yy/mm/dd")); + TEST(language->date_format_short(), QStringLiteral("dd/yy")); + TEST(language->time_format_override(), true); + TEST(language->date_format_override(), true); + TEST(language->use_system_language(), true); + +} + +QTEST_MAIN(TestQPrefLanguage) diff --git a/tests/testqPrefLanguage.h b/tests/testqPrefLanguage.h new file mode 100644 index 000000000..c10b99930 --- /dev/null +++ b/tests/testqPrefLanguage.h @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef TESTQPREFLANGUAGE_H +#define TESTQPREFLANGUAGE_H + +#include <QObject> + +class TestQPrefLanguage : public QObject { + Q_OBJECT + +private slots: + void initTestCase(); + void test_struct_get(); + void test_set_struct(); + void test_set_load_struct(); + void test_struct_disk(); + void test_multiple(); + void test_oldPreferences(); +}; + +#endif // TESTQPREFLANGUAGE_H diff --git a/tests/testqPrefPartialPressureGas.cpp b/tests/testqPrefPartialPressureGas.cpp new file mode 100644 index 000000000..5e5c090ab --- /dev/null +++ b/tests/testqPrefPartialPressureGas.cpp @@ -0,0 +1,187 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "testqPrefPartialPressureGas.h" + +#include "core/pref.h" +#include "core/qthelper.h" +#include "core/settings/qPref.h" + +#include <QTest> + +void TestQPrefPartialPressureGas::initTestCase() +{ + QCoreApplication::setOrganizationName("Subsurface"); + QCoreApplication::setOrganizationDomain("subsurface.hohndel.org"); + QCoreApplication::setApplicationName("SubsurfaceTestQPrefPartialPressureGas"); +} + +void TestQPrefPartialPressureGas::test_struct_get() +{ + // Test struct pref -> get func. + + auto tst = qPrefPartialPressureGas::instance(); + + prefs.pp_graphs.phe = true; + prefs.pp_graphs.phe_threshold = 21.2; + prefs.pp_graphs.pn2 = true; + prefs.pp_graphs.pn2_threshold = 21.3; + prefs.pp_graphs.po2 = true; + prefs.pp_graphs.po2_threshold_max = 21.4; + prefs.pp_graphs.po2_threshold_min = 21.5; + + QCOMPARE(tst->phe(), prefs.pp_graphs.phe); + QCOMPARE(tst->phe_threshold(), prefs.pp_graphs.phe_threshold); + QCOMPARE(tst->pn2(), prefs.pp_graphs.pn2); + QCOMPARE(tst->pn2_threshold(), prefs.pp_graphs.pn2_threshold); + QCOMPARE(tst->po2(), prefs.pp_graphs.po2); + QCOMPARE(tst->po2_threshold_max(), prefs.pp_graphs.po2_threshold_max); + QCOMPARE(tst->po2_threshold_min(), prefs.pp_graphs.po2_threshold_min); +} + +void TestQPrefPartialPressureGas::test_set_struct() +{ + // Test set func -> struct pref + + auto tst = qPrefPartialPressureGas::instance(); + + tst->set_phe(false); + tst->set_phe_threshold(22.2); + tst->set_pn2(false); + tst->set_pn2_threshold(22.3); + tst->set_po2(false); + tst->set_po2_threshold_max(22.4); + tst->set_po2_threshold_min(22.5); + + QCOMPARE(prefs.pp_graphs.phe, false); + QCOMPARE(prefs.pp_graphs.phe_threshold, 22.2); + QCOMPARE(prefs.pp_graphs.pn2, false); + QCOMPARE(prefs.pp_graphs.pn2_threshold, 22.3); + QCOMPARE(prefs.pp_graphs.po2, false); + QCOMPARE(prefs.pp_graphs.po2_threshold_max, 22.4); + QCOMPARE(prefs.pp_graphs.po2_threshold_min, 22.5); +} + +void TestQPrefPartialPressureGas::test_set_load_struct() +{ + // test set func -> load -> struct pref + + auto tst = qPrefPartialPressureGas::instance(); + + tst->set_phe(true); + tst->set_phe_threshold(23.2); + tst->set_pn2(true); + tst->set_pn2_threshold(23.3); + tst->set_po2(true); + tst->set_po2_threshold_max(23.4); + tst->set_po2_threshold_min(23.5); + + prefs.pp_graphs.phe = false; + prefs.pp_graphs.phe_threshold = 21.2; + prefs.pp_graphs.pn2 = false; + prefs.pp_graphs.pn2_threshold = 21.3; + prefs.pp_graphs.po2 = false; + prefs.pp_graphs.po2_threshold_max = 21.4; + prefs.pp_graphs.po2_threshold_min = 21.5; + + tst->load(); + QCOMPARE(prefs.pp_graphs.phe, true); + QCOMPARE(prefs.pp_graphs.phe_threshold, 23.2); + QCOMPARE(prefs.pp_graphs.pn2, true); + QCOMPARE(prefs.pp_graphs.pn2_threshold, 23.3); + QCOMPARE(prefs.pp_graphs.po2, true); + QCOMPARE(prefs.pp_graphs.po2_threshold_max, 23.4); + QCOMPARE(prefs.pp_graphs.po2_threshold_min, 23.5); +} + +void TestQPrefPartialPressureGas::test_struct_disk() +{ + // test struct prefs -> disk + + auto tst = qPrefPartialPressureGas::instance(); + + prefs.pp_graphs.phe = false; + prefs.pp_graphs.phe_threshold = 24.2; + prefs.pp_graphs.pn2 = false; + prefs.pp_graphs.pn2_threshold = 24.3; + prefs.pp_graphs.po2 = false; + prefs.pp_graphs.po2_threshold_max = 24.4; + prefs.pp_graphs.po2_threshold_min = 24.5; + + tst->sync(); + prefs.pp_graphs.phe = true; + prefs.pp_graphs.phe_threshold = 1.2; + prefs.pp_graphs.pn2 = true; + prefs.pp_graphs.pn2_threshold = 1.3; + prefs.pp_graphs.po2 = true; + prefs.pp_graphs.po2_threshold_max = 1.4; + prefs.pp_graphs.po2_threshold_min = 1.5; + + tst->load(); + QCOMPARE(prefs.pp_graphs.phe, false); + QCOMPARE(prefs.pp_graphs.phe_threshold, 24.2); + QCOMPARE(prefs.pp_graphs.pn2, false); + QCOMPARE(prefs.pp_graphs.pn2_threshold, 24.3); + QCOMPARE(prefs.pp_graphs.po2, false); + QCOMPARE(prefs.pp_graphs.po2_threshold_max, 24.4); + QCOMPARE(prefs.pp_graphs.po2_threshold_min, 24.5); +} + +void TestQPrefPartialPressureGas::test_multiple() +{ + // test multiple instances have the same information + + prefs.pp_graphs.phe_threshold = 2.2; + auto tst_direct = new qPrefPartialPressureGas; + + prefs.pp_graphs.pn2_threshold = 2.3; + auto tst = qPrefPartialPressureGas::instance(); + + QCOMPARE(tst->phe_threshold(), tst_direct->phe_threshold()); + QCOMPARE(tst->pn2_threshold(), tst_direct->pn2_threshold()); + QCOMPARE(tst_direct->phe_threshold(), 2.2); + QCOMPARE(tst_direct->pn2_threshold(), 2.3); +} + +#define TEST(METHOD, VALUE) \ + QCOMPARE(METHOD, VALUE); \ + pp->sync(); \ + pp->load(); \ + QCOMPARE(METHOD, VALUE); + +void TestQPrefPartialPressureGas::test_oldPreferences() +{ + auto pp = qPrefPartialPressureGas::instance(); + pp->set_pn2(false); + pp->set_phe(false); + pp->set_po2(false); + pp->set_po2_threshold_min(1.0); + pp->set_po2_threshold_max(2.0); + pp->set_pn2_threshold(3.0); + pp->set_phe_threshold(4.0); + + TEST(pp->pn2(), false); + TEST(pp->phe(), false); + TEST(pp->po2(), false); + TEST(pp->pn2_threshold(), 3.0); + TEST(pp->phe_threshold(), 4.0); + TEST(pp->po2_threshold_min(), 1.0); + TEST(pp->po2_threshold_max(), 2.0); + + pp->set_pn2(true); + pp->set_phe(true); + pp->set_po2(true); + pp->set_po2_threshold_min(4.0); + pp->set_po2_threshold_max(5.0); + pp->set_pn2_threshold(6.0); + pp->set_phe_threshold(7.0); + + TEST(pp->pn2(), true); + TEST(pp->phe(), true); + TEST(pp->po2(), true); + TEST(pp->pn2_threshold(), 6.0); + TEST(pp->phe_threshold(), 7.0); + TEST(pp->po2_threshold_min(), 4.0); + TEST(pp->po2_threshold_max(), 5.0); + +} + +QTEST_MAIN(TestQPrefPartialPressureGas) diff --git a/tests/testqPrefPartialPressureGas.h b/tests/testqPrefPartialPressureGas.h new file mode 100644 index 000000000..28c1b20a3 --- /dev/null +++ b/tests/testqPrefPartialPressureGas.h @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0 +#ifndef TESTQPREFPARTIALPRESSUREGAS_H +#define TESTQPREFPARTIALPRESSUREGAS_H + +#include <QObject> + +class TestQPrefPartialPressureGas : public QObject { + Q_OBJECT + +private slots: + void initTestCase(); + void test_struct_get(); + void test_set_struct(); + void test_set_load_struct(); + void test_struct_disk(); + void test_multiple(); + void test_oldPreferences(); +}; + +#endif // TESTQPREFPARTIALPRESSUREGAS_H diff --git a/tests/testqPrefUpdateManager.cpp b/tests/testqPrefUpdateManager.cpp index 166fea032..4dc3c2696 100644 --- a/tests/testqPrefUpdateManager.cpp +++ b/tests/testqPrefUpdateManager.cpp @@ -23,7 +23,7 @@ void TestQPrefUpdateManager::test_struct_get() prefs.update_manager.dont_check_for_updates = true; prefs.update_manager.dont_check_exists = true; prefs.update_manager.last_version_used = copy_qstring("last_version"); - prefs.update_manager.next_check = copy_qstring(QString("11/09/1957")); + prefs.update_manager.next_check = QDate::fromString("11/09/1957", "dd/MM/yyyy").toJulianDay(); QCOMPARE(tst->dont_check_for_updates(), true); QCOMPARE(tst->dont_check_exists(), true); @@ -40,12 +40,14 @@ void TestQPrefUpdateManager::test_set_struct() tst->set_dont_check_for_updates(false); tst->set_dont_check_exists(false); tst->set_last_version_used("last_version2"); - prefs.update_manager.next_check = copy_qstring(QString("11/09/1957")); + tst->set_next_check(QDate::fromString("11/09/1957", "dd/MM/yyyy")); + tst->set_uuidString("uuid"); QCOMPARE(prefs.update_manager.dont_check_for_updates, false); QCOMPARE(prefs.update_manager.dont_check_exists, false); QCOMPARE(QString(prefs.update_manager.last_version_used), QString("last_version2")); - QCOMPARE(QDate::fromString(QString(prefs.update_manager.next_check), "dd/MM/yyyy"), QDate::fromString("11/09/1957", "dd/MM/yyyy")); + QCOMPARE(QDate::fromJulianDay(prefs.update_manager.next_check), QDate::fromString("11/09/1957", "dd/MM/yyyy")); + QCOMPARE(tst->uuidString(), QString("uuid")); } void TestQPrefUpdateManager::test_set_load_struct() @@ -57,22 +59,24 @@ void TestQPrefUpdateManager::test_set_load_struct() // secure set_ stores on disk prefs.update_manager.dont_check_for_updates = true; prefs.update_manager.dont_check_exists = true; - prefs.update_manager.next_check = copy_qstring(QString("value1")); + prefs.update_manager.next_check = 100; tst->set_dont_check_for_updates(false); tst->set_dont_check_exists(false); tst->set_last_version_used("last_version2"); tst->set_next_check(QDate::fromString("11/09/1957", "dd/MM/yyyy")); + tst->set_uuidString("uuid2"); prefs.update_manager.dont_check_for_updates = true; prefs.update_manager.dont_check_exists = true; prefs.update_manager.last_version_used = copy_qstring("last_version"); - prefs.update_manager.next_check = copy_qstring(QString("01/01/2018")); + prefs.update_manager.next_check = 1000; tst->load(); QCOMPARE(prefs.update_manager.dont_check_for_updates, false); QCOMPARE(QString(prefs.update_manager.last_version_used), QString("last_version2")); - QCOMPARE(QDate::fromString(QString(prefs.update_manager.next_check),"dd/MM/yyyy"), QDate::fromString("11/09/1957", "dd/MM/yyyy")); + QCOMPARE(QDate::fromJulianDay(prefs.update_manager.next_check), QDate::fromString("11/09/1957", "dd/MM/yyyy")); + QCOMPARE(tst->uuidString(), QString("uuid2")); // dont_check_exists is NOT stored on disk QCOMPARE(prefs.update_manager.dont_check_exists, true); @@ -87,13 +91,13 @@ void TestQPrefUpdateManager::test_struct_disk() prefs.update_manager.dont_check_for_updates = true; prefs.update_manager.dont_check_exists = true; prefs.update_manager.last_version_used = copy_qstring("last_version"); - prefs.update_manager.next_check = copy_qstring("11/09/1957"); + prefs.update_manager.next_check = QDate::fromString("11/09/1957", "dd/MM/yyyy").toJulianDay(); tst->sync(); prefs.update_manager.dont_check_for_updates = false; prefs.update_manager.dont_check_exists = false; prefs.update_manager.last_version_used = copy_qstring(""); - prefs.update_manager.next_check = copy_qstring("01/09/2057"); + prefs.update_manager.next_check = 1000; tst->load(); QCOMPARE(tst->dont_check_for_updates(), true); @@ -120,6 +124,16 @@ void TestQPrefUpdateManager::test_multiple() QCOMPARE(tst_direct->dont_check_exists(), false); } +void TestQPrefUpdateManager::test_next_check() +{ + auto tst = qPrefUpdateManager::instance(); + + prefs.update_manager.next_check = QDate::fromString("11/09/1957", "dd/MM/yyyy").toJulianDay(); + prefs.update_manager.next_check++; + + QCOMPARE(tst->next_check(), QDate::fromString("12/09/1957", "dd/MM/yyyy")); +} + #define TEST(METHOD, VALUE) \ QCOMPARE(METHOD, VALUE); \ update->sync(); \ diff --git a/tests/testqPrefUpdateManager.h b/tests/testqPrefUpdateManager.h index 5dc58e0d2..baa8d3489 100644 --- a/tests/testqPrefUpdateManager.h +++ b/tests/testqPrefUpdateManager.h @@ -15,6 +15,7 @@ private slots: void test_struct_disk(); void test_multiple(); void test_oldPreferences(); + void test_next_check(); }; #endif // TESTQPREFUPDATEMANAGER_H diff --git a/tests/testrenumber.cpp b/tests/testrenumber.cpp index 9b5a7f4af..f6a628083 100644 --- a/tests/testrenumber.cpp +++ b/tests/testrenumber.cpp @@ -7,14 +7,14 @@ void TestRenumber::setup() { - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47.xml", &dive_table), 0); process_dives(false, false); dive_table.preexisting = dive_table.nr; } void TestRenumber::testMerge() { - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47b.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47b.xml", &dive_table), 0); process_dives(true, false); QCOMPARE(dive_table.nr, 1); QCOMPARE(unsaved_changes(), 1); @@ -24,7 +24,7 @@ void TestRenumber::testMerge() void TestRenumber::testMergeAndAppend() { - QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47c.xml"), 0); + QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test47c.xml", &dive_table), 0); process_dives(true, false); QCOMPARE(dive_table.nr, 2); QCOMPARE(unsaved_changes(), 1); diff --git a/tests/tst_qPrefAnimations.qml b/tests/tst_qPrefAnimations.qml deleted file mode 100644 index 01e59fa42..000000000 --- a/tests/tst_qPrefAnimations.qml +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -import QtQuick 2.6 -import QtTest 1.2 -import org.subsurfacedivelog.mobile 1.0 - -TestCase { - name: "qPrefAnimations" - - SsrfAnimationsPrefs { - id: tst - } - - function test_variables() { - var x1 = tst.animation_speed; - tst.animation_speed = 37 - compare(tst.animation_speed, 37) - } - -} diff --git a/tests/tst_qPrefDisplay.qml b/tests/tst_qPrefDisplay.qml index eb4e11e30..e25f17bf8 100644 --- a/tests/tst_qPrefDisplay.qml +++ b/tests/tst_qPrefDisplay.qml @@ -11,21 +11,68 @@ TestCase { } function test_variables() { + var x0 = display.animation_speed + display.animation_speed = 37 + compare(display.animation_speed, 37) + var x1 = display.divelist_font display.divelist_font = "helvitica" compare(display.divelist_font, "helvitica") + var x2 = display.font_size display.font_size = 12.0 compare(display.font_size, 12.0) + var x3 = display.display_invalid_dives display.display_invalid_dives = !x3 compare(display.display_invalid_dives, !x3) + var x4 = display.show_developer display.show_developer = !x4 compare(display.show_developer, !x4) + var x5 = display.theme display.theme = "myColor" compare(display.theme, "myColor") - } +//TBD var x6 = display.tooltip_position +//TBD display.tooltip_position = ?? +//TBD compare(display.tooltip_position, ??) + + var x7 = display.lastDir + display.lastDir = "myDir" + compare(display.lastDir, "myDir") + + var x8 = display.UserSurvey + display.UserSurvey = "yes" + compare(display.UserSurvey, "yes") + +//TBD var x9 = display.mainSplitter +//TBD display.mainSplitter = ??? +//TBD compare(display.mainSplitter, ???) + +//TBD var x10 = display.topSplitter +//TBD display.topSplitter = ??? +//TBD compare(display.topSplitter, ???) + +//TBD var x11 = display.bottomSplitter +//TBD display.bottomSplitter = ??? +//TBD compare(display.bottomSplitter, ???) + + var x12 = display.maximized + display.maximized = true + compare(display.maximized, true) + +//TBD var x13 = display.geometry +//TBD display.geometry = ??? +//TBD compare(display.geometry, ???) + +//TBD var x14 = display.windowState +//TBD display.windowState = ??? +//TBD compare(display.windowState, ???) + + var x15 = display.lastState + display.lastState = 17 + compare(display.lastState, 17) + } } diff --git a/tests/tst_qPrefGeneral.qml b/tests/tst_qPrefGeneral.qml new file mode 100644 index 000000000..5c1669056 --- /dev/null +++ b/tests/tst_qPrefGeneral.qml @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0 +import QtQuick 2.6 +import QtTest 1.2 +import org.subsurfacedivelog.mobile 1.0 + +TestCase { + name: "qPrefGeneral" + + SsrfGeneralPrefs { + id: tst + } + + SsrfPrefs { + id: prefs + } + + function test_variables() { + var x1 = tst.auto_recalculate_thumbnails + tst.auto_recalculate_thumbnails = true + compare(tst.auto_recalculate_thumbnails, true) + + var x2 = tst.default_cylinder + tst.default_cylinder = "my string" + compare(tst.default_cylinder, "my string") + + var x3 = tst.default_filename + tst.default_filename = "my string" + compare(tst.default_filename, "my string") + +//TBD var x4 = tst.default_file_behavior +//TBD tst.default_file_behavior = ?? +//TBD compare(tst.default_file_behavior, ??) + + var x5 = tst.defaultsetpoint + tst.defaultsetpoint = 17 + compare(tst.defaultsetpoint, 17) + + var x6 = tst.extract_video_thumbnails + tst.extract_video_thumbnails = true + compare(tst.extract_video_thumbnails, true) + + var x7 = tst.extract_video_thumbnails_position + tst.extract_video_thumbnails_position = 17 + compare(tst.extract_video_thumbnails_position, 17) + + var x8 = tst.ffmpeg_executable + tst.ffmpeg_executable = "my string" + compare(tst.ffmpeg_executable, "my string") + + var x9 = tst.o2consumption + tst.o2consumption = 17 + compare(tst.o2consumption, 17) + + var x10 = tst.pscr_ratio + tst.pscr_ratio = 17 + compare(tst.pscr_ratio, 17) + + var x11 = tst.use_default_file + tst.use_default_file = true + compare(tst.use_default_file, true) + + var x12 = tst.diveshareExport_uid + tst.diveshareExport_uid = "myUid" + compare(tst.diveshareExport_uid, "myUid") + + var x13 = tst.diveshareExport_private + tst.diveshareExport_private = true + compare(tst.diveshareExport_private, true) + } +} diff --git a/tests/tst_qPrefGeocoding.qml b/tests/tst_qPrefGeocoding.qml new file mode 100644 index 000000000..eb65bb7ed --- /dev/null +++ b/tests/tst_qPrefGeocoding.qml @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +import QtQuick 2.6 +import QtTest 1.2 +import org.subsurfacedivelog.mobile 1.0 + +TestCase { + name: "qPrefGeocoding" + + SsrfGeocodingPrefs { + id: geo + } + + function test_variables() { +//TBD var x1 = geo.first_taxonomy_category +//TBD geo.first_taxonomy_category = ?? +//TBD compare(geo.first_taxonom_categroy, ??) + +//TBD var x2 = geo.second_taxonomy_category +//TBD geo.second_taxonomy_category = ?? +//TBD compare(geo.second_taxonom_categroy, ??) + +//TBD var x3 = geo.third_taxonomy_category +//TBD geo.third_taxonomy_category = ?? +//TBD compare(geo.third_taxonom_categroy, ??) + } +} diff --git a/tests/tst_qPrefLanguage.qml b/tests/tst_qPrefLanguage.qml new file mode 100644 index 000000000..efcc35534 --- /dev/null +++ b/tests/tst_qPrefLanguage.qml @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0 +import QtQuick 2.6 +import QtTest 1.2 +import org.subsurfacedivelog.mobile 1.0 + +TestCase { + name: "qPrefLanguage" + + SsrfLanguagePrefs { + id: tst + } + + SsrfPrefs { + id: prefs + } + + function test_variables() { + var x1 = tst.date_format + tst.date_format = "new date format" + compare(tst.date_format, "new date format") + + var x2 = tst.date_format_override + tst.date_format_override = true + compare(tst.date_format_override, true) + + var x3 = tst.date_format_short + tst.date_format_short = "new short format" + compare(tst.date_format_short, "new short format") + + var x4 = tst.language + tst.language = "new lang format" + compare(tst.language, "new lang format") + + var x5 = tst.lang_locale + tst.lang_locale = "new loc lang format" + compare(tst.lang_locale, "new loc lang format") + + var x6 = tst.time_format + tst.time_format = "new time format" + compare(tst.time_format, "new time format") + + var x7 = tst.time_format_override + tst.time_format_override = true + compare(tst.time_format_override, true) + + var x8 = tst.use_system_language + tst.use_system_language = true + compare(tst.use_system_language, true) + } +} diff --git a/tests/tst_qPrefPartialPressureGas.qml b/tests/tst_qPrefPartialPressureGas.qml new file mode 100644 index 000000000..049ab2b93 --- /dev/null +++ b/tests/tst_qPrefPartialPressureGas.qml @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: GPL-2.0 +import QtQuick 2.6 +import QtTest 1.2 +import org.subsurfacedivelog.mobile 1.0 + +TestCase { + name: "qPrefPartialPressureGas" + + SsrfPartialPressureGasPrefs { + id: tst + } + + SsrfPrefs { + id: prefs + } + + function test_variables() { + var x1 = tst.phe = true + tst.phe = true + compare(tst.phe, true) + + var x2 = tst.phe_threshold = 21.2 + tst.phe_threshold = 21.2 + compare(tst.phe_threshold, 21.2) + + var x3 = tst.pn2 = true + tst.pn2 = true + compare(tst.pn2, true) + + var x4 = tst.pn2_threshold = 21.3 + tst.pn2_threshold = 21.3 + compare(tst.pn2_threshold, 21.3) + + var x5 = tst.po2 = true + tst.po2 = true + compare(tst.po2, true) + + var x6 = tst.po2_threshold_max = 21.4 + tst.po2_threshold_max = 21.4 + compare(tst.po2_threshold_max, 21.4) + + var x7 = tst.po2_threshold_min = 21.5 + tst.po2_threshold_min = 21.5 + compare(tst.po2_threshold_min, 21.5) + } +} diff --git a/tests/tst_qPrefUpdateManager.qml b/tests/tst_qPrefUpdateManager.qml index 3554f88c8..7b3ee07a0 100644 --- a/tests/tst_qPrefUpdateManager.qml +++ b/tests/tst_qPrefUpdateManager.qml @@ -31,5 +31,9 @@ TestCase { var x4_date = Date.fromLocaleString(Qt.locale(), "01-01-2001", "dd-MM-yyyy") tst.next_check = x4_date compare(tst.next_check, x4_date) + + var x5 = tst.uuidString + tst.uuidString = "jan again" + compare(tst.uuidString, "jan again") } } diff --git a/theme/list_lib.js b/theme/list_lib.js index 34e4a6043..409229a91 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -772,7 +772,7 @@ function showtrips() { var divelist = document.getElementById('diveslist'); divelist.innerHTML = ""; - for (var i = 0; i < trips.length; i++) { + for (var i = trips.length - 1; i >= 0; i--) { divelist.innerHTML += '<ul id="trip_' + i + '" class="trips" onclick="toggle_trip_expansion(' + i + ')">' + trips[i].name + ' ( ' + trips[i].dives.length + ' dives)' + '</ul>' + '<div id="trip_dive_list_' + i + '"></div>'; }; diff --git a/translations/subsurface_he.ts b/translations/subsurface_he.ts index 38137714c..09adec064 100644 --- a/translations/subsurface_he.ts +++ b/translations/subsurface_he.ts @@ -17,7 +17,7 @@ <message> <location filename="../mobile-widgets/qml/About.qml" line="38"/> <source>View your dive logs while on the go.</source> - <translation>הצג את יומני הצלילה שלך בדרך</translation> + <translation>הצג את יומני הצלילה שלך בדרך.</translation> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="49"/> @@ -27,13 +27,13 @@ 2011-2018</source> <translation>גרסה: %1 -© צוות פיתח של Subsurface +© צוות הפיתוח של Subsurface 2011-2018</translation> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="62"/> <source>Copy logs to clipboard</source> - <translation>העתיק לוגים ללוח</translation> + <translation>העתק לוגים ללוח</translation> </message> </context> <context> @@ -49,7 +49,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="14"/> <source>Remote Bluetooth device selection</source> - <translation>בחירת התקני Bluetooth מרוחקים</translation> + <translation>בחירת התקני בלוטות' מרוחקים</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="172"/> @@ -72,22 +72,22 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="193"/> <source>Bluetooth mode</source> - <translation>מצב Bluetooth</translation> + <translation>מצב בלוטות'</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="201"/> <source>Auto</source> - <translation>אוטומתי</translation> + <translation>אוטומטי</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="206"/> <source>Force LE</source> - <translation>הגדיר ל- BLE</translation> + <translation>אלץ BLE</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="211"/> <source>Force classical</source> - <translation>הגדיר ל-Bluetooth קלסי</translation> + <translation>אלץ מצב קלאסי</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="229"/> @@ -105,7 +105,7 @@ <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="66"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="33"/> <source>Local Bluetooth device details</source> - <translation>נתוני התקני Bluetooth מקומיים</translation> + <translation>נתוני התקני בלוטות' מקומיים</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="75"/> @@ -122,13 +122,13 @@ <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="118"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="37"/> <source>Bluetooth powered on</source> - <translation>Bluetooth פועל</translation> + <translation>בלוטות' פועל</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="140"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="38"/> <source>Turn on/off</source> - <translation>כבה/הפעל</translation> + <translation>הפעל/כבה</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="150"/> @@ -149,12 +149,12 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="139"/> <source>Trying to turn on the local Bluetooth device...</source> - <translation>מנסה להדליק התקן Bluetooth מקומי...</translation> + <translation>מנסה להדליק התקן בלוטות' מקומי...</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="142"/> <source>Trying to turn off the local Bluetooth device...</source> - <translation>מנסה לכבות התקן Bluetooth מקומי...</translation> + <translation>מנסה לכבות התקן בלוטות' מקומי...</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="174"/> @@ -175,7 +175,7 @@ <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="214"/> <source>The local Bluetooth device was %1.</source> <extracomment>%1 will be replaced with "turned on" or "turned off"</extracomment> - <translation>התקן Bluetooth מקומי היה %1.</translation> + <translation>התקן בלוטות' מקומי היה %1.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="215"/> @@ -227,7 +227,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="295"/> <source>A device needs a non-zero address for a connection.</source> - <translation>התקן דורש כתובת גדול מ-0 ע״מ להחבר</translation> + <translation>התקן דורש כתובת שאינה 0 על מנת להתחבר.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="318"/> @@ -282,7 +282,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="423"/> <source>Pairing error. If the remote device requires a custom PIN code, please try to pair the devices using your operating system. </source> - <translation>שגיאת חיבור. אם ההתקן המרוחק דורש קוד PIN, אנא נסה לשייך את המכשירים על ידי שימוש במערכת ההפעלה שלך.</translation> + <translation>שגיאת חיבור. אם ההתקן המרוחק דורש קוד PIN, אנא נסה לשייך את המכשירים על ידי שימוש במערכת ההפעלה שלך. </translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="425"/> @@ -292,7 +292,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="434"/> <source>The Bluetooth adaptor is powered off, power it on before doing discovery.</source> - <translation>מתאם Bluetooth כבוי, הפעל אותו לפני הפעלת סריקה.</translation> + <translation>מתאם בלוטות' כבוי, הפעל אותו לפני הפעלת סריקה.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="437"/> @@ -317,12 +317,12 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="509"/> <source>The local Bluetooth adapter cannot be accessed.</source> - <translation>לא ניתן לגשת למתאם Bluetooth המקומי.</translation> + <translation>לא ניתן לגשת למתאם בלוטות' המקומי.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="559"/> <source>The device discovery agent was not created because the %1 address does not match the physical adapter address of any local Bluetooth device.</source> - <translation>סוכן גילוי המכשירים לא נוצר מכיוון שהכתובת %1 אינה תואמת את כתובת המתאם הפיסית של אף אחד מהתקני Bluetooth המקומיים.</translation> + <translation>סוכן גילוי המכשירים לא נוצר מכיוון שהכתובת %1 אינה תואמת את כתובת המתאם הפיסית של אף אחד מהתקני בלוטות' המקומיים.</translation> </message> </context> <context> @@ -330,7 +330,7 @@ <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="550"/> <source>Person: </source> - <translation>אדם:</translation> + <translation>אדם: </translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="551"/> @@ -351,7 +351,7 @@ <message numerus="yes"> <location filename="../core/checkcloudconnection.cpp" line="58"/> <source>Waiting for cloud connection (%n second(s) passed)</source> - <translation><numerusform>ממתין לחיבור לאיחסון בענן (%n שניה עברה)</numerusform><numerusform>ממתין לחיבור לאיחסון בענן (%n שניות עברו)</numerusform><numerusform>ממתין לחיבור לאיחסון בענן (%n שניות עברו)</numerusform><numerusform>ממתין לחיבור לאיחסון בענן (%n שניות עברו)</numerusform></translation> + <translation><numerusform>ממתין לחיבור לאחסון בענן (%n שניה עברה)</numerusform><numerusform>ממתין לחיבור לאיחסון בענן (%n שניות עברו)</numerusform><numerusform>ממתין לחיבור לאחסון בענן (%n שניות עברו)</numerusform><numerusform>ממתין לחיבור לאחסון בענן (%n שניות עברו)</numerusform></translation> </message> <message> <location filename="../core/checkcloudconnection.cpp" line="65"/> @@ -379,12 +379,12 @@ <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="89"/> <source>PIN</source> - <translation>מספר זיהוי</translation> + <translation>PIN</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="106"/> <source>Register</source> - <translation>להירשם</translation> + <translation>הירשם</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="117"/> @@ -407,7 +407,7 @@ <message> <location filename="../core/cloudstorage.cpp" line="65"/> <source>Cloud account verification required, enter PIN in preferences</source> - <translation>נדרש אימות של חשבון Cloud, הזן PIN בהעדפות</translation> + <translation>נדרש אימות של חשבון ענן, הזן PIN בהעדפות</translation> </message> </context> <context> @@ -415,7 +415,7 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>Dive #</source> - <translation>צלילה מס' </translation> + <translation>צלילה מס'</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> @@ -651,7 +651,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="47"/> <source>Connect via Bluetooth</source> - <translation>התחבר ב-Bluetooth</translation> + <translation>התחבר בבלוטות'</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="54"/> @@ -696,7 +696,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="139"/> <source>Update firmware</source> - <translation>עידכון קושחה</translation> + <translation>עדכון קושחה</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="163"/> @@ -891,7 +891,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1398"/> <source>330LSB/Gauss</source> - <translation> 330LSB ל-גאוס</translation> + <translation>330LSB ל-גאוס</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1403"/> @@ -1072,7 +1072,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1725"/> <source>Left button sensitivity</source> - <translation>רגישות לחצן שמאלית</translation> + <translation>רגישות לחצן שמאלי</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1732"/> @@ -1247,7 +1247,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2852"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2971"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="845"/> @@ -1463,7 +1463,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2473"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3548"/> <source>pO₂ min</source> - <translation>לחץ למצן מינימלי</translation> + <translation>pO₂ מינימלי</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3589"/> @@ -1541,7 +1541,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3822"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3914"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3836"/> @@ -1561,12 +1561,12 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3864"/> <source>Imperial</source> - <translation>אימפריאל</translation> + <translation>אימפריאלי</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3869"/> <source>Metric</source> - <translation>מטרית</translation> + <translation>מטרי</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="487"/> @@ -1785,7 +1785,7 @@ <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Work press.</source> - <translation>לחץ מקסימלי</translation> + <translation>לחץ עבודה</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> @@ -1841,27 +1841,27 @@ <message> <location filename="../qt-models/cylindermodel.cpp" line="247"/> <source>Clicking here will remove this cylinder.</source> - <translation>לחיצה פה תסיר את המיכל הזה</translation> + <translation>לחיצה כאן תסיר מיכל זה.</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="259"/> <source>Switch depth for deco gas. Calculated using Deco pO₂ preference, unless set manually.</source> - <translation>עומק מעבר לגז דקו. מחושב באמצעות העדפת דקו pO₂, אלא אם כן נקבע באופן ידני.</translation> + <translation>עומק מעבר לגז דקו. מחושב באמצעות העדפת pO₂ דקו, אלא אם כן נקבע באופן ידני.</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="262"/> <source>Calculated using Bottom pO₂ preference. Setting MOD adjusts O₂%, set to '*' for best O₂% for max. depth.</source> - <translation>מחושב באמצעות העדפת pO₂ תחתית. הגדרת MOD מתאים% ה- O₂, הגדיר '*' עבור ה- O₂% לעומק מרבי הטוב ביותר.</translation> + <translation>מחושב באמצעות העדפת pO₂ תחתית. הגדרת MOD תשנה את O₂% בהתאם. הגדר '*' עבור O₂% מיטבי לעומק מירבי.</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="265"/> <source>Calculated using Best Mix END preference. Setting MND adjusts He%, set to '*' for best He% for max. depth.</source> - <translation>מחושב באמצעות העדפת END Mix Best. הגדרת MND המתאים He%, הגדיר '*' עבור מיטב He% לעומק מרבי.</translation> + <translation>מחושב באמצעות העדפת END Mix Best. הגדרת MND תשנה את He% בהתאם, הגדר '*' עבור He% מיטבי לעומק מרבי.</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="245"/> <source>This gas is in use. Only cylinders that are not used in the dive can be removed.</source> - <translation>הגז בשימוש. רק ניתן להסיר מיכלים שלא בשימוש בצלילה.</translation> + <translation>הגז בשימוש. ניתן להסיר רק מיכלים שאינם בשימוש בצלילה.</translation> </message> </context> <context> @@ -1966,7 +1966,7 @@ <message> <location filename="../qt-models/divecomputermodel.cpp" line="36"/> <source>Clicking here will remove this dive computer.</source> - <translation>לחיצה פה תסיר את המחשב</translation> + <translation>לחיצה כאן תסיר את המחשב.</translation> </message> </context> <context> @@ -1989,7 +1989,7 @@ <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="169"/> <source>Show on map</source> - <translation>הצג במפה</translation> + <translation>הצג על המפה</translation> </message> </context> <context> @@ -2084,7 +2084,7 @@ GPS הנוכחי:</translation> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="371"/> <source>Rating:</source> - <translation>דירוג</translation> + <translation>דירוג:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="384"/> @@ -2132,7 +2132,7 @@ GPS הנוכחי:</translation> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="112"/> <source>Rating:</source> - <translation>דירוג</translation> + <translation>דירוג:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="155"/> @@ -2170,7 +2170,7 @@ GPS הנוכחי:</translation> <message> <location filename="../profile-widget/diveeventitem.cpp" line="184"/> <source> (cyl. %1)</source> - <translation>(מכל %1)</translation> + <translation> (מיכל %1)</translation> </message> <message> <location filename="../profile-widget/diveeventitem.cpp" line="188"/> @@ -2225,12 +2225,12 @@ GPS הנוכחי:</translation> <message> <location filename="../qt-models/diveimportedmodel.cpp" line="78"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../qt-models/diveimportedmodel.cpp" line="78"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> </context> <context> @@ -2245,7 +2245,7 @@ GPS הנוכחי:</translation> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="350"/> <source>Cloud credentials</source> - <translation>זיהוי לענן</translation> + <translation>זיהוי חשבון ענן</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="357"/> @@ -2379,7 +2379,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="14"/> <source>Export dive log files</source> - <translation>יצוא קבצי יומני צלילת </translation> + <translation>יצוא קבצי יומני צלילה</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="44"/> @@ -2404,7 +2404,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="147"/> <source>di&velogs.de</source> - <translation>divelogs.de </translation> + <translation>di&velogs.de</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="157"/> @@ -2460,12 +2460,12 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="298"/> <source>Metric</source> - <translation>מטרית</translation> + <translation>מטרי</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="303"/> <source>Imperial</source> - <translation>אימפריאל</translation> + <translation>אימפריאלי</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="316"/> @@ -2591,7 +2591,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="87"/> <source>Send the dive data to dive-share.appspot.com website.</source> - <translation>שלח את נתוני צלילה לאתר dive-share.appspot.com</translation> + <translation>שלח את נתוני צלילה לאתר dive-share.appspot.com.</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="89"/> @@ -2616,7 +2616,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="138"/> <source>Export UDDF file as</source> - <translation>היצוא קובץ UDDF כ-</translation> + <translation>יצוא קובץ UDDF כ-</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="139"/> @@ -2649,17 +2649,17 @@ GPS הנוכחי:</translation> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="142"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="146"/> <source>Export CSV file as</source> - <translation>היצוא קובץ CSV כ-</translation> + <translation>יצוא קובץ CSV כ-</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="153"/> <source>Export world map</source> - <translation>היצוא מפת העולם</translation> + <translation>יצוא מפת העולם</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="158"/> <source>Export Subsurface XML</source> - <translation>היצוא XML של Subsurface</translation> + <translation>יצוא XML של Subsurface</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="167"/> @@ -2674,7 +2674,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="177"/> <source>Export HTML files as</source> - <translation>היצוא קובצי HTML כ-</translation> + <translation>יצוא קובצי HTML כ-</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="193"/> @@ -2693,7 +2693,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="14"/> <source>Import dive log file</source> - <translation> יבוא קובץ יומן צלילה</translation> + <translation>יבוא קובץ יומן צלילה</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="89"/> @@ -2728,12 +2728,12 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="127"/> <source>Metric</source> - <translation>מטרית</translation> + <translation>מטרי</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="132"/> <source>Imperial</source> - <translation>אימפריאל</translation> + <translation>אימפריאלי</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="155"/> @@ -2835,7 +2835,7 @@ GPS הנוכחי:</translation> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="749"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="874"/> <source>Dive #</source> - <translation>צלילה מס' </translation> + <translation>צלילה מס'</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="662"/> @@ -3007,7 +3007,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/diveplanner.ui" line="144"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="131"/> @@ -3050,12 +3050,12 @@ GPS הנוכחי:</translation> <message> <location filename="../qt-models/diveplannermodel.cpp" line="270"/> <source>cyl.</source> - <translation>מכל</translation> + <translation>מיכל</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="376"/> <source>Final depth</source> - <translation>עומק מירבי</translation> + <translation>עומק סופי</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="378"/> @@ -3085,12 +3085,12 @@ GPS הנוכחי:</translation> <message> <location filename="../qt-models/diveplannermodel.cpp" line="1038"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="1044"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="1047"/> @@ -3249,7 +3249,7 @@ GPS הנוכחי:</translation> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="14"/> <source>Dialog</source> - <translation>דיאלוג</translation> + <translation>תיבת דו-שיח</translation> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="61"/> @@ -3407,7 +3407,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../qt-models/divetripmodel.cpp" line="543"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="543"/> @@ -3517,7 +3517,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="897"/> <source>The archive could not be opened: </source> - <translation>אין אפשרות לפתוח את הארכיב + <translation>אין אפשרות לפתוח את הארכיב: </translation> </message> <message> @@ -3573,7 +3573,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="89"/> <source>Choose Bluetooth download mode</source> - <translation>בחר מצב הורדה ל-Bluetooth</translation> + <translation>בחר מצב הורדה לבלוטות'</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="123"/> @@ -3637,7 +3637,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="14"/> <source>Download from dive computer</source> - <translation>משוך נתונים ממחשב צלילה</translation> + <translation>הורד נתונים ממחשב צלילה</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="52"/> @@ -3655,12 +3655,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="73"/> <source>Force download of all dives</source> - <translation>משוך את כל הצלילות.</translation> + <translation>אלץ הורדת כל הצלילות.</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="80"/> <source>Always prefer downloaded dives</source> - <translation>תמיד העדף צלילות מורדות</translation> + <translation>תמיד העדף צלילות שהורדו</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="87"/> @@ -3680,12 +3680,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="122"/> <source>Choose Bluetooth download mode</source> - <translation>בחר מצב הורדה ל-Bluetooth</translation> + <translation>בחר מצב הורדה לבלוטות'</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="129"/> <source>Select a remote Bluetooth device.</source> - <translation>בחירת מכשירי Bluetooth מרחוק</translation> + <translation>בחר מכשיר בלוטות' מרוחק</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="139"/> @@ -3744,17 +3744,17 @@ p, li { white-space: pre-wrap; } <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="55"/> <source> Vendor name: </source> - <translation>שם יצרן :</translation> + <translation> שם יצרן:</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="86"/> <source> Dive Computer:</source> - <translation>מחשב צלילה:</translation> + <translation> מחשב צלילה:</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="121"/> <source> Connection:</source> - <translation>חיבור:</translation> + <translation> חיבור:</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="180"/> @@ -3774,7 +3774,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="213"/> <source> Downloaded dives</source> - <translation>צלילות שהורדו</translation> + <translation> צלילות שהורדו</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="214"/> @@ -3820,17 +3820,17 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.ui" line="82"/> <source>Connect to Facebook text placeholder</source> - <translation>להתחבר לפייסבוק מציין מיקום טקסט </translation> + <translation>מציין מיקום טקסט להתחבר לפייסבוק</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="335"/> <source>To disconnect Subsurface from your Facebook account, use the 'Share on' menu entry.</source> - <translation>על מנת לנתק Subsurface מחשבון הפייסבוק שלך, השתמש 'Share' בתפריט.</translation> + <translation>כדי לנתק את Subsurface מחשבון הפייסבוק שלך, השתמש באפשרות 'Share' בתפריט.</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="346"/> <source>To connect to Facebook, please log in. This enables Subsurface to publish dives to your timeline</source> - <translation>כדי להתחבר לפייסבוק, אנא התחבר. זה מאפשר Subsurface לפרסם צלילות לציר הזמן שלך</translation> + <translation>כדי להתחבר לפייסבוק, אנא בצע כניסה. זה מאפשר Subsurface לפרסם צלילות לציר הזמן שלך</translation> </message> </context> <context> @@ -3838,7 +3838,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="193"/> <source>Facebook logged in successfully</source> - <translation>מחובר ל-Facebook בהצלחה</translation> + <translation>כניסה לפייסבוק הצליחה</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="196"/> @@ -3848,7 +3848,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="294"/> <source>Dive uploaded successfully to Facebook</source> - <translation>הצלילה הועלתה בהצלחה ל- Facebook</translation> + <translation>הצלילה הועלתה בהצלחה לפייסבוק</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="296"/> @@ -3861,7 +3861,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plugins/facebook/facebook_integration.cpp" line="35"/> <source>Facebook</source> - <translation>Facebook</translation> + <translation>פייסבוק</translation> </message> </context> <context> @@ -3915,7 +3915,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/filterwidget.ui" line="73"/> <source>Reset filters</source> - <translation>אפס סינון</translation> + <translation>אפס סינונים</translation> </message> <message> <location filename="../desktop-widgets/filterwidget.ui" line="87"/> @@ -3933,28 +3933,28 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/findmovedimagesdialog.ui" line="23"/> <source>Find moved images</source> - <translation type="unfinished"/> + <translation>מצא תמונות שהועברו</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.ui" line="37"/> <source>Found images</source> - <translation type="unfinished"/> + <translation>תמונות שנמצאו</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.ui" line="71"/> <source>Match only images in selected dive(s)</source> - <translation type="unfinished"/> + <translation>מצא רק תמונות מצלילות שנבחרו</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.ui" line="95"/> <source>Scanning:</source> - <translation type="unfinished"/> + <translation>סורק:</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.ui" line="121"/> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="240"/> <source>Select folder and scan</source> - <translation type="unfinished"/> + <translation>בחר תיקייה וסרוק</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="173"/> @@ -3964,27 +3964,27 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="179"/> <source>Stop scanning</source> - <translation type="unfinished"/> + <translation>הפסק סריקה</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="250"/> <source>Scanning cancelled - results may be incomplete</source> - <translation type="unfinished"/> + <translation>הסריקה בוטלה - התוצאות עשויות להיות לא מלאות</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="254"/> <source>No matching images found</source> - <translation type="unfinished"/> + <translation>לא נמצאו תמונות מתאימות</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="266"/> <source>Found <b>%1</b> images at their current place.</source> - <translation type="unfinished"/> + <translation>נמצאו <b> %1 </b> תמונות במיקומן הנוכחי.</translation> </message> <message> <location filename="../desktop-widgets/findmovedimagesdialog.cpp" line="268"/> <source>Found <b>%1</b> images at new locations:</source> - <translation type="unfinished"/> + <translation>נמצאו <b> %1 </b> תמונות במיקום החדש.</translation> </message> </context> <context> @@ -3992,7 +3992,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../core/configuredivecomputerthreads.cpp" line="2233"/> <source>This feature is not yet available for the selected dive computer.</source> - <translation>אפשרות זו לא קיימת למחשב הצלילה הנבחר</translation> + <translation>אפשרות זו לא קיימת למחשב הצלילה הנבחר.</translation> </message> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="2238"/> @@ -4013,7 +4013,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../qt-models/models.cpp" line="52"/> <source>cyl.</source> - <translation>מכל</translation> + <translation>מיכל</translation> </message> </context> <context> @@ -4021,7 +4021,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../mobile-widgets/qml/kirigami/src/controls/GlobalDrawer.qml" line="336"/> <source>Back</source> - <translation>תזור</translation> + <translation>חזור</translation> </message> </context> <context> @@ -4029,27 +4029,27 @@ p, li { white-space: pre-wrap; } <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="14"/> <source>GPS Fixes</source> - <translation>נ"צים שמורים</translation> + <translation>נ"צ שמורות</translation> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="28"/> <source>Date: </source> - <translation>תאריך:</translation> + <translation>תאריך: </translation> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="40"/> <source>Name: </source> - <translation>שם:</translation> + <translation>שם: </translation> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="52"/> <source>Latitude: </source> - <translation>קו רוחב:</translation> + <translation>קו רוחב: </translation> </message> <message> <location filename="../mobile-widgets/qml/GpsList.qml" line="63"/> <source>Longitude: </source> - <translation>קו אורך:</translation> + <translation>קו אורך: </translation> </message> </context> <context> @@ -4078,7 +4078,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="556"/> <source>Location: </source> - <translation>מיקום:</translation> + <translation>מיקום: </translation> </message> </context> <context> @@ -4086,17 +4086,17 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="489"/> <source> (same GPS fix)</source> - <translation>(מיקום GPS זהה)</translation> + <translation> (מיקום GPS זהה)</translation> </message> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="494"/> <source> (~%1 away</source> - <translation>(~%1 מפה</translation> + <translation>(~%1 מכאן</translation> </message> <message numerus="yes"> <location filename="../desktop-widgets/modeldelegates.cpp" line="495"/> <source>, %n dive(s) here)</source> - <translation><numerusform>, %n צלילה/ות כאן)</numerusform><numerusform>, %n צלילה/ות כאן)</numerusform><numerusform>, %n צלילה/ות כאן)</numerusform><numerusform>, %n צלילה/ות כאן)</numerusform></translation> + <translation><numerusform>, %n צלילה כאן)</numerusform><numerusform>, %n צלילה/ות כאן)</numerusform><numerusform>, %n צלילה/ות כאן)</numerusform><numerusform>, %n צלילות כאן)</numerusform></translation> </message> <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="500"/> @@ -4111,7 +4111,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/modeldelegates.cpp" line="504"/> <source>Pick site: </source> - <translation>בחר אתר:</translation> + <translation>בחר אתר: </translation> </message> </context> <context> @@ -4220,7 +4220,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/locationinformation.cpp" line="87"/> <source>You are about to merge dive sites, you can't undo that action Are you sure you want to continue?</source> - <translation>אתה עומד למזג אתרי צלילה, אתה לא יכול לבטל את הפעולה הזו + <translation>אתה עומד למזג אתרי צלילה, לא ניתן לבטל פעולה זו האם אתה בטוח שאתה רוצה להמשיך?</translation> </message> <message> @@ -4403,7 +4403,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="346"/> <source>This trip is being edited.</source> - <translation>טיול זה בעריכה</translation> + <translation>טיול זה בעריכה.</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="353"/> @@ -4472,7 +4472,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/mainwindow.ui" line="133"/> <source>&Edit</source> - <translation>ערוך</translation> + <translation>עריכה</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="138"/> @@ -4538,12 +4538,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/mainwindow.ui" line="215"/> <source>P&references</source> - <translation>הגדרות</translation> + <translation>העדפות</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="226"/> <source>&Quit</source> - <translation>&צא</translation> + <translation>&יציאה</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="237"/> @@ -4683,7 +4683,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/mainwindow.ui" line="429"/> <source>Export dive logs</source> - <translation>יצוא יומני צלילה </translation> + <translation>יצוא יומני צלילה</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.ui" line="437"/> @@ -4879,7 +4879,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/divelistview.cpp" line="584"/> <source>Trying to merge dives with %1min interval in between</source> - <translation>מנסה למזג צלילות עם מרווח של 1% דקות ביניהם</translation> + <translation>מנסה למזג צלילות עם מרווח של %1 דקות ביניהם</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="270"/> @@ -4924,7 +4924,7 @@ If answering no, the cloud will only be synced on next call to "Open cloud <message> <location filename="../desktop-widgets/mainwindow.cpp" line="700"/> <source>Failure taking cloud storage online</source> - <translation>חיבור לאחסון בענן נכשלה</translation> + <translation>חיבור לאחסון בענן נכשל</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="769"/> @@ -5119,7 +5119,7 @@ Subsurface כבר ניסתה לאכלס מראש את הנתונים אבל כד <message> <location filename="../desktop-widgets/mainwindow.cpp" line="2029"/> <source>Contacting cloud service...</source> - <translation>מתחבר לאחסון בענן</translation> + <translation>מתחבר לאחסון בענן...</translation> </message> </context> <context> @@ -5148,12 +5148,12 @@ Subsurface כבר ניסתה לאכלס מראש את הנתונים אבל כד <message> <location filename="../map-widget/qml/MapWidgetContextMenu.qml" line="16"/> <source>Copy coordinates to clipboard (decimal)</source> - <translation>העתיק נ״צ ללוח (דקות דסימלי)</translation> + <translation>העתק נ"צ ללוח (דצימלי)</translation> </message> <message> <location filename="../map-widget/qml/MapWidgetContextMenu.qml" line="17"/> <source>Copy coordinates to clipboard (sexagesimal)</source> - <translation>העתיק נ״צ ללוח (דקות, שניות)</translation> + <translation>העתק נ"צ ללוח (דקות, שניות)</translation> </message> <message> <location filename="../map-widget/qml/MapWidgetContextMenu.qml" line="18"/> @@ -5193,7 +5193,7 @@ The QML modules QtPositioning and QtLocation could be missing!</source> If your device uses Bluetooth, do the same preparations as for a logbook download before continuing with the update</source> <translation> -אם המכשיר עושה שימוש ב-Bluetooth, בצע את אותן ההכנות כמו עבור הורדת יומן לפני שתמשיך עם העדכון</translation> +אם המכשיר עושה שימוש בבלוטות', בצע את אותן ההכנות כמו עבור הורדת יומן לפני שתמשיך עם העדכון</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="303"/> @@ -5203,7 +5203,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="304"/> <source>Update firmware</source> - <translation>עידכון קושחה</translation> + <translation>עדכון קושחה</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="306"/> @@ -5285,17 +5285,17 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/diveplanner.cpp" line="551"/> <source>50% avg. depth to 6m</source> - <translation>50% עומק ממוצע ל-6 מטר</translation> + <translation>50% עומק ממוצע ל-6 מטרים</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="552"/> <source>6m to surface</source> - <translation>6 מטר לפני המים</translation> + <translation>6 מטרים לפני המים</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="553"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="556"/> @@ -5375,7 +5375,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="111"/> <source>Use default</source> - <translation>השתמש בברית המחדל</translation> + <translation>השתמש בברירת המחדל</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="121"/> @@ -5415,7 +5415,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="227"/> <source>Reset all settings to their default value</source> - <translation>אפס את כל ההגדרות לערך ברירת המחדל שלה</translation> + <translation>אפס את כל ההגדרות לערך ברירת המחדל שלהן</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.cpp" line="9"/> @@ -5472,17 +5472,17 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="131"/> <source>CCR options:</source> - <translation>אופציות למערכת סגורה</translation> + <translation>אפשרויות למערכת סגורה:</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="239"/> <source>Ceiling display setup</source> - <translation>אופציות לתצוגת תקרה</translation> + <translation>אפשרויות לתצוגת תקרה</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="314"/> <source>Draw dive computer reported ceiling red</source> - <translation>לצייר באדום תקרה מדווחת ממחשב צלילה</translation> + <translation>צייר באדום תקרה מדווחת ממחשב צלילה</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="268"/> @@ -5507,7 +5507,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="175"/> <source>pSCR options:</source> - <translation>אפציות למערכת חצי סגורה</translation> + <translation>אפשרויות למערכת חצי סגורה:</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="202"/> @@ -5552,7 +5552,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="138"/> <source>Dive planner default setpoint</source> - <translation>רירת מחדל לערך setpoint</translation> + <translation>ברירת מחדל לערך setpoint</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="161"/> @@ -5587,7 +5587,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="374"/> <source>Recalculate thumbnails if older than image</source> - <translation>חשב גרסה מוקתנת של תמונות עם ישן יותר מהתמונות</translation> + <translation>עדכן גרסה מוקטנת של תמונות אם ישנה יותר מהתמונות</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="255"/> @@ -5623,7 +5623,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="367"/> <source>Show mean depth in Profile</source> - <translation>הצג עומק ממוצע בפרופיל.</translation> + <translation>הצג עומק ממוצע בפרופיל</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.cpp" line="9"/> @@ -5702,13 +5702,13 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="76"/> <source>To correctly load a new language you must restart Subsurface.</source> - <translation>כדי לטעון שפה חדשה בצורה נכונה עליך להפעיל מחדש את Subsurface</translation> + <translation>כדי לטעון שפה חדשה בצורה נכונה עליך להפעיל מחדש את Subsurface.</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.cpp" line="96"/> <source>These will be used as is. This might not be what you intended. See http://doc.qt.io/qt-5/qdatetime.html#toString</source> - <translation>אלה ישמשו כמו שהוא. זה יכול להיות לא למה שאתה מתכוון. + <translation>אלו ישמשו כמות שהם. יתכן וזו אינה כוונתך. ראה http://doc.qt.io/qt-5/qdatetime.html#toString</translation> </message> <message> @@ -5804,7 +5804,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="231"/> <source>Subsurface web service</source> - <translation> שירות איטרנט של Subsurface</translation> + <translation>שירות איטרנט של Subsurface</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="243"/> @@ -5814,7 +5814,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="253"/> <source>Save user ID locally?</source> - <translation>שמור זיהוי משתמש מקומית</translation> + <translation>שמור זיהוי משתמש מקומית?</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="10"/> @@ -5839,7 +5839,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="18"/> <source>SOCKS proxy</source> - <translation>שרת פרוקסי ל-SOCKS</translation> + <translation>שרת SOCKS פרוקסי</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.cpp" line="71"/> @@ -5893,12 +5893,12 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="33"/> <source>&Metric</source> - <translation>מטרית</translation> + <translation>מטרי</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="40"/> <source>Imperial</source> - <translation>אימפריאל</translation> + <translation>אימפריאלי</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="47"/> @@ -6153,7 +6153,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <location filename="../desktop-widgets/printoptions.cpp" line="132"/> <source>The template '%1' is read-only and cannot be edited. Please export this template to a different file.</source> - <translation>התבנית ׳%1׳ הינו לקריה בלבד ואי-אפשר לשנות אותה. + <translation>התבנית '%1' הנה לקריאה בלבד ולא ניתן לשנות אותה. נא לשמור תבנית זו בשם אחר.</translation> </message> <message> @@ -6171,7 +6171,7 @@ Please export this template to a different file.</source> <location filename="../desktop-widgets/printoptions.cpp" line="159"/> <location filename="../desktop-widgets/printoptions.cpp" line="195"/> <source>The destination template '%1' is read-only and cannot be overwritten.</source> - <translation>התבנית ׳%1׳ הינו לקריה בלבד ואי-אפשר לדרוס אותה.</translation> + <translation>התבנית '%1' הנה לקריאה בלבד ולא ניתן לדרוס אותה.</translation> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="179"/> @@ -6186,12 +6186,12 @@ Please export this template to a different file.</source> <message> <location filename="../desktop-widgets/printoptions.cpp" line="220"/> <source>Delete template '%1'?</source> - <translation>מחק תבנית ׳%1׳?</translation> + <translation>מחק תבנית '%1'?</translation> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="227"/> <source>The template '%1' is read-only and cannot be deleted.</source> - <translation>התבנית ׳%1׳ הינו לקריה בלבד ואי-אפשר למחוק אותה.</translation> + <translation>התבנית '%1' הנה לקריאה בלבד ולא ניתן למחוק אותה.</translation> </message> </context> <context> @@ -6199,7 +6199,7 @@ Please export this template to a different file.</source> <message> <location filename="../profile-widget/profilewidget2.cpp" line="799"/> <source> (#%1 of %2)</source> - <translation>(#%1 מתוך %2)</translation> + <translation> (#%1 מתוך %2)</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="795"/> @@ -6239,7 +6239,7 @@ Please export this template to a different file.</source> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1422"/> <source> (cyl. %1)</source> - <translation>(מכל %1)</translation> + <translation> (מיכל %1)</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1428"/> @@ -6254,12 +6254,12 @@ Please export this template to a different file.</source> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1432"/> <source>Split dive into two</source> - <translation type="unfinished"/> + <translation>פצל צלילה לשתי צלילות</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1442"/> <source>Change divemode</source> - <translation>שינוי מוד צלילה</translation> + <translation>שינוי מצב צלילה</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1466"/> @@ -6300,12 +6300,12 @@ Please export this template to a different file.</source> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1570"/> <source>Hide all %1 events?</source> - <translation>הסתר את כל %1 האירועים</translation> + <translation>הסתר את כל %1 האירועים?</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1605"/> <source>Remove the selected event?</source> - <translation>הסר את האירוע שנבחרו?</translation> + <translation>הסר את האירוע שנבחר?</translation> </message> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1606"/> @@ -6348,7 +6348,7 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="293"/> <source>%1 dives loaded from local dive data file</source> - <translation>%1 צלילות טעונות מאיחסין מקומי</translation> + <translation>%1 צלילות נטענו מאחסון מקומי</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="390"/> @@ -6358,28 +6358,28 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="394"/> <source>Error parsing local storage, giving up</source> - <translation>שגיאה בקריאת קובץ מקומי, מבטל</translation> + <translation>שגיאה בקריאת קובץ מקומי, מוותר</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="403"/> <source>no cloud credentials</source> - <translation>אין פרטי זיהוי לענן</translation> + <translation>אין פרטי זיהוי לחשבון ענן</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="404"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="489"/> <source>Please enter valid cloud credentials.</source> - <translation>נא להזין פרטי זיהוי חוקיים לענן.</translation> + <translation>נא להזין פרטי זיהוי חוקיים לחשבון ענן.</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="445"/> <source>Cloud storage email and password can only consist of letters, numbers, and '.', '-', '_', and '+'.</source> - <translation>דואר אלקטרוני וסיסמא לאחסון בענן יכולים רק מורכבים מאותיות, מספרים, ו, '.' '-', '_', ו '+'.</translation> + <translation>דואר אלקטרוני וסיסמא לאחסון בענן יכולים מורכבים רק מאותיות, מספרים, '.' '-', '_', ו '+'.</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="451"/> <source>Invalid format for email address</source> - <translation>פורמט מייל לא חוקי</translation> + <translation>פורמט דואר אלקטרוני לא חוקי</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="502"/> @@ -6429,17 +6429,17 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="645"/> <source>Cloud credentials valid, loading dives...</source> - <translation>פרטי זיהוי לענן נכונים, טוען צלילות</translation> + <translation>פרטי זיהוי לענן נכונים, טוען צלילות...</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="655"/> <source>Cloud storage error: %1</source> - <translation>שגיאת איחסון ענן: %1</translation> + <translation>שגיאת אחסון ענן: %1</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="701"/> <source>Loading dives from local storage ('no cloud' mode)</source> - <translation>טוען צלילות מקובץ מקומי (מוד ללא איחסון בענן)</translation> + <translation>טוען צלילות מקובץ מקומי (מצב ללא אחסון בענן)</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="747"/> @@ -6455,14 +6455,14 @@ Please export this template to a different file.</source> <location filename="../mobile-widgets/qmlmanager.cpp" line="949"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="950"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="949"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="950"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="951"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="949"/> @@ -6489,7 +6489,7 @@ Please export this template to a different file.</source> <location filename="../core/configuredivecomputerthreads.cpp" line="2130"/> <location filename="../core/configuredivecomputerthreads.cpp" line="2155"/> <source>This feature is not yet available for the selected dive computer.</source> - <translation>אפשרות זו לא קיימת עדיין למחשב צלילה הנבחר</translation> + <translation>אפשרות זו לא קיימת עדיין למחשב הצלילה הנבחר</translation> </message> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="2132"/> @@ -6509,7 +6509,7 @@ Please export this template to a different file.</source> <message> <location filename="../desktop-widgets/renumber.ui" line="43"/> <source>Renumbering all dives</source> - <translation>ממספר כל צלילות מחדש</translation> + <translation>ממספר מחדש את כל הצלילות</translation> </message> <message> <location filename="../desktop-widgets/renumber.ui" line="61"/> @@ -6525,12 +6525,12 @@ Please export this template to a different file.</source> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="152"/> <source>Renumber selected dives</source> - <translation>למספר מחדש צלילות שנבחרו</translation> + <translation>מספר מחדש צלילות שנבחרו</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="154"/> <source>Renumber all dives</source> - <translation>למספר כל צלילות מחדש</translation> + <translation>מספר מחדש את כל הצלילות</translation> </message> </context> <context> @@ -6587,12 +6587,12 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="19"/> <source>Credentials need to be verified</source> - <translation>יש לאמת פרטי זהות</translation> + <translation>יש לאמת פרטי זיהוי</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="20"/> <source>Credentials verified</source> - <translation>פרטי זהות מאומתים</translation> + <translation>פרטי זיהוי מאומתים</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="21"/> @@ -6607,12 +6607,12 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="39"/> <source>Email</source> - <translation>אימייל</translation> + <translation>דואר אלקטרוני</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="45"/> <source>Not applicable</source> - <translation>לא רלבנטי</translation> + <translation>לא רלוונטי</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="53"/> @@ -6646,7 +6646,7 @@ Please export this template to a different file.</source> <location filename="../mobile-widgets/qml/Settings.qml" line="175"/> <location filename="../mobile-widgets/qml/Settings.qml" line="228"/> <source>Highlight</source> - <translation>בחור</translation> + <translation>סמן</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="146"/> @@ -6681,7 +6681,7 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="323"/> <source>Display Developer menu</source> - <translation>הצג תפרית למפתחים</translation> + <translation>הצג תפריט מפתחים</translation> </message> </context> <context> @@ -6689,12 +6689,12 @@ Please export this template to a different file.</source> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="23"/> <source>Shift selected image times</source> - <translation>שינוי זמנים של התמונות הנבחרות</translation> + <translation>הזז זמנים של התמונות הנבחרות</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="34"/> <source>Shift times of image(s) by</source> - <translation>להזיז זמני (תמונה/תמונות) ב-</translation> + <translation>הזז זמני (תמונה/תמונות) ב-</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="95"/> @@ -6728,22 +6728,22 @@ Not all images have timestamps in the range between <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="186"/> <source>To compute the offset between the clocks of your dive computer and your camera use your camera to take a picture of your dive compuer displaying the current time. Download that image to your computer and press this button.</source> - <translation>כדי לחשב את הקיזוז בין השעונים של מחשב הצלילה שלך ואת המצלמה שלך להשתמש במצלמה כדי לצלם תמונה של מחשב הצלילה שלך בו מוצגות הזמן הנוכחי. להוריד את התמונה למחשב שלך ולחץ על לחצן זה.</translation> + <translation>כדי לחשב את הקיזוז בין השעונים של מחשב הצלילה שלך והמצלמה שלך השתמש במצלמה כדי לצלם תמונה של מחשב הצלילה שלך בו מוצג הזמן הנוכחי. הורד את התמונה למחשב שלך ולחץ על לחצן זה.</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="196"/> <source>Determine camera time offset</source> - <translation>לחשב קיזוז זמן מצלמה</translation> + <translation>חשב קיזוז זמן מצלמה</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="199"/> <source>Select image of divecomputer showing time</source> - <translation>בחר תמונה של מחשב הצלילה מציג זמן</translation> + <translation>בחר תמונה של מחשב הצלילה המציג את הזמן</translation> </message> <message> <location filename="../desktop-widgets/shiftimagetimes.ui" line="221"/> <source>Which date and time are displayed on the image?</source> - <translation>אילו תאריך ושעה מוצגים בתמונה?</translation> + <translation>מהם התאריך והשעה המוצגים בתמונה?</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="307"/> @@ -6758,29 +6758,29 @@ Not all images have timestamps in the range between <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="386"/> <source>Selected dive date/time</source> - <translation>זמן/תאריך של הצלילה הנבחר</translation> + <translation>תאריך/שעה של הצלילה שנבחרה</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="388"/> <source>First selected dive date/time</source> - <translation>זמן/תאריך של הצלילה הראשונה שנבחר</translation> + <translation>תאריך/שעה של הצלילה הראשונה שנבחרה</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="389"/> <source>Last selected dive date/time</source> - <translation>זמן/תאריך של הצלילה האחרונה שנבחר</translation> + <translation>תאריך/שעה של הצלילה האחרונה שנבחרה</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="391"/> <source> Files with inappropriate date/time</source> <translation> -קבצים אם זמן/תאריך לא היגיוניים</translation> +קבצים עם תאריך/שעה לא נכונים</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="401"/> <source>No Exif date/time found</source> - <translation>לא נמצה נתוני Exif ל-זמן/תאריך</translation> + <translation>לא נמצאו נתוני תאריך/שעה ב-Exif</translation> </message> </context> <context> @@ -6788,12 +6788,12 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/shifttimes.ui" line="23"/> <source>Shift selected dive times</source> - <translation>להזיז זמני צלילות הנבחרות</translation> + <translation>הזז זמני צלילות שנבחרו</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="49"/> <source>Shift times of selected dives by</source> - <translation>להזיז זמנים של הצלילות הנבחרות ב-</translation> + <translation>הזז זמנים של הצלילות שנבחרו ב-</translation> </message> <message> <location filename="../desktop-widgets/shifttimes.ui" line="72"/> @@ -6863,12 +6863,12 @@ Files with inappropriate date/time</source> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="295"/> <source><html><head/><body><p><span style=" font-weight:600; color:#6ebeb9;">Select the .slg file(s) you want to import to Subsurface format, and the exported .xml file. It's advisable to use a new output file, as its actual content will be erased.</span></p></body></html></source> - <translation><html><head/><body><p><span style=" font-weight:600; color:#6ebeb9;"> בחר קבצי .slg אתה רוצה לייבא לפורמט של Subsurface, ואת קובץ XML מיוצא. רצוי להשתמש בקובץ פלט חדש, כיוון שתוכן קובץ ה-XML יימחק.</span></p></body></html></translation> + <translation><html><head/><body><p><span style=" font-weight:600; color:#6ebeb9;"> בחר קבצי .slg אותם אתה רוצה לייבא לפורמט של Subsurface, ואת קובץ XML ליצוא. רצוי להשתמש בקובץ פלט חדש, כיוון שתוכן קובץ ה-XML יימחק.</span></p></body></html></translation> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.ui" line="377"/> <source>Import messages (errors, warnings, etc)</source> - <translation>הארות מיבא (שגיאות, אזהרות, וכו ')</translation> + <translation>הודעות מיבוא (שגיאות, אזהרות, וכו')</translation> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="59"/> @@ -6913,7 +6913,7 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="396"/> <source>Dive date: %1 </source> - <translation>תאריך צלילה: %1 + <translation>תאריך צלילה: %1 </translation> </message> <message> @@ -6927,13 +6927,13 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="400"/> <source>h</source> <comment>abbreviation for hours</comment> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="401"/> <source>min</source> <comment>abbreviation for minutes</comment> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="404"/> @@ -6946,7 +6946,7 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="407"/> <source>Buddy: %1 </source> - <translation>בן זוג: %1 + <translation>בן זוג: %1 </translation> </message> <message> @@ -6989,7 +6989,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="44"/> <source>The text to the right will be posted as the description with your dive profile graph to Facebook. The album name is required (the profile graph will be posted to that album).</source> - <translation>הטקסט מימין יפורסם כמתואר עם תרשים פרופיל הצלילה שלך ל- Facebook. שם האלבום נדרש (גרף הפרופיל יפורסם באלבום זה).</translation> + <translation>הטקסט מימין יפורסם בפייסבוק כתיאור יחד עם תרשים פרופיל הצלילה שלך. שם האלבום נדרש (גרף הפרופיל יפורסם באלבום זה).</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="57"/> @@ -7004,7 +7004,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="71"/> <source>Include</source> - <translation>לכלול</translation> + <translation>כלול</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="78"/> @@ -7039,7 +7039,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="126"/> <source>Facebook post preview</source> - <translation>תצוגה מקדימה פייסבוק</translation> + <translation>תצוגה מקדימה לפוסט של פייסבוק</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="136"/> @@ -7052,12 +7052,12 @@ Files with inappropriate date/time</source> <message> <location filename="../mobile-widgets/qml/StartPage.qml" line="37"/> <source>To use Subsurface-mobile with Subsurface cloud storage, please enter your cloud credentials.<br/><br/>If this is the first time you use Subsurface cloud storage, enter a valid email (all lower case) and a password of your choice (letters and numbers).<br/><br/>To use Subsurface-mobile only with local data on this device, select the no cloud button above.</source> - <translation>כדי להשתמש Subsurface-Mobile עם אחסון ענן של Subsurface, אנא הכנס זיהוי הענן שלך.<br/><br/>אם זו הפעם הראשונה שאתה משתמש באחסון ענן של Subsurface , הזן כתובת דואר אלקטרוני תקינה (באותיות קטנות בלבד) וסיסמה על פי בחירתך (אותיות ומספרים). <br/><br/>כדי להשתמש Subsurface-Mobile עם אחסון מקותי בלבד במכשיר זה, הקש על סמל לא ענן להלן.</translation> + <translation>כדי להשתמש ב-Subsurface-Mobile עם אחסון ענן של Subsurface, אנא הכנס את מזהה הענן שלך.<br/><br/>אם זו הפעם הראשונה שאתה משתמש באחסון הענן של Subsurface , הזן כתובת דואר אלקטרוני תקינה (באותיות קטנות בלבד) וסיסמה על פי בחירתך (אותיות ומספרים). <br/><br/>כדי להשתמש Subsurface-Mobile עם אחסון מקומי בלבד במכשיר זה, הקש על סמל 'ללא ענן' למעלה.</translation> </message> <message> <location filename="../mobile-widgets/qml/StartPage.qml" line="50"/> <source>Thank you for registering with Subsurface. We sent <b>%1</b> a PIN code to complete the registration. If you do not receive an email from us within 15 minutes, please check the correct spelling of your email address and your spam box first.<br/><br/>In case of any problems regarding cloud account setup, please contact us at our user forum (https://subsurface-divelog.org/user-forum/).<br/><br/></source> - <translation>תודה על ההרשמה ל- Subsurface. שלחנו ל-<b>%1</b> קוד PIN כדי להשלים את ההרשמה. אם לא תקבל הודעת דוא"ל מאתנו בתוך 15 דקות, בדוק את האיות הנכון של כתובת הדוא"ל שלך ושל תיבת הדואר הזבל שלך<br/><br/>. במקרה של בעיות כלשהן בנוגע להגדרת חשבון ענן, צור איתנו קשר בפורום המשתמשים שלנו (https://subsurface-divelog.org/user-forum/).<br/><br/></translation> + <translation>תודה על ההרשמה ל- Subsurface. שלחנו ל-<b>%1</b> קוד PIN כדי להשלים את ההרשמה. אם לא תקבל הודעת דוא"ל מאתנו בתוך 15 דקות, בדוק את האיות הנכון של כתובת הדוא"ל שלך ושל תיבת דואר הזבל שלך<br/><br/>. במקרה של בעיות כלשהן בנוגע להגדרת חשבון ענן, צור איתנו קשר בפורום המשתמשים שלנו (https://subsurface-divelog.org/user-forum/).<br/><br/></translation> </message> </context> <context> @@ -7103,7 +7103,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="419"/> <source>Webservice</source> - <translation>שירות איטרנט</translation> + <translation>שירות אינטרנט</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="503"/> @@ -7123,7 +7123,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="546"/> <source>Connection error: </source> - <translation>שגיאת חיבור:</translation> + <translation>שגיאת חיבור: </translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="549"/> @@ -7146,7 +7146,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="561"/> <source>Suits: </source> - <translation>חליפות:</translation> + <translation>חליפות: </translation> </message> </context> <context> @@ -7154,7 +7154,7 @@ Files with inappropriate date/time</source> <message> <location filename="../qt-models/filtermodels.cpp" line="170"/> <source>No suit set</source> - <translation>חליפה לא מוגדרת</translation> + <translation>לא הוגדרה חליפה</translation> </message> </context> <context> @@ -7170,7 +7170,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="14"/> <source>Information</source> - <translation>מידע נוסף</translation> + <translation>מידע</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="59"/> @@ -7185,7 +7185,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="97"/> <source>Gases used</source> - <translation>גזים שנוצלו</translation> + <translation>גזים בשימוש</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="116"/> @@ -7251,13 +7251,13 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="77"/> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="84"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="77"/> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="84"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="77"/> @@ -7280,7 +7280,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDivePhotos.ui" line="29"/> <source>Zoom level</source> - <translation>רמת זוום</translation> + <translation>רמת זום</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDivePhotos.cpp" line="52"/> @@ -7428,7 +7428,7 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="93"/> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="95"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="84"/> @@ -7436,7 +7436,7 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="93"/> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="95"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="84"/> @@ -7452,7 +7452,7 @@ Files with inappropriate date/time</source> mixed from Air and using: </source> <translation>גזים אלה יכולים להיות -מעורב מאוויר ובאמצעות: +מעורבבים מאוויר ובאמצעות: </translation> </message> <message> @@ -7485,7 +7485,7 @@ mixed from Air and using: <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="545"/> <source>Tags: </source> - <translation>תגיות:</translation> + <translation>תגיות: </translation> </message> </context> <context> @@ -7741,7 +7741,7 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> @@ -7766,7 +7766,7 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="273"/> <source>Max. CNS</source> - <translation>רעילות שייורית מקסימלית</translation> + <translation>רעילות שיורית מירבית</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="276"/> @@ -7776,12 +7776,12 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="375"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="375"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="253"/> @@ -7895,7 +7895,7 @@ mixed from Air and using: <message> <location filename="../desktop-widgets/updatemanager.cpp" line="88"/> <source>Latest version is %1, please check %2 our download page %3 for information in how to update.</source> - <translation>גרסה האחרונה היא 1%, אנא בדוק %2 בדף ההורדה שלנו %3 למידע כיצד לעדכן.</translation> + <translation>הגרסה האחרונה היא %1, אנא בדוק %2 בדף ההורדה שלנו %3 למידע כיצד לעדכן.</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="98"/> @@ -7911,8 +7911,8 @@ mixed from Air and using: <location filename="../desktop-widgets/updatemanager.cpp" line="116"/> <source>Subsurface is checking every two weeks if a new version is available. If you don't want Subsurface to continue checking, please click Decline.</source> - <translation>Subsurface בודקת כל שבועיים אם גרסה חדשה זמינה. -אם אתה לא רוצה ש-Subsurface תמשיך לבדוק, אנא לחץ על דחה.</translation> + <translation>Subsurface בודקת כל שבועיים אם זמינה גרסה חדשה. +אם אתה לא רוצה ש-Subsurface תמשיך לבדוק, אנא לחץ על 'דחה'.</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="118"/> @@ -7989,7 +7989,7 @@ If you don't want Subsurface to continue checking, please click Decline.</s <message> <location filename="../desktop-widgets/usersurvey.ui" line="96"/> <source>Manually entering dives</source> - <translation>הזנה צלילות ידנית</translation> + <translation>הזנת צלילות ידנית</translation> </message> <message> <location filename="../desktop-widgets/usersurvey.ui" line="103"/> @@ -8128,7 +8128,7 @@ Language: %1</source> <message> <location filename="../desktop-widgets/webservices.ui" line="32"/> <source>Enter your ID here</source> - <translation>הכנס זיהוי כאן</translation> + <translation>הכנס מזהה כאן</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="44"/> @@ -8143,7 +8143,7 @@ Language: %1</source> <message> <location filename="../desktop-widgets/webservices.ui" line="85"/> <source>Save user ID locally?</source> - <translation>שמור זיהוי משתמש מקומי</translation> + <translation>שמור זיהוי משתמש מקומי?</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="92"/> @@ -8181,7 +8181,7 @@ Language: %1</source> <message> <location filename="../qt-models/weightmodel.cpp" line="78"/> <source>Clicking here will remove this weight system.</source> - <translation>לחיצה פה תסיר את משקולות אלה.</translation> + <translation>לחיצה כאן תסיר משקולות אלה.</translation> </message> </context> <context> @@ -8199,7 +8199,7 @@ Language: %1</source> <location filename="../core/configuredivecomputerthreads.cpp" line="2179"/> <location filename="../core/configuredivecomputerthreads.cpp" line="2204"/> <source>This feature is not yet available for the selected dive computer.</source> - <translation>אפשרות זו לא קיימת למחשב צלילה הנבחר</translation> + <translation>אפשרות זו לא קיימת למחשב הצלילה הנבחר.</translation> </message> <message> <location filename="../core/configuredivecomputerthreads.cpp" line="2181"/> @@ -8214,12 +8214,12 @@ Language: %1</source> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="62"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="62"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="62"/> @@ -8325,7 +8325,7 @@ Maximum</source> <location filename="../core/cochran.c" line="381"/> <location filename="../core/libdivecomputer.c" line="258"/> <source>deco stop</source> - <translation>עצירה לדקומפרסיה</translation> + <translation>עצירת דקו</translation> </message> <message> <location filename="../core/cochran.c" line="332"/> @@ -8449,7 +8449,7 @@ Maximum</source> <message> <location filename="../core/datatrak.c" line="309"/> <source>Dry suit</source> - <translation>חליפה ישבה</translation> + <translation>חליפה יבשה</translation> </message> <message> <location filename="../core/datatrak.c" line="369"/> @@ -8605,7 +8605,7 @@ Maximum</source> <message> <location filename="../core/dive.c" line="27"/> <source>deep</source> - <translation>עמוק</translation> + <translation>עומק</translation> </message> <message> <location filename="../core/dive.c" line="27"/> @@ -8874,12 +8874,12 @@ Maximum</source> <message> <location filename="../core/git-access.c" line="104"/> <source>Transfer from storage (%d/%d)</source> - <translation>מעביר מאיחסון (%d/%d)</translation> + <translation>מעביר מאחסון (%d/%d)</translation> </message> <message> <location filename="../core/git-access.c" line="116"/> <source>Transfer to storage (%d/%d)</source> - <translation>מעביר לאיחסון (%d/%d)</translation> + <translation>מעביר לאחסון (%d/%d)</translation> </message> <message> <location filename="../core/git-access.c" line="152"/> @@ -8935,12 +8935,12 @@ Maximum</source> <message> <location filename="../core/git-access.c" line="508"/> <source>Update local storage to match cloud storage</source> - <translation>עדכן קבצים מקומיים כדי להיות זהים לאיחסון בענן</translation> + <translation>עדכן קבצים מקומיים כדי להיות זהים לאחסון בענן</translation> </message> <message> <location filename="../core/git-access.c" line="516"/> <source>Push local changes to cloud storage</source> - <translation>שומר שינוים מקומיים לאיחסון בענן</translation> + <translation>שומר שינוים מקומיים לאחסון בענן</translation> </message> <message> <location filename="../core/git-access.c" line="534"/> @@ -8950,7 +8950,7 @@ Maximum</source> <message> <location filename="../core/git-access.c" line="576"/> <source>Store data into cloud storage</source> - <translation>שמור נתונים לאיחסון בענן</translation> + <translation>שמור נתונים לאחסון בענן</translation> </message> <message> <location filename="../core/git-access.c" line="600"/> @@ -8965,12 +8965,12 @@ Maximum</source> <message> <location filename="../core/git-access.c" line="640"/> <source>Successful cloud connection, fetch remote</source> - <translation>מחובר לאיחסון בענן, טוען מרחוק</translation> + <translation>מחובר לאחסון בענן, טוען מרחוק</translation> </message> <message> <location filename="../core/git-access.c" line="659"/> <source>Done syncing with cloud storage</source> - <translation>סנכרון עם איחסון בענן הסתיים בהצלחה</translation> + <translation>סנכרון עם אחסון בענן הסתיים בהצלחה</translation> </message> <message> <location filename="../core/git-access.c" line="794"/> @@ -9264,7 +9264,7 @@ You can create this logfile by selecting the corresponding checkbox in the downl <message> <location filename="../core/plannernotes.c" line="115"/> <source>DISCLAIMER / WARNING: THIS IS A NEW IMPLEMENTATION OF THE %s ALGORITHM AND A DIVE PLANNER IMPLEMENTATION BASED ON THAT WHICH HAS RECEIVED ONLY A LIMITED AMOUNT OF TESTING. WE STRONGLY RECOMMEND NOT TO PLAN DIVES SIMPLY BASED ON THE RESULTS GIVEN HERE.</source> - <translation>כתב ויתור / אזהרה: זה יישום חדש של אלגוריתם %s ויישום תכנן צלילה בהתבסס על כך שקיבל רק כמות מוגבלת של בדיקות. אנו ממליצים בחום לא לתכנן צלילות מבוססות רק על פי תוצאות כאן.</translation> + <translation>כתב ויתור / אזהרה: זה יישום חדש של אלגוריתם %s ויישום תכנון צלילה המתבסס עליו שבוצעו עליהם רק כמות מוגבלת של בדיקות. אנו ממליצים בחום לא לתכנן צלילות מבוססות רק על פי התוצאות שכאן.</translation> </message> <message> <location filename="../core/plannernotes.c" line="109"/> @@ -9913,7 +9913,7 @@ EADD: %d%s / %.1fg/ℓ <message numerus="yes"> <location filename="../core/qthelper.cpp" line="1010"/> <source>(%n dive(s))</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>(%n צלילה)</numerusform><numerusform>(%n צליל(ה/ות))</numerusform><numerusform>(%n צליל(ה/ות))</numerusform><numerusform>(%n צלילות)</numerusform></translation> </message> <message> <location filename="../core/qthelper.cpp" line="1246"/> @@ -10128,7 +10128,7 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="534"/> <source>Dive #</source> - <translation>צלילה מס' </translation> + <translation>צלילה מס'</translation> </message> <message> <location filename="../core/save-html.c" line="535"/> @@ -10525,7 +10525,7 @@ Is the Uemis Zurich plugged in correctly?</source> <location filename="../core/worldmap-save.c" line="46"/> <location filename="../desktop-widgets/templatelayout.h" line="111"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../core/divelogexportlogic.cpp" line="56"/> @@ -10533,7 +10533,7 @@ Is the Uemis Zurich plugged in correctly?</source> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="132"/> <location filename="../desktop-widgets/templatelayout.h" line="110"/> <source>h</source> - <translation>שעה</translation> + <translation>שעות</translation> </message> <message> <location filename="../core/divelogexportlogic.cpp" line="56"/> @@ -10571,17 +10571,17 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../smtk-import/smartrak.c" line="292"/> <source>Built</source> - <translation>בנוי</translation> + <translation>בניה</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="292"/> <source>Sank</source> - <translation>טובע</translation> + <translation>טיבוע</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="292"/> <source>Sank Time</source> - <translation>זמן תחתית</translation> + <translation>זמן טיבוע</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="293"/> @@ -10616,7 +10616,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../smtk-import/smartrak.c" line="295"/> <source>Draught</source> - <translation>ממשך</translation> + <translation>שוקע</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="295"/> @@ -10686,12 +10686,12 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../core/save-git.c" line="951"/> <source>Start saving data</source> - <translation>התחיל לשמור נתונים</translation> + <translation>התחל לשמור נתונים</translation> </message> <message> <location filename="../core/save-git.c" line="960"/> <source>Start saving dives</source> - <translation>התחיל לשמור צלילות</translation> + <translation>התחל לשמור צלילות</translation> </message> <message> <location filename="../core/save-git.c" line="993"/> @@ -10706,7 +10706,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../profile-widget/profilewidget2.cpp" line="1633"/> <source>modechange</source> - <translation>שינוי מוד</translation> + <translation>שינוי מצב</translation> </message> <message> <location filename="../core/gpslocation.h" line="14"/> @@ -10721,7 +10721,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="638"/> <source>Don't save an empty log to the cloud</source> - <translation>נא לא לשמור יומן ריק לענן</translation> + <translation>לא לשמור יומן ריק לענן</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="34"/> @@ -10746,12 +10746,12 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="631"/> <source>Expected XML tag 'DiveDateReader', got instead '%1</source> - <translation>צפיתי לתגית XML 'DiveDateReader', נמצא %1 במקומו.</translation> + <translation>תג XML צפוי 'DiveDateReader', נמצא %1 במקומו.</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="677"/> <source>Expected XML tag 'DiveDates' not found</source> - <translation>תג XML הצפוי 'DiveDates' לא נמצא</translation> + <translation>תג XML צפוי 'DiveDates' לא נמצא</translation> </message> <message> <location filename="../desktop-widgets/subsurfacewebservices.cpp" line="684"/> @@ -10834,17 +10834,17 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../mobile-widgets/qml/main.qml" line="244"/> <source>Apply GPS fixes</source> - <translation>הפעיל תיקוני GPS</translation> + <translation>הפעל תיקוני GPS</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="309"/> <source>Download GPS data</source> - <translation>הורד נתוני GPS </translation> + <translation>הורד נתוני GPS</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="320"/> <source>Show GPS fixes</source> - <translation>הצג נ"צים שמורים</translation> + <translation>הצג נ"צ שמורים</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="333"/> @@ -11028,7 +11028,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/plannerSettings.ui" line="370"/> <location filename="../desktop-widgets/plannerSettings.ui" line="800"/> <source>min</source> - <translation>דקה</translation> + <translation>דקות</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="389"/> @@ -11084,7 +11084,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plannerSettings.ui" line="640"/> <source>m</source> - <translation>מטר</translation> + <translation>מטרים</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="741"/> @@ -11119,7 +11119,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plannerSettings.ui" line="637"/> <source>Used to calculate best mix. Select best mix depth in 'Available gases' table by entering gas depth, followed by "B" (best trimix mix) or "BN" (best nitrox mix)</source> - <translation>אנו מבססים את חישוב התמהיל הטוב ביותר. בחר עומק תמהיל הטוב ביותר בטבלה 'גזים זמינים' על ידי עומק גז הזנה, ואחריו "B" (תערובת טרימיקס הטוב ביותר) או "BN" (תערובת נייטרוקס הטובה ביותר)</translation> + <translation>משמש לחישוב תערובת מיטבית. בחר עומק תערובת מיטבית בטבלת 'גזים זמינים' על ידי הזנת עומק גז, ואחריו "B" (תערובת טרימיקס הטובה ביותר) או "BN" (תערובת נייטרוקס הטובה ביותר)</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="313"/> diff --git a/translations/subsurface_hu.ts b/translations/subsurface_hu.ts index 67ba8c4e7..ca42e041c 100644 --- a/translations/subsurface_hu.ts +++ b/translations/subsurface_hu.ts @@ -17,7 +17,7 @@ <message> <location filename="../mobile-widgets/qml/About.qml" line="38"/> <source>View your dive logs while on the go.</source> - <translation type="unfinished"/> + <translation>Nézd meg a merülési naplóidat útközben.</translation> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="49"/> @@ -25,12 +25,15 @@ © Subsurface developer team 2011-2018</source> - <translation type="unfinished"/> + <translation>Verzió: 1% + +© Subsurface fejlesztő csapata +2011-2018</translation> </message> <message> <location filename="../mobile-widgets/qml/About.qml" line="62"/> <source>Copy logs to clipboard</source> - <translation type="unfinished"/> + <translation>Naplók másolása a vágólapra</translation> </message> </context> <context> @@ -38,7 +41,7 @@ <message> <location filename="../mobile-widgets/qml/kirigami/src/controls/templates/private/BackButton.qml" line="51"/> <source>Navigate Back</source> - <translation type="unfinished"/> + <translation>Vissza</translation> </message> </context> <context> @@ -46,7 +49,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="14"/> <source>Remote Bluetooth device selection</source> - <translation type="unfinished"/> + <translation>Távoli bluetooth eszköz kiválasztása</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="172"/> @@ -69,12 +72,12 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="193"/> <source>Bluetooth mode</source> - <translation type="unfinished"/> + <translation>Bluetooth mód</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="201"/> <source>Auto</source> - <translation type="unfinished"/> + <translation>Autómata</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="206"/> @@ -90,19 +93,19 @@ <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="229"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="40"/> <source>Scan</source> - <translation type="unfinished"/> + <translation>Keresés</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="242"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="41"/> <source>Clear</source> - <translation type="unfinished"/> + <translation>Tiszta</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="66"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="33"/> <source>Local Bluetooth device details</source> - <translation type="unfinished"/> + <translation>Helyi bluetooth eszköz részletei</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="75"/> @@ -113,30 +116,30 @@ <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="89"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="35"/> <source>Address:</source> - <translation type="unfinished"/> + <translation>Cím:</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="118"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="37"/> <source>Bluetooth powered on</source> - <translation type="unfinished"/> + <translation>Bluetooth bekapcsolva</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="140"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="38"/> <source>Turn on/off</source> - <translation type="unfinished"/> + <translation>Be/Kikapcsolás</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.ui" line="150"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="34"/> <source>Select device:</source> - <translation type="unfinished"/> + <translation>Eszköz választás:</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="36"/> <source>Name:</source> - <translation type="unfinished"/> + <translation>Név:</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="61"/> @@ -146,74 +149,74 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="139"/> <source>Trying to turn on the local Bluetooth device...</source> - <translation type="unfinished"/> + <translation>Megpróbálom bekapcsolni a helyi bluetooth eszközt</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="142"/> <source>Trying to turn off the local Bluetooth device...</source> - <translation type="unfinished"/> + <translation>Megpróbálom kikapcsolni a helyi bluetooth eszközt</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="174"/> <source>Remote devices list was cleared.</source> - <translation type="unfinished"/> + <translation>Távoli eszköz lista törölve lett.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="189"/> <source>Scanning for remote devices...</source> - <translation type="unfinished"/> + <translation>Távoli eszközök keresése...</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="198"/> <source>Scanning finished successfully.</source> - <translation type="unfinished"/> + <translation>Keresés sikeresen befejeződött</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="214"/> <source>The local Bluetooth device was %1.</source> <extracomment>%1 will be replaced with "turned on" or "turned off"</extracomment> - <translation type="unfinished"/> + <translation>A helyi bluetooth eszköz %1.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="215"/> <source>turned on</source> - <translation type="unfinished"/> + <translation>bekapcsolva</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="215"/> <source>turned off</source> - <translation type="unfinished"/> + <translation>kikapcsolva</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="231"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="371"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="391"/> <source>UNPAIRED</source> - <translation type="unfinished"/> + <translation>NEM PÁROSÍTOTT</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="235"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="376"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="389"/> <source>PAIRED</source> - <translation type="unfinished"/> + <translation>PÁROSÍTOTT</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="238"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="381"/> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="390"/> <source>AUTHORIZED_PAIRED</source> - <translation type="unfinished"/> + <translation>ENGEDÉLYEZETT_PÁROSÍTOTT</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="253"/> <source>%1 (%2) [State: %3]</source> - <translation type="unfinished"/> + <translation>%1 (%2) [Állapot: %3]</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="276"/> <source>The device %1 can be used for connection. You can press the Save button.</source> - <translation type="unfinished"/> + <translation>Az 1% eszköz készen áll a kapcsolatra. Nyomd meg a mentés gombot.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="289"/> @@ -229,52 +232,53 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="318"/> <source>The local device was changed.</source> - <translation type="unfinished"/> + <translation>A helyi eszköz megváltozott.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="338"/> <source>Pair</source> - <translation type="unfinished"/> + <translation>Párosítás</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="339"/> <source>Remove pairing</source> - <translation type="unfinished"/> + <translation>Párosítás megszüntetése</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="355"/> <source>Trying to pair device %1</source> - <translation type="unfinished"/> + <translation>1% eszköz párosítása</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="359"/> <source>Trying to unpair device %1</source> - <translation type="unfinished"/> + <translation>1% eszköz párosításának megszüntetése</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="372"/> <source>Device %1 was unpaired.</source> - <translation type="unfinished"/> + <translation>Az 1% eszköz párosítása megszüntetve.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="379"/> <source>Device %1 was paired.</source> - <translation type="unfinished"/> + <translation>Az 1% eszköz párosítva.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="384"/> <source>Device %1 was paired and is authorized.</source> - <translation type="unfinished"/> + <translation>Az 1% eszköz párosítva és engedélyezve.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="410"/> <source>The device %1 can now be used for connection. You can press the Save button.</source> - <translation type="unfinished"/> + <translation>Az 1% eszköz készen áll a kapcsolatra. +Nyomd meg a mentés gombot.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="422"/> <source>Local device error: %1.</source> - <translation type="unfinished"/> + <translation>Helyi eszköz hiba: %1.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="423"/> @@ -284,7 +288,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="425"/> <source>Unknown error</source> - <translation type="unfinished"/> + <translation>Ismeretlen hiba</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="434"/> @@ -299,7 +303,7 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="443"/> <source>An unknown error has occurred.</source> - <translation type="unfinished"/> + <translation>Egy ismeretlen híba létett fel.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="448"/> @@ -309,12 +313,12 @@ <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="502"/> <source>Not available</source> - <translation type="unfinished"/> + <translation>Nem elérhető</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="509"/> <source>The local Bluetooth adapter cannot be accessed.</source> - <translation type="unfinished"/> + <translation>A helyi bluetooth adapter nem elérhető.</translation> </message> <message> <location filename="../desktop-widgets/btdeviceselectiondialog.cpp" line="559"/> @@ -327,12 +331,12 @@ <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="550"/> <source>Person: </source> - <translation type="unfinished"/> + <translation>Személy:</translation> </message> <message> <location filename="../desktop-widgets/simplewidgets.cpp" line="551"/> <source>Searches for buddies and divemasters</source> - <translation type="unfinished"/> + <translation>Merülőtárs és merülés vezető keresése</translation> </message> </context> <context> @@ -340,7 +344,7 @@ <message> <location filename="../qt-models/filtermodels.cpp" line="279"/> <source>No buddies</source> - <translation type="unfinished"/> + <translation>Nincs merülőtárs</translation> </message> </context> <context> @@ -348,12 +352,12 @@ <message numerus="yes"> <location filename="../core/checkcloudconnection.cpp" line="58"/> <source>Waiting for cloud connection (%n second(s) passed)</source> - <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> + <translation><numerusform>Várakozás a felhő kapcsolatra (%n eltelt másodperc(ek))</numerusform><numerusform>Várakozás a felhő kapcsolatra (%n eltelt másodperc(ek))</numerusform></translation> </message> <message> <location filename="../core/checkcloudconnection.cpp" line="65"/> <source>Cloud connection failed</source> - <translation type="unfinished"/> + <translation>Felhő kapcsolódás sikertelen</translation> </message> </context> <context> @@ -361,42 +365,42 @@ <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="49"/> <source>Cloud credentials</source> - <translation type="unfinished"/> + <translation>Felhő hitelesítő adatok</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="55"/> <source>Email</source> - <translation type="unfinished"/> + <translation>Email</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="71"/> <source>Password</source> - <translation type="unfinished"/> + <translation>Jelszó</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="89"/> <source>PIN</source> - <translation type="unfinished"/> + <translation>PIN</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="106"/> <source>Register</source> - <translation type="unfinished"/> + <translation>Regisztrálás</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="117"/> <source>Cancel</source> - <translation type="unfinished"/> + <translation>Mégse</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="133"/> <source>Sign-in or Register</source> - <translation type="unfinished"/> + <translation>Bejentkezés vagy Regisztrálás</translation> </message> <message> <location filename="../mobile-widgets/qml/CloudCredentials.qml" line="144"/> <source>No cloud mode</source> - <translation type="unfinished"/> + <translation>Nem felhő mód</translation> </message> </context> <context> @@ -404,7 +408,7 @@ <message> <location filename="../core/cloudstorage.cpp" line="65"/> <source>Cloud account verification required, enter PIN in preferences</source> - <translation type="unfinished"/> + <translation>Felhő hozzáférés hitelesítés szükséges add meg a PIN-t a beállításokban</translation> </message> </context> <context> @@ -412,7 +416,7 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>Dive #</source> - <translation type="unfinished"/> + <translation>Merülés #</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> @@ -437,37 +441,37 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>GPS</source> - <translation type="unfinished"/> + <translation>GPS</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>Weight</source> - <translation type="unfinished"/> + <translation>Súly</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>Cyl. size</source> - <translation type="unfinished"/> + <translation>Palack méret</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="47"/> <source>Start pressure</source> - <translation type="unfinished"/> + <translation>Kezdő nyomás</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>End pressure</source> - <translation type="unfinished"/> + <translation>Végső nyomás</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Max. depth</source> - <translation type="unfinished"/> + <translation>Max. mélység</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Avg. depth</source> - <translation type="unfinished"/> + <translation>Átl. mélység</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> @@ -482,27 +486,27 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Air temp.</source> - <translation type="unfinished"/> + <translation>Levegő hőm.</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="48"/> <source>Water temp.</source> - <translation type="unfinished"/> + <translation>Víz hőm.</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> @@ -517,37 +521,37 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> <source>Sample time</source> - <translation type="unfinished"/> + <translation>Idő minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> <source>Sample depth</source> - <translation type="unfinished"/> + <translation>Mélység minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> <source>Sample temperature</source> - <translation type="unfinished"/> + <translation>Hőmérséklet minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> <source>Sample pO₂</source> - <translation type="unfinished"/> + <translation>pO₂ minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> <source>Sample CNS</source> - <translation type="unfinished"/> + <translation>CNS minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="49"/> <source>Sample NDL</source> - <translation type="unfinished"/> + <translation>NDL minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="50"/> <source>Sample TTS</source> - <translation type="unfinished"/> + <translation>TTS minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="50"/> @@ -557,7 +561,7 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="50"/> <source>Sample pressure</source> - <translation type="unfinished"/> + <translation>Nyomás minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="51"/> @@ -582,12 +586,12 @@ <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="52"/> <source>Visibility</source> - <translation type="unfinished"/> + <translation>Láthatóság</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="52"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> </context> <context> @@ -595,32 +599,32 @@ <message> <location filename="../core/configuredivecomputer.cpp" line="221"/> <source>Could not save the backup file %1. Error Message: %2</source> - <translation type="unfinished"/> + <translation>Nem menthető a biztonsági fájl %1. Hiba üzenet: %2</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="237"/> <source>Could not open backup file: %1</source> - <translation type="unfinished"/> + <translation>Nem nyitható meg a biztonsági mentés: %1</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="585"/> <source>Dive computer details read successfully</source> - <translation type="unfinished"/> + <translation>Búvárkomputer részletei sikeresen kiolvasva</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="594"/> <source>Setting successfully written to device</source> - <translation type="unfinished"/> + <translation>Beállítások sikeresen az eszközre írva</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="603"/> <source>Device firmware successfully updated</source> - <translation type="unfinished"/> + <translation>Eszköz firmware-e sikeresen frissítve</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="612"/> <source>Device settings successfully reset</source> - <translation type="unfinished"/> + <translation>Az eszköz beállításai sikeresen alaphelyzetbe állítva</translation> </message> <message> <location filename="../core/configuredivecomputer.cpp" line="628"/> @@ -630,7 +634,7 @@ <message> <location filename="../core/configuredivecomputer.cpp" line="647"/> <source>Could not a establish connection to the dive computer.</source> - <translation type="unfinished"/> + <translation>A kapcsolat nem létrehozható a búvárkomputerrel</translation> </message> </context> <context> @@ -638,7 +642,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="14"/> <source>Configure dive computer</source> - <translation type="unfinished"/> + <translation>Búvárkomputer beállítása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="22"/> @@ -648,12 +652,12 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="47"/> <source>Connect via Bluetooth</source> - <translation type="unfinished"/> + <translation>Kapcsolódás bluetooth-val</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="54"/> <source>Connect</source> - <translation type="unfinished"/> + <translation>Kapcsolódás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="64"/> @@ -668,32 +672,32 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="90"/> <source>Read settings from backup file or from device before writing to the device</source> - <translation type="unfinished"/> + <translation>Beállítások kiolvasása a biztonsági mentésből vagy az eszközről mielőtt felülírná az eszközt</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="93"/> <source>Save changes to device</source> - <translation type="unfinished"/> + <translation>Változások mentése az eszközre</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="116"/> <source>Read settings from backup file or from device before writing to a backup file</source> - <translation type="unfinished"/> + <translation>Beállítások kiolvasása a biztonsági mentésből vagy az eszközről mielőtt felülírná a biztonsági mentést</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="119"/> <source>Backup</source> - <translation type="unfinished"/> + <translation>Biztonsági mentés</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="129"/> <source>Restore backup</source> - <translation type="unfinished"/> + <translation>Biztonsági mentés visszaállítása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="139"/> <source>Update firmware</source> - <translation type="unfinished"/> + <translation>Firmware frissítése</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="163"/> @@ -703,22 +707,22 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="170"/> <source>...</source> - <translation type="unfinished"/> + <translation>...</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="177"/> <source>Cancel</source> - <translation type="unfinished"/> + <translation>Mégse</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="241"/> <source>Suunto Vyper family</source> - <translation type="unfinished"/> + <translation>Suunto Vyper család</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="232"/> <source>OSTC 4</source> - <translation type="unfinished"/> + <translation>OSTC 4</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="262"/> @@ -726,7 +730,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2492"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3567"/> <source>Basic settings</source> - <translation type="unfinished"/> + <translation>Alap beállítások</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1201"/> @@ -738,13 +742,13 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1206"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2504"/> <source>Medium</source> - <translation type="unfinished"/> + <translation>Közepes</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1211"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2509"/> <source>High</source> - <translation type="unfinished"/> + <translation>Magas</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="603"/> @@ -770,7 +774,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2991"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3069"/> <source>%</source> - <translation type="unfinished"/> + <translation>%</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1230"/> @@ -814,7 +818,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2565"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3662"/> <source>Serial No.</source> - <translation type="unfinished"/> + <translation>Sorozatszám</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="305"/> @@ -822,7 +826,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2588"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3685"/> <source>Firmware version</source> - <translation type="unfinished"/> + <translation>Firmware verzió</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1301"/> @@ -872,53 +876,53 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1366"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2664"/> <source>Salinity (0-5%)</source> - <translation type="unfinished"/> + <translation>Sótartalom (0-5%)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1379"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2677"/> <source>Reset device to default settings</source> - <translation type="unfinished"/> + <translation>Az eszköz alaphelyzetbe állítása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1393"/> <source>230LSB/Gauss</source> - <translation type="unfinished"/> + <translation>230LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1398"/> <source>330LSB/Gauss</source> - <translation type="unfinished"/> + <translation>330LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1403"/> <source>390LSB/Gauss</source> - <translation type="unfinished"/> + <translation>390LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1408"/> <source>440LSB/Gauss</source> - <translation type="unfinished"/> + <translation>440LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1413"/> <source>660LSB/Gauss</source> - <translation type="unfinished"/> + <translation>660LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1418"/> <source>820LSB/Gauss</source> - <translation type="unfinished"/> + <translation>820LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1423"/> <source>1090LSB/Gauss</source> - <translation type="unfinished"/> + <translation>1090LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1428"/> <source>1370LSB/Gauss</source> - <translation type="unfinished"/> + <translation>1370LSB/Gauss</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1462"/> @@ -930,7 +934,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2710"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3805"/> <source>Computer model</source> - <translation type="unfinished"/> + <translation>Komputer model</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="315"/> @@ -938,19 +942,19 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2717"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3719"/> <source>Custom text</source> - <translation type="unfinished"/> + <translation>Egyéni szöveg</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1497"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2735"/> <source>OC</source> - <translation type="unfinished"/> + <translation>NyR</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1502"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2740"/> <source>CC</source> - <translation type="unfinished"/> + <translation>NyR</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="661"/> @@ -970,30 +974,30 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1520"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2758"/> <source>Dive mode</source> - <translation type="unfinished"/> + <translation>Merülési mód</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1531"/> <source>2s</source> - <translation type="unfinished"/> + <translation>2mp</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1536"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3775"/> <source>10s</source> - <translation type="unfinished"/> + <translation>10mp</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="359"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1544"/> <source>Sampling rate</source> - <translation type="unfinished"/> + <translation>Mintavétel aránya</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1555"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2769"/> <source>Standard</source> - <translation type="unfinished"/> + <translation>Alapértelmezett</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1560"/> @@ -1018,46 +1022,46 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1578"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2792"/> <source>Sync dive computer time with PC</source> - <translation type="unfinished"/> + <translation>Búvárkomputer idő szinkronizálása a PC-vel</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1585"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2799"/> <source>Dive mode color</source> - <translation type="unfinished"/> + <translation>Merülési mód szín</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="345"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1595"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2809"/> <source>Show safety stop</source> - <translation type="unfinished"/> + <translation>Biztonsági megálló mutatása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="470"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1602"/> <source>End Depth</source> - <translation type="unfinished"/> + <translation>Végső mélység</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="278"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1628"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2835"/> <source>Length</source> - <translation type="unfinished"/> + <translation>Hossz</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="463"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1635"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2842"/> <source>Start Depth</source> - <translation type="unfinished"/> + <translation>Induló mélység</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="477"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1642"/> <source>Reset Depth</source> - <translation type="unfinished"/> + <translation>Mélység visszaállítása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="573"/> @@ -1069,13 +1073,13 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1725"/> <source>Left button sensitivity</source> - <translation type="unfinished"/> + <translation>Bal gomb érzékenység</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1732"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3167"/> <source>Always show pO₂</source> - <translation type="unfinished"/> + <translation>Mindig mutassa a pO₂-t</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="579"/> @@ -1088,13 +1092,13 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1746"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2911"/> <source>Future TTS</source> - <translation type="unfinished"/> + <translation>Jövőbeni TTS</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1753"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2918"/> <source>Pressure sensor offset</source> - <translation type="unfinished"/> + <translation>Nyomásérzékelő eltérés</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="815"/> @@ -1114,14 +1118,14 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="586"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1806"/> <source>Desaturation</source> - <translation type="unfinished"/> + <translation>Deszaturáció</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="645"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1858"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2984"/> <source>Decotype</source> - <translation type="unfinished"/> + <translation>Dekompresszio típusa</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="656"/> @@ -1161,76 +1165,76 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="782"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1983"/> <source>Saturation</source> - <translation type="unfinished"/> + <translation>Telítettség</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1993"/> <source>Flip screen</source> - <translation type="unfinished"/> + <translation>Képernyő fordítás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2000"/> <source>Right button sensitivity</source> - <translation type="unfinished"/> + <translation>Jobb gomb érzékenység</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2007"/> <source>MOD warning</source> - <translation type="unfinished"/> + <translation>MOD figyelmeztetés</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="838"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2014"/> <source>Graphical speed indicator</source> - <translation type="unfinished"/> + <translation>Grafikus sebesség mutató</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2021"/> <source>Dynamic ascent rate</source> - <translation type="unfinished"/> + <translation>Dinamikus emelkedési arány</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="877"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2028"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3092"/> <source>Bottom gas consumption</source> - <translation type="unfinished"/> + <translation>Fenék gáz fogyasztás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="884"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2035"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3099"/> <source>Deco gas consumption</source> - <translation type="unfinished"/> + <translation>Deco gáz fogyasztás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2106"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3194"/> <source>Temperature sensor offset</source> - <translation type="unfinished"/> + <translation>Hőmérséklet érzékelő eltérés</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2113"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3201"/> <source>°C</source> - <translation type="unfinished"/> + <translation>°C</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="892"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2133"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3221"/> <source>Gas settings</source> - <translation type="unfinished"/> + <translation>Gáz beállítás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="214"/> <source>OSTC Mk2/2N/2C</source> - <translation type="unfinished"/> + <translation>OSTC Mk2/2N/2C</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="223"/> <source>OSTC 2/3/Sport/Plus/cR</source> - <translation type="unfinished"/> + <translation>OSTC 2/3/Sport/Plus/cR</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="506"/> @@ -1244,7 +1248,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2852"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2971"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="845"/> @@ -1255,7 +1259,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3122"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3138"/> <source>ℓ/min</source> - <translation type="unfinished"/> + <translation>ℓ/perc</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="935"/> @@ -1285,7 +1289,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3274"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3359"/> <source>Type</source> - <translation type="unfinished"/> + <translation>Típus</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="950"/> @@ -1298,105 +1302,105 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3364"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3439"/> <source>Change depth</source> - <translation type="unfinished"/> + <translation>Mélység változtatása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="955"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2196"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3284"/> <source>Gas 1</source> - <translation type="unfinished"/> + <translation>Gáz 1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="960"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2201"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3289"/> <source>Gas 2</source> - <translation type="unfinished"/> + <translation>Gáz 2</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="965"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2206"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3294"/> <source>Gas 3</source> - <translation type="unfinished"/> + <translation>Gáz 3</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="970"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2211"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3299"/> <source>Gas 4</source> - <translation type="unfinished"/> + <translation>Gáz 4</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="975"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2216"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3304"/> <source>Gas 5</source> - <translation type="unfinished"/> + <translation>Gáz 5</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1040"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2281"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3369"/> <source>Dil 1</source> - <translation type="unfinished"/> + <translation>Dil 1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1045"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2286"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3374"/> <source>Dil 2</source> - <translation type="unfinished"/> + <translation>Dil 2</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1050"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2291"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3379"/> <source>Dil 3</source> - <translation type="unfinished"/> + <translation>Dil 3</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1055"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2296"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3384"/> <source>Dil 4</source> - <translation type="unfinished"/> + <translation>Dil 4</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1060"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2301"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3389"/> <source>Dil 5</source> - <translation type="unfinished"/> + <translation>Dil 5</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1095"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2346"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3434"/> <source>Setpoint</source> - <translation type="unfinished"/> + <translation>Alapérték</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1105"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2356"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3444"/> <source>SP 1</source> - <translation type="unfinished"/> + <translation>SP 1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1110"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2361"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3449"/> <source>SP 2</source> - <translation type="unfinished"/> + <translation>SP 2</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1115"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2366"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3454"/> <source>SP 3</source> - <translation type="unfinished"/> + <translation>SP 3</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1136"/> @@ -1406,13 +1410,13 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3509"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3525"/> <source>cbar</source> - <translation type="unfinished"/> + <translation>cbar</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1884"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3007"/> <source>mbar</source> - <translation type="unfinished"/> + <translation>mbar</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2371"/> @@ -1424,7 +1428,7 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2376"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3464"/> <source>SP 5</source> - <translation type="unfinished"/> + <translation>SP 5</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2384"/> @@ -1435,13 +1439,13 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2408"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3473"/> <source>Fixed setpoint</source> - <translation type="unfinished"/> + <translation>Rögzített alapérték</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2413"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3478"/> <source>Sensor</source> - <translation type="unfinished"/> + <translation>Érzékelő</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3486"/> @@ -1453,24 +1457,24 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2466"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3541"/> <source>pO₂ max</source> - <translation type="unfinished"/> + <translation>pO₂ max</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="1175"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2473"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3548"/> <source>pO₂ min</source> - <translation type="unfinished"/> + <translation>pO₂ min</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3589"/> <source>Safety level</source> - <translation type="unfinished"/> + <translation>Biztonsági szint</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3615"/> <source>Altitude range</source> - <translation type="unfinished"/> + <translation>Magassági tartomány</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3622"/> @@ -1481,55 +1485,55 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="338"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3642"/> <source>Number of dives</source> - <translation type="unfinished"/> + <translation>Merülések száma</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3702"/> <source>Max. depth</source> - <translation type="unfinished"/> + <translation>Max. mélység</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3749"/> <source>P0 (none)</source> <extracomment>Suunto safety level</extracomment> - <translation type="unfinished"/> + <translation>P0 (nincs)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3754"/> <source>P1 (medium)</source> <extracomment>Suunto safety level</extracomment> - <translation type="unfinished"/> + <translation>P1 (közepes)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3759"/> <source>P2 (high)</source> <extracomment>Suunto safety level</extracomment> - <translation type="unfinished"/> + <translation>P2 (magas)</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3767"/> <source>Sample rate</source> - <translation type="unfinished"/> + <translation>Mintavétel aránya</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3780"/> <source>20s</source> - <translation type="unfinished"/> + <translation>20mp</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3785"/> <source>30s</source> - <translation type="unfinished"/> + <translation>30mp</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3790"/> <source>60s</source> - <translation type="unfinished"/> + <translation>60mp</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3798"/> <source>Total dive time</source> - <translation type="unfinished"/> + <translation>Teljes merülési idő</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="694"/> @@ -1538,22 +1542,22 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3822"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3914"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3836"/> <source>24h</source> - <translation type="unfinished"/> + <translation>24ó</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3841"/> <source>12h</source> - <translation type="unfinished"/> + <translation>12ó</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3849"/> <source>Time format</source> - <translation type="unfinished"/> + <translation>Idő formátum</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3864"/> @@ -1563,7 +1567,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3869"/> <source>Metric</source> - <translation type="unfinished"/> + <translation>Metrikus</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="487"/> @@ -1571,22 +1575,22 @@ <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2819"/> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3880"/> <source>s</source> - <translation type="unfinished"/> + <translation>mp</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3887"/> <source>Light</source> - <translation type="unfinished"/> + <translation>Fény</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3904"/> <source>Depth alarm</source> - <translation type="unfinished"/> + <translation>Mélység risztás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3924"/> <source>Time alarm</source> - <translation type="unfinished"/> + <translation>Idő riasztás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="399"/> @@ -1606,12 +1610,12 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="424"/> <source>Salinity</source> - <translation type="unfinished"/> + <translation>Sótartalom</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="434"/> <source>kg/ℓ</source> - <translation type="unfinished"/> + <translation>kg/ℓ</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="666"/> @@ -1621,27 +1625,27 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="676"/> <source>L16-GF OC</source> - <translation type="unfinished"/> + <translation>L16-GF OC</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="681"/> <source>L16-GF CC</source> - <translation type="unfinished"/> + <translation>L16-GF CC</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="686"/> <source>PSCR-GF</source> - <translation type="unfinished"/> + <translation>PSCR-GF</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2881"/> <source>Travel gas consumption</source> - <translation type="unfinished"/> + <translation>Utazó gáz fogyasztás</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="2904"/> <source>Button sensitivity</source> - <translation type="unfinished"/> + <translation>Gomb érzékenység</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3034"/> @@ -1656,7 +1660,7 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.ui" line="3181"/> <source>+</source> - <translation type="unfinished"/> + <translation>+</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="896"/> @@ -1666,90 +1670,90 @@ <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1367"/> <source>Backup dive computer settings</source> - <translation type="unfinished"/> + <translation>Búvárkomputer beállításainak biztonsági mentése</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1368"/> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1389"/> <source>Backup files</source> - <translation type="unfinished"/> + <translation>Fájlok biztonsági mentése</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1372"/> <source>XML backup error</source> - <translation type="unfinished"/> + <translation>XML biztonsági mentés hiba</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1373"/> <source>An error occurred while saving the backup file. %1</source> - <translation type="unfinished"/> + <translation>Egy hiba lépett fel a fájl biztonági mentésése közben. %1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1376"/> <source>Backup succeeded</source> - <translation type="unfinished"/> + <translation>Biztonsági mentés sikeres</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1377"/> <source>Your settings have been saved to: %1</source> - <translation type="unfinished"/> + <translation>A beállításaid mentve lettek: %1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1388"/> <source>Restore dive computer settings</source> - <translation type="unfinished"/> + <translation>Helyreállítani a buvárkomputer beállításat</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1394"/> <source>XML restore error</source> - <translation type="unfinished"/> + <translation>XML helyreállítási hiba</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1395"/> <source>An error occurred while restoring the backup file. %1</source> - <translation type="unfinished"/> + <translation>Egy hiba lépett fel a biztonági mentésése helyreállítása közben. %1</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1399"/> <source>Restore succeeded</source> - <translation type="unfinished"/> + <translation>Helyreállítás sikeres</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1400"/> <source>Your settings have been restored successfully.</source> - <translation type="unfinished"/> + <translation>A beállításaid helyreállítása sikeres.</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1410"/> <source>Select firmware file</source> - <translation type="unfinished"/> + <translation>Firmware fájl kiválasztása</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1411"/> <source>All files</source> - <translation type="unfinished"/> + <translation>Összes fájl</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1472"/> <source>Log files</source> - <translation type="unfinished"/> + <translation>Napló fájlok</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1497"/> <source>Connecting to device...</source> - <translation type="unfinished"/> + <translation>Csatlakozás az eszközhöz ...</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1523"/> <source>Connected to device</source> - <translation type="unfinished"/> + <translation>Csatlakoztatva az eszközhöz</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1543"/> <source>Disconnected from device</source> - <translation type="unfinished"/> + <translation>Leválasztva az eszközről</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="1471"/> @@ -1770,38 +1774,38 @@ <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Type</source> - <translation type="unfinished"/> + <translation>Típus</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Size</source> - <translation type="unfinished"/> + <translation>Méret</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>Work press.</source> - <translation type="unfinished"/> + <translation>Munka nyomás</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <location filename="../qt-models/cylindermodel.cpp" line="24"/> <source>Start press.</source> - <translation type="unfinished"/> + <translation>Kezdő nyomás</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>End press.</source> - <translation type="unfinished"/> + <translation>Végső nyomás</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>O₂%</source> - <translation type="unfinished"/> + <translation>O₂%</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="16"/> <source>He%</source> - <translation type="unfinished"/> + <translation>He%</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="17"/> @@ -1821,7 +1825,7 @@ <message> <location filename="../qt-models/cylindermodel.cpp" line="17"/> <source>Use</source> - <translation type="unfinished"/> + <translation>Használ</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="52"/> @@ -1831,7 +1835,7 @@ <message> <location filename="../qt-models/cylindermodel.cpp" line="56"/> <source>ℓ</source> - <translation type="unfinished"/> + <translation>ℓ</translation> </message> <message> <location filename="../qt-models/cylindermodel.cpp" line="247"/> @@ -1874,32 +1878,32 @@ <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="73"/> <source>Dive site</source> - <translation type="unfinished"/> + <translation>Merülő hely</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="80"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="87"/> <source>Visibility</source> - <translation type="unfinished"/> + <translation>Láthatóság</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="94"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="101"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="108"/> <source>Weights</source> - <translation type="unfinished"/> + <translation>Súlyok</translation> </message> <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="115"/> @@ -1919,7 +1923,7 @@ <message> <location filename="../desktop-widgets/divecomponentselection.ui" line="136"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> </context> <context> @@ -1927,18 +1931,18 @@ <message> <location filename="../desktop-widgets/divecomputermanagementdialog.ui" line="17"/> <source>Edit dive computer nicknames</source> - <translation type="unfinished"/> + <translation>Búvárkomputer becenév szerkesztése</translation> </message> <message> <location filename="../desktop-widgets/divecomputermanagementdialog.cpp" line="42"/> <source>Remove the selected dive computer?</source> - <translation type="unfinished"/> + <translation>Elávolítja a kiválasztott buvárkomutert?</translation> </message> <message> <location filename="../desktop-widgets/divecomputermanagementdialog.cpp" line="43"/> <source>Are you sure that you want to remove the selected dive computer?</source> - <translation type="unfinished"/> + <translation>Biztosan el akarod távolítani a kiválaszott buvárkomputert?</translation> </message> </context> <context> @@ -1951,17 +1955,17 @@ <message> <location filename="../qt-models/divecomputermodel.cpp" line="9"/> <source>Device ID</source> - <translation type="unfinished"/> + <translation>Eszköz azonosító</translation> </message> <message> <location filename="../qt-models/divecomputermodel.cpp" line="9"/> <source>Nickname</source> - <translation type="unfinished"/> + <translation>Becenév</translation> </message> <message> <location filename="../qt-models/divecomputermodel.cpp" line="36"/> <source>Clicking here will remove this dive computer.</source> - <translation type="unfinished"/> + <translation>Ide kattintva eltávolíthatja a buvárkomputert</translation> </message> </context> <context> @@ -1969,7 +1973,7 @@ <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="47"/> <source>Dive details</source> - <translation type="unfinished"/> + <translation>Merülés részletei</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="142"/> @@ -1979,12 +1983,12 @@ <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="159"/> <source>Cancel edit</source> - <translation type="unfinished"/> + <translation>Szerkesztés visszavonása</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetails.qml" line="169"/> <source>Show on map</source> - <translation type="unfinished"/> + <translation>Mutasd a térképen</translation> </message> </context> <context> @@ -1992,7 +1996,7 @@ <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="116"/> <source>Dive %1</source> - <translation type="unfinished"/> + <translation>Merülés %1</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="120"/> @@ -2002,18 +2006,18 @@ <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="132"/> <source>Location:</source> - <translation type="unfinished"/> + <translation>Elhelyezkedés:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="155"/> <source>Coordinates:</source> - <translation type="unfinished"/> + <translation>Koordináták:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="168"/> <source>Use current GPS location:</source> - <translation type="unfinished"/> + <translation>Használd az aktuális GPS elhelyezkedést:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="189"/> @@ -2023,72 +2027,72 @@ GPS location:</source> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="202"/> <source>Duration:</source> - <translation type="unfinished"/> + <translation>Időtartam:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="216"/> <source>Air Temp:</source> - <translation type="unfinished"/> + <translation>Levegő hőm.:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="229"/> <source>Water Temp:</source> - <translation type="unfinished"/> + <translation>Víz hőm.:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="242"/> <source>Suit:</source> - <translation type="unfinished"/> + <translation>Ruha:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="263"/> <source>Buddy:</source> - <translation type="unfinished"/> + <translation>Merülőtárs:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="283"/> <source>Divemaster:</source> - <translation type="unfinished"/> + <translation>Merülés vezető:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="303"/> <source>Weight:</source> - <translation type="unfinished"/> + <translation>Súly:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="317"/> <source>Cylinder:</source> - <translation type="unfinished"/> + <translation>Palack:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="331"/> <source>Gas mix:</source> - <translation type="unfinished"/> + <translation>Gázkeverék:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="345"/> <source>Start Pressure:</source> - <translation type="unfinished"/> + <translation>Induló nyomás:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="358"/> <source>End Pressure:</source> - <translation type="unfinished"/> + <translation>Végső nyomás:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="371"/> <source>Rating:</source> - <translation type="unfinished"/> + <translation>Értékelés:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="384"/> <source>Visibility:</source> - <translation type="unfinished"/> + <translation>Láthatóság:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsEdit.qml" line="398"/> <source>Notes:</source> - <translation type="unfinished"/> + <translation>Jegyzetek:</translation> </message> </context> <context> @@ -2096,27 +2100,27 @@ GPS location:</source> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="228"/> <source>No profile to show</source> - <translation type="unfinished"/> + <translation>Nincs profil megmutatni</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="234"/> <source>Suit:</source> - <translation type="unfinished"/> + <translation>Ruha:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="240"/> <source>Air Temp:</source> - <translation type="unfinished"/> + <translation>Levegő hőm.:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="284"/> <source>Cylinder:</source> - <translation type="unfinished"/> + <translation>Palack:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="246"/> <source>Water Temp:</source> - <translation type="unfinished"/> + <translation>Víz hőm.:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="63"/> @@ -2126,37 +2130,37 @@ GPS location:</source> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="112"/> <source>Rating:</source> - <translation type="unfinished"/> + <translation>Értékelés:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="155"/> <source>Visibility:</source> - <translation type="unfinished"/> + <translation>Láthatóság:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="337"/> <source>Divemaster:</source> - <translation type="unfinished"/> + <translation>Merülés vezető:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="291"/> <source>Weight:</source> - <translation type="unfinished"/> + <translation>Súly:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="344"/> <source>Buddy:</source> - <translation type="unfinished"/> + <translation>Merülőtárs:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="298"/> <source>SAC:</source> - <translation type="unfinished"/> + <translation>SAC:</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveDetailsView.qml" line="380"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> </context> <context> @@ -2174,17 +2178,17 @@ GPS location:</source> <message> <location filename="../profile-widget/diveeventitem.cpp" line="189"/> <source>ΔHe</source> - <translation type="unfinished"/> + <translation>ΔHe</translation> </message> <message> <location filename="../profile-widget/diveeventitem.cpp" line="190"/> <source>ΔN₂</source> - <translation type="unfinished"/> + <translation>ΔN₂</translation> </message> <message> <location filename="../profile-widget/diveeventitem.cpp" line="211"/> <source>Manual switch to OC</source> - <translation type="unfinished"/> + <translation>Kézi váltás OC-re</translation> </message> <message> <location filename="../profile-widget/diveeventitem.cpp" line="213"/> @@ -2204,7 +2208,7 @@ GPS location:</source> <message> <location filename="../qt-models/diveimportedmodel.cpp" line="39"/> <source>Date/time</source> - <translation type="unfinished"/> + <translation>Dátum/idő</translation> </message> <message> <location filename="../qt-models/diveimportedmodel.cpp" line="41"/> @@ -2219,12 +2223,12 @@ GPS location:</source> <message> <location filename="../qt-models/diveimportedmodel.cpp" line="78"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../qt-models/diveimportedmodel.cpp" line="78"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> </context> <context> @@ -2239,7 +2243,7 @@ GPS location:</source> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="350"/> <source>Cloud credentials</source> - <translation type="unfinished"/> + <translation>Felhő hitelesítő adatok</translation> </message> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="357"/> @@ -2249,7 +2253,7 @@ GPS location:</source> <message> <location filename="../mobile-widgets/qml/DiveList.qml" line="382"/> <source>No dives in dive list</source> - <translation type="unfinished"/> + <translation>Nincs merülés a listában</translation> </message> </context> <context> @@ -2267,12 +2271,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelistview.cpp" line="861"/> <source>Collapse others</source> - <translation type="unfinished"/> + <translation>Továbbiak összecsukása</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="865"/> <source>Remove dive(s) from trip</source> - <translation type="unfinished"/> + <translation>Merülés(ek) eltávolítása az túrából</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="866"/> @@ -2282,12 +2286,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelistview.cpp" line="880"/> <source>Add dive(s) to trip immediately above</source> - <translation type="unfinished"/> + <translation>Merülés(ek) hozzáadása a túrához azonnal fölé</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="882"/> <source>Add dive(s) to trip immediately below</source> - <translation type="unfinished"/> + <translation>Merülés(ek) hozzáadása a túrához azonnal alá</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="886"/> @@ -2302,7 +2306,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelistview.cpp" line="891"/> <source>Delete dive(s)</source> - <translation type="unfinished"/> + <translation>Merülés(ek) törlése</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="893"/> @@ -2312,12 +2316,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelistview.cpp" line="897"/> <source>Merge selected dives</source> - <translation type="unfinished"/> + <translation>Egysiteni a kiválasztott merüléseket</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="899"/> <source>Renumber dive(s)</source> - <translation type="unfinished"/> + <translation>Újraszámozni a merülés(t/eket)</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="900"/> @@ -2327,22 +2331,22 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelistview.cpp" line="901"/> <source>Split selected dives</source> - <translation type="unfinished"/> + <translation>Felosztani a kiválasztott merüléseket</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="902"/> <source>Load image(s) from file(s)</source> - <translation type="unfinished"/> + <translation>Kép(ek) betöltése fájlból</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="903"/> <source>Load image from web</source> - <translation type="unfinished"/> + <translation>Kép betöltése webről</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="929"/> <source>Image files (%1)</source> - <translation type="unfinished"/> + <translation>Kép fájlok (%1)</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="985"/> @@ -2352,7 +2356,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelistview.cpp" line="927"/> <source>Open image files</source> - <translation type="unfinished"/> + <translation>Képfájl megnyitása</translation> </message> </context> <context> @@ -2360,12 +2364,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="389"/> <source>Create a new dive site, copying relevant information from the current dive.</source> - <translation type="unfinished"/> + <translation>Új merülőhely létrehozása, az aktuális merülésre vonatkozó információinak másolásával</translation> </message> <message> <location filename="../desktop-widgets/locationinformation.cpp" line="390"/> <source>Create a new dive site with this name</source> - <translation type="unfinished"/> + <translation>Új merülőhely létrehozása ezzel a névvel</translation> </message> </context> <context> @@ -2373,57 +2377,57 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="14"/> <source>Export dive log files</source> - <translation type="unfinished"/> + <translation>Merülésnaplófájlok exportálása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="44"/> <source>General export</source> - <translation type="unfinished"/> + <translation>Általános exportálás</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="103"/> <source>Export format</source> - <translation type="unfinished"/> + <translation>Exportálás formátuma</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="115"/> <source>Subsurface &XML</source> - <translation type="unfinished"/> + <translation>Subsurface &XML</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="134"/> <source>UDDF</source> - <translation type="unfinished"/> + <translation>UDDF</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="147"/> <source>di&velogs.de</source> - <translation type="unfinished"/> + <translation>di&velogs.de</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="157"/> <source>DiveShare</source> - <translation type="unfinished"/> + <translation>DiveShare</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="167"/> <source>CSV dive profile</source> - <translation type="unfinished"/> + <translation>CSV merülés profil</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="177"/> <source>CSV dive details</source> - <translation type="unfinished"/> + <translation>CSV merülés részletek</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="187"/> <source>Worldmap</source> - <translation type="unfinished"/> + <translation>Világtérkép</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="197"/> <source>TeX</source> - <translation type="unfinished"/> + <translation>TeX</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="207"/> @@ -2433,28 +2437,28 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="253"/> <source>Selection</source> - <translation type="unfinished"/> + <translation>Kiválasztás</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="262"/> <location filename="../desktop-widgets/divelogexportdialog.ui" line="356"/> <source>Selected dives</source> - <translation type="unfinished"/> + <translation>Kiválasztott merülések</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="272"/> <source>All dives</source> - <translation type="unfinished"/> + <translation>Összes merülés</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="285"/> <source>CSV units</source> - <translation type="unfinished"/> + <translation>CSV egységek</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="298"/> <source>Metric</source> - <translation type="unfinished"/> + <translation>Metrikus</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="303"/> @@ -2464,22 +2468,22 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="316"/> <source>HTML</source> - <translation type="unfinished"/> + <translation>HTML</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="334"/> <source>General settings</source> - <translation type="unfinished"/> + <translation>Általános beállítások</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="340"/> <source>Subsurface numbers</source> - <translation type="unfinished"/> + <translation>Subsurface számok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="369"/> <source>Export yearly statistics</source> - <translation type="unfinished"/> + <translation>Éves statisztika exportálása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="385"/> @@ -2489,32 +2493,32 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="395"/> <source>Export list only</source> - <translation type="unfinished"/> + <translation>Csak a lista exportálása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="402"/> <source>Export photos</source> - <translation type="unfinished"/> + <translation>Fotók exportálása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="418"/> <source>Style options</source> - <translation type="unfinished"/> + <translation>Stílus beállítása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="433"/> <source>Font</source> - <translation type="unfinished"/> + <translation>Betűtípus</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="443"/> <source>Font size</source> - <translation type="unfinished"/> + <translation>Betű mérete</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="454"/> <source>8</source> - <translation type="unfinished"/> + <translation>8</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="459"/> @@ -2524,43 +2528,43 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="464"/> <source>12</source> - <translation type="unfinished"/> + <translation>12</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="469"/> <source>14</source> - <translation type="unfinished"/> + <translation>14</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="474"/> <source>16</source> - <translation type="unfinished"/> + <translation>16</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="479"/> <source>18</source> - <translation type="unfinished"/> + <translation>18</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="484"/> <source>20</source> - <translation type="unfinished"/> + <translation>20</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="492"/> <source>Theme</source> - <translation type="unfinished"/> + <translation>Téma</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="503"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="102"/> <source>Light</source> - <translation type="unfinished"/> + <translation>Fény</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.ui" line="508"/> <source>Sand</source> - <translation type="unfinished"/> + <translation>Homok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="79"/> @@ -2595,7 +2599,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="91"/> <source>Subsurface native XML format.</source> - <translation type="unfinished"/> + <translation>Subsurface nativ XML formátum</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="93"/> @@ -2615,29 +2619,29 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="139"/> <source>UDDF files</source> - <translation type="unfinished"/> + <translation>UDDF fájlok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="143"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="147"/> <source>CSV files</source> - <translation type="unfinished"/> + <translation>CSV fájlok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="154"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="178"/> <source>HTML files</source> - <translation type="unfinished"/> + <translation>HTML fájlok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="159"/> <source>Subsurface files</source> - <translation type="unfinished"/> + <translation>Subsurface fájlok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="171"/> <source>TeX files</source> - <translation type="unfinished"/> + <translation>TeX fájlok</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="142"/> @@ -2648,12 +2652,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="153"/> <source>Export world map</source> - <translation type="unfinished"/> + <translation>Világtérkép exportálása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="158"/> <source>Export Subsurface XML</source> - <translation type="unfinished"/> + <translation>Subsurface XML exportálása</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="167"/> @@ -2663,7 +2667,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="171"/> <source>Export to TeX file</source> - <translation type="unfinished"/> + <translation>Exportálás TeX fájlba</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="177"/> @@ -2673,13 +2677,13 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="193"/> <source>Please wait, exporting...</source> - <translation type="unfinished"/> + <translation>Kérlek várj, exportálás ...</translation> </message> <message> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="228"/> <location filename="../desktop-widgets/divelogexportdialog.cpp" line="410"/> <source>Can't open file %s</source> - <translation type="unfinished"/> + <translation>A %s fájlt nem lehet megnyitni</translation> </message> </context> <context> @@ -2692,37 +2696,37 @@ GPS location:</source> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="89"/> <source>dd.mm.yyyy</source> - <translation type="unfinished"/> + <translation>nn.hh.éééé</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="94"/> <source>mm/dd/yyyy</source> - <translation type="unfinished"/> + <translation>hh/nn/éééé</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="99"/> <source>yyyy-mm-dd</source> - <translation type="unfinished"/> + <translation>éééé-hh-nn</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="108"/> <source>Seconds</source> - <translation type="unfinished"/> + <translation>Másodpercek</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="113"/> <source>Minutes</source> - <translation type="unfinished"/> + <translation>Percek</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="118"/> <source>Minutes:seconds</source> - <translation type="unfinished"/> + <translation>Percek:másodpercek</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="127"/> <source>Metric</source> - <translation type="unfinished"/> + <translation>Metrikus</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.ui" line="132"/> @@ -2750,25 +2754,25 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="751"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="870"/> <source>Sample time</source> - <translation type="unfinished"/> + <translation>Idő minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="635"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="753"/> <source>Sample depth</source> - <translation type="unfinished"/> + <translation>Mélység minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="637"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="755"/> <source>Sample temperature</source> - <translation type="unfinished"/> + <translation>Hőmérséklet minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="639"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="757"/> <source>Sample pO₂</source> - <translation type="unfinished"/> + <translation>Minta pO₂</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="641"/> @@ -2792,19 +2796,19 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="647"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="765"/> <source>Sample CNS</source> - <translation type="unfinished"/> + <translation>Minta CNS</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="649"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="767"/> <source>Sample NDL</source> - <translation type="unfinished"/> + <translation>Minta NDL</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="651"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="769"/> <source>Sample TTS</source> - <translation type="unfinished"/> + <translation>Minta TTS</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="653"/> @@ -2816,7 +2820,7 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="655"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="773"/> <source>Sample pressure</source> - <translation type="unfinished"/> + <translation>Nyomás minta</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="657"/> @@ -2829,7 +2833,7 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="749"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="874"/> <source>Dive #</source> - <translation type="unfinished"/> + <translation>Merülés #</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="662"/> @@ -2855,43 +2859,43 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="665"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="886"/> <source>Max. depth</source> - <translation type="unfinished"/> + <translation>Max. mélység</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="666"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="888"/> <source>Avg. depth</source> - <translation type="unfinished"/> + <translation>Átl. mélység</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="667"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="920"/> <source>Air temp.</source> - <translation type="unfinished"/> + <translation>Levegő hőm.</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="668"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="922"/> <source>Water temp.</source> - <translation type="unfinished"/> + <translation>Víz hőm.</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="669"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="910"/> <source>Cyl. size</source> - <translation type="unfinished"/> + <translation>Palack méret</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="670"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="912"/> <source>Start pressure</source> - <translation type="unfinished"/> + <translation>Kezdő nyomás</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="671"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="914"/> <source>End pressure</source> - <translation type="unfinished"/> + <translation>Végső nyomás</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="672"/> @@ -2915,7 +2919,7 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="675"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="884"/> <source>GPS</source> - <translation type="unfinished"/> + <translation>GPS</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="676"/> @@ -2933,39 +2937,39 @@ GPS location:</source> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="678"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="894"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="679"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="779"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="926"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="680"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="777"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="924"/> <source>Visibility</source> - <translation type="unfinished"/> + <translation>Láthatóság</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="681"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="896"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="682"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="898"/> <source>Weight</source> - <translation type="unfinished"/> + <translation>Súly</translation> </message> <message> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="683"/> <location filename="../desktop-widgets/divelogimportdialog.cpp" line="900"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> </context> <context> @@ -2981,7 +2985,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/diveplanner.ui" line="74"/> <source>Planned dive time</source> - <translation type="unfinished"/> + <translation>Tervezett merülési idő</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="117"/> @@ -2996,42 +3000,42 @@ GPS location:</source> <message> <location filename="../desktop-widgets/diveplanner.ui" line="166"/> <source>mbar</source> - <translation type="unfinished"/> + <translation>mbar</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="144"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="131"/> <source>Water type</source> - <translation type="unfinished"/> + <translation>Víz típusa</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="180"/> <source>Fresh water</source> - <translation type="unfinished"/> + <translation>Édesvíz</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="185"/> <source>Sea water</source> - <translation type="unfinished"/> + <translation>Sósvíz</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="190"/> <source>EN13319</source> - <translation type="unfinished"/> + <translation>EN13319</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="195"/> <source>Custom</source> - <translation type="unfinished"/> + <translation>Egyéni</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.ui" line="221"/> <source>kg/ℓ</source> - <translation type="unfinished"/> + <translation>kg/ℓ</translation> </message> </context> <context> @@ -3039,17 +3043,17 @@ GPS location:</source> <message> <location filename="../qt-models/diveplannermodel.cpp" line="169"/> <source>unknown</source> - <translation type="unfinished"/> + <translation>ismeretlen</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="270"/> <source>cyl.</source> - <translation type="unfinished"/> + <translation>pal.</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="376"/> <source>Final depth</source> - <translation type="unfinished"/> + <translation>Végső mélység</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="378"/> @@ -3074,17 +3078,17 @@ GPS location:</source> <message> <location filename="../qt-models/diveplannermodel.cpp" line="386"/> <source>Dive mode</source> - <translation type="unfinished"/> + <translation>Merülési mód</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="1038"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="1044"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../qt-models/diveplannermodel.cpp" line="1047"/> @@ -3107,12 +3111,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="119"/> <source>Available gases</source> - <translation type="unfinished"/> + <translation>Elérhető gázok</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="120"/> <source>Add cylinder</source> - <translation type="unfinished"/> + <translation>Palack hozzáadása</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="151"/> @@ -3122,12 +3126,12 @@ GPS location:</source> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="161"/> <source>Save new</source> - <translation type="unfinished"/> + <translation>Új mentése</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="266"/> <source>kg/ℓ</source> - <translation type="unfinished"/> + <translation>kg/ℓ</translation> </message> </context> <context> @@ -3145,17 +3149,17 @@ GPS location:</source> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="118"/> <source>Pressure</source> - <translation type="unfinished"/> + <translation>Nyomás</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="120"/> <source>Temperature</source> - <translation type="unfinished"/> + <translation>Hőmérséklet</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="122"/> <source>Color</source> - <translation type="unfinished"/> + <translation>Szín</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="124"/> @@ -3180,52 +3184,52 @@ GPS location:</source> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="132"/> <source>SAC</source> - <translation type="unfinished"/> + <translation>SAC</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="134"/> <source>pN₂</source> - <translation type="unfinished"/> + <translation>pN₂</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="136"/> <source>pHe</source> - <translation type="unfinished"/> + <translation>pHe</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="138"/> <source>pO₂</source> - <translation type="unfinished"/> + <translation>pO₂</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="140"/> <source>Setpoint</source> - <translation type="unfinished"/> + <translation>Alapérték</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="142"/> <source>Sensor 1</source> - <translation type="unfinished"/> + <translation>Érzékelő 1</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="144"/> <source>Sensor 2</source> - <translation type="unfinished"/> + <translation>Érzékelő 2</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="146"/> <source>Sensor 3</source> - <translation type="unfinished"/> + <translation>Érzékelő 3</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="148"/> <source>Ambient pressure</source> - <translation type="unfinished"/> + <translation>Környezeti nyomás</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="150"/> <source>Heart rate</source> - <translation type="unfinished"/> + <translation>Pulzus</translation> </message> <message> <location filename="../qt-models/diveplotdatamodel.cpp" line="152"/> @@ -3243,7 +3247,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="14"/> <source>Dialog</source> - <translation type="unfinished"/> + <translation>Párbezéd</translation> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="61"/> @@ -3253,7 +3257,7 @@ GPS location:</source> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="75"/> <source>⌫</source> - <translation type="unfinished"/> + <translation>⌫</translation> </message> <message> <location filename="../desktop-widgets/diveshareexportdialog.ui" line="82"/> @@ -3308,7 +3312,7 @@ p, li { white-space: pre-wrap; } <location filename="../qt-models/divetripmodel.cpp" line="485"/> <location filename="../qt-models/divetripmodel.cpp" line="540"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="488"/> @@ -3324,18 +3328,18 @@ p, li { white-space: pre-wrap; } <message> <location filename="../qt-models/divetripmodel.cpp" line="497"/> <source>Weight</source> - <translation type="unfinished"/> + <translation>Súly</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="500"/> <location filename="../qt-models/divetripmodel.cpp" line="555"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="494"/> <source>Temp.</source> - <translation type="unfinished"/> + <translation>Hőm.</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="503"/> @@ -3347,40 +3351,40 @@ p, li { white-space: pre-wrap; } <location filename="../qt-models/divetripmodel.cpp" line="506"/> <location filename="../qt-models/divetripmodel.cpp" line="561"/> <source>Gas</source> - <translation type="unfinished"/> + <translation>Gáz</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="509"/> <source>SAC</source> - <translation type="unfinished"/> + <translation>SAC</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="512"/> <location filename="../qt-models/divetripmodel.cpp" line="569"/> <source>OTU</source> - <translation type="unfinished"/> + <translation>OTU</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="515"/> <location filename="../qt-models/divetripmodel.cpp" line="572"/> <source>Max CNS</source> - <translation type="unfinished"/> + <translation>Max CNS</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="518"/> <location filename="../qt-models/divetripmodel.cpp" line="575"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="521"/> <source>Photos</source> - <translation type="unfinished"/> + <translation>Fotók</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="524"/> <source>Country</source> - <translation type="unfinished"/> + <translation>Ország</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="527"/> @@ -3396,7 +3400,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../qt-models/divetripmodel.cpp" line="543"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="543"/> @@ -3591,7 +3595,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="362"/> <source>Log files</source> - <translation type="unfinished"/> + <translation>Napló fájlok</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.cpp" line="387"/> @@ -3637,7 +3641,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="115"/> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="132"/> <source>...</source> - <translation type="unfinished"/> + <translation>...</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="73"/> @@ -3700,12 +3704,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="243"/> <source>Select all</source> - <translation type="unfinished"/> + <translation>Összes kiválasztása</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="250"/> <source>Unselect all</source> - <translation type="unfinished"/> + <translation>Összes kiválaszás törlése</translation> </message> <message> <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="291"/> @@ -3716,7 +3720,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/downloadfromdivecomputer.ui" line="298"/> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="191"/> <source>Cancel</source> - <translation type="unfinished"/> + <translation>Mégse</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="16"/> @@ -3771,7 +3775,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="251"/> <source>Accept</source> - <translation type="unfinished"/> + <translation>Elfogad</translation> </message> <message> <location filename="../mobile-widgets/qml/DownloadFromDiveComputer.qml" line="270"/> @@ -4000,7 +4004,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../qt-models/models.cpp" line="52"/> <source>cyl.</source> - <translation type="unfinished"/> + <translation>pal.</translation> </message> </context> <context> @@ -4129,7 +4133,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/locationInformation.ui" line="43"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="53"/> @@ -4144,7 +4148,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/locationInformation.ui" line="76"/> <source>...</source> - <translation type="unfinished"/> + <translation>...</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="97"/> @@ -4154,12 +4158,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/locationInformation.ui" line="138"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="152"/> <source>Country</source> - <translation type="unfinished"/> + <translation>Ország</translation> </message> <message> <location filename="../desktop-widgets/locationInformation.ui" line="162"/> @@ -4231,7 +4235,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="535"/> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="574"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="14"/> @@ -4252,13 +4256,13 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="107"/> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="308"/> <source>Air temp.</source> - <translation type="unfinished"/> + <translation>Levegő hőm.</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="117"/> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="309"/> <source>Water temp.</source> - <translation type="unfinished"/> + <translation>Víz hőm.</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="192"/> @@ -4274,7 +4278,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="225"/> <source>...</source> - <translation type="unfinished"/> + <translation>...</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="260"/> @@ -4289,27 +4293,27 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="316"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="329"/> <source>Visibility</source> - <translation type="unfinished"/> + <translation>Láthatóság</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="336"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="395"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="405"/> <source>Dive mode</source> - <translation type="unfinished"/> + <translation>Merülési mód</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.ui" line="499"/> @@ -4344,7 +4348,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="60"/> <source>Photos</source> - <translation type="unfinished"/> + <translation>Fotók</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="84"/> @@ -4364,12 +4368,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="105"/> <source>Add cylinder</source> - <translation type="unfinished"/> + <translation>Palack hozzáadása</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="108"/> <source>Weights</source> - <translation type="unfinished"/> + <translation>Súlyok</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/maintab.cpp" line="109"/> @@ -4850,7 +4854,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/mainwindow.cpp" line="578"/> <location filename="../desktop-widgets/mainwindow.cpp" line="2029"/> <source>Cancel</source> - <translation type="unfinished"/> + <translation>Mégse</translation> </message> <message> <location filename="../desktop-widgets/divelistview.cpp" line="583"/> @@ -4943,7 +4947,7 @@ If answering no, the cloud will only be synced on next call to "Open cloud <location filename="../desktop-widgets/mainwindow.cpp" line="1423"/> <location filename="../desktop-widgets/mainwindow.cpp" line="1662"/> <source>Subsurface files</source> - <translation type="unfinished"/> + <translation>Subsurface fájlok</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1381"/> @@ -4985,7 +4989,7 @@ If answering no, the cloud will only be synced on next call to "Open cloud <location filename="../desktop-widgets/mainwindow.cpp" line="1387"/> <location filename="../desktop-widgets/mainwindow.cpp" line="1431"/> <source>UDDF</source> - <translation type="unfinished"/> + <translation>UDDF</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1388"/> @@ -5037,7 +5041,7 @@ If answering no, the cloud will only be synced on next call to "Open cloud <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1439"/> <source>All files</source> - <translation type="unfinished"/> + <translation>Összes fájl</translation> </message> <message> <location filename="../desktop-widgets/mainwindow.cpp" line="1450"/> @@ -5175,7 +5179,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="304"/> <source>Update firmware</source> - <translation type="unfinished"/> + <translation>Firmware frissítése</translation> </message> <message> <location filename="../desktop-widgets/configuredivecomputerdialog.cpp" line="306"/> @@ -5267,7 +5271,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/diveplanner.cpp" line="553"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="556"/> @@ -5279,7 +5283,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <location filename="../desktop-widgets/diveplanner.cpp" line="565"/> <location filename="../desktop-widgets/diveplanner.cpp" line="566"/> <source>ℓ/min</source> - <translation type="unfinished"/> + <translation>ℓ/perc</translation> </message> <message> <location filename="../desktop-widgets/diveplanner.cpp" line="575"/> @@ -5307,12 +5311,12 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="29"/> <source>Font</source> - <translation type="unfinished"/> + <translation>Betűtípus</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="39"/> <source>Font size</source> - <translation type="unfinished"/> + <translation>Betű mérete</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="52"/> @@ -5352,7 +5356,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="121"/> <source>...</source> - <translation type="unfinished"/> + <translation>...</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_defaults.ui" line="130"/> @@ -5402,7 +5406,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_defaults.cpp" line="22"/> <source>Subsurface files</source> - <translation type="unfinished"/> + <translation>Subsurface fájlok</translation> </message> </context> <context> @@ -5464,7 +5468,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="298"/> <source>+</source> - <translation type="unfinished"/> + <translation>+</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="245"/> @@ -5569,13 +5573,13 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="192"/> <source>ℓ/min</source> - <translation type="unfinished"/> + <translation>ℓ/perc</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="275"/> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="328"/> <source>%</source> - <translation type="unfinished"/> + <translation>%</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_graph.ui" line="321"/> @@ -5654,7 +5658,7 @@ If your device uses Bluetooth, do the same preparations as for a logbook downloa <message> <location filename="../desktop-widgets/preferences/preferences_language.ui" line="132"/> <source>Time format</source> - <translation type="unfinished"/> + <translation>Idő formátum</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_language.ui" line="151"/> @@ -5737,7 +5741,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="108"/> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="172"/> <source>Password</source> - <translation type="unfinished"/> + <translation>Jelszó</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_network.ui" line="134"/> @@ -5897,7 +5901,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="96"/> <source>Pressure</source> - <translation type="unfinished"/> + <translation>Nyomás</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="103"/> @@ -5927,7 +5931,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="150"/> <source>Temperature</source> - <translation type="unfinished"/> + <translation>Hőmérséklet</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="157"/> @@ -5942,7 +5946,7 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="177"/> <source>Weight</source> - <translation type="unfinished"/> + <translation>Súly</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="184"/> @@ -5967,12 +5971,12 @@ See http://doc.qt.io/qt-5/qdatetime.html#toString</source> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="220"/> <source>Minutes</source> - <translation type="unfinished"/> + <translation>Percek</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="227"/> <source>Seconds</source> - <translation type="unfinished"/> + <translation>Másodpercek</translation> </message> <message> <location filename="../desktop-widgets/preferences/preferences_units.ui" line="237"/> @@ -6133,7 +6137,7 @@ Please export this template to a different file.</source> <location filename="../desktop-widgets/printoptions.cpp" line="149"/> <location filename="../desktop-widgets/printoptions.cpp" line="180"/> <source>HTML files</source> - <translation type="unfinished"/> + <translation>HTML fájlok</translation> </message> <message> <location filename="../desktop-widgets/printoptions.cpp" line="159"/> @@ -6423,14 +6427,14 @@ Please export this template to a different file.</source> <location filename="../mobile-widgets/qmlmanager.cpp" line="949"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="950"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="949"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="950"/> <location filename="../mobile-widgets/qmlmanager.cpp" line="951"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../mobile-widgets/qmlmanager.cpp" line="949"/> @@ -6565,7 +6569,7 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="21"/> <source>No cloud mode</source> - <translation type="unfinished"/> + <translation>Nem felhő mód</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="31"/> @@ -6575,7 +6579,7 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="39"/> <source>Email</source> - <translation type="unfinished"/> + <translation>Email</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="45"/> @@ -6595,7 +6599,7 @@ Please export this template to a different file.</source> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="85"/> <source>Theme</source> - <translation type="unfinished"/> + <translation>Téma</translation> </message> <message> <location filename="../mobile-widgets/qml/Settings.qml" line="93"/> @@ -6849,12 +6853,12 @@ Files with inappropriate date/time</source> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="60"/> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="71"/> <source>All files</source> - <translation type="unfinished"/> + <translation>Összes fájl</translation> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="71"/> <source>Subsurface files</source> - <translation type="unfinished"/> + <translation>Subsurface fájlok</translation> </message> <message> <location filename="../smtk-import/smrtk2ssrfc_window.cpp" line="70"/> @@ -6872,7 +6876,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="376"/> <source>Medium</source> - <translation type="unfinished"/> + <translation>Közepes</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="396"/> @@ -6890,13 +6894,13 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="400"/> <source>h</source> <comment>abbreviation for hours</comment> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="401"/> <source>min</source> <comment>abbreviation for minutes</comment> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/facebookconnectwidget.cpp" line="404"/> @@ -6928,7 +6932,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="14"/> <source>Dialog</source> - <translation type="unfinished"/> + <translation>Párbezéd</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="26"/> @@ -6938,7 +6942,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="31"/> <source>Medium</source> - <translation type="unfinished"/> + <translation>Közepes</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="36"/> @@ -6993,7 +6997,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="113"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/plugins/facebook/socialnetworksdialog.ui" line="126"/> @@ -7154,7 +7158,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="135"/> <source>SAC</source> - <translation type="unfinished"/> + <translation>SAC</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="154"/> @@ -7164,17 +7168,17 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="173"/> <source>OTU</source> - <translation type="unfinished"/> + <translation>OTU</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="192"/> <source>Max. depth</source> - <translation type="unfinished"/> + <translation>Max. mélység</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="211"/> <source>Avg. depth</source> - <translation type="unfinished"/> + <translation>Átl. mélység</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="230"/> @@ -7184,12 +7188,12 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="249"/> <source>Air temp.</source> - <translation type="unfinished"/> + <translation>Levegő hőm.</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="268"/> <source>Water temp.</source> - <translation type="unfinished"/> + <translation>Víz hőm.</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="287"/> @@ -7199,7 +7203,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.ui" line="306"/> <source>Water type</source> - <translation type="unfinished"/> + <translation>Víz típusa</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="71"/> @@ -7210,13 +7214,13 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="77"/> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="84"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="77"/> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="84"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveInformation.cpp" line="77"/> @@ -7234,7 +7238,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDivePhotos.ui" line="14"/> <source>Photos</source> - <translation type="unfinished"/> + <translation>Fotók</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDivePhotos.ui" line="29"/> @@ -7244,7 +7248,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDivePhotos.cpp" line="52"/> <source>Load image(s) from file(s)</source> - <translation type="unfinished"/> + <translation>Kép(ek) betöltése fájlból</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDivePhotos.cpp" line="53"/> @@ -7297,7 +7301,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.ui" line="97"/> <source>Temperature</source> - <translation type="unfinished"/> + <translation>Hőmérséklet</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.ui" line="109"/> @@ -7312,7 +7316,7 @@ Files with inappropriate date/time</source> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.ui" line="85"/> <source>SAC</source> - <translation type="unfinished"/> + <translation>SAC</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.ui" line="159"/> @@ -7387,7 +7391,7 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="93"/> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="95"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="84"/> @@ -7395,7 +7399,7 @@ Files with inappropriate date/time</source> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="93"/> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="95"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../desktop-widgets/tab-widgets/TabDiveStatistics.cpp" line="84"/> @@ -7491,7 +7495,7 @@ mixed from Air and using: <message> <location filename="../desktop-widgets/templateedit.ui" line="104"/> <source>Font</source> - <translation type="unfinished"/> + <translation>Betűtípus</translation> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="112"/> @@ -7521,7 +7525,7 @@ mixed from Air and using: <message> <location filename="../desktop-widgets/templateedit.ui" line="144"/> <source>Font size</source> - <translation type="unfinished"/> + <translation>Betű mérete</translation> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="165"/> @@ -7546,7 +7550,7 @@ mixed from Air and using: <message> <location filename="../desktop-widgets/templateedit.ui" line="188"/> <source>Custom</source> - <translation type="unfinished"/> + <translation>Egyéni</translation> </message> <message> <location filename="../desktop-widgets/templateedit.ui" line="200"/> @@ -7688,7 +7692,7 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="241"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> @@ -7698,7 +7702,7 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="244"/> @@ -7728,17 +7732,17 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="276"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="375"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="375"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="253"/> @@ -7760,12 +7764,12 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="256"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="262"/> <source>Gas</source> - <translation type="unfinished"/> + <translation>Gáz</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="267"/> @@ -7781,7 +7785,7 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="270"/> <source>OTU</source> - <translation type="unfinished"/> + <translation>OTU</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="279"/> @@ -7791,7 +7795,7 @@ mixed from Air and using: <message> <location filename="../qt-models/divetripmodel.cpp" line="282"/> <source>Country</source> - <translation type="unfinished"/> + <translation>Ország</translation> </message> <message> <location filename="../qt-models/divetripmodel.cpp" line="285"/> @@ -7804,7 +7808,7 @@ mixed from Air and using: <message> <location filename="../desktop-widgets/urldialog.ui" line="14"/> <source>Dialog</source> - <translation type="unfinished"/> + <translation>Párbezéd</translation> </message> <message> <location filename="../desktop-widgets/urldialog.ui" line="52"/> @@ -7878,7 +7882,7 @@ If you don't want Subsurface to continue checking, please click Decline.</s <message> <location filename="../desktop-widgets/updatemanager.cpp" line="119"/> <source>Accept</source> - <translation type="unfinished"/> + <translation>Elfogad</translation> </message> <message> <location filename="../desktop-widgets/updatemanager.cpp" line="121"/> @@ -8100,7 +8104,7 @@ Language: %1</source> <message> <location filename="../desktop-widgets/webservices.ui" line="92"/> <source>Password</source> - <translation type="unfinished"/> + <translation>Jelszó</translation> </message> <message> <location filename="../desktop-widgets/webservices.ui" line="106"/> @@ -8123,12 +8127,12 @@ Language: %1</source> <message> <location filename="../qt-models/weightmodel.cpp" line="14"/> <source>Type</source> - <translation type="unfinished"/> + <translation>Típus</translation> </message> <message> <location filename="../qt-models/weightmodel.cpp" line="14"/> <source>Weight</source> - <translation type="unfinished"/> + <translation>Súly</translation> </message> <message> <location filename="../qt-models/weightmodel.cpp" line="78"/> @@ -8166,12 +8170,12 @@ Language: %1</source> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="62"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="62"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../qt-models/yearlystatisticsmodel.cpp" line="62"/> @@ -8300,7 +8304,7 @@ Maximum</source> <location filename="../core/cochran.c" line="400"/> <location filename="../core/libdivecomputer.c" line="277"/> <source>pO₂</source> - <translation type="unfinished"/> + <translation>pO₂</translation> </message> <message> <location filename="../core/cochran.c" line="361"/> @@ -8633,7 +8637,7 @@ Maximum</source> <message> <location filename="../core/dive.c" line="341"/> <source>ℓ</source> - <translation type="unfinished"/> + <translation>ℓ</translation> </message> <message> <location filename="../core/dive.c" line="346"/> @@ -8648,7 +8652,7 @@ Maximum</source> <location filename="../core/qthelper.cpp" line="765"/> <location filename="../core/qthelper.cpp" line="1294"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../core/dive.c" line="392"/> @@ -8934,7 +8938,7 @@ Maximum</source> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="30"/> <location filename="../core/uemis-downloader.c" line="194"/> <source>unknown</source> - <translation type="unfinished"/> + <translation>ismeretlen</translation> </message> <message> <location filename="../core/libdivecomputer.c" line="257"/> @@ -9313,7 +9317,7 @@ You can create this logfile by selecting the corresponding checkbox in the downl <message> <location filename="../core/plannernotes.c" line="397"/> <source>OTU</source> - <translation type="unfinished"/> + <translation>OTU</translation> </message> <message> <location filename="../core/plannernotes.c" line="405"/> @@ -9333,7 +9337,7 @@ You can create this logfile by selecting the corresponding checkbox in the downl <message> <location filename="../core/plannernotes.c" line="499"/> <source>SAC</source> - <translation type="unfinished"/> + <translation>SAC</translation> </message> <message> <location filename="../core/plannernotes.c" line="518"/> @@ -9827,7 +9831,7 @@ EADD: %d%s / %.1fg/ℓ <location filename="../core/save-html.c" line="556"/> <location filename="../core/worldmap-save.c" line="113"/> <source>Can't open file %s</source> - <translation type="unfinished"/> + <translation>A %s fájlt nem lehet megnyitni</translation> </message> <message> <location filename="../core/save-html.c" line="491"/> @@ -9852,12 +9856,12 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="495"/> <source>Air temp.</source> - <translation type="unfinished"/> + <translation>Levegő hőm.</translation> </message> <message> <location filename="../core/save-html.c" line="496"/> <source>Water temp.</source> - <translation type="unfinished"/> + <translation>Víz hőm.</translation> </message> <message> <location filename="../core/save-html.c" line="497"/> @@ -9892,12 +9896,12 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="505"/> <source>Rating</source> - <translation type="unfinished"/> + <translation>Értékelés</translation> </message> <message> <location filename="../core/save-html.c" line="506"/> <source>Visibility</source> - <translation type="unfinished"/> + <translation>Láthatóság</translation> </message> <message> <location filename="../core/save-html.c" line="507"/> @@ -9917,7 +9921,7 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="510"/> <source>Suit</source> - <translation type="unfinished"/> + <translation>Ruha</translation> </message> <message> <location filename="../core/divesite-helper.cpp" line="21"/> @@ -9928,14 +9932,14 @@ EADD: %d%s / %.1fg/ℓ <location filename="../core/divesite-helper.cpp" line="29"/> <location filename="../core/save-html.c" line="511"/> <source>Tags</source> - <translation type="unfinished"/> + <translation>Címkék</translation> </message> <message> <location filename="../core/save-html.c" line="512"/> <location filename="../smtk-import/smartrak.c" line="296"/> <location filename="../smtk-import/smartrak.c" line="369"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../core/save-html.c" line="513"/> @@ -9985,7 +9989,7 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="524"/> <source>Max. depth</source> - <translation type="unfinished"/> + <translation>Max. mélység</translation> </message> <message> <location filename="../core/save-html.c" line="525"/> @@ -10025,7 +10029,7 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="534"/> <source>Dive #</source> - <translation type="unfinished"/> + <translation>Merülés #</translation> </message> <message> <location filename="../core/save-html.c" line="535"/> @@ -10046,12 +10050,12 @@ EADD: %d%s / %.1fg/ℓ <location filename="../core/save-html.c" line="538"/> <location filename="../core/save-html.c" line="545"/> <source>Type</source> - <translation type="unfinished"/> + <translation>Típus</translation> </message> <message> <location filename="../core/save-html.c" line="539"/> <source>Size</source> - <translation type="unfinished"/> + <translation>Méret</translation> </message> <message> <location filename="../core/save-html.c" line="540"/> @@ -10061,22 +10065,22 @@ EADD: %d%s / %.1fg/ℓ <message> <location filename="../core/save-html.c" line="541"/> <source>Start pressure</source> - <translation type="unfinished"/> + <translation>Kezdő nyomás</translation> </message> <message> <location filename="../core/save-html.c" line="542"/> <source>End pressure</source> - <translation type="unfinished"/> + <translation>Végső nyomás</translation> </message> <message> <location filename="../core/save-html.c" line="543"/> <source>Gas</source> - <translation type="unfinished"/> + <translation>Gáz</translation> </message> <message> <location filename="../core/save-html.c" line="544"/> <source>Weight</source> - <translation type="unfinished"/> + <translation>Súly</translation> </message> <message> <location filename="../core/save-html.c" line="546"/> @@ -10406,7 +10410,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../core/worldmap-save.c" line="45"/> <source>Duration:</source> - <translation type="unfinished"/> + <translation>Időtartam:</translation> </message> <message> <location filename="../core/divelogexportlogic.cpp" line="56"/> @@ -10417,7 +10421,7 @@ Is the Uemis Zurich plugged in correctly?</source> <location filename="../core/worldmap-save.c" line="46"/> <location filename="../desktop-widgets/templatelayout.h" line="111"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../core/divelogexportlogic.cpp" line="56"/> @@ -10425,7 +10429,7 @@ Is the Uemis Zurich plugged in correctly?</source> <location filename="../core/subsurface-qt/DiveObjectHelper.cpp" line="132"/> <location filename="../desktop-widgets/templatelayout.h" line="110"/> <source>h</source> - <translation type="unfinished"/> + <translation>ó</translation> </message> <message> <location filename="../core/divelogexportlogic.cpp" line="56"/> @@ -10453,12 +10457,12 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../core/worldmap-save.c" line="57"/> <source>Location:</source> - <translation type="unfinished"/> + <translation>Elhelyezkedés:</translation> </message> <message> <location filename="../core/worldmap-save.c" line="61"/> <source>Notes:</source> - <translation type="unfinished"/> + <translation>Jegyzetek:</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="292"/> @@ -10498,7 +10502,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../smtk-import/smartrak.c" line="294"/> <source>Length</source> - <translation type="unfinished"/> + <translation>Hossz</translation> </message> <message> <location filename="../smtk-import/smartrak.c" line="294"/> @@ -10553,7 +10557,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../core/taxonomy.c" line="10"/> <source>Country</source> - <translation type="unfinished"/> + <translation>Ország</translation> </message> <message> <location filename="../core/taxonomy.c" line="11"/> @@ -10711,7 +10715,7 @@ Is the Uemis Zurich plugged in correctly?</source> <message> <location filename="../mobile-widgets/qml/main.qml" line="291"/> <source>GPS</source> - <translation type="unfinished"/> + <translation>GPS</translation> </message> <message> <location filename="../mobile-widgets/qml/main.qml" line="399"/> @@ -10899,7 +10903,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/plannerSettings.ui" line="323"/> <location filename="../desktop-widgets/plannerSettings.ui" line="406"/> <source>%</source> - <translation type="unfinished"/> + <translation>%</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="293"/> @@ -10920,7 +10924,7 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/plannerSettings.ui" line="370"/> <location filename="../desktop-widgets/plannerSettings.ui" line="800"/> <source>min</source> - <translation type="unfinished"/> + <translation>perc</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="389"/> @@ -10955,12 +10959,12 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plannerSettings.ui" line="495"/> <source>+</source> - <translation type="unfinished"/> + <translation>+</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="515"/> <source>Dive mode</source> - <translation type="unfinished"/> + <translation>Merülési mód</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="525"/> @@ -10971,12 +10975,12 @@ p, li { white-space: pre-wrap; } <location filename="../desktop-widgets/plannerSettings.ui" line="546"/> <location filename="../desktop-widgets/plannerSettings.ui" line="608"/> <source>ℓ/min</source> - <translation type="unfinished"/> + <translation>ℓ/perc</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="640"/> <source>m</source> - <translation type="unfinished"/> + <translation>m</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="741"/> @@ -11041,7 +11045,7 @@ p, li { white-space: pre-wrap; } <message> <location filename="../desktop-widgets/plannerSettings.ui" line="677"/> <source>Notes</source> - <translation type="unfinished"/> + <translation>Jegyzetek</translation> </message> <message> <location filename="../desktop-widgets/plannerSettings.ui" line="715"/> |