Ejemplo n.º 1
0
    void HelpersQmlWrapper::turnTaskbarProgressOff() {
#if defined(Q_OS_WIN) && !defined(UI_TESTS)
        if (!m_WinTaskbarButtonApplicable) { return; }
        LOG_DEBUG << "Turning off taskbar button in Windows";
        QWinTaskbarProgress *progress = m_TaskbarButton->progress();
        progress->setVisible(false);
#endif
    }
Ejemplo n.º 2
0
    void HelpersQmlWrapper::setTaskbarProgress(double value) {
#if defined(Q_OS_WIN) && !defined(UI_TESTS)
        if (!m_WinTaskbarButtonApplicable) { return; }
        LOG_DEBUG << value;
        QWinTaskbarProgress *progress = m_TaskbarButton->progress();
        progress->setValue((int)value);
#else
        Q_UNUSED(value);
#endif
    }
Ejemplo n.º 3
0
void ProgressDialog::finish()
{
    accept();
    progress->setValue(0);
#ifdef WINEXTRAS
    taskbar->clearOverlayIcon();
    QWinTaskbarProgress *taskProgress = taskbar->progress();
    taskProgress->setVisible(false);
    taskProgress->reset();
#endif
}
Ejemplo n.º 4
0
void ProgressDialog::reset()
{
    progress->setValue(0);
#ifdef WINEXTRAS
    if (isWinExtras) {
        taskbar->clearOverlayIcon();
        QWinTaskbarProgress *taskProgress = taskbar->progress();
        taskProgress->setVisible(false);
        taskProgress->reset();
    }
#endif
}
Ejemplo n.º 5
0
void ProgressDialog::setProgress(short percentage, QString text)
{
    label->setText(text);
    progress->setValue(percentage);
#ifdef WINEXTRAS
    if (isWinExtras) {
        taskbar->setWindow(static_cast<QWidget*>(parent())->windowHandle());
        if (icon->pixmap()) { taskbar->setOverlayIcon(*icon->pixmap()); }
        QWinTaskbarProgress *taskProgress = taskbar->progress();
        taskProgress->setValue(percentage);
        taskProgress->setVisible(true);
    }
#endif
    show();
}
Ejemplo n.º 6
0
void MainWindow::OnItemsManagerStatusUpdate(const ItemsFetchStatus &status) {
    QString str = QString("Receiving stash data, %1/%2").arg(status.fetched).arg(status.total);
    if (status.throttled)
        str += " (throttled, sleeping 60 seconds)";
    if (status.fetched == status.total)
        str = "Received all tabs";
    status_bar_label_->setText(str);

#ifdef Q_OS_WIN32
    QWinTaskbarProgress *progress = taskbar_button_->progress();
    progress->setVisible(status.fetched != status.total);
    progress->setMinimum(0);
    progress->setMaximum(status.total);
    progress->setValue(status.fetched);
    progress->setPaused(status.throttled);
#endif
}