blob: e19136749152c29eec7776f0f440bd6eb5083f04 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  | 
#ifndef PACKSPAGE_H
#define PACKSPAGE_H
#include <QWidget>
#include <QAbstractListModel>
#include <QModelIndex>
#include <QListView>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QGridLayout>
#include "DictionaryOptionsDialog.h"
#include "PackFieldsView.h"
class CardSideView;
class Dictionary;
class PacksListModel;
class UnusedFieldsListModel;
class PacksPage : public QWidget
{
    Q_OBJECT
public:
    PacksPage( DictionaryOptionsDialog* aParent );
    ~PacksPage();
public slots:
    void moveItemsUpDown();
    void removeFields();
    void addFields();
    void addPack();
    void removePacks();
    void renamePack();
private:
    void createPacksList();
    void createPackFieldsList();
    void createUnusedFieldsList();
    void createPackPreview();
private slots:
    void updatePreviewForPack();    
    void updateUsesExactAnswer(const QModelIndex& index);
    void updatePackUsesExactAnswer(int state);
private:
    DictionaryOptionsDialog* m_parent;
    // Models
    PacksListModel* m_packsListModel;
    QAbstractListModel* m_packFieldsListModel;
    UnusedFieldsListModel* m_unusedFieldsListModel;
    int m_curPack;
    // List views
    PackFieldsView* m_packsListView;
    PackFieldsView* m_fieldsListView;
    PackFieldsView* m_unusedFieldsListView;
    QCheckBox* usesExactAnswerBox;
    CardSideView* m_qstPreview;
    CardSideView* m_ansPreview;
    // Layouts
    QGridLayout* m_packsListLt;
    QGridLayout* m_fieldsListLt;
    QGridLayout* m_unusedFieldsListLt;
    QVBoxLayout* m_previewLt;
};
#endif
  |