summaryrefslogtreecommitdiffstats
path: root/randomtab.h
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2016-11-10 18:10:30 +0100
committerArno <arno@disconnect.de>2016-11-10 18:10:30 +0100
commitaa0cdc4493c0f0435a64cfa8cee010c7659dc8fa (patch)
tree0b10d02fd9e9b81f06e846aa515245cd5a54b8b6 /randomtab.h
parent54eaa7a4a883978a308d799e1f108bdce5e9c030 (diff)
downloadSheMov-aa0cdc4493c0f0435a64cfa8cee010c7659dc8fa.tar.gz
SheMov-aa0cdc4493c0f0435a64cfa8cee010c7659dc8fa.tar.bz2
SheMov-aa0cdc4493c0f0435a64cfa8cee010c7659dc8fa.zip
Add Random file browser
Idea: Select random movies based on a selection of genres and actors in a new tab, so you don't have the agony of choice. This is just the basic layout. The selectors are filled and the buttons are connected, but it doesn't select anything yet.
Diffstat (limited to 'randomtab.h')
-rw-r--r--randomtab.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/randomtab.h b/randomtab.h
new file mode 100644
index 0000000..f8d2218
--- /dev/null
+++ b/randomtab.h
@@ -0,0 +1,53 @@
+/*
+ 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 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();
+
+ 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;
+ QStandardItemModel *mFileModel;
+ QStandardItemModel *mGenreModel;
+ QStandardItemModel *mActorModel;
+ QSortFilterProxyModel *mFileProxy;
+ QSqlDatabase mDb;
+};
+
+#endif // RANDOMTAB_H