Example #1
0
void IssuesWidget::addItem(QTreeWidgetItem *item)
{
    if (!item)
        return;

    int count = _ui->_treeWidget->topLevelItemCount();
    if (count >= maxIssueCount)
        return;

    _ui->_treeWidget->setSortingEnabled(false);
    _reenableSorting.start();

    // Insert item specific errors behind the others
    int insertLoc = 0;
    if (!item->text(1).isEmpty()) {
        for (int i = 0; i < count; ++i) {
            if (_ui->_treeWidget->topLevelItem(i)->text(1).isEmpty()) {
                insertLoc = i + 1;
            } else {
                break;
            }
        }
    }

    _ui->_treeWidget->insertTopLevelItem(insertLoc, item);
    item->setHidden(!shouldBeVisible(item, currentAccountFilter(), currentFolderFilter()));
    emit issueCountUpdated(_ui->_treeWidget->topLevelItemCount());
}
Example #2
0
void LegacySystemTray::setVisible(bool visible) {
  SystemTray::setVisible(visible);
  if(mode() == Legacy) {
    if(shouldBeVisible())
      _trayIcon->show();
    else
      _trayIcon->hide();
  }
}
Example #3
0
void IssuesWidget::slotRefreshIssues()
{
    auto tree = _ui->_treeWidget;
    auto filterFolderAlias = currentFolderFilter();
    auto filterAccount = currentAccountFilter();

    for (int i = 0; i < tree->topLevelItemCount(); ++i) {
        auto item = tree->topLevelItem(i);
        item->setHidden(!shouldBeVisible(item, filterAccount, filterFolderAlias));
    }

    _ui->_treeWidget->setColumnHidden(2, !filterFolderAlias.isEmpty());
}
Example #4
0
void YaEventNotifier::update()
{
	updateSkippedList();

	eventNotifierFrame_->setEvent(currentEventId(), currentEvent());
	eventNotifierFrame_->setEventCounter(skipped_ids_.count() + 1, GlobalEventQueue::instance()->ids().count());

	if (shouldBeVisible())
		show();
	else
		hide();

	emit visibilityChanged();
}
Example #5
0
void LegacySystemTray::setMode(Mode mode_) {
  SystemTray::setMode(mode_);

  if(mode() == Legacy) {
    syncLegacyIcon();
    if(shouldBeVisible())
      _trayIcon->show();
    else
      _trayIcon->hide();
    if(state() == NeedsAttention)
      _blinkTimer.start();
  } else {
    _trayIcon->hide();
    _blinkTimer.stop();
  }
}
Example #6
0
void YaEventNotifier::showEvent(QShowEvent* event)
{
	if (shouldBeVisible())
		QWidget::showEvent(event);
}