summaryrefslogtreecommitdiffstats
path: root/newmoviewizard.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-07-02 16:28:02 +0200
committerArno <am@disconnect.de>2010-07-02 16:28:02 +0200
commit8c6051a16b12f265d7a30b4b24da10b3ba63edae (patch)
tree4dd81ab3533b55654247c9a2e1583e88cde1b780 /newmoviewizard.h
parenteed880078be57296517535f9c06e279f722b4ec3 (diff)
downloadSheMov-8c6051a16b12f265d7a30b4b24da10b3ba63edae.tar.gz
SheMov-8c6051a16b12f265d7a30b4b24da10b3ba63edae.tar.bz2
SheMov-8c6051a16b12f265d7a30b4b24da10b3ba63edae.zip
Started NewMovieWizard for adding movies
Finished GUI for first page of NewMovieWizard. To make things easier I added two new member functions to SmTreeModel: -QModelIndex find() to find items by value of a column -void reparent() to remove an item from one parent and add it to another
Diffstat (limited to 'newmoviewizard.h')
-rw-r--r--newmoviewizard.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/newmoviewizard.h b/newmoviewizard.h
new file mode 100644
index 0000000..a92d91d
--- /dev/null
+++ b/newmoviewizard.h
@@ -0,0 +1,79 @@
+/*
+ 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 NEWMOVIEWIZARD_H
+#define NEWMOVIEWIZARD_H
+
+#include <QWizard>
+#include <QWizardPage>
+#include <QHash>
+
+#include "smtreemodel.h"
+
+class QTreeView;
+class WizardTreeModel;
+class SmTreeItem;
+class QLineEdit;
+class QSpinBox;
+class QPushButton;
+class QComboBox;
+
+class NewMovieWizard : public QWizard {
+ Q_OBJECT
+ public:
+ explicit NewMovieWizard(QWidget *parent = 0);
+
+};
+
+class MovieInfoPage : public QWizardPage {
+ Q_OBJECT
+ public:
+ explicit MovieInfoPage(QWidget *parent = 0);
+
+ private slots:
+ void addFiles();
+ void removeFile();
+ void typeChanged(QString);
+
+ private:
+ QTreeView *mFileView;
+ QLineEdit *mTitle;
+ QSpinBox *mSeriesNo;
+ QSpinBox *mPartno;
+ QSpinBox *mQuality;
+ QSpinBox *mDvdNo;
+ QPushButton *mAddFile;
+ QPushButton *mRemoveFile;
+ QComboBox *mFileType;
+ WizardTreeModel *mFileModel;
+ SmTreeItem *mMoviesItem;
+ SmTreeItem *mCoversItem;
+};
+
+class WizardTreeModel : public SmTreeModel {
+ Q_OBJECT
+ public:
+ enum CustomRoles { FileNameRole = Qt::UserRole + 1, FileSizeRole = Qt::UserRole + 2, FileTypeRole = Qt::UserRole + 3, FullPathRole = Qt::UserRole + 4 };
+ enum Fields { FileName = 0, FileSize = 1, FileType = 3, FullPath = 4 };
+ enum Types { Movie = 1, FrontCover = 2, BackCover = 3, GeneralCover = 4 };
+ explicit WizardTreeModel(QStringList &headers, QObject *parent = 0);
+ virtual ~WizardTreeModel() {}
+
+ //data + flags
+ virtual QVariant data(const QModelIndex &index, int role) const;
+ virtual Qt::ItemFlags flags(const QModelIndex &index) const;
+
+ //file types
+ QStringList types() const;
+ int typeId(const QString &value) const;
+
+ private:
+ QHash<int, QString> mFileTypeMap;
+
+};
+
+#endif