コード例 #1
0
ProgressItem::ProgressItem(ListProgress *view, QListViewItem *after, QCString app_id, int job_id, bool showDefault) : QListViewItem(view, after)
{

    listProgress = view;

    m_iTotalSize = 0;
    m_iTotalFiles = 0;
    m_iProcessedSize = 0;
    m_iProcessedFiles = 0;
    m_iSpeed = 0;

    m_sAppId = app_id;
    m_iJobId = job_id;
    m_visible = true;
    m_defaultProgressVisible = showDefault;

    // create dialog, but don't show it
    defaultProgress = new KIO::DefaultProgress(false);
    defaultProgress->setOnlyClean(true);
    connect(defaultProgress, SIGNAL(stopped()), this, SLOT(slotCanceled()));
    connect(&m_showTimer, SIGNAL(timeout()), this, SLOT(slotShowDefaultProgress()));

    if(showDefault)
    {
        m_showTimer.start(500, true);
    }
}
コード例 #2
0
BtRefreshProgressDialog::BtRefreshProgressDialog(sword::InstallSource &source,
                                                 QWidget *parent,
                                                 Qt::WindowFlags flags)
             : QProgressDialog(parent, flags)
             , m_source(source)
{
    Q_ASSERT(BtInstallBackend::isRemote(source));
    setWindowTitle(tr("Refreshing source %1").arg(QString(source.caption)));
    setCancelButtonText(tr("&Cancel"));
    setLabelText(tr("Connecting..."));
    Q_ASSERT(minimum() == 0);
    setMaximum(100);
    setValue(0);
    setWindowModality(Qt::ApplicationModal);
    setMinimumDuration(1000);

    connect(this, SIGNAL(canceled()),
            this, SLOT(slotCanceled()));
    connect(&m_installMgr, SIGNAL(percentCompleted(int,int)),
            this,          SLOT(slotPercentCompleted(int,int)));
}