Exemple #1
0
void StatusBar::resetMainText() {
  /*
    if( sender() )
    debug() << sender()->name() << endl;

    // don't reset if we are showing a shortMessage
    if( SingleShotPool::isActive( this, SLOT(resetMainText()) ) )
    return;
  */
  m_mainTextLabel->setPalette(QPalette());

  if (allDone()) {
    m_mainTextLabel->setText(mainText_);
  }

  else {
    //m_mainTextLabel->setPaletteBackgroundColor( m_mainTextLabel->paletteBackgroundColor().dark( 110 ) );
    m_mainTextLabel->setPalette(QToolTip::palette());

    ProgressBar *bar = 0;
    uint count = 0;

    for (ProgressMap::ConstIterator it = progressMap_.begin();
        it != progressMap_.end(); ++it ) {
      if (!(*it)->isFinished_) {
        bar =  *it;
        count++;
      }
    }

    if (count == 1) {
      m_mainTextLabel->setText(bar->description() + "...");
    } else {
      m_mainTextLabel->setText(tr("Multiple background-tasks running"));
    }
  }
}