mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
desktop: don't update notes field when executing command
User report: when switching focus between windows, the cursor position gets lost. This is due to a note-edit command being fired, which then overwrites the notes tab. To prevent this, don't update the notes field when placing a command. Moreover, generally don't update the dive selection when placing a command as that also rewrites all the values. Should this be extended to other fields? Fixes #3365 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
1b8f3a06ec
commit
889827aadb
4 changed files with 6 additions and 7 deletions
|
@ -248,7 +248,7 @@ void MainTab::divesChanged(const QVector<dive *> &dives, DiveField field)
|
|||
ui.depth->setText(get_depth_string(current_dive->maxdepth, true));
|
||||
if (field.rating)
|
||||
ui.rating->setCurrentStars(current_dive->rating);
|
||||
if (field.notes)
|
||||
if (field.notes && !Command::placingCommand())
|
||||
updateNotes(current_dive);
|
||||
if (field.datetime) {
|
||||
updateDateTime(current_dive);
|
||||
|
@ -306,11 +306,10 @@ static bool isHtml(const QString &s)
|
|||
void MainTab::updateNotes(const struct dive *d)
|
||||
{
|
||||
QString tmp(d->notes);
|
||||
if (isHtml(tmp)) {
|
||||
if (isHtml(tmp))
|
||||
ui.notes->setHtml(tmp);
|
||||
} else {
|
||||
else
|
||||
ui.notes->setPlainText(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
void MainTab::updateDateTime(const struct dive *d)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue