mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Remember Trip Selection.
This patch remembers the trip selection across the Dive Tree Model. It's a tiny bit big because we used to have a variable 'selected trips' that's now calculed dynamically - this is more future proof. This is a start of Un-cluttering the view ( for 4.1 I hope to reduce the code in this class to nearly a half. ) Fixes #303 Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e91a1fc26c
commit
e175b1d1ab
6 changed files with 76 additions and 24 deletions
|
|
@ -29,8 +29,7 @@ public:
|
|||
void rememberSelection();
|
||||
void restoreSelection();
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
QSet<dive_trip_t *> selectedTrips;
|
||||
|
||||
QList<dive_trip_t*> selectedTrips();
|
||||
public slots:
|
||||
void toggleColumnVisibilityByIndex();
|
||||
void reloadHeaderActions();
|
||||
|
|
@ -55,17 +54,20 @@ signals:
|
|||
private:
|
||||
bool mouseClickSelection;
|
||||
QList<int> expandedRows;
|
||||
QList<int> selectedDives;
|
||||
int sortColumn;
|
||||
Qt::SortOrder currentOrder;
|
||||
DiveTripModel::Layout currentLayout;
|
||||
QLineEdit *searchBox;
|
||||
QModelIndex contextMenuIndex;
|
||||
|
||||
/* if dive_trip_t is null, there's no problem. */
|
||||
QMultiHash<dive_trip_t *, int> selectedDives;
|
||||
void merge_trip(const QModelIndex &a, const int offset);
|
||||
void setupUi();
|
||||
void backupExpandedRows();
|
||||
void restoreExpandedRows();
|
||||
int lastVisibleColumn();
|
||||
void selectTrip ( dive_trip_t* trip );
|
||||
};
|
||||
|
||||
#endif // DIVELISTVIEW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue