summaryrefslogtreecommitdiffstats
path: root/newmoviewizard.h
blob: cd739bf26dc892b9efe4ef6d465b86c86ac30fdb (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
  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 <QWizardPage>
#include <QStyledItemDelegate>

#include "smtreemodel.h"
#include "mappingtablewidget.h"

class QSpinBox;
class QComboBox;
class QCheckBox;
class QPlainTextEdit;
class QSortFilterProxyModel;
class WizardTreeModel;
class MovieInfoPage;
class MovieMappingPage;
class MovieMetadataPage;
class PictureViewer2;
class QCompleter;
class QStringListModel;
class MappingEditorWidget;
class MetadataEditorWidget;

class NewMovieWizard : public QWizard {
	Q_OBJECT
	public:
        explicit NewMovieWizard(QWidget *parent = nullptr);
        virtual void accept();
        virtual void reject();
		MovieInfoPage *infoPage() { return mInfoPage; }
		MovieMappingPage *actorPage() { return mActorPage; }
        MovieMappingPage *genrePage() { return mGenrePage; }

	private:
		MovieInfoPage *mInfoPage;
		MovieMappingPage *mActorPage;
		MovieMappingPage *mGenrePage;
		MovieMetadataPage *mMetadataPage;
};

class MovieInfoPage : public QWizardPage {
	Q_OBJECT
	public:
        explicit MovieInfoPage(QWidget *parent = nullptr);
		WizardTreeModel *model() { return mFileModel; }
		virtual void initializePage();
		void addFile(const QString &file);
        void setCurrentDir(const QString &dir) { mCurrentDir = dir; }
        void selectFirst();
        void saveData();
        void restoreData();
        const QStringList &origins() const { return mOrigins; }

    public slots:
        void initCompleters();
        void guessOld(const QString &fullPath);

	private slots:
        void extractTitle();
        void addOld();
		void addFiles();
		void removeFile();

	private:
		void setupGui();
        SmTreeView *mFileView;
		QLineEdit *mTitle;
		QLineEdit *mSubtitle;
		QSpinBox *mSeriesNo;
		QSpinBox *mQuality;
        QPushButton *mExtractTitle;
        QPushButton *mAddOld;
		QPushButton *mAddFile;
		QPushButton *mRemoveFile;
        WizardTreeModel *mFileModel;
        SmTreeItem *mMoviesItem;
        SmTreeItem *mCoversItem;
        QCompleter *mSeriesCompleter;
        QStringListModel *mSeriesCompleterModel;
        QSortFilterProxyModel *mProxy;
        QString mCurrentDir;
        QString mCurTitle;
        QString mCurSubtitle;
        QStringList mOrigins;
        int mCurSeriesno;
        int mCurQuality;
};

#endif