Add support for multi-selection in set editor (#2441)

This commit is contained in:
Zach H 2017-03-22 15:49:38 -04:00 committed by GitHub
parent 33e8a2ea95
commit 85985a9433
4 changed files with 175 additions and 74 deletions

View file

@ -2,6 +2,10 @@
#define WINDOW_SETS_H
#include <QMainWindow>
#include <QSet>
#include <QDialogButtonBox>
#include <QLabel>
#include <QGridLayout>
class SetsModel;
class SetsProxyModel;
@ -15,18 +19,25 @@ class WndSets : public QMainWindow {
private:
SetsModel *model;
QTreeView *view;
QPushButton *enableAllButton, *disableAllButton;
QPushButton *toggleAllButton, *toggleSelectedButton;
QPushButton *enableAllButton, *disableAllButton, *enableSomeButton, *disableSomeButton;
QAction *aUp, *aDown, *aBottom, *aTop;
QToolBar *setsEditToolBar;
QDialogButtonBox *buttonBox;
QLabel *labNotes;
QGridLayout *mainLayout;
void rebuildMainLayout(int actionToTake);
enum {NO_SETS_SELECTED, SOME_SETS_SELECTED};
public:
WndSets(QWidget *parent = 0);
~WndSets();
protected:
void selectRow(int row);
void selectRows(QSet<int> rows);
private slots:
void actEnable();
void actDisable();
void actEnableAll();
void actDisableAll();
void actEnableSome();
void actDisableSome();
void actSave();
void actRestore();
void actUp();