From 0e1b0cf1da697851b0db4f8b860da8ac3a509d17 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 12 Mar 2019 23:51:39 +0100 Subject: Undo: Implement undo of dive site name editing Implement an undo command that edits the name of a dive site. Connect it to the dive site table, so that names can be edited directly in the table. Send signals on undo / redo so that the dive site table and the dive site edit widget can be updated. Signed-off-by: Berthold Stoeger --- qt-models/divelocationmodel.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qt-models/divelocationmodel.h') diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index 34ac34c04..4fd7b3d36 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -35,15 +35,20 @@ public slots: void diveSiteDiveCountChanged(struct dive_site *ds); void diveSiteAdded(struct dive_site *ds, int idx); void diveSiteDeleted(struct dive_site *ds, int idx); + void diveSiteChanged(struct dive_site *ds, int field); }; class DiveSiteSortedModel : public QSortFilterProxyModel { Q_OBJECT private: + struct dive_site *getDiveSite(const QModelIndex &idx); bool filterAcceptsRow(int sourceRow, const QModelIndex &source_parent) const override; bool lessThan(const QModelIndex &i1, const QModelIndex &i2) const override; +#ifndef SUBSURFACE_MOBILE + bool setData(const QModelIndex &index, const QVariant &value, int role) override; public slots: void remove(const QModelIndex &index); +#endif // SUBSURFACE_MOBILE public: DiveSiteSortedModel(); QStringList allSiteNames() const; -- cgit v1.2.3-70-g09d2