diff options
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);  | 
