summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-07-31 11:05:59 +0200
committerArno <am@disconnect.de>2010-07-31 11:05:59 +0200
commit6d3b28f9b12964b161b5a7ac0038435cfdd6e27b (patch)
tree59d49ee1ab59b53bb762135d70759350f4b44159 /shemov.cpp
parent066cc53c2506fb7f7cb7b3b0d888243df611cacd (diff)
downloadSheMov-6d3b28f9b12964b161b5a7ac0038435cfdd6e27b.tar.gz
SheMov-6d3b28f9b12964b161b5a7ac0038435cfdd6e27b.tar.bz2
SheMov-6d3b28f9b12964b161b5a7ac0038435cfdd6e27b.zip
Added database maintenance code
Implemented a function in MappingTableModel to remove all actors/genres with no references in the according mapping table. Available through the "File" menu.
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/shemov.cpp b/shemov.cpp
index 58f2658..1c180b7 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -253,6 +253,18 @@ void SheMov::createActions(){
//File menu
mPlaySelectedFSA = new QAction(tr("Play selected movies..."), this);
connect(mPlaySelectedFSA, SIGNAL(triggered()), mFSWidget, SLOT(playSelected()));
+ mNewMovieWizardA = new QAction(tr("Archive movie..."), this);
+ connect(mNewMovieWizardA, SIGNAL(triggered()), this, SLOT(newMovieWizard()));
+ mCleanupMapper = new QSignalMapper(this);
+ mCleanupGroup = new QActionGroup(this);
+ QAction *cleanup1 = new QAction(tr("Cleanup actors..."), this);
+ connect(cleanup1, SIGNAL(triggered()), mCleanupMapper, SLOT(map()));
+ mCleanupMapper->setMapping(cleanup1, "actors");
+ mCleanupGroup->addAction(cleanup1);
+ QAction *cleanup2 = new QAction(tr("Cleanup genres..."), this);
+ connect(cleanup2, SIGNAL(triggered()), mCleanupMapper, SLOT(map()));
+ mCleanupMapper->setMapping(cleanup2, "genres");
+ mCleanupGroup->addAction(cleanup2);
mQuitA = new QAction(tr("Quit"), this);
mQuitA->setShortcut(tr("CTRL+q"));
@@ -329,8 +341,6 @@ void SheMov::createActions(){
connect(mCollapseAllSeriesA, SIGNAL(triggered()), mATree->seriesWidget()->seriesTree(), SLOT(collapseAll()));
mExpandCurrentA = new QAction(tr("Expand"), this);
connect(mExpandCurrentA, SIGNAL(triggered()), mATree->seriesWidget(), SLOT(expandCurrent()));
- mNewMovieWizardA = new QAction(tr("Archive movie..."), this);
- connect(mNewMovieWizardA, SIGNAL(triggered()), this, SLOT(newMovieWizard()));
mAddCoverA = new QAction(tr("Add cover..."), this);
connect(mAddCoverA, SIGNAL(triggered()), mATree->seriesWidget(), SLOT(addCover()));
@@ -369,6 +379,7 @@ void SheMov::createActions(){
mOpenWithMapperAV = new QSignalMapper(this);
connect(mOpenWithMapperFS, SIGNAL(mapped(QString)), mFSWidget, SLOT(playSelected(QString)));
connect(mOpenWithMapperAV, SIGNAL(mapped(QString)), mATree, SLOT(playSelected(QString)));
+ connect(mCleanupMapper, SIGNAL(mapped(QString)), mATree, SLOT(cleanDatabase(QString)));
connect(viewMapper, SIGNAL(mapped(int)), mATree, SLOT(setFileViewMode(int)));
}
@@ -379,6 +390,9 @@ void SheMov::createMenus(){
fileMenu->addAction(mPlaySelectedFSA);
fileMenu->addSeparator();
fileMenu->addAction(mNewMovieWizardA);
+ QMenu *cleanupMenu = new QMenu(tr("Clean database"), this);
+ cleanupMenu->addActions(mCleanupGroup->actions());
+ fileMenu->addMenu(cleanupMenu);
fileMenu->addSeparator();
fileMenu->addAction(mQuitA);
menuBar()->addMenu(fileMenu);