blob: 2e3171adf5517fbcef7155103abb936701e69abf (
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
/*
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 ARCHIVEVIEW_H
#define ARCHIVEVIEW_H
#include <QDialog>
#include <QSortFilterProxyModel>
#include <QWidget>
#include <QDate>
#include "archivemodel.h"
#include "smtreeview.h"
class QComboBox;
class QLabel;
class QLineEdit;
class QSortFilterProxyModel;
class QTextEdit;
class QCompleter;
class QStandardItemModel;
class QSpinBox;
class QToolBar;
class QMouseEvent;
class QDragEnterEvent;
class QRadioButton;
/* separate widget since we need it in NewMovieWizard
* and editing genres, actors in the new ArchiveView */
class MappingEditorWidget : public QWidget {
Q_OBJECT
public:
explicit MappingEditorWidget(const QString &caption, bool showClearButton = false, QWidget *parent = nullptr);
void fillCompleter(const QStringList &completions);
void setCurrentItems(const QStringList &items);
QStringList items() const;
void setDecorationItem(const QIcon &icon) { mDecorationIcon = icon; }
public slots:
void clear();
private slots:
void addItem();
void removeItem();
private:
QStandardItemModel *mModel;
QSortFilterProxyModel *mProxy;
SmTreeView *mView;
QPushButton *mAdd;
QPushButton *mRemove;
QPushButton *mClear;
QLineEdit *mEditor;
QCompleter *mCompleter;
QStringListModel *mCompleterModel;
QString mCaption;
QIcon mDecorationIcon;
};
/* dialog putting MappingEditorWidget and
* Cancel, Accept buttons together. Used when editing
* ArchiveView */
class MappingEditor : public QDialog {
Q_OBJECT
public:
explicit MappingEditor(const QString &caption, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget);
MappingEditorWidget *widget() { return mWidget; }
private:
QPushButton *mAccept;
QPushButton *mCancel;
MappingEditorWidget *mWidget;
};
class MetadataEditorWidget : public QWidget {
Q_OBJECT
public:
explicit MetadataEditorWidget(QWidget *parent = nullptr);
void setMetadata(const QList<QVariant> &data);
QList<QVariant> metadata() const;
void replaceSubject(const QString &subject);
signals:
void oldSelected(const QString &);
private slots:
void addToComment(const QString &reason);
private:
QSpinBox *mReleaseYear;
QLineEdit *mSubject;
QTextEdit *mComment;
QRadioButton *mTorrent;
QRadioButton *mUsenet;
QDate mAdded;
QComboBox *mReencReason;
QList<QWidget*> mWidgets;
};
class MetadataEditor : public QDialog {
Q_OBJECT
public:
explicit MetadataEditor(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget);
MetadataEditorWidget *widget() { return mWidget; }
private:
MetadataEditorWidget *mWidget;
QPushButton *mCancel;
QPushButton *mAccept;
};
class PartEditor : public QDialog {
Q_OBJECT
public:
explicit PartEditor(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget);
void setPartNo(int partNo);
int partNo() const;
void setSubtitle(const QString &subtitle);
QString subtitle() const;
private:
QSpinBox *mPartNo;
QLineEdit *mSubtitle;
QPushButton *mCancel;
QPushButton *mAccept;
};
#endif // ARCHIVEVIEW_H
|