Logo Search packages:      
Sourcecode: tellico version File versions

void MainWindow::slotEntryCount (  )  [slot]

Updates the entry count in the status bar.

Definition at line 1389 of file mainwindow.cpp.

References Tellico::Data::Collection::entryCount(), and Tellico::DetailedListView::visibleItems().

Referenced by importFile(), initFileOpen(), openURL(), Tellico::Controller::slotCollectionAdded(), and Tellico::Controller::slotUpdateSelection().

                                {
  Data::Collection* coll = Kernel::self()->collection();
  if(!coll) {
    return;
  }

  int count = coll->entryCount();
  QString text = i18n("Total Entries: %1").arg(count);
  // I add a space before and after for asthetic reasons
  text.prepend(QString::fromLatin1(" "));
  text.append(QString::fromLatin1(" "));

  int selectCount = Controller::self()->selectedEntries().count();
  int filterCount = m_detailedView->visibleItems();
  // if more than one book is selected, add the number of selected books
  if(filterCount < count && selectCount > 1) {
    text += i18n("(%1 filtered; %2 selected)").arg(filterCount).arg(selectCount);
    text += QString::fromLatin1(" ");
  } else if(filterCount < count) {
    text += i18n("(%1 filtered)").arg(filterCount);
    text += QString::fromLatin1(" ");
  } else if(selectCount > 1) {
    text += i18n("(%1 selected)").arg(selectCount);
    text += QString::fromLatin1(" ");
  }

  statusBar()->changeItem(text, ID_STATUS_COUNT);
}


Generated by  Doxygen 1.6.0   Back to index