Ejemplo n.º 1
0
QModernProgressDialog::QModernProgressDialog(const QString & labelText, const QString & cancelButtonText, QWidget* parent, Qt::WindowFlags f):
    QDialog(parent, f)
{
    createWidgets();
    setLabelText(labelText);
    setCancelButtonText(cancelButtonText);
}
Ejemplo n.º 2
0
void QProgressDialog::init( QWidget *creator,
			    const char* lbl, const char* canc,
			    int totstps)
{
    d = new QProgressData(this, creator, lbl, totstps);
    setCancelButtonText( canc );
    connect( this, SIGNAL(cancelled()), this, SLOT(cancel()) );
    layout();
}
void UpdaterDialog::updateDone(bool result)
{
  if (result)
    setLabelText(tr("There's a new version available,<br> please see <a href=\"http://lightscreen.sourceforge.net/new-version\">the Lighscreen website</a>."));
  else
    setLabelText(tr("No new versions available"));

  setMaximum(1);

  setCancelButtonText(tr("Close"));
}
Ejemplo n.º 4
0
void UpdaterDialog::updateDone(bool result)
{
    if (result) {
        setLabelText(tr("There's a new version available,<br> please see <a href=\"https://lightscreen.com.ar/whatsnew/%1\">the Lighscreen website</a>.").arg(qApp->applicationVersion()));
    } else {
        setLabelText(tr("No new versions available."));
    }

    setMaximum(1);

    setCancelButtonText(tr("Close"));
}
Ejemplo n.º 5
0
void QProgressDialog::init( QWidget *creator,
			    const QString& lbl, const QString& canc,
			    int totstps)
{
    d = new QProgressDialogData(this, creator, lbl, totstps);
    d->autoClose = TRUE;
    d->autoReset = TRUE;
    d->forceHide = FALSE;
    setCancelButtonText( canc );
    connect( this, SIGNAL(canceled()), this, SIGNAL(cancelled()) );
    connect( this, SIGNAL(canceled()), this, SLOT(cancel()) );
    forceTimer = new QTimer( this );
    connect( forceTimer, SIGNAL(timeout()), this, SLOT(forceShow()) );
    layout();
}
bool QProgressDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: cancel(); break;
    case 1: reset(); break;
    case 2: setTotalSteps((int)static_QUType_int.get(_o+1)); break;
    case 3: setProgress((int)static_QUType_int.get(_o+1)); break;
    case 4: setProgress((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 5: setLabelText((const QString&)static_QUType_QString.get(_o+1)); break;
    case 6: setCancelButtonText((const QString&)static_QUType_QString.get(_o+1)); break;
    case 7: setMinimumDuration((int)static_QUType_int.get(_o+1)); break;
    case 8: forceShow(); break;
    default:
	return QDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
Ejemplo n.º 7
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)));
}
Ejemplo n.º 8
0
ProgressDialog::ProgressDialog(const QString &labelText , /*
                               int totalSteps,
                               int showAfter,*/
                               QWidget *parent /*,
                               bool modal*/) :
    QProgressDialog(parent),
//    m_wasVisible(false),
//    m_frozen(false),
//    m_modal(modal),
//    m_minimumTimeHasExpired(false),
//    m_minimumDuration(1000),
//    m_sleepingBetweenOperations(false),
//    m_operationText(""),
//    m_totalSteps(totalSteps),
//    m_deferredClose(false),
    m_indeterminate(false)

{
    RG_DEBUG << "ProgressDialog::ProgressDialog - " << labelText << /* " - modal : " << modal << */ endl;

    setWindowTitle(tr("Rosegarden"));
    setBar(new ProgressBar(this));
    setLabelText(labelText);

    // Setting this to QString() causes the cancel button to be deleted.
    // The cancel buttons have never worked properly, and they are particularly
    // broken now, creating a very tricky plumbing problem.  Not being able to
    // cancel is not ideal, but at least not showing a cancel button is
    // truthful.
    setCancelButtonText(QString());

    setMinimumDuration(2000);
    setAttribute(Qt::WA_DeleteOnClose);
    hide();
//    setModal(modal);
/*    setWindowFlags(Qt::Dialog);

    QVBoxLayout *layout = new QVBoxLayout;
    setLayout(layout);
    layout->setAlignment(Qt::AlignCenter);

    QLabel *info = new QLabel(tr("<qt><h3>Processing...</h3></qt>"));
    layout->addWidget(info);

    QGroupBox *box = new QGroupBox;
    layout->addWidget(box);

    QVBoxLayout *boxLayout = new QVBoxLayout;
    box->setLayout(boxLayout);

    m_label = new QLabel(labelText);
    boxLayout->addWidget(m_label);

    m_progressBar = new ProgressBar(totalSteps);
    boxLayout->addWidget(m_progressBar);

    connect(m_progressBar, SIGNAL(valueChanged(int)),
            this, SLOT(slotCheckShow(int)));

    QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Cancel);
    layout->addWidget(bb);
    bb->setCenterButtons(true);

    connect(bb, SIGNAL(rejected()), this, SLOT(cancel()));
*/
    // don't show before this timer has elapsed
    m_showAfterTimer = new QTimer;
    m_showAfterTimer->setSingleShot(true);
    m_showAfterTimer->start(2000);
    connect(m_showAfterTimer, SIGNAL(timeout()), this, SLOT(forceShow()));

/*
    m_timer = new QTimer;
    m_timer->setSingleShot(true);
    QWidget::hide(); */
}
Ejemplo n.º 9
0
void QProgressDialogPrivate::retranslateStrings()
{
    if (useDefaultCancelText)
        setCancelButtonText(QProgressDialog::tr("Cancel"));
}