diff options
author | Arno <am@disconnect.de> | 2013-07-08 22:09:36 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-07-08 22:09:36 +0200 |
commit | 9dc2528dfdb04f18641602cfd24c09cb9b119107 (patch) | |
tree | 3849b34fea7be7db681af81ab732c4cbe72371ac /newmoviewizard.h | |
parent | 1013140a8b66968de1cfa0d07a353b47b8234899 (diff) | |
download | SheMov-9dc2528dfdb04f18641602cfd24c09cb9b119107.tar.gz SheMov-9dc2528dfdb04f18641602cfd24c09cb9b119107.tar.bz2 SheMov-9dc2528dfdb04f18641602cfd24c09cb9b119107.zip |
Make new archive work
Well, this is a huge commit. Should be severals, but who knew...
First and foremost feature: Make NewMovieWizard work with the
experimental model. This change obsoleted a lot of code. Also, the old
archive won't work with with the new Wizward...
There are most probably many other features I forgot about.
Diffstat (limited to 'newmoviewizard.h')
-rw-r--r-- | newmoviewizard.h | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/newmoviewizard.h b/newmoviewizard.h index ecc416a..b793ea0 100644 --- a/newmoviewizard.h +++ b/newmoviewizard.h @@ -8,7 +8,8 @@ #ifndef NEWMOVIEWIZARD_H #define NEWMOVIEWIZARD_H -#include <QtWidgets/QWizardPage> +#include <QWizardPage> +#include <QStyledItemDelegate> #include "smtreemodel.h" #include "mappingtablewidget.h" @@ -23,6 +24,8 @@ class MovieInfoPage; class MovieMappingPage; class MovieMetadataPage; class PictureViewer2; +class QCompleter; +class QStringListModel; class NewMovieWizard : public QWizard { Q_OBJECT @@ -36,11 +39,7 @@ class NewMovieWizard : public QWizard { protected: void showEvent(QShowEvent *); - signals: - void seriesAdded(const QString series, int seriesPart); - private: - void doMetadata(const QModelIndex &idx); MovieInfoPage *mInfoPage; MovieMappingPage *mActorPage; MovieMappingPage *mGenrePage; @@ -56,17 +55,12 @@ class MovieInfoPage : public QWizardPage { virtual void initializePage(); void addFile(const QString &file); + public slots: + void initCompleters(); + private slots: void addFiles(); void removeFile(); - void onDvd(int); - void typeChanged(QString); - void seriesPartChanged(int); - void setNextDvdNo(); - void initModel(); - void fileSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous); - void itemClicked(const QModelIndex &index); - void hasPartnoStateChanged(int state); private: void setupGui(); @@ -74,20 +68,14 @@ class MovieInfoPage : public QWizardPage { QLineEdit *mTitle; QLineEdit *mSubtitle; QSpinBox *mSeriesNo; - QSpinBox *mPartno; QSpinBox *mQuality; - QSpinBox *mDvdNo; QPushButton *mAddFile; QPushButton *mRemoveFile; - QComboBox *mFileType; - QCheckBox *mOnDvd; - QCheckBox *mHasPartno; - QCheckBox *mUsePicViewer; - QPushButton *mNextDvdNo; WizardTreeModel *mFileModel; SmTreeItem *mMoviesItem; SmTreeItem *mCoversItem; - PictureViewer2 *mPicViewer; + QCompleter *mSeriesCompleter; + QStringListModel *mSeriesCompleterModel; }; class MovieMappingPage : public QWizardPage { @@ -136,23 +124,20 @@ class WizardTreeModel : public SmTreeModel { public: enum CustomRoles { FileNameRole = Qt::UserRole + 1, FileSizeRole = Qt::UserRole + 2, FileTypeRole = Qt::UserRole + 3, FilePartRole = Qt::UserRole + 4, FullPathRole = Qt::UserRole + 5 }; enum Fields { FileName = 0, FileSize = 1, FileType = 2, FilePart = 3, FullPath = 4 }; + enum { NumFields = 5 }; 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 bool setData(const QModelIndex &index, const QVariant &value, int role); virtual Qt::ItemFlags flags(const QModelIndex &index) const; - QHash<QString, int> files(); - int filesPart(const QString &fullPath) const; - - //file types - QStringList types() const; - int typeId(const QString &value) const; - QString typeName(int typeId) const; + QList<QVariant> fileData(int column) const; + void clear(); private: - QHash<int, QString> mFileTypeMap; + QHash<int, QString> mFiletypeMap; QHash<QString, int> mFilePartMap; }; |