summaryrefslogtreecommitdiffstats
path: root/shemovcleaner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shemovcleaner.cpp')
-rw-r--r--shemovcleaner.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/shemovcleaner.cpp b/shemovcleaner.cpp
index 70b44ad..f5d74ad 100644
--- a/shemovcleaner.cpp
+++ b/shemovcleaner.cpp
@@ -36,6 +36,10 @@ ShemovCleaner::ShemovCleaner(QWidget *parent, Qt::WindowFlags f) : QMainWindow(p
createActions();
connect(mTorrentTab, SIGNAL(statusMessage(QString)), this, SLOT(statusBarMessage(QString)));
connect(mTorrentTab, SIGNAL(selectionCountChanged(QString)), this, SLOT(setSelectionCount(QString)));
+ connect(mFileTab, SIGNAL(statusMessage(QString)), this, SLOT(statusBarMessage(QString)));
+ connect(mFileTab, SIGNAL(selectionCountChanged(QString)), this, SLOT(setSelectionCount(QString)));
+ connect(mFileTab, SIGNAL(durationChanged(QString)), this, SLOT(setDuration(QString)));
+ connect(mTab, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
QSettings s;
restoreGeometry(s.value("geometry").toByteArray());
@@ -45,6 +49,10 @@ void ShemovCleaner::statusBarMessage(const QString &msg){
statusBar()->showMessage(msg);
}
+void ShemovCleaner::setDuration(const QString &msg){
+ mDuration->setText(msg);
+}
+
void ShemovCleaner::setSelectionCount(const QString &msg){
mSelected->setText(msg);
}
@@ -57,6 +65,15 @@ void ShemovCleaner::configure(){
}
}
+void ShemovCleaner::tabChanged(int idx){
+ if(idx == Torrents){
+ mTorrentTab->fileSelectionChanged(QItemSelection(), QItemSelection());
+ setDuration("00:00:00");
+ }else if(idx == Videos){
+ mFileTab->fileSelectionChanged(QItemSelection(), QItemSelection());
+ }
+}
+
void ShemovCleaner::closeEvent(QCloseEvent *e){
QSettings s;
s.setValue("geometry", saveGeometry());
@@ -67,8 +84,13 @@ void ShemovCleaner::createStatusBar(){
QLabel *l1 = new QLabel(tr("Sel."));
mSelected = new QLabel("000/000");
mSelected->setFrameStyle(QFrame::Panel | QFrame::Sunken);
+ QLabel *l2 = new QLabel(tr("Dur."));
+ mDuration = new QLabel("00:00:00");
+ mDuration->setFrameStyle(QFrame::Panel | QFrame::Sunken);
statusBar()->addPermanentWidget(l1);
statusBar()->addPermanentWidget(mSelected);
+ statusBar()->addPermanentWidget(l2);
+ statusBar()->addPermanentWidget(mDuration);
}
void ShemovCleaner::createActions(){