コード例 #1
0
ファイル: newdatabasedlg.cpp プロジェクト: seanet7or/mosaicit
NewDatabaseDlg::NewDatabaseDlg(QWidget *parent) :
        QDialog(parent),
        ui(new Ui::NewDatabaseDlg)
{
    ui->setupUi(this);

    setTabOrder(ui->nameEdit, ui->selectFileButton);
    setTabOrder(ui->selectFileButton, ui->directoryEdit);
    setTabOrder(ui->directoryEdit, ui->selectDirButton);
    setTabOrder(ui->selectDirButton, ui->includeSubdirectories);
    setTabOrder(ui->includeSubdirectories, ui->buildButton);
    setTabOrder(ui->buildButton, ui->cancelButton);

    m_canceled = true;

    connect(ui->buildButton,
            SIGNAL(pressed()),
            this,
            SLOT(buildButtonPressed()));
    connect(ui->selectDirButton,
            SIGNAL(pressed()),
            this,
            SLOT(selectDirButtonPressed()));
    connect(ui->cancelButton,
            SIGNAL(pressed()),
            this,
            SLOT(cancelButtonPressed()));
    connect(ui->selectFileButton,
            SIGNAL(pressed()),
            this,
            SLOT(selectFileButtonPressed()));
    this->readSettings();
}
コード例 #2
0
ファイル: rpmbuildplugin.cpp プロジェクト: Kicer86/builder
RpmBuildPlugin::RpmBuildPlugin(): BuildPlugin("RPM builer"), buttonsEnabled(false)
{
    //construct layout
    buttons = new QGridLayout;
    log = new QPlainTextEdit;
    buildButton = new QPushButton(buildButtonText);
    fastBuildButton = new QPushButton(fastBuildButtonText);

    editSpecButton = new QPushButton(tr("Edit spec file"));
    showMacrosButton = new QPushButton(tr("Show Rpm macros"));
    showConstantsButton = new QPushButton(tr("Show spec's constants"));

    progressBar = new QExProgressBarView;

    //1st column - build buttons
    buttons->addWidget(buildButton, 0, 0);
    buttons->addWidget(fastBuildButton, 1, 0);

    //2nd column - spacer
    buttons->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);


    //3rd and 4th columns - editing
    buttons->addWidget(editSpecButton, 0, 2);
    buttons->addWidget(showMacrosButton, 0, 3);
    buttons->addWidget(showConstantsButton, 1, 2, 1, 2);

    //3rd row - progress bar
    buttons->addWidget(progressBar, 2, 0, 1, 4);

    connect(buildButton, SIGNAL(pressed()), this, SLOT(buildButtonPressed()));
    connect(fastBuildButton, SIGNAL(pressed()), this, SLOT(fastBuildButtonPressed()));

    connect(editSpecButton, SIGNAL(clicked()), this, SLOT(specButtonPressed()));
    connect(showConstantsButton, SIGNAL(clicked()), this, SLOT(specConstantsButtonPressed()));
    connect(showMacrosButton, SIGNAL(clicked()), this, SLOT(showMacrosButtonPressed()));

    //disable all buttons until any ReleaseInfo is chosen
    buildButton->setDisabled(true);
    fastBuildButton->setDisabled(true);
    editSpecButton->setDisabled(true);
    showConstantsButton->setDisabled(true);
    showMacrosButton->setDisabled(true);
}