summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-10-03 11:51:29 +0200
committerArno <am@disconnect.de>2010-10-03 11:51:29 +0200
commit0861ec020923ff8a1549f6c4a3f5437ce62573b5 (patch)
tree9c60034f8077a00b5c97b0effaf0d9785a11a871 /shemov.cpp
parent3c86ae36f5048929ed43e1d49060d45e927953e8 (diff)
downloadSheMov-0861ec020923ff8a1549f6c4a3f5437ce62573b5.tar.gz
SheMov-0861ec020923ff8a1549f6c4a3f5437ce62573b5.tar.bz2
SheMov-0861ec020923ff8a1549f6c4a3f5437ce62573b5.zip
Implemented "Archive selected" action
New context menu entry in FSWidget: archive selected. The selected files will be inserted into the MovieInfoPage when archiving a movie.
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/shemov.cpp b/shemov.cpp
index a37ec83..2fa47d3 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -218,6 +218,18 @@ void SheMov::newMovieWizard(){
mNewMovieWizard->show();
}
+void SheMov::newMovieWizardWithFiles(){
+ QModelIndexList selected = mFSWidget->fileView()->selectionModel()->selectedRows();
+ if(selected.isEmpty()){
+ return;
+ }
+ mNewMovieWizard->restart();
+ foreach(QModelIndex sel, selected){
+ mNewMovieWizard->infoPage()->addFile(sel.data(QFileSystemModel::FilePathRole).toString());
+ }
+ mNewMovieWizard->show();
+}
+
void SheMov::setSize(qint64 size){
QLocale l;
QString val;
@@ -258,6 +270,8 @@ void SheMov::createActions(){
connect(mPlaySelectedFSA, SIGNAL(triggered()), mFSWidget, SLOT(playSelected()));
mNewMovieWizardA = new QAction(tr("Archive movie..."), this);
connect(mNewMovieWizardA, SIGNAL(triggered()), this, SLOT(newMovieWizard()));
+ mArchiveSelectedA = new QAction(tr("Archive selected..."), this);
+ connect(mArchiveSelectedA, SIGNAL(triggered()), this, SLOT(newMovieWizardWithFiles()));
mCleanupMapper = new QSignalMapper(this);
mCleanupGroup = new QActionGroup(this);
QAction *cleanup1 = new QAction(tr("Cleanup actors..."), this);
@@ -472,6 +486,10 @@ void SheMov::createMenus(){
mFSWidget->fileView()->addAction(mCopyA);
mFSWidget->fileView()->addAction(mMoveA);
mFSWidget->fileView()->addAction(mRenameMenuA);
+ QAction *sep10 = new QAction(this);
+ sep10->setSeparator(true);
+ mFSWidget->fileView()->addAction(sep10);
+ mFSWidget->fileView()->addAction(mArchiveSelectedA);
//ArchiveTreeView context menu
mATree->seriesWidget()->seriesTree()->addAction(mNewSeriesA);