mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site rewrite: mark location field as soon as editing starts
Don't wait until the user switches focus to a different part of the tab to mark the location field. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5a61c81cc2
commit
485df96cf6
2 changed files with 16 additions and 0 deletions
|
@ -1304,6 +1304,21 @@ void MainTab::on_tagWidget_textChanged()
|
|||
markChangedWidget(ui.tagWidget);
|
||||
}
|
||||
|
||||
void MainTab::on_location_textChanged()
|
||||
{
|
||||
if (editMode == IGNORE)
|
||||
return;
|
||||
|
||||
// we don't want to act on the edit until editing is finished,
|
||||
// but we want to mark the field so it's obvious it is being edited
|
||||
QString currentLocation;
|
||||
struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid);
|
||||
if (ds)
|
||||
currentLocation = ds->name;
|
||||
if (ui.location->text() != currentLocation)
|
||||
markChangedWidget(ui.location);
|
||||
}
|
||||
|
||||
void MainTab::on_location_editingFinished()
|
||||
{
|
||||
if (editMode == IGNORE || acceptingEdit == true)
|
||||
|
|
|
@ -65,6 +65,7 @@ slots:
|
|||
void acceptChanges();
|
||||
void rejectChanges();
|
||||
void on_location_editingFinished();
|
||||
void on_location_textChanged();
|
||||
void on_divemaster_textChanged();
|
||||
void on_buddy_textChanged();
|
||||
void on_suit_textChanged(const QString &text);
|
||||
|
|
Loading…
Add table
Reference in a new issue