diff options
author | Arno <am@disconnect.de> | 2010-07-28 22:21:38 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-07-28 22:21:38 +0200 |
commit | ff8fdb92b8c2dfaa4818150d75c32fc303b438cb (patch) | |
tree | bb21093ef7887a6f75e31aa7a070d636666574be /seriestreewidget.cpp | |
parent | 004b9243248a29eaa73b5fae5a5ef7b5ca914f94 (diff) | |
download | SheMov-ff8fdb92b8c2dfaa4818150d75c32fc303b438cb.tar.gz SheMov-ff8fdb92b8c2dfaa4818150d75c32fc303b438cb.tar.bz2 SheMov-ff8fdb92b8c2dfaa4818150d75c32fc303b438cb.zip |
Reset NewMovieWizard
Well, the point of this commit was to have one NewMovieWizard in memory
all the time and just show it when it's needed.
For this several things were necessary:
1. implement initializePage() for every QWizardPage. For this I had to
implement reset functions in some models.
2. setOption(QWizard::IndependentPages, true) in Wizard constructor.
3. Make NewMovieWizard a member of SheMov... Well, it was, already, but
I didn't remove the ptr.
The good news: the Wizard works.
Bad News:
1. Program crashes in ArchiveViewWizard::currentChanged (see TODOS)
2. Cover files also have a quality Attribute attached.
Diffstat (limited to 'seriestreewidget.cpp')
-rw-r--r-- | seriestreewidget.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/seriestreewidget.cpp b/seriestreewidget.cpp index a124450..7e5d41f 100644 --- a/seriestreewidget.cpp +++ b/seriestreewidget.cpp @@ -95,6 +95,23 @@ void SeriesTreeWidget::newSeries(){ } } +void SeriesTreeWidget::seriesAdded(QString seriesName, int seriesPart, bool resort){ + if(resort){ + mProxy->invalidate(); + } + QModelIndex destIdx = mModel->findValue(seriesName); + if(destIdx.isValid()){ + QModelIndex seriesPartIdx = mModel->findValue(seriesPart, destIdx, SeriesTreeModel::SeriesPart); + if(seriesPartIdx.isValid()){ + destIdx = seriesPartIdx; + } + } + if(destIdx.isValid()){ + QModelIndex proxyIndex = mProxy->mapFromSource(destIdx); + mView->selectionModel()->setCurrentIndex(proxyIndex, QItemSelectionModel::ClearAndSelect); + } +} + void SeriesTreeWidget::deleteFromSeries(){ QModelIndexList selected = mView->selectionModel()->selectedRows(); if(selected.isEmpty()){ |