summaryrefslogtreecommitdiffstats
path: root/archiveview.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-07-12 10:39:31 +0200
committerArno <am@disconnect.de>2013-07-12 10:39:31 +0200
commit96df0c7b20a6f3e8c118d373f52193f71ab4b521 (patch)
treeee2e7f7a612a3becfda3a78fc02dd9ad1a063814 /archiveview.h
parente989a412665303f37f950584370db4b6e5eb7198 (diff)
downloadSheMov-96df0c7b20a6f3e8c118d373f52193f71ab4b521.tar.gz
SheMov-96df0c7b20a6f3e8c118d373f52193f71ab4b521.tar.bz2
SheMov-96df0c7b20a6f3e8c118d373f52193f71ab4b521.zip
Split MappingEditor into two classes
Split MappingEditor into a Dialog and the actual MappingEditorWidget. Turns out that we need the Widget in NewMovieWizard, also. No need for code duplication. NB: Before this I tried to convert the WizardTreeModel to a QStandardItemModel, but it had severe performance problems. Most likely I would have ended up subclassing QStandardItemModel anyway, so leave it as it is.
Diffstat (limited to 'archiveview.h')
-rw-r--r--archiveview.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/archiveview.h b/archiveview.h
index 1359e88..36c3eb4 100644
--- a/archiveview.h
+++ b/archiveview.h
@@ -133,10 +133,13 @@ class FileTypeDelegate : public QStyledItemDelegate {
QHash<int, QString> mFiletypeMap;
};
-class MappingEditor : public QDialog {
+/* separate widget since we need it in NewMovieWizard
+ * and editing genres, actors in the new ArchiveView */
+
+class MappingEditorWidget : public QWidget {
Q_OBJECT
public:
- explicit MappingEditor(const QString &caption, QWidget *parent = 0, Qt::WindowFlags f = 0);
+ explicit MappingEditorWidget(const QString &caption, QWidget *parent = 0);
void fillCompleter(const QStringList &completions);
void setCurrentItems(const QStringList &items);
QStringList items() const;
@@ -151,13 +154,27 @@ class MappingEditor : public QDialog {
SmTreeView *mView;
QPushButton *mAdd;
QPushButton *mRemove;
- QPushButton *mAccept;
- QPushButton *mCancel;
QLineEdit *mEditor;
QCompleter *mCompleter;
QStringListModel *mCompleterModel;
};
+/* 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 = 0, Qt::WindowFlags f = 0);
+ MappingEditorWidget *widget() { return mWidget; }
+
+ private:
+ QPushButton *mAccept;
+ QPushButton *mCancel;
+ MappingEditorWidget *mWidget;
+};
+
class MetadataEditor : public QDialog {
Q_OBJECT
public: