summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2011-12-17 10:37:15 +0100
committerArno <am@disconnect.de>2011-12-17 10:37:15 +0100
commit27d2b736a8fc33bc2f98212ebde25d97fcefac16 (patch)
treed39249c20f3a5f6b45f304fa03077594faa926c1
parente61280ee1bc34a6b04c1db208a560b4df544fdcb (diff)
downloadSheMov-27d2b736a8fc33bc2f98212ebde25d97fcefac16.tar.gz
SheMov-27d2b736a8fc33bc2f98212ebde25d97fcefac16.tar.bz2
SheMov-27d2b736a8fc33bc2f98212ebde25d97fcefac16.zip
Make DbAnalyzerDialog non-modal
Make DbAnalyzerdialg a member of Shemov, so it can be shown non-modal. So actors/genres can be edited while the dialog is open. It also has the nice side effect that we can refresh the views after deleting stray items.
-rw-r--r--dbanalyzer.cpp7
-rw-r--r--shemov.cpp11
-rw-r--r--shemov.h1
3 files changed, 11 insertions, 8 deletions
diff --git a/dbanalyzer.cpp b/dbanalyzer.cpp
index 52fb71f..4de88da 100644
--- a/dbanalyzer.cpp
+++ b/dbanalyzer.cpp
@@ -195,13 +195,14 @@ void DbAnalyzerDialog::deleteItems(){
int deleteMode;
switch(mTab->currentIndex()){
case 0:
+ case 1:
return;
break;
- case 1:
+ case 2:
view = mStrayActorsV;
deleteMode = Actors;
break;
- case 2:
+ case 3:
view = mStrayGenresV;
deleteMode = Genres;
break;
@@ -219,7 +220,7 @@ void DbAnalyzerDialog::deleteItems(){
}
void DbAnalyzerDialog::tabChanged(int index){
- mDelete->setEnabled(index != 0);
+ mDelete->setEnabled(index > 1);
mTotal->setText(mTotals.at(index));
}
diff --git a/shemov.cpp b/shemov.cpp
index 5b8b789..265c52c 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -79,9 +79,12 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
connect(mATree->seriesWidget()->seriesTree()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(updateSelectionCount(QItemSelection,QItemSelection)));
connect(this, SIGNAL(configChanged()), mATree, SLOT(readSettings()));
- //newmoviewizard
+ //newmoviewizard + dbanalyzer
mNewMovieWizard = new NewMovieWizard(this);
connect(mNewMovieWizard, SIGNAL(seriesAdded(QString,int)), mATree->seriesWidget(), SLOT(seriesAdded(QString,int)));
+ mDbAnalyzerDialog = new DbAnalyzerDialog(this);
+ connect(mDbAnalyzerDialog, SIGNAL(partClicked(int, int)), mATree, SLOT(selectMoviePart(int, int)));
+ connect(mDbAnalyzerDialog, SIGNAL(delItems(int,QList<int>&)), this, SLOT(analyzeDelete(int,QList<int>&)));
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addWidget(mTab);
@@ -985,10 +988,7 @@ void SheMov::checkConsistency(){
}
void SheMov::analyzeDb(){
- DbAnalyzerDialog d(this);
- connect(&d, SIGNAL(partClicked(int, int)), mATree, SLOT(selectMoviePart(int, int)));
- connect(&d, SIGNAL(delItems(int,QList<int>&)), this, SLOT(analyzeDelete(int,QList<int>&)));
- d.exec();
+ mDbAnalyzerDialog->show();
}
void SheMov::analyzeDelete(int mode, QList<int> &ids){
@@ -1010,6 +1010,7 @@ void SheMov::analyzeDelete(int mode, QList<int> &ids){
}
Q_ASSERT(model);
model->deleteItems(ids);
+ mDbAnalyzerDialog->refresh();
}
void SheMov::toggleHover(QObject *object){
diff --git a/shemov.h b/shemov.h
index 4d61b4b..898f487 100644
--- a/shemov.h
+++ b/shemov.h
@@ -191,5 +191,6 @@ class SheMov : public QMainWindow {
FilesystemWidget *mFSWidget;
ArchiveTreeView *mATree;
NewMovieWizard *mNewMovieWizard;
+ DbAnalyzerDialog *mDbAnalyzerDialog;
};
#endif