summaryrefslogtreecommitdiffstats
path: root/shemov.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-03-22 09:18:52 +0100
committerArno <am@disconnect.de>2013-03-22 09:18:52 +0100
commit153683e2e961b13c5e97e582563656851bce377c (patch)
tree5efd902813f059dfb76548f96e77558c58930d98 /shemov.cpp
parent50b34092a45990000ba73409abd75377816b70e6 (diff)
downloadSheMov-153683e2e961b13c5e97e582563656851bce377c.tar.gz
SheMov-153683e2e961b13c5e97e582563656851bce377c.tar.bz2
SheMov-153683e2e961b13c5e97e582563656851bce377c.zip
Show duration in statusBar
Show total duration of selected Movies in FileView. Created a new class Helper::Duration for this and declared it as QMetaType.
Diffstat (limited to 'shemov.cpp')
-rw-r--r--shemov.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/shemov.cpp b/shemov.cpp
index 107959b..6aa7c74 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -127,6 +127,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla
splash.showMessage(tr("Finishing..."), Qt::AlignHCenter, Qt::yellow);
qApp->processEvents();
connect(mFSWidget->fileView(), SIGNAL(selectedSize(qint64)), this, SLOT(setSize(qint64)));
+ connect(mFSWidget->fileView(), SIGNAL(selectedDuration(QVariant)), this, SLOT(setDuration(QVariant)));
connect(mFSWidget->fileView(), SIGNAL(numSelected(int)), this, SLOT(updateSelectedCount(int)));
connect(mFSWidget, SIGNAL(windowTitle(QString)), this, SLOT(setWindowTitle(QString)));
connect(mFSWidget->fileView(), SIGNAL(statusbarMessage(const QString &)), this, SLOT(statusbarMessage(const QString &)));
@@ -202,14 +203,16 @@ void SheMov::tabChanged(int newTab){
mPVSelectAllA->disconnect();
mPVShowNPDialogA->setEnabled(newTab == 0);
mPVAddToNPA->setEnabled(newTab == 0);
+ statusbarMessage(QString());
switch(newTab){
case 0:
connect(mPVSelectAllA, SIGNAL(triggered()), mFSWidget, SLOT(selectAllPV()));
+ setDuration(mFSWidget->fileView()->duration());
break;
case 2:
connect(mPVSelectAllA, SIGNAL(triggered()), mPicWidget->picView(), SLOT(setPVAll()));
- break;
default:
+ setDuration(QVariant());
;;
}
}
@@ -327,6 +330,11 @@ void SheMov::setSize(qint64 size){
mSelectedSize->setText(val);
}
+void SheMov::setDuration(const QVariant dur){
+ Helper::Duration d = dur.value<Helper::Duration>();
+ mSelectedDuration->setText(d.toString());
+}
+
QAction *SheMov::createSeparator(){
QAction *tmp = new QAction(this);
tmp->setSeparator(true);
@@ -349,6 +357,11 @@ QSignalMapper *SheMov::createHeaderMapper(SmTreeModel *model, QActionGroup *grou
}
void SheMov::createStatusbar(){
+ QLabel *selDurL = new QLabel(tr("Duration"));
+ mSelectedDuration = new QLabel("00:00:00");
+ mSelectedDuration->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+ statusBar()->addPermanentWidget(selDurL);
+ statusBar()->addPermanentWidget(mSelectedDuration);
QLabel *selSizeL = new QLabel(tr("Sel. Size"));
mSelectedSize = new QLabel(tr("nothing selected yet"));
mSelectedSize->setFrameStyle(QFrame::Panel | QFrame::Sunken);