From 06233888b033adc6e821331e6d1822e9807371ae Mon Sep 17 00:00:00 2001 From: am Date: Fri, 14 Aug 2009 18:53:25 +0000 Subject: -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 --- shemov.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 4dc03b7..4e18806 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -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("n/a"); + 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("%1").arg(l.toString(s)); + }else{ + val = QString("%1").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); -- cgit v1.2.3-70-g09d2