- // target directory
- QLabel* targetLab = new QLabel( tr( "Type the target directory:" ), productsPage );
- targetFolder = new QLineEdit( productsPage );
- QWhatsThis::add( targetFolder, tr( "Enter target root directory where products will be installed" ) );
- QToolTip::add ( targetFolder, tr( "Enter target root directory where products will be installed" ) );
- targetBtn = new QPushButton( tr( "Browse..." ), productsPage );
- QWhatsThis::add( targetBtn, tr( "Click this to browse target directory" ) );
- QToolTip::add ( targetBtn, tr( "Click this to browse target directory" ) );
- // create advanced mode widgets container
- moreBox = new QWidget( productsPage );
- QGridLayout* moreBoxLayout = new QGridLayout( moreBox );
- moreBoxLayout->setMargin( 0 ); moreBoxLayout->setSpacing( 6 );
- // temp directory
- QLabel* tempLab = new QLabel( tr( "Type the directory for the temporary files:" ), moreBox );
- tempFolder = new QLineEdit( moreBox );
- // tempFolder->setText( "/tmp" ); // default is /tmp directory
- QWhatsThis::add( tempFolder, tr( "Enter directory where to put temporary files" ) );
- QToolTip::add ( tempFolder, tr( "Enter directory where to put temporary files" ) );
- tempBtn = new QPushButton( tr( "Browse..." ), moreBox );
- tempBtn->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
- QWhatsThis::add( tempBtn, tr( "Click this to browse temporary directory" ) );
- QToolTip::add ( tempBtn, tr( "Click this to browse temporary directory" ) );
- // create products list
- productsView = new ProductsView( moreBox );
- productsView->setMinimumSize( 250, 180 );
- QWhatsThis::add( productsView, tr( "This view lists the products you wish to be installed" ) );
- QToolTip::add ( productsView, tr( "This view lists the products you wish to be installed" ) );
- // products info box
- productsInfo = new QTextBrowser( moreBox );
- productsInfo->setMinimumSize( 270, 135 );
- QWhatsThis::add( productsInfo, tr( "Shows info about the product: required disk space and prerequisites" ) );
- QToolTip::add ( productsInfo, tr( "Shows info about the product: required disk space and prerequisites" ) );
- // disk space labels
- QLabel* reqLab1 = new QLabel( tr( "Total disk space required:" ), moreBox );
- QWhatsThis::add( reqLab1, tr( "Shows total disk space required for installing selected products" ) );
- QToolTip::add ( reqLab1, tr( "Shows total disk space required for installing selected products" ) );
- requiredSize = new QLabel( moreBox );
- requiredSize->setMinimumWidth( 100 );
- QWhatsThis::add( requiredSize, tr( "Shows total disk space required for installing selected products" ) );
- QToolTip::add ( requiredSize, tr( "Shows total disk space required for installing selected products" ) );
- QLabel* reqLab2 = new QLabel( tr( "Space for temporary files:" ), moreBox );
- QWhatsThis::add( reqLab2, tr( "Shows additional disk space which is required for temporary files" ) );
- QToolTip::add ( reqLab2, tr( "Shows additional disk space which is required for temporary files" ) );
- requiredTemp = new QLabel( moreBox );
- requiredTemp->setMinimumWidth( 100 );
- QWhatsThis::add( requiredTemp, tr( "Shows additional disk space which is required for temporary files" ) );
- QToolTip::add ( requiredTemp, tr( "Shows additional disk space which is required for temporary files" ) );
- QFont fnt = reqLab1->font();
- fnt.setBold( true );
- reqLab1->setFont( fnt );
- requiredSize->setFont( fnt );
- reqLab2->setFont( fnt );
- requiredTemp->setFont( fnt );
- QGridLayout* sizeLayout = new QGridLayout; sizeLayout->setMargin( 0 ); sizeLayout->setSpacing( 6 );
- sizeLayout->addWidget( reqLab1, 0, 0 );
- sizeLayout->addWidget( requiredSize, 0, 1 );
- sizeLayout->addWidget( reqLab2, 1, 0 );
- sizeLayout->addWidget( requiredTemp, 1, 1 );
- // prerequisites checkbox
- prerequisites = new QCheckBox( tr( "Auto set prerequisites products" ), moreBox );
- prerequisites->setChecked( true );
- QWhatsThis::add( prerequisites, tr( "Check this if you want prerequisites products to be set on automatically" ) );
- QToolTip::add ( prerequisites, tr( "Check this if you want prerequisites products to be set on automatically" ) );
- // <Unselect All> button
- unselectBtn = new QPushButton( tr( "&Unselect All" ), moreBox );
- QWhatsThis::add( unselectBtn, tr( "Unselects all products" ) );
- QToolTip::add ( unselectBtn, tr( "Unselects all products" ) );
- // <SALOME sources> / <SALOME binaries> tri-state checkboxes
- selectBinBtn = new QMyCheckBox( tr( "SALOME binaries" ), moreBox );
- selectBinBtn->setTristate( true );
- QWhatsThis::add( selectBinBtn, tr( "Selects/unselects SALOME binaries" ) );
- QToolTip::add ( selectBinBtn, tr( "Selects/unselects SALOME binaries" ) );
- selectSrcBtn = new QMyCheckBox( tr( "SALOME sources" ), moreBox );
- selectSrcBtn->setTristate( true );
- QWhatsThis::add( selectSrcBtn, tr( "Selects/unselects SALOME sources" ) );
- QToolTip::add ( selectSrcBtn, tr( "Selects/unselects SALOME sources" ) );
- buildSrcBtn = new QMyCheckBox( tr( "Build SALOME sources" ), moreBox );
- QWhatsThis::add( buildSrcBtn, tr( "Check this box if you want to build selected SALOME sources after the installation" ) );
- QToolTip::add ( buildSrcBtn, tr( "Check this box if you want to build selected SALOME sources after the installation" ) );
- QGridLayout* btnLayout = new QGridLayout; btnLayout->setMargin( 0 ); btnLayout->setSpacing( 6 );
- btnLayout->addMultiCellWidget( unselectBtn, 0, 0, 0, 1 );
- btnLayout->addMultiCellWidget( selectBinBtn, 1, 1, 0, 1 );
- btnLayout->addMultiCellWidget( selectSrcBtn, 2, 2, 0, 1 );
- btnLayout->addWidget( buildSrcBtn, 3, 1 );
- btnLayout->setColSpacing( 0, 20 );
- btnLayout->setColStretch( 1, 10 );
- // layouting advancet mode widgets
- moreBoxLayout->addMultiCellWidget( tempLab, 0, 0, 0, 2 );
- moreBoxLayout->addMultiCellWidget( tempFolder, 1, 1, 0, 1 );
- moreBoxLayout->addWidget ( tempBtn, 1, 2 );
- moreBoxLayout->addMultiCellWidget( productsView, 2, 5, 0, 0 );
- moreBoxLayout->addMultiCellWidget( productsInfo, 2, 2, 1, 2 );
- moreBoxLayout->addMultiCellWidget( prerequisites,3, 3, 1, 2 );
- moreBoxLayout->addMultiCellLayout( btnLayout, 4, 4, 1, 2 );
- moreBoxLayout->addMultiCellLayout( sizeLayout, 5, 5, 1, 2 );
- // <Less...> box
- lessBox = new QWidget( productsPage );
- QGridLayout* lessBoxLayout = new QGridLayout( lessBox );
- lessBoxLayout->setMargin( 0 ); lessBoxLayout->setSpacing( 6 );
- // <Install all products from sources> check box
- allFromSrcBtn = new QMyCheckBox( tr( "Install all products from sources" ), lessBox );
- lessBoxLayout->addWidget( allFromSrcBtn, 0, 0 );
- lessBoxLayout->setRowStretch( 1, 10 );
- //lessBoxLayout->addItem( new QSpacerItem( 10,10, QSizePolicy::Minimum, QSizePolicy ), 1, 1 );
- // <More...> button
- moreBtn = new QPushButton( tr( "More..." ), productsPage );
- // layouting
- pageLayout->addMultiCellWidget( targetLab, 0, 0, 0, 1 );
- pageLayout->addWidget ( targetFolder, 1, 0 );
- pageLayout->addWidget ( targetBtn, 1, 1 );
- pageLayout->addMultiCellWidget( moreBox, 2, 2, 0, 1 );
- pageLayout->addMultiCellWidget( lessBox, 3, 3, 0, 1 );
- pageLayout->addWidget ( moreBtn, 4, 1 );
- pageLayout->setRowStretch( 2, 5 );
- pageLayout->setRowStretch( 3, 5 );
- //pageLayout->addRowSpacing( 6, 10 );
- // xml reader
- QFile xmlfile(xmlFileName);
- if ( xmlfile.exists() ) {
- QXmlInputSource source( &xmlfile );
- QXmlSimpleReader reader;
-
- StructureParser* handler = new StructureParser( this );
- handler->setProductsList(productsView);
- handler->setTargetDir(targetFolder);
- handler->setTempDir(tempFolder);
- reader.setContentHandler( handler );
- reader.parse( source );
- }
- // take into account command line parameters
- if ( !targetDirPath.isEmpty() )
- targetFolder->setText( targetDirPath );
- if ( !tmpDirPath.isEmpty() )
- tempFolder->setText( tmpDirPath );
-
- // set first item to be selected
- if ( productsView->childCount() > 0 ) {
- productsView->setSelected( productsView->firstChild(), true );
- onSelectionChanged();
- }
+ // create installation type button group
+ buttonGrp = new QButtonGroup( typePage );
+ buttonGrp->setFrameShape(QButtonGroup::NoFrame);
+ QGridLayout* buttonGrpLayout = new QGridLayout( buttonGrp );
+ buttonGrpLayout->setMargin( 0 ); buttonGrpLayout->setSpacing( 6 );
+ QSpacerItem* spacer1 = new QSpacerItem( 16, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ QSpacerItem* spacer2 = new QSpacerItem( 16, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ QLabel* selectLab = new QLabel( tr( "Select a type of the installation:" ), buttonGrp );
+ QSpacerItem* spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
+ // ... 'install binaries' layout
+ QGridLayout* binLayout = new QGridLayout( 2, 2, 0 );
+ binBtn = new QRadioButton( tr( "Install binaries" ), buttonGrp );
+ QFont rbFont = binBtn->font();
+ rbFont.setBold( true );
+ binBtn->setFont( rbFont );
+ QSpacerItem* spacer4 = new QSpacerItem( 16, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
+ QLabel* binLab = new QLabel( tr( "- all the binaries and sources of the chosen SALOME modules will be installed.\n"
+ "- all the binaries of the chosen prerequisites will be installed." ),
+ buttonGrp );
+ binLayout->addMultiCellWidget( binBtn, 0, 0, 0, 1 );
+ binLayout->addItem ( spacer4, 1, 0 );
+ binLayout->addWidget ( binLab, 1, 1 );
+ // ... 'install sources' layout
+ QGridLayout* srcLayout = new QGridLayout( 2, 2, 0 );
+ srcBtn = new QRadioButton( tr( "Install sources" ), buttonGrp );
+ srcBtn->setFont( rbFont );
+ QSpacerItem* spacer5 = new QSpacerItem( 16, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
+ QLabel* srcLab = new QLabel( tr( "- all the sources of the chosen modules and prerequisites will be installed without\ncompilation." ),
+ buttonGrp );
+ srcLayout->addMultiCellWidget( srcBtn, 0, 0, 0, 1 );
+ srcLayout->addItem ( spacer5, 1, 0 );
+ srcLayout->addWidget ( srcLab, 1, 1 );
+ // ... 'install sources and make compilation' layout
+ QGridLayout* srcCompileLayout = new QGridLayout( 3, 3, 0 );
+ srcCompileBtn = new QRadioButton( tr( "Install sources and make a compilation" ), buttonGrp );
+ srcCompileBtn->setFont( rbFont );
+ QSpacerItem* spacer6 = new QSpacerItem( 16, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
+ QLabel* srcCompileLab1 = new QLabel( tr( "- all the sources of the chosen modules and prerequisites will be installed and\ncompiled." ),
+ buttonGrp );
+ QLabel* srcCompileLab2 = new QLabel( tr( "Note:" ),
+ buttonGrp );
+ QFont noteFont = srcCompileLab2->font();
+ noteFont.setUnderline( true );
+ srcCompileLab2->setFont( noteFont );
+ srcCompileLab2->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) );
+ srcCompileLab2->setAlignment( Qt::AlignHCenter | Qt::AlignTop );
+ QLabel* srcCompileLab3 = new QLabel( " " +
+ tr( "it is a long time operation and it can take more than 24 hours depending\n on the computer." ),
+ buttonGrp );
+ removeSrcBtn = new QCheckBox( tr( "Remove sources and temporary files after compilation" ), typePage );
+ setAboutInfo( removeSrcBtn, tr( "Check this option if you want to remove sources of the products\nwith all the temporary files after build finishing" ) );
+ removeSrcBtn->setChecked( false );
+ removeSrcBtn->setEnabled( false );
+ rmSrcPrevState = removeSrcBtn->isChecked();
+
+ srcCompileLayout->addMultiCellWidget( srcCompileBtn, 0, 0, 0, 2 );
+ srcCompileLayout->addMultiCell ( spacer6, 1, 2, 0, 0 );
+ srcCompileLayout->addMultiCellWidget( srcCompileLab1, 1, 1, 1, 2 );
+ srcCompileLayout->addWidget ( srcCompileLab2, 2, 1 );
+ srcCompileLayout->addWidget ( srcCompileLab3, 2, 2 );
+ srcCompileLayout->addMultiCellWidget( removeSrcBtn, 3, 3, 1, 2 );
+ // layout widgets in the button group
+ buttonGrpLayout->addItem ( spacer1, 0, 1 );
+ buttonGrpLayout->addMultiCellWidget( selectLab, 1, 1, 0, 1 );
+ buttonGrpLayout->addMultiCell ( spacer3, 2, 4, 0, 0 );
+ buttonGrpLayout->addLayout ( binLayout, 2, 1 );
+ buttonGrpLayout->addLayout ( srcLayout, 3, 1 );
+ buttonGrpLayout->addLayout ( srcCompileLayout, 4, 1 );
+ buttonGrpLayout->addItem ( spacer2, 5, 1 );
+ // layout button group at the page
+ pageLayout->addWidget( buttonGrp, 0, 0 );
+ // connecting signals
+ connect( buttonGrp, SIGNAL( clicked(int) ), this, SLOT ( onButtonGroup(int) ) );