From 9dc2528dfdb04f18641602cfd24c09cb9b119107 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 8 Jul 2013 22:09:36 +0200 Subject: 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. --- newmoviewizard.h | 43 ++++++++++++++----------------------------- 1 file changed, 14 insertions(+), 29 deletions(-) (limited to 'newmoviewizard.h') 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 +#include +#include #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 files(); - int filesPart(const QString &fullPath) const; - - //file types - QStringList types() const; - int typeId(const QString &value) const; - QString typeName(int typeId) const; + QList fileData(int column) const; + void clear(); private: - QHash mFileTypeMap; + QHash mFiletypeMap; QHash mFilePartMap; }; -- cgit v1.2.3-70-g09d2