mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Profile: Allow Editing of Initial Gas.
Allow the initial gas of the dive to be edited through the context menu in the dive profile, by right-clicking into the profile at the very start of the dive. Of course this will likely completely invalidate the decompression calculation of any actually logged dives, but this is no different to the addition and modification of gas changes during the dive that is already possible. Proposed by @harrydevil in #4291. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
parent
7d215deaa1
commit
6c8f158569
1 changed files with 6 additions and 2 deletions
|
@ -558,10 +558,14 @@ void ProfileWidget2::contextMenuEvent(QContextMenuEvent *event)
|
|||
|
||||
// Add or edit Gas Change
|
||||
if (d && item && item->ev.is_gaschange()) {
|
||||
addGasChangeMenu(m, tr("Edit Gas Change"), *d, dc, item->ev.time.seconds);
|
||||
addGasChangeMenu(m, tr("Edit gas change"), *d, dc, item->ev.time.seconds);
|
||||
} else if (d && d->cylinders.size() > 1) {
|
||||
// if we have more than one gas, offer to switch to another one
|
||||
addGasChangeMenu(m, tr("Add gas change"), *d, dc, seconds);
|
||||
const struct divecomputer *currentdc = d->get_dc(dc);
|
||||
if (seconds == 0 || (!currentdc->samples.empty() && seconds <= currentdc->samples[0].time.seconds))
|
||||
addGasChangeMenu(m, tr("Set initial gas"), *d, dc, 0);
|
||||
else
|
||||
addGasChangeMenu(m, tr("Add gas change"), *d, dc, seconds);
|
||||
}
|
||||
m.addAction(tr("Add setpoint change"), [this, seconds]() { ProfileWidget2::addSetpointChange(seconds); });
|
||||
m.addAction(tr("Add bookmark"), [this, seconds]() { addBookmark(seconds); });
|
||||
|
|
Loading…
Reference in a new issue