summaryrefslogtreecommitdiffstats
path: root/newmoviewizard.h
blob: 20eb91a1f2583164237251801fdd778190297907 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
  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;
};

class MovieMappingPage : public QWizardPage {
	Q_OBJECT
	public:
        explicit MovieMappingPage(const QString &table, QWidget *parent = nullptr);
        MappingEditorWidget *widget() { return mWidget; }
		virtual void initializePage();

	private:
        /* defined in archiveview.h */
        MappingEditorWidget *mWidget;
        QString mTable;
};

#endif