KLProjectConfigWidget::KLProjectConfigWidget(KLProject* project, QWidget *parent, const char *name)
    :QDialog(parent, name), m_validator(QRegExp("0x[0-9a-fA-F]{1,4}"), this, "reValidator"),
      ui(new Ui_KLProjectConfigWidgetBase)
{
    ui->setupUi(this);
    m_project = project;
    m_projectManagerInConfigWidget =
            new KLProjectManagerWidget( project, ui->tab_common, "managerInConfig" );
    m_projectManagerInConfigWidget->setConfigButtonVisible( false );
    ui->layProjectManager->addWidget( m_projectManagerInConfigWidget );
    ui->cbCPU->clear();
    // Add all the CPUs:
    ui->cbCPU->insertStringList( project->cpus() );
    // Update the project files list:
    project->update();
    // Add linker flags columns
    ui->lvLinkerFlags->addColumn(i18n("Purpose"));
    ui->lvLinkerFlags->addColumn(i18n("Flags"));
    // Fill the linker flags list:
    m_possibleLinkerFlags["-Wl,-lm"] = i18n("Link with math library");
    m_possibleLinkerFlags["-Wl,-lprintf"] = i18n("Link with printf library");
    m_possibleLinkerFlags["-Wl,-lprintf_min"] = i18n("Link with printf_min library");
    m_possibleLinkerFlags["-Wl,-u,vfprintf -Wl,-lprintf_flt"] = i18n("Link with floating point printf library");
    QStringList keys = m_possibleLinkerFlags.keys();
    keys.sort();

    for ( QStringList::iterator it = keys.begin(); it != keys.end(); ++it )
    {
        Q3CheckListItem* cur = new Q3CheckListItem( ui->lvLinkerFlags, m_possibleLinkerFlags[*it], Q3CheckListItem::CheckBox );
        cur->setText( 1, *it );
        m_linkerFlagsCBs.append( cur );
    }
    updateGUIFromSettings();
    updateCPUInfo( ui->cbCPU->currentText() );

    connect(ui->cbCPU,SIGNAL(currentIndexChanged(QString)),this,SLOT(slotCPUChanged(QString)));
    connect(ui->pbOK,SIGNAL(clicked()),this,SLOT(slotOK()));
    connect(ui->pbCancel,SIGNAL(clicked()),this,SLOT(slotCancel()));
    connect(ui->pbSetDefault,SIGNAL(clicked()),this,SLOT(slotSetDefault()));

    //Setup spinboxes with hex-in and output
    ui->kisbStartOfText->setValidator(&m_validator);
    ui->kisbStartOfText->setBase(16);

    ui->kisbStartOfData->setValidator(&m_validator);
    ui->kisbStartOfData->setBase(16);

    ui->kisbStartOfBSS->setValidator(&m_validator);
    ui->kisbStartOfBSS->setBase(16);

    ui->kisbStartOfHeap->setValidator(&m_validator);
    ui->kisbStartOfHeap->setBase(16);

    ui->kisbEndOfHeap->setValidator(&m_validator);
    ui->kisbEndOfHeap->setBase(16);
}
Example #2
0
File: qt4.cpp Project: m8a/uim
void UimPrefDialog::createMainWidgets()
{
    QVBoxLayout *mainVLayout = new QVBoxLayout( this );
    mainVLayout->setMargin( 6 );

    QSplitter *mainSplitter = new QSplitter( this );

    /* ListView */
    m_groupListView = new QTreeWidget( mainSplitter );
    m_groupListView->setRootIsDecorated( false );
    m_groupListView->setHeaderLabel( _("Group") );
    m_groupListView->setSelectionMode( QAbstractItemView::SingleSelection );
    connect( m_groupListView, SIGNAL(itemSelectionChanged()),
                      this, SLOT(slotItemSelectionChanged()) );

    /* Contents Frame */
    m_rightSideWidget = new QScrollArea( mainSplitter );
    m_rightSideWidget->setWidgetResizable( true );
    m_groupWidgetStack = new QStackedWidget;

    /* Buttons */
    QWidget *buttonHWidget = new QWidget( this );
    buttonHWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed);
    QHBoxLayout *buttonHLayout = new QHBoxLayout( buttonHWidget );
    buttonHLayout->setMargin( 6 );
    buttonHLayout->setSpacing( 6 );
    QPushButton *defaultButton = new QPushButton( _("Defaults"), buttonHWidget );
    connect( defaultButton, SIGNAL(clicked()),
                      this, SLOT(slotSetDefault()) );
    QPushButton *okButton = new QPushButton( _("OK"), buttonHWidget );
    connect( okButton, SIGNAL(clicked()),
                      this, SLOT(slotOK()) );
    m_applyButton = new QPushButton( _("Apply"), buttonHWidget );
    m_applyButton->setEnabled( false );
    connect( m_applyButton, SIGNAL(clicked()),
                      this, SLOT(slotApply()) );
    QPushButton *cancelButton = new QPushButton( _("Cancel"), buttonHWidget );
    connect( cancelButton, SIGNAL(clicked()),
                      this, SLOT(slotCancel()) );
    buttonHLayout->addWidget( defaultButton );
    buttonHLayout->addStretch();
    buttonHLayout->addWidget( okButton );
    buttonHLayout->addWidget( m_applyButton );
    buttonHLayout->addWidget( cancelButton );

    QFrame *separator = new QFrame( this );
    separator->setFrameShape( QFrame::HLine );
    separator->setFrameShadow( QFrame::Sunken );
    mainVLayout->setMargin( 0 );
    mainVLayout->addWidget( mainSplitter );
    mainVLayout->addWidget( separator );
    mainVLayout->addWidget( buttonHWidget );

    mainSplitter->setStretchFactor( 1, 1 );
}