summaryrefslogtreecommitdiffstats
path: root/randomtab.h
blob: ccec1d618ae59f21779a101788c4ce5d63b3c21a (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
/*
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
  as published by the Free Software Foundation; either version
  2 of the License, or (at your option) any later version.
*/

#ifndef RANDOMTAB_H
#define RANDOMTAB_H

#include <QWidget>
#include <QSqlDatabase>

class QComboBox;
class QPushButton;
class QTreeView;
class QSortFilterProxyModel;
class QStandardItemModel;
class QLineEdit;
class QTextEdit;

class RandomTab : public QWidget {
    Q_OBJECT
    public:
        enum CustomRoles { IdRole = Qt::UserRole + 1 };
        explicit RandomTab(QWidget *parent = 0);

    public slots:
        void setupModels();
        void clearAll();
        void refreshComboboxes();
        void select();
        void logMessage(const QString &msg);

    private:
        void setupGui();
        QComboBox *mGenre1;
        QComboBox *mGenre2;
        QComboBox *mGenre3;
        QComboBox *mActor1;
        QComboBox *mActor2;
        QComboBox *mActor3;
        QLineEdit *mNumber;
        QPushButton *mSelect;
        QPushButton *mClear;
        QPushButton *mRefresh;
        QTreeView *mFileView;
        QTextEdit *mLog;
        QStandardItemModel *mFileModel;
        QStandardItemModel *mGenreModel;
        QStandardItemModel *mActorModel;
        QSortFilterProxyModel *mFileProxy;
        QSqlDatabase mDb;
};

#endif // RANDOMTAB_H