summaryrefslogtreecommitdiffstats
path: root/newmoviewizard.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-07-04 10:13:17 +0200
committerArno <am@disconnect.de>2010-07-04 10:13:17 +0200
commit5dd4fe05df7619fb68356613b698fb373f4fccee (patch)
treed74adce3b2a1c56448e9dea08a23c51f83decedb /newmoviewizard.h
parent8c6051a16b12f265d7a30b4b24da10b3ba63edae (diff)
downloadSheMov-5dd4fe05df7619fb68356613b698fb373f4fccee.tar.gz
SheMov-5dd4fe05df7619fb68356613b698fb373f4fccee.tar.bz2
SheMov-5dd4fe05df7619fb68356613b698fb373f4fccee.zip
Fix MovieInfoPage
The first page of NewMovieWizard gave me quite a headache. It crashed with a segmentation fault because of exposing mDvdNo via registerField() without actually assigning a QCheckBox to it. The backtrace isn't very helpful in such a case. I also fixed some bugs on the way: 1. use SmTreeItem::setData in SmTreeModel::addRow instead of deleting the old item and creating a new one. This way I don't need to take care of the parent. 2. get data of old item in SmTreeModel::reparent before calling removeRows. This call deletes the item. 3. Fix column alignments in WizardTreeModel for size column
Diffstat (limited to 'newmoviewizard.h')
-rw-r--r--newmoviewizard.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/newmoviewizard.h b/newmoviewizard.h
index a92d91d..e28a3a9 100644
--- a/newmoviewizard.h
+++ b/newmoviewizard.h
@@ -21,11 +21,13 @@ class QLineEdit;
class QSpinBox;
class QPushButton;
class QComboBox;
+class QCheckBox;
class NewMovieWizard : public QWizard {
Q_OBJECT
public:
explicit NewMovieWizard(QWidget *parent = 0);
+ void accept();
};
@@ -33,11 +35,14 @@ class MovieInfoPage : public QWizardPage {
Q_OBJECT
public:
explicit MovieInfoPage(QWidget *parent = 0);
+ WizardTreeModel *model() { return mFileModel; }
private slots:
void addFiles();
void removeFile();
+ void onDvd(int);
void typeChanged(QString);
+ void setNextDvdNo();
private:
QTreeView *mFileView;
@@ -49,6 +54,8 @@ class MovieInfoPage : public QWizardPage {
QPushButton *mAddFile;
QPushButton *mRemoveFile;
QComboBox *mFileType;
+ QCheckBox *mOnDvd;
+ QPushButton *mNextDvdNo;
WizardTreeModel *mFileModel;
SmTreeItem *mMoviesItem;
SmTreeItem *mCoversItem;
@@ -58,7 +65,7 @@ class WizardTreeModel : public SmTreeModel {
Q_OBJECT
public:
enum CustomRoles { FileNameRole = Qt::UserRole + 1, FileSizeRole = Qt::UserRole + 2, FileTypeRole = Qt::UserRole + 3, FullPathRole = Qt::UserRole + 4 };
- enum Fields { FileName = 0, FileSize = 1, FileType = 3, FullPath = 4 };
+ enum Fields { FileName = 0, FileSize = 1, FileType = 2, FullPath = 3 };
enum Types { Movie = 1, FrontCover = 2, BackCover = 3, GeneralCover = 4 };
explicit WizardTreeModel(QStringList &headers, QObject *parent = 0);
virtual ~WizardTreeModel() {}