servatrice/cockatrice/src/window_sets.h
David Szabo 81803e2612 Search in "Manage sets" window (#3229)
* search field added; sortfilterproxy displayed in treeview

* searching works properly

* moving with filter on works; view isnt't updated yet

* clangify & view updating figured out

* moving disabled when sorting is active

* drag&drop disabled when view sorted

* clangified

* foreach replaced

* button rename & SORT_RESET defined

* changed variable names

* 'x' button added & searchlabel text modified

* 'enabled' column won't grow anymore

* column resize improvement

* button hint & restore original order added

* moving with filter on works; view isnt't updated yet

* sort disable build in column headers (3 clicks)

* codacy fix

* typo + wording

* background color for warning

* buttons moved down a bit

* clicking "default order" button will hide the warning text
2018-06-10 11:00:42 -04:00

69 lines
1.6 KiB
C++

#ifndef WINDOW_SETS_H
#define WINDOW_SETS_H
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QMainWindow>
#include <QSet>
class SetsModel;
class SetsProxyModel;
class SetsDisplayModel;
class QPushButton;
class CardDatabase;
class QItemSelection;
class QTreeView;
class WndSets : public QMainWindow
{
Q_OBJECT
private:
SetsModel *model;
SetsDisplayModel *displayModel;
QTreeView *view;
QPushButton *toggleAllButton, *toggleSelectedButton;
QPushButton *enableAllButton, *disableAllButton, *enableSomeButton, *disableSomeButton;
QPushButton *defaultSortButton;
QAction *aUp, *aDown, *aBottom, *aTop;
QToolBar *setsEditToolBar;
QDialogButtonBox *buttonBox;
QLabel *labNotes, *searchLabel, *sortWarning;
QLineEdit *searchField;
QGridLayout *mainLayout;
QHBoxLayout *filterBox;
int sortIndex;
Qt::SortOrder sortOrder;
void rebuildMainLayout(int actionToTake);
enum
{
NO_SETS_SELECTED,
SOME_SETS_SELECTED
};
public:
WndSets(QWidget *parent = 0);
~WndSets();
protected:
void selectRows(QSet<int> rows);
private slots:
void actEnableAll();
void actDisableAll();
void actEnableSome();
void actDisableSome();
void actSave();
void actRestore();
void actUp();
void actDown();
void actTop();
void actBottom();
void actToggleButtons(const QItemSelection &selected, const QItemSelection &deselected);
void actDisableSortButtons(int index);
void actRestoreOriginalOrder();
void actDisableResetButton(const QString &filterText);
void actSort(int index);
};
#endif