diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-08-14 18:53:25 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-08-14 18:53:25 +0000 |
commit | 06233888b033adc6e821331e6d1822e9807371ae (patch) | |
tree | cc3ded50eb1640805652e1ec77988b39e31d13c8 /shemov.cpp | |
parent | 41802000a0bcbb44c3add7f218eceec101f52cc0 (diff) | |
download | SheMov-06233888b033adc6e821331e6d1822e9807371ae.tar.gz SheMov-06233888b033adc6e821331e6d1822e9807371ae.tar.bz2 SheMov-06233888b033adc6e821331e6d1822e9807371ae.zip |
-Implemented conlumnContains() in MovieModel
-Implemented guess-function in ArchiveEditDialog
-Cumulative size is now shown in statusBar() when selecting items in ArchiveViewWidget
-Fixed EditArchiveItemDialog allowing duplicate titles (neccessary after creating iseriesno and ipartno)
-Fixed windowTitle() when changing tabs
git-svn-id: file:///var/svn/repos2/shemov/trunk@401 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'shemov.cpp')
-rw-r--r-- | shemov.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -81,6 +81,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla mFSWidget->fileView()->findActions(); connect(mFSWidget->fileView()->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(updateSelectionCount(const QItemSelection &, const QItemSelection &))); + connect(mAVWidget->fileView()->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this, SLOT(updateSelectionCount(const QItemSelection &, const QItemSelection &))); connect(mFSWidget, SIGNAL(windowTitle(const QString &)), this, SLOT(newWindowTitle(const QString &))); connect(mFSWidget->fileView(), SIGNAL(statusbarMessage(const QString &)), this, SLOT(statusbarMessage(const QString &))); connect(mFSWidget, SIGNAL(statusbarMessage(const QString &)), this, SLOT(statusbarMessage(const QString &))); @@ -96,7 +97,24 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla } void SheMov::updateSelectionCount(const QItemSelection & /* sel */, const QItemSelection & /* prev */){ - mSelectedItems->setText(QString::number(mFSWidget->fileView()->selectionModel()->selectedRows().count())); + QLocale l; + switch (mTab->currentIndex()) { + case 0: + mSelectedItems->setText(QString::number(mFSWidget->fileView()->selectionModel()->selectedRows().count())); + mSelectedSize->setText("<span style=\"color:#000000\">n/a</span>"); + break; + case 1: + mSelectedItems->setText(QString::number(mAVWidget->fileView()->selectionModel()->selectedRows().count())); + qint64 s = mAVWidget->currentSize(); + QString val; + if(s < Q_INT64_C(4707319808)){ + val = QString("<span style=\"color:#008000\">%1</span>").arg(l.toString(s)); + }else{ + val = QString("<span style=\"color:#ff0000\">%1</span>").arg(l.toString(s)); + } + mSelectedSize->setText(val); + break; + } } void SheMov::newWindowTitle(const QString &title){ @@ -120,9 +138,23 @@ void SheMov::configure(){ void SheMov::tabChanged(int newTab){ mEditFSMenuA->setVisible(newTab == 0); mEditArchiveMenuA->setVisible(newTab == 1); + if(newTab == 0){ + setWindowTitle(mFSWidget->windowTitle()); + //mSelectedItems->setText(QString::number(mFSWidget->fileView()->selectionModel()->selectedRows().count())); + } + if(newTab == 1){ + setWindowTitle(mAVWidget->windowTitle()); + //mSelectedItems->setText(QString::number(mAVWidget->fileView()->selectionModel()->selectedRows().count())); + } + updateSelectionCount(QItemSelection(), QItemSelection()); } void SheMov::createStatusbar(){ + QLabel *selSizeL = new QLabel(tr("Sel. Size")); + mSelectedSize = new QLabel(tr("nothing selected yet")); + mSelectedSize->setFrameStyle(QFrame::Panel | QFrame::Sunken); + statusBar()->addPermanentWidget(selSizeL); + statusBar()->addPermanentWidget(mSelectedSize); QLabel *selCountL = new QLabel(tr("Sel. Items")); mSelectedItems = new QLabel("0"); mSelectedItems->setFrameStyle(QFrame::Panel | QFrame::Sunken); |