diff options
author | Arno <am@disconnect.de> | 2011-12-17 08:19:34 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2011-12-17 08:19:34 +0100 |
commit | 621e72e606f88739a67ce6efc4832e0abdc34ffa (patch) | |
tree | 93180bcbf91e93815894ae9b65ca113c319eb9e6 /shemov.cpp | |
parent | a80ccf5546c14de14906f5dfb4c7efc65ec54344 (diff) | |
download | SheMov-621e72e606f88739a67ce6efc4832e0abdc34ffa.tar.gz SheMov-621e72e606f88739a67ce6efc4832e0abdc34ffa.tar.bz2 SheMov-621e72e606f88739a67ce6efc4832e0abdc34ffa.zip |
Implemented delete stray actors
Added a tab to DbAnalyzerDialog for actors that aren't associated with a
movie and make it possible to delete them.
Diffstat (limited to 'shemov.cpp')
-rw-r--r-- | shemov.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -51,6 +51,7 @@ #include "filestreemodel.h" #include "consistencycheck.h" #include "mappingtableeditor.h" +#include "mappingtablemodel.h" #include "dbanalyzer.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) { @@ -986,9 +987,31 @@ 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(); } +void SheMov::analyzeDelete(int mode, QList<int> &ids){ + QString message = QString(tr("Really delete %1 items?")).arg(QString::number(ids.count())); + int res = QMessageBox::question(this, tr("Delete items"), message, QMessageBox::Yes | QMessageBox::No); + if(res != QMessageBox::Yes){ + return; + } + MappingTableModel *model = 0; + switch(mode){ + case DbAnalyzerDialog::Actors: + model = qobject_cast<MappingTableModel*>(SmGlobals::instance()->model("actors")); + break; + case DbAnalyzerDialog::Genres: + model = qobject_cast<MappingTableModel*>(SmGlobals::instance()->model("genres")); + break; + default: + ; + } + Q_ASSERT(model); + model->deleteItems(ids); +} + void SheMov::toggleHover(QObject *object){ QAction *action = qobject_cast<QAction*>(object); if(action){ |