From a59ac6eb3cebdd4e3f41552c21f14165203c1ab2 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 18 Jul 2010 14:42:26 +0200 Subject: Implemented add covers Finally we can add covers to already existsing series. Seems to work, but I encountered a crash when merging series while testing... Unfortunately I don't know the cause. --- seriestreewidget.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'seriestreewidget.h') diff --git a/seriestreewidget.h b/seriestreewidget.h index 0db8873..815b5f5 100644 --- a/seriestreewidget.h +++ b/seriestreewidget.h @@ -11,13 +11,17 @@ #include #include #include +#include class QLineEdit; class QPushButton; class QSortFilterProxyModel; +class QComboBox; class SeriesTreeModel; class SeriesTreeView; class SeriesTreeSortModel; +class FilesTreeModel; +class AddCoverDialog; class SeriesTreeWidget : public QWidget { Q_OBJECT @@ -33,6 +37,7 @@ class SeriesTreeWidget : public QWidget { void readSettings(); void writeSettings(); void expandCurrent(); + void addCover(); private slots: void filter(); @@ -40,12 +45,16 @@ class SeriesTreeWidget : public QWidget { void itemExpanded(const QModelIndex &); void itemCollaped(const QModelIndex &); + signals: + void filesReload(); + private: QLineEdit *mFilterEdit; QPushButton *mFilter; SeriesTreeView *mView; SeriesTreeSortModel *mProxy; SeriesTreeModel *mModel; + AddCoverDialog *mCoverDialog; QStringList mExpandedItems; }; @@ -68,4 +77,26 @@ class SeriesTreeSortModel : public QSortFilterProxyModel { virtual bool lessThan(const QModelIndex &left, const QModelIndex &right) const; }; +class AddCoverDialog : public QDialog { + Q_OBJECT + public: + explicit AddCoverDialog(QWidget *parent = 0, Qt::WindowFlags f = 0); + const QString file() const; + int fileType() const { return mCurrentType; } + + private slots: + void selectFile(); + void typeChanged(const QString &type); + + private: + QLineEdit *mFile; + QComboBox *mFileType; + QPushButton *mSelectFile; + QPushButton *mOk; + QPushButton *mCancel; + QString mLastOpenedDir; + int mCurrentType; + FilesTreeModel *mFilesModel; +}; + #endif -- cgit v1.2.3-70-g09d2