SizeDialogBase::SizeDialogBase(QWidget* parent, Device& d, Partition& part, qint64 minFirst, qint64 maxLast) :
    QDialog(parent),
    m_SizeDialogWidget(new SizeDialogWidget(this)),
    m_SizeDetailsWidget(new SizeDetailsWidget(this)),
    m_Device(d),
    m_Partition(part),
    m_MinimumFirstSector(minFirst),
    m_MaximumLastSector(maxLast),
    m_MinimumLength(-1),
    m_MaximumLength(-1)
{
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    setLayout(mainLayout);
    mainLayout->addWidget(&dialogWidget());
    QFrame* detailsBox = new QFrame(this);
    mainLayout->addWidget(detailsBox);
    QVBoxLayout *detailsLayout = new QVBoxLayout(detailsBox);
    detailsLayout->addWidget(&detailsWidget());
    detailsWidget().hide();

    QDialogButtonBox* dialogButtonBox = new QDialogButtonBox;
    detailsButton = new QPushButton;
    okButton = dialogButtonBox->addButton(QDialogButtonBox::Ok);
    cancelButton = dialogButtonBox->addButton(QDialogButtonBox::Cancel);
    detailsButton->setText(i18nc("@item:button advanced settings button", "Advanced") + QStringLiteral(" >>"));
    dialogButtonBox->addButton(detailsButton, QDialogButtonBox::ActionRole);
    mainLayout->setSizeConstraint(QLayout::SetFixedSize);
    mainLayout->addWidget(dialogButtonBox);

    connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
}
Esempio n. 2
0
bool DialogForm::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: toggleDetails(); break;
    case 1: languageChange(); break;
    default:
	return QDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
Dialog_CompilerError::Dialog_CompilerError(QWidget *parent) : QDialog(parent) {
	this->setupUi(this);

    /*
     * Initialise the most expensive dialog of all times. VIS is wasting
     * taxpayer's money(tm) ...
     */
    this->details = new Widget_CompilerError(this);
    
    QGridLayout *layout = dynamic_cast<QGridLayout *>(this->layout());
    layout->setSizeConstraint(QLayout::SetFixedSize);
    layout->addWidget(this->details, 2, 0);
    connect(btnDetails, SIGNAL(clicked()), this, SLOT(toggleDetails()));

    this->details->hide();
}
}

void ApplyProgressDialog::setupConnections()
{
	connect(&operationRunner(), SIGNAL(progressSub(int)), &dialogWidget().progressSub(), SLOT(setValue(int)));
	connect(&operationRunner(), SIGNAL(finished()), SLOT(onAllOpsFinished()));
	connect(&operationRunner(), SIGNAL(cancelled()), SLOT(onAllOpsCancelled()));
	connect(&operationRunner(), SIGNAL(error()), SLOT(onAllOpsError()));
	connect(&operationRunner(), SIGNAL(opStarted(int, Operation*)), SLOT(onOpStarted(int, Operation*)));
	connect(&operationRunner(), SIGNAL(opFinished(int, Operation*)), SLOT(onOpFinished(int, Operation*)));
	connect(&timer(), SIGNAL(timeout()), SLOT(onSecondElapsed()));
	connect(&detailsWidget().buttonSave(), SIGNAL(clicked()), SLOT(saveReport()));
	connect(&detailsWidget().buttonBrowser(), SIGNAL(clicked()), SLOT(browserReport()));
	connect(dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
	connect(dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
	connect(detailsButton, SIGNAL(clicked()), this, SLOT(toggleDetails()));
}

/** Shows the dialog */
void ApplyProgressDialog::show()
{
	setStatus(i18nc("@info:progress", "Setting up..."));

	resetReport();

	dialogWidget().progressTotal().setRange(0, operationRunner().numJobs());
	dialogWidget().progressTotal().setValue(0);

	dialogWidget().treeTasks().clear();
	okButton->setVisible(false);
	cancelButton->setVisible(true);