1 // File : SALOME_InstallWizard.cxx
2 // Created : Thu Dec 18 12:01:00 2002
3 // Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
5 // Module : Installation Wizard
6 // Copyright : 2002-2012 CEA
10 #include "SALOME_InstallWizard.hxx"
11 #include "SALOME_ProductsView.hxx"
12 #include "SALOME_ProgressView.hxx"
13 #include "SALOME_XmlHandler.hxx"
14 #include "SALOME_HelpWindow.hxx"
18 #include <qlineedit.h>
19 #include <qpushbutton.h>
20 #include <qlistview.h>
22 #include <qtextedit.h>
23 #include <qtextbrowser.h>
25 #include <qcheckbox.h>
26 #include <qsplitter.h>
28 #include <qfiledialog.h>
29 #include <qapplication.h>
30 #include <qfileinfo.h>
31 #include <qmessagebox.h>
34 #include <qwhatsthis.h>
38 #include <qwaitcondition.h>
40 #include <qstringlist.h>
41 #include <qpopupmenu.h>
43 #include <qradiobutton.h>
44 #include <qbuttongroup.h>
54 #include <sys/utsname.h>
58 #define max( x, y ) ( x ) > ( y ) ? ( x ) : ( y )
61 QString tmpDirName() { return QString( "/INSTALLWORK" ) + QString::number( getpid() ); }
62 #define TEMPDIRNAME tmpDirName()
64 // uncomment next line to redirect all shell output (usually for errors) to /dev/null device
65 // #define USE_DEV_NULL
67 // ================================================================
70 * Helper class to generate shell command
72 // ================================================================
76 Script( const QString& cmd = QString::null, const QString& sep = " " ) : mySeparator( sep )
80 void append( const QString& cmd )
82 if ( !cmd.isEmpty() ) myList.append( cmd );
84 Script& operator<<( const QString& cmd )
89 QString script() const
91 return myList.join( mySeparator );
102 // ================================================================
105 * Class for executing system commands
107 // ================================================================
108 static QMutex myMutex(false);
109 static QWaitCondition myWC;
110 class ProcessThread: public QThread
112 typedef QPtrList<QCheckListItem> ItemList;
114 ProcessThread( SALOME_InstallWizard* iw ) : QThread(), myWizard( iw ) { myItems.setAutoDelete( false ); }
116 void addCommand( QCheckListItem* item, const QString& cmd ) {
117 myItems.append( item );
118 myCommands.push_back( cmd );
121 bool hasCommands() const { return myCommands.count() > 0; }
122 void clearCommands() { myCommands.clear(); myItems.clear(); }
125 while ( hasCommands() ) {
126 ___MESSAGE___( "ProcessThread::run - Processing command : " << myCommands[ 0 ].latin1() );
127 int result = system( myCommands[ 0 ] ) / 256; // return code is <errno> * 256
128 ___MESSAGE___( "ProcessThread::run - Result : " << result );
129 QCheckListItem* item = myItems.first();
130 myCommands.pop_front();
131 myItems.removeFirst();
133 SALOME_InstallWizard::postValidateEvent( myWizard, result, (void*)item );
141 QStringList myCommands;
143 SALOME_InstallWizard* myWizard;
146 // ================================================================
151 // ================================================================
152 class WarnDialog: public QDialog
154 static WarnDialog* myDlg;
157 WarnDialog( QWidget* parent )
158 : QDialog( parent, "WarnDialog", true, WDestructiveClose ) {
159 setCaption( tr( "Information" ) );
161 QLabel* lab = new QLabel( tr( "Please, wait while checking native products configuration ..." ), this );
162 lab->setAlignment( AlignCenter );
163 lab->setFrameStyle( QFrame::Box | QFrame::Plain );
164 QVBoxLayout* l = new QVBoxLayout( this );
167 this->setFixedSize( lab->sizeHint().width() + 50,
168 lab->sizeHint().height() * 5 );
170 void accept() { return; }
171 void reject() { return; }
172 void closeEvent( QCloseEvent* e )
173 { if ( !myCloseFlag ) return;
175 QDialog::closeEvent( e );
177 ~WarnDialog() { myDlg = 0; }
179 static void showWarnDlg( QWidget* parent, bool show ) {
182 myDlg = new WarnDialog( parent );
183 QSize sh = myDlg->size();
184 myDlg->move( parent->x() + (parent->width()-sh.width())/2,
185 parent->y() + (parent->height()-sh.height())/2 );
193 myDlg->myCloseFlag = true;
198 static bool isWarnDlgShown() { return myDlg != 0; }
200 WarnDialog* WarnDialog::myDlg = 0;
202 // ================================================================
205 * Installation progress info window class
207 // ================================================================
208 class InstallInfo : public QTextEdit
211 InstallInfo( QWidget* parent ) : QTextEdit( parent ), finished( false ) {}
212 void setFinished( const bool f ) { finished = f; }
214 QPopupMenu* createPopupMenu( const QPoint& )
216 int para1, col1, para2, col2;
217 getSelection(¶1, &col1, ¶2, &col2);
218 bool allSelected = hasSelectedText() &&
219 para1 == 0 && para2 == paragraphs()-1 && col1 == 0 && col2 == paragraphLength(para2);
220 QPopupMenu* popup = new QPopupMenu( this );
221 int id = popup->insertItem( tr( "&Copy" ) );
222 popup->setItemEnabled( id, hasSelectedText() );
223 popup->connectItem ( id, this, SLOT( copy() ) );
224 id = popup->insertItem( tr( "Select &All" ) );
225 popup->setItemEnabled( id, (bool)text().length() && !allSelected );
226 popup->connectItem ( id, this, SLOT( selectAll() ) );
228 QWidget* p = parentWidget();
229 while ( p && !p->inherits( "SALOME_InstallWizard" ) )
230 p = p->parentWidget();
231 if ( p && p->inherits( "SALOME_InstallWizard" ) ) {
232 popup->insertSeparator();
233 id = popup->insertItem( tr( "&Save Log" ) );
234 popup->setItemEnabled( id, (bool)text().length() );
235 popup->connectItem ( id, (SALOME_InstallWizard*)p, SLOT( saveLog() ) );
244 // ================================================================
246 * getAllProducts [ static ]
247 * Defines list of all products as a string separated by space symbols
249 // ================================================================
250 static QString getAllProducts(MapProducts& theProductsMap)
252 QStringList aModules, aPrereqs;
253 for ( MapProducts::Iterator mapIter = theProductsMap.begin(); mapIter != theProductsMap.end(); ++mapIter ) {
254 QCheckListItem* item = mapIter.key();
255 Dependancies dep = mapIter.data();
256 QString curModule = item->text(0);
257 if ( !aModules.contains( curModule ) && !aPrereqs.contains( curModule ) ) {
258 if ( dep.getType() == "component" ) {
259 aModules.append( curModule );
260 aModules.append( curModule + "_src" );
263 aPrereqs.append( curModule );
264 aPrereqs.append( curModule + "_src" );
268 return QStringList(aPrereqs+aModules).join(" ");
271 // ================================================================
273 * setAboutInfo [ static ]
274 * Sets 'what's this' and 'tooltip' information for the widget
276 // ================================================================
277 static void setAboutInfo( QWidget* widget, const QString& tip )
279 QWhatsThis::add( widget, tip );
280 QToolTip::add ( widget, tip );
283 #define QUOTE(arg) QString("'") + QString(arg) + QString("'")
285 /* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
286 T H E O L D I M P L E M E N T A T I O N
287 static QString DefineDependeces(MapProducts& theProductsMap, QCheckListItem* product ){
288 QStringList aProducts;
289 if ( theProductsMap.contains( product ) ) {
290 Dependancies dep = theProductsMap[ product ];
291 QStringList deps = dep.getDependancies();
292 for (int i = 0; i<(int)deps.count(); i++ ) {
293 aProducts.append( deps[i] );
296 return QString("\"") + aProducts.join(" ") + QString("\"");
298 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
300 // ================================================================
303 * Makes directory recursively, returns false if not succedes
305 // ================================================================
306 static bool makeDir( const QString& theDir, QString& theCreated )
308 if ( theDir.isEmpty() )
310 QString aDir = QDir::cleanDirPath( QFileInfo( theDir ).absFilePath() );
312 while ( start > 0 ) {
313 start = aDir.find( QDir::separator(), start );
315 QFileInfo fi( aDir.left( start ) );
316 if ( !fi.exists() ) {
317 // VSR: Create directory and set permissions to allow other users to remove it
319 script << "mkdir" << QUOTE( fi.absFilePath() );
321 script << ">& /dev/null";
324 script << "chmod 777" << QUOTE( fi.absFilePath() );
326 script << ">& /dev/null";
328 ___MESSAGE___( "script = " << script.script().latin1() );
329 if ( system( script.script().latin1() ) )
331 // VSR: Remember the top of the created directory (to remove it in the end of the installation)
332 if ( theCreated.isNull() )
333 theCreated = fi.absFilePath();
338 if ( !QFileInfo( aDir ).exists() ) {
339 // VSR: Create directory, other users should NOT have possibility to remove it!!!
341 script << "mkdir" << QUOTE( aDir );
343 script << ">& /dev/null";
345 ___MESSAGE___( "script = " << script.script().latin1() );
346 if ( system( script.script().latin1() ) )
348 // VSR: Remember the top of the created directory (to remove it in the end of the installation)
349 if ( theCreated.isNull() )
354 // ================================================================
356 * readFile [ static ]
357 * Reads the file, returns false if can't open it
359 // ================================================================
360 static bool readFile( const QString& fileName, QString& text )
362 if ( QFile::exists( fileName ) ) {
363 QFile file( fileName );
364 if ( file.open( IO_ReadOnly ) ) {
365 QTextStream stream( &file );
367 while ( !stream.eof() ) {
368 line = stream.readLine(); // line of text excluding '\n'
377 // ================================================================
379 * hasSpace [ static ]
380 * Checks if string contains spaces; used to check directory paths
382 // ================================================================
383 static bool hasSpace( const QString& dir )
385 for ( int i = 0; i < (int)dir.length(); i++ ) {
386 if ( dir[ i ].isSpace() )
392 // ================================================================
395 * Creates HTML-wrapped title text
397 // ================================================================
398 static QString makeTitle( const QString& text, const QString& separator = " ", bool fl = true )
400 QStringList words = QStringList::split( separator, text );
402 for ( uint i = 0; i < words.count(); i++ )
403 words[i] = QString( "<font color=red>%1</font>" ).arg( words[i].left(1) ) + words[i].mid(1);
406 if ( words.count() > 0 )
407 words[0] = QString( "<font color=red>%1</font>" ).arg( words[0] );
408 if ( words.count() > 1 )
409 words[words.count()-1] = QString( "<font color=red>%1</font>" ).arg( words[words.count()-1] );
411 QString res = words.join( separator );
412 if ( !res.isEmpty() )
413 res = QString( "<b>%1</b>" ).arg( res );
417 // ================================================================
419 * QMyCheckBox class : custom check box
420 * The only goal is to give access to the protected setState() method
422 // ================================================================
423 class QMyCheckBox: public QCheckBox
426 QMyCheckBox( const QString& text, QWidget* parent, const char* name = 0 ) : QCheckBox ( text, parent, name ) {}
427 void setState ( ToggleState s ) { QCheckBox::setState( s ); }
430 // ================================================================
435 // ================================================================
436 class AboutDlg: public QDialog
439 AboutDlg( SALOME_InstallWizard* parent ) : QDialog( parent, "About dialog box", true )
442 setCaption( QString( "About %1" ).arg( parent->getIWName() ) );
444 QPalette pal = palette();
445 QColorGroup cg = pal.active();
446 cg.setColor( QColorGroup::Foreground, Qt::darkBlue );
447 cg.setColor( QColorGroup::Background, Qt::white );
448 pal.setActive( cg ); pal.setInactive( cg ); pal.setDisabled( cg );
451 QGridLayout* main = new QGridLayout( this, 1, 1, 11, 6 );
453 QLabel* logo = new QLabel( this, "logo" );
454 logo->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
455 logo->setMinimumSize( 32, 32 ); logo->setMaximumSize( 32, 32 );
456 logo->setPaletteBackgroundColor( QColor( 234, 250, 234 ) );
457 logo->setFrameStyle( QLabel::NoFrame | QLabel::Plain );
458 logo->setPixmap( pixmap( pxAbout ) );
459 logo->setScaledContents( false );
460 logo->setAlignment( QLabel::AlignCenter );
462 QLabel* decorLeft = new QLabel( this, "decorLeft" );
463 decorLeft->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ) );
464 decorLeft->setMinimumWidth( 32 ); decorLeft->setMaximumWidth( 32 );
465 decorLeft->setPaletteBackgroundColor( QColor( 234, 250, 234 ) );
466 decorLeft->setScaledContents( false );
467 QLabel* decorTop = new QLabel( this, "decorTop" );
468 decorTop->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
469 decorTop->setMinimumHeight( 32 ); decorTop->setMaximumHeight( 32 );
470 decorTop->setPaletteBackgroundColor( QColor( 234, 250, 234 ) );
471 decorTop->setScaledContents( false );
473 QLabel* title = new QLabel( this, "title" );
474 QString tlt = parent->getIWName();
475 title->setText( makeTitle( tlt ) );
476 QLabel* version = new QLabel( this, "version" );
477 version->setText( QString( "<b>Version</b>: %1.%1.%1" ).arg( __IW_VERSION_MAJOR__ ) \
478 .arg( __IW_VERSION_MINOR__ ) \
479 .arg( __IW_VERSION_PATCH__ ) );
480 QLabel* copyright = new QLabel( this, "copyright" );
481 copyright->setText( "<b>Copyright</b> © 2002-2012 CEA" );
482 QFont font = title->font();
483 font.setPointSize( (int)( font.pointSize() * 1.8 ) );
484 title->setFont( font );
485 QFrame* line = new QFrame( this, "line" );
486 line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
487 QLabel* url = new QLabel( this, "url" );
488 url->setText( makeTitle( "www.salome-platform.org", ".", false ) );
489 url->setAlignment( AlignRight );
490 font = version->font();
491 font.setPointSize( (int)( font.pointSize() / 1.2 ) );
492 version->setFont( font );
493 copyright->setFont( font );
494 url->setFont( font );
496 main->addWidget( logo, 0, 0 );
497 main->addMultiCellWidget( decorLeft, 1, 5, 0, 0 );
498 main->addWidget( decorTop, 0, 1 );
499 main->addWidget( title, 1, 1 );
500 main->addWidget( version, 2, 1 );
501 main->addWidget( copyright, 3, 1 );
502 main->addWidget( line, 4, 1 );
503 main->addWidget( url, 5, 1 );
505 QFontMetrics fm( title->font() );
506 int width = (int)( fm.width( tlt ) * 1.5 );
507 title->setMinimumWidth( width );
508 // setMaximumSize( minimumSize() );
510 void mousePressEvent( QMouseEvent* )
516 // ================================================================
518 * SALOME_InstallWizard::SALOME_InstallWizard
521 // ================================================================
522 SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName,
523 const QString& aTargetDir,
524 const QString& aTmpDir,
525 const bool aForceSrc,
526 const bool aSingleDir)
527 : InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ),
531 exitConfirmed( false ),
534 myIWName = tr( "Installation Wizard" );
535 tmpCreated = QString::null;
536 xmlFileName = aXmlFileName;
537 myTargetPath = aTargetDir;
539 forceSrc = aForceSrc;
540 singleDir = aSingleDir;
543 QDir rootDir( rootDirPath() );
544 binPath = rootDir.filePath( "Products/BINARIES" );
545 srcPath = rootDir.filePath( "Products/SOURCES" );
546 oneProdDirName = "PRODUCTS";
548 commonPlatform = "Debian 3.1";
551 // get XML filename and current platform
553 // ... get current platform
554 curPlatform = currentPlatform().join(" ");
555 //cout << "curOS = " << curPlatform << endl;
557 // ... check XML and platform definition
560 // set application font
562 fnt.setPointSize( 14 );
567 setIcon( pixmap( pxIcon ) );
569 setSizeGripEnabled( true );
572 addLogo( pixmap( pxLogo ) );
575 setVersion( "6.5.0" );
576 setCaption( tr( "SALOME %1" ).arg( myVersion ) );
577 setCopyright( tr( "<h5>Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE<br></h5>"
578 "<h5>Copyright © 2003-2007 OPEN CASCADE,<br>EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D,<br>LEG, PRINCIPIA R&D, BUREAU VERITAS</h5>" ));
579 setLicense( tr( "<h5>GNU LGPL</h5>" ) );
581 ___MESSAGE___( "Configuration file : " << xmlFileName.latin1() );
582 ___MESSAGE___( "Target directory : " << myTargetPath.latin1() );
583 ___MESSAGE___( "Temporary directory: " << myTmpPath.latin1() );
588 StructureParser* parser = new StructureParser( this );
589 parser->readXmlFile(xmlFileName);
591 // create instance of class for starting shell script to get available disk space
592 diskSpaceProc = new QProcess( this, "procDiskSpace" );
593 // create instance of class for starting shell install script
594 shellProcess = new QProcess( this, "shellProcess" );
595 // create instance of class for starting shell script to modify SALOME *.la files
596 modifyLaProc = new QProcess( this, "modifyLaProc" );
597 // create instance of class for starting shell script to check Fortran libraries
598 checkFLibProc = new QProcess( this, "checkFLibProc" );
600 // create introduction page
602 // create page to select installation type
604 // create page to select the reference installation platform (if necessary)
606 // create directories page
608 // create products page
610 // create prestart page
612 // create progress page
614 // create readme page
618 setAboutInfo( backButton(), tr( "Return to the previous step\nof the installation procedure" ) );
619 setAboutInfo( nextButton(), tr( "Move to the next step\nof the installation procedure" ) );
620 setAboutInfo( finishButton(), tr( "Finish the installation and quit the program" ) );
621 setAboutInfo( cancelButton(), tr( "Cancel the installation and quit the program" ) );
622 setAboutInfo( helpButton(), tr( "Show the help information" ) );
624 // common signals connections
625 connect( this, SIGNAL( selected( const QString& ) ),
626 this, SLOT( pageChanged( const QString& ) ) );
627 connect( this, SIGNAL( helpClicked() ), this, SLOT( helpClicked() ) );
628 connect( this, SIGNAL( aboutClicked() ), this, SLOT( onAbout() ) );
630 // catch signals from launched diskSpaceProc
631 connect( diskSpaceProc, SIGNAL( processExited() ), this, SLOT( updateAvailableSpace() ) );
632 // catch signals from launched shellProcess
633 connect(shellProcess, SIGNAL( readyReadStdout() ), this, SLOT( readFromStdout() ) );
634 connect(shellProcess, SIGNAL( readyReadStderr() ), this, SLOT( readFromStderr() ) );
635 connect(shellProcess, SIGNAL( processExited() ), this, SLOT( productInstalled() ) );
636 connect(shellProcess, SIGNAL( wroteToStdin() ), this, SLOT( wroteToStdin() ) );
637 // catch signals from launched modifyLaProc
638 connect(modifyLaProc, SIGNAL( readyReadStdout() ), this, SLOT( readFromStdout() ) );
639 connect(modifyLaProc, SIGNAL( readyReadStderr() ), this, SLOT( readFromStderr() ) );
640 connect(modifyLaProc, SIGNAL( processExited() ), this, SLOT( checkModifyLaResult() ) );
641 // catch signals from launched checkFLibProc
642 connect(checkFLibProc, SIGNAL( processExited() ), this, SLOT( checkFLibResult() ) );
644 // create validation thread
645 myThread = new ProcessThread( this );
648 setAboutIcon( pixmap( pxAbout ) );
649 showAboutBtn( true );
651 // ================================================================
653 * SALOME_InstallWizard::~SALOME_InstallWizard
656 // ================================================================
657 SALOME_InstallWizard::~SALOME_InstallWizard()
659 shellProcess->kill(); // kill it for sure
660 int PID = (int)shellProcess->processIdentifier();
663 script << "kill -9" << QString::number( PID );
665 script << ">& /dev/null";
667 ___MESSAGE___( "script: " << script.script().latin1() );
668 if ( system( script.script().latin1() ) ) {
674 // ================================================================
676 * SALOME_InstallWizard::getBasePlatform
677 * Determine the base platform for binaries installation
679 // ================================================================
680 QString SALOME_InstallWizard::getBasePlatform()
682 QString aBasePlt = "";
683 if ( platformsMap.find( curPlatform ) != platformsMap.end() )
684 aBasePlt = curPlatform;
686 aBasePlt = commonPlatform;
689 // ================================================================
691 * SALOME_InstallWizard::currentPlatform
692 * Tries to determine the current user's operating system
694 // ================================================================
695 QStringList SALOME_InstallWizard::currentPlatform()
698 QString platName, platVersion, platArch;
699 QString osFileName = "/etc/issue";
700 if ( QFile::exists( osFileName ) ) {
701 QFile file( osFileName );
702 if ( file.open( IO_ReadOnly ) ) {
703 QTextStream stream( &file );
704 QStringList lines = QStringList::split( "\n", stream.read() );
706 for ( uint i = 0; i < lines.count(); i++ ) {
707 QString str = lines[i];
708 if ( str.isEmpty() ) continue;
710 QRegExp regvar = QRegExp( "(.*)\\s+[^\\s]*[R|r]elease[^\\s]*\\s+([\\d.]*)" );
711 int pos = regvar.search( str );
713 regvar = QRegExp( "(.*)\\s+[^\\s]*[L|l][I|i][N|n][U|u][X|x][^\\s]*(.*)\\s+([\\d.]*)\\s+" );
714 pos = regvar.search( str );
718 for ( int i = 1; i < regvar.numCaptures(); i++ )
719 name.append( regvar.cap( i ) );
721 // retrieve platform name
722 platName = QStringList::split( " ", name.join( " " ) ).join( " " );
723 platName = platName.replace( "Linux", "" ).replace( "linux", "" ).replace( "LINUX", "" ).stripWhiteSpace();
724 platName = platName.replace( "Welcome to", "" ).stripWhiteSpace();
725 platName = QStringList::split( " ", platName ).join( " " );
726 // retrieve platform version number
727 platVersion = regvar.cap( regvar.numCaptures() );
730 uname( &uname_data );
731 if ( QString( uname_data.machine ) == "x86_64" )
739 if ( !platName.isEmpty() ) vals.append( platName );
740 if ( !platVersion.isEmpty() ) vals.append( platVersion );
741 if ( !platArch.isEmpty() ) vals.append( platArch );
745 // ================================================================
747 * SALOME_InstallWizard::rootDirPath
748 * Get application root dir
750 // ================================================================
751 QString SALOME_InstallWizard::rootDirPath()
753 static QString rootDir;
754 if ( rootDir.isEmpty() ) {
755 QDir appDir( qApp->applicationDirPath() );
757 rootDir = appDir.absPath();
762 // ================================================================
764 * SALOME_InstallWizard::getPlatformBinPath
765 * Get platform binaries path
767 // ================================================================
768 QString SALOME_InstallWizard::getPlatformBinPath( const QString& plt ) const
770 return QDir::cleanDirPath( getBinPath() + "/" + QStringList::split( " ", plt ).join( "_" ) );
773 // ================================================================
775 * SALOME_InstallWizard::getXmlMap
776 * Creates a map of the supported operating systems and
777 * corresponding XML files.
779 // ================================================================
780 MapXmlFiles SALOME_InstallWizard::getXmlMap( const QString& aXmlFileName )
784 if ( !aXmlFileName.isEmpty() )
785 xmlList.append( QFileInfo( aXmlFileName ).absFilePath() );
787 QDir dir( rootDirPath() );
788 QStringList entries = dir.entryList( "*.xml", QDir::Files | QDir::Readable );
789 if ( entries.remove( "config.xml" ) )
790 entries.append( "config.xml" );
791 for ( uint i = 0; i < entries.count(); i++ )
792 xmlList.append( QDir( rootDirPath() ).filePath( entries[i] ) );
796 QDomDocument doc( "xml_doc" );
798 QDomNodeList nodeList;
801 QString platforms = "";
802 QStringList platList;
803 for ( uint i = 0; i < xmlList.count(); i++ ) {
804 file.setName( xmlList[i] );
805 if ( !doc.setContent( &file ) ) {
811 docElem = doc.documentElement();
812 nodeList = docElem.elementsByTagName( "config" );
813 if ( nodeList.count() == 0 )
815 node = nodeList.item( 0 );
816 if ( node.isElement() ) {
817 elem = node.toElement();
818 if ( elem.attribute( "platforms" ) ) {
819 platforms = elem.attribute( "platforms" ).stripWhiteSpace();
820 QStringList platList = QStringList::split( ",", platforms );
821 for ( uint j = 0; j < platList.count(); j++ ) {
822 QString platform = platList[j].stripWhiteSpace();
823 if ( !platform.isEmpty() && xmlMap.find( platform ) == xmlMap.end() )
824 xmlMap[ platList[j] ] = xmlList[i];
831 // ================================================================
833 * SALOME_InstallWizard::checkXmlAndPlatform
834 * Check XML file and current platform definition
836 // ================================================================
837 void SALOME_InstallWizard::getXmlAndPlatform()
840 if ( xmlFileName.isEmpty() ) {
841 xmlMap = getXmlMap();
842 if ( !curPlatform.isEmpty() ) {
843 // try to get XML file for current platform
844 if ( xmlMap.find( curPlatform ) != xmlMap.end() ) {
845 xmlFileName = xmlMap[ curPlatform ];
846 QFileInfo fibp( getPlatformBinPath( curPlatform ) );
847 if ( !fibp.isDir() ) {
848 warnMsg = tr( "Binaries are absent for current platform" );
850 platformsMap = xmlMap;
853 platformsMap = xmlMap;
854 warnMsg = tr( "Your Linux platform is not supported by this SALOME package" );
858 // get all supported platforms
859 platformsMap = xmlMap;
860 warnMsg = tr( "Installation Wizard can't identify target Linux platform" );
864 xmlMap = getXmlMap( xmlFileName );
865 if ( !curPlatform.isEmpty() ) {
866 // check that the user's XML file supports current platform
867 if ( xmlMap.find( curPlatform ) == xmlMap.end() ) {
868 platformsMap = getXmlMap();
869 MapXmlFiles::Iterator it;
870 for ( it = xmlMap.begin(); it != xmlMap.end(); ++it )
871 platformsMap.insert( it.key(), it.data(), true );
872 warnMsg = tr( "The given configuration file doesn't support your Linux platform" );
875 platformsMap = xmlMap;
879 // get all supported platforms
880 platformsMap = getXmlMap();
881 MapXmlFiles::Iterator it;
882 for ( it = xmlMap.begin(); it != xmlMap.end(); ++it )
883 platformsMap.insert( it.key(), it.data(), true );
884 warnMsg = tr( "Installation Wizard can't define your Linux platform" );
888 // ================================================================
890 * SALOME_InstallWizard::eventFilter
891 * Event filter, spies for Help window closing
893 // ================================================================
894 bool SALOME_InstallWizard::eventFilter( QObject* object, QEvent* event )
896 if ( object && object == helpWindow && event->type() == QEvent::Close )
898 return InstallWizard::eventFilter( object, event );
900 // ================================================================
902 * SALOME_InstallWizard::closeEvent
903 * Close event handler
905 // ================================================================
906 void SALOME_InstallWizard::closeEvent( QCloseEvent* ce )
908 if ( WarnDialog::isWarnDlgShown() ) {
912 if ( !exitConfirmed ) {
913 if ( QMessageBox::information( this,
915 tr( "Do you want to quit %1?" ).arg( getIWName() ),
925 exitConfirmed = true;
930 // ================================================================
932 * SALOME_InstallWizard::setupIntroPage
933 * Creates introduction page
935 // ================================================================
936 void SALOME_InstallWizard::setupIntroPage()
939 introPage = new QWidget( this, "IntroPage" );
940 QGridLayout* pageLayout = new QGridLayout( introPage );
941 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
942 // create logo picture
943 logoLab = new QLabel( introPage );
944 logoLab->setPixmap( pixmap( pxBigLogo ) );
945 logoLab->setScaledContents( true );
946 logoLab->setFrameStyle( QLabel::Plain | QLabel::NoFrame );
947 logoLab->setAlignment( AlignCenter );
948 // create version box
949 QVBox* versionBox = new QVBox( introPage ); versionBox->setSpacing( 6 );
950 versionBox->setFrameStyle( QVBox::Panel | QVBox::Sunken );
951 QWidget* stretch1 = new QWidget( versionBox ); versionBox->setStretchFactor( stretch1, 5 );
952 versionLab = new QLabel( QString("%1 %2").arg( tr( "Version" ) ).arg(myVersion), versionBox );
953 versionLab->setAlignment( AlignCenter );
954 copyrightLab = new QLabel( myCopyright, versionBox );
955 copyrightLab->setAlignment( AlignCenter );
956 licenseLab = new QLabel( myLicense, versionBox );
957 licenseLab->setAlignment( AlignCenter );
958 QWidget* stretch2 = new QWidget( versionBox ); versionBox->setStretchFactor( stretch2, 5 );
960 info = new QLabel( introPage );
961 info->setText( tr( "This program will install <b>%1</b>."
962 "<br><br>The wizard will also help you to install all products "
963 "which are necessary for <b>%2</b> and setup "
964 "your environment.<br><br>Click <code>Cancel</code> button to abort "
965 "installation and quit. Click <code>Next</code> button to continue with the "
966 "installation program." ).arg( myCaption ).arg( myCaption ) );
967 info->setFrameStyle( QLabel::WinPanel | QLabel::Sunken );
968 info->setMargin( 6 );
969 info->setAlignment( WordBreak );
970 info->setMinimumWidth( 250 );
971 QPalette pal = info->palette();
972 pal.setColor( QColorGroup::Background, QApplication::palette().active().base() );
973 info->setPalette( pal );
974 info->setLineWidth( 2 );
976 pageLayout->addWidget( logoLab, 0, 0 );
977 pageLayout->addWidget( versionBox, 1, 0 );
978 pageLayout->addMultiCellWidget( info, 0, 1, 1, 1 );
979 pageLayout->setColStretch( 1, 5 );
980 pageLayout->setRowStretch( 1, 5 );
982 addPage( introPage, tr( "Introduction" ) );
984 // ================================================================
986 * SALOME_InstallWizard::setupTypePage
987 * Creates installation types page
989 // ================================================================
990 void SALOME_InstallWizard::setupTypePage()
993 typePage = new QWidget( this, "TypePage" );
994 QGridLayout* pageLayout = new QGridLayout( typePage );
995 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
996 // create installation type button group
997 buttonGrp = new QButtonGroup( typePage );
998 buttonGrp->setFrameShape(QButtonGroup::NoFrame);
999 QGridLayout* buttonGrpLayout = new QGridLayout( buttonGrp );
1000 buttonGrpLayout->setMargin( 0 ); buttonGrpLayout->setSpacing( 6 );
1001 QSpacerItem* spacer1 = new QSpacerItem( 16, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
1002 QSpacerItem* spacer2 = new QSpacerItem( 16, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
1003 QLabel* selectLab = new QLabel( tr( "Select a type of the installation:" ), buttonGrp );
1004 QSpacerItem* spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
1005 // ... 'install binaries' layout
1006 QGridLayout* binLayout = new QGridLayout( 2, 2, 0 );
1007 binBtn = new QRadioButton( tr( "Install binaries" ), buttonGrp );
1008 QFont rbFont = binBtn->font();
1009 rbFont.setBold( true );
1010 binBtn->setFont( rbFont );
1011 QSpacerItem* spacer4 = new QSpacerItem( 16, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
1012 QLabel* binLab = new QLabel( tr( "- all the binaries and sources of the chosen SALOME modules will be installed.\n"
1013 "- all the binaries of the chosen prerequisites will be installed." ),
1015 binLayout->addMultiCellWidget( binBtn, 0, 0, 0, 1 );
1016 binLayout->addItem ( spacer4, 1, 0 );
1017 binLayout->addWidget ( binLab, 1, 1 );
1018 // ... 'install sources' layout
1019 QGridLayout* srcLayout = new QGridLayout( 2, 2, 0 );
1020 srcBtn = new QRadioButton( tr( "Install sources" ), buttonGrp );
1021 srcBtn->setFont( rbFont );
1022 QSpacerItem* spacer5 = new QSpacerItem( 16, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
1023 QLabel* srcLab = new QLabel( tr( "- all the sources of the chosen modules and prerequisites will be installed without\ncompilation." ),
1025 srcLayout->addMultiCellWidget( srcBtn, 0, 0, 0, 1 );
1026 srcLayout->addItem ( spacer5, 1, 0 );
1027 srcLayout->addWidget ( srcLab, 1, 1 );
1028 // ... 'install sources and make compilation' layout
1029 QGridLayout* srcCompileLayout = new QGridLayout( 3, 3, 0 );
1030 srcCompileBtn = new QRadioButton( tr( "Install sources and make a compilation" ), buttonGrp );
1031 srcCompileBtn->setFont( rbFont );
1032 QSpacerItem* spacer6 = new QSpacerItem( 16, 16, QSizePolicy::Fixed, QSizePolicy::Minimum );
1033 QLabel* srcCompileLab1 = new QLabel( tr( "- all the sources of the chosen modules and prerequisites will be installed and\ncompiled." ),
1035 QLabel* srcCompileLab2 = new QLabel( tr( "Note:" ),
1037 QFont noteFont = srcCompileLab2->font();
1038 noteFont.setUnderline( true );
1039 srcCompileLab2->setFont( noteFont );
1040 srcCompileLab2->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) );
1041 srcCompileLab2->setAlignment( Qt::AlignHCenter | Qt::AlignTop );
1042 QLabel* srcCompileLab3 = new QLabel( " " +
1043 tr( "it is a long time operation and it can take more than 24 hours depending\n on the computer." ),
1045 removeSrcBtn = new QCheckBox( tr( "Remove sources and temporary files after compilation" ), typePage );
1046 setAboutInfo( removeSrcBtn, tr( "Check this option if you want to remove sources of the products\nwith all the temporary files after build finishing" ) );
1047 removeSrcBtn->setChecked( false );
1048 removeSrcBtn->setEnabled( false );
1049 rmSrcPrevState = removeSrcBtn->isChecked();
1051 srcCompileLayout->addMultiCellWidget( srcCompileBtn, 0, 0, 0, 2 );
1052 srcCompileLayout->addMultiCell ( spacer6, 1, 2, 0, 0 );
1053 srcCompileLayout->addMultiCellWidget( srcCompileLab1, 1, 1, 1, 2 );
1054 srcCompileLayout->addWidget ( srcCompileLab2, 2, 1 );
1055 srcCompileLayout->addWidget ( srcCompileLab3, 2, 2 );
1056 srcCompileLayout->addMultiCellWidget( removeSrcBtn, 3, 3, 1, 2 );
1057 // layout widgets in the button group
1058 buttonGrpLayout->addItem ( spacer1, 0, 1 );
1059 buttonGrpLayout->addMultiCellWidget( selectLab, 1, 1, 0, 1 );
1060 buttonGrpLayout->addMultiCell ( spacer3, 2, 4, 0, 0 );
1061 buttonGrpLayout->addLayout ( binLayout, 2, 1 );
1062 buttonGrpLayout->addLayout ( srcLayout, 3, 1 );
1063 buttonGrpLayout->addLayout ( srcCompileLayout, 4, 1 );
1064 buttonGrpLayout->addItem ( spacer2, 5, 1 );
1065 // layout button group at the page
1066 pageLayout->addWidget( buttonGrp, 0, 0 );
1067 // connecting signals
1068 connect( buttonGrp, SIGNAL( clicked(int) ), this, SLOT ( onButtonGroup(int) ) );
1070 addPage( typePage, tr( "Installation type" ) );
1072 // ================================================================
1074 * SALOME_InstallWizard::setupPlatformPage
1075 * Creates platforms page, if necessary
1077 // ================================================================
1078 void SALOME_InstallWizard::setupPlatformPage()
1081 platformsPage = new QWidget( this, "PlatformsPage" );
1082 QGridLayout* pageLayout = new QGridLayout( platformsPage );
1083 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
1084 // create warning labels
1085 QLabel* warnLab2 = new QLabel( tr( "WARNING!" ), platformsPage );
1086 warnLab2->setAlignment( Qt::AlignHCenter );
1087 QFont fnt = warnLab2->font();
1088 fnt.setBold( true );
1089 warnLab2->setFont( fnt );
1090 warnLab = new QLabel( warnMsg, platformsPage );
1091 warnLab->setAlignment( Qt::AlignHCenter | Qt::WordBreak );
1092 warnLab3 = new QLabel( tr( "If you want to proceed anyway, please select platform from the following list:" ),
1094 warnLab3->setAlignment( Qt::AlignHCenter | Qt::WordBreak );
1095 // create button group
1096 platBtnGrp = new QButtonGroup( platformsPage );
1097 platBtnGrp->setFrameShape(QButtonGroup::LineEditPanel);
1098 platBtnGrp->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) );
1099 QVBoxLayout* platBtnGrpLayout = new QVBoxLayout( platBtnGrp );
1100 platBtnGrpLayout->setMargin( 11 ); platBtnGrpLayout->setSpacing( 6 );
1101 // create platforms radio-buttons
1103 MapXmlFiles::Iterator it;
1104 for ( it = platformsMap.begin(); it != platformsMap.end(); ++it ) {
1106 QRadioButton* rb = new QRadioButton( plat, platBtnGrp, plat );
1107 platBtnGrpLayout->addWidget( rb );
1110 QSpacerItem* spacer1 = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
1111 QSpacerItem* spacer2 = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
1113 // layout widgets on page
1114 pageLayout->addItem ( spacer1, 0, 0 );
1115 pageLayout->addWidget ( warnLab2, 1, 0 );
1116 pageLayout->addWidget ( warnLab, 2, 0 );
1117 pageLayout->addWidget ( warnLab3, 3, 0 );
1118 pageLayout->addItem ( spacer2, 4, 0 );
1119 pageLayout->addMultiCellWidget( platBtnGrp, 0, 4, 1, 1 );
1121 // connecting signals
1122 connect( platBtnGrp, SIGNAL( clicked(int) ), this, SLOT ( onButtonGroup(int) ) );
1125 addPage( platformsPage, tr( "Installation platform" ) );
1127 // ================================================================
1129 * SALOME_InstallWizard::setupDirPage
1130 * Creates directories page
1132 // ================================================================
1133 void SALOME_InstallWizard::setupDirPage()
1136 dirPage = new QWidget( this, "DirPage" );
1137 QGridLayout* pageLayout = new QGridLayout( dirPage );
1138 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
1139 QSpacerItem* spacer1 = new QSpacerItem( 16, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
1140 QSpacerItem* spacer2 = new QSpacerItem( 16, 50, QSizePolicy::Minimum, QSizePolicy::Expanding );
1142 QGridLayout* targetLayout = new QGridLayout( 2, 2, 0 );
1143 QLabel* targetLab = new QLabel( tr( "Set a target directory to install SALOME platform:" ), dirPage );
1144 targetFolder = new QLineEdit( dirPage );
1145 targetBtn = new QPushButton( tr( "Browse..." ), dirPage );
1146 setAboutInfo( targetBtn, tr( "Click this button to browse\nthe installation directory" ) );
1147 targetLayout->addMultiCellWidget( targetLab, 0, 0, 0, 1 );
1148 targetLayout->addWidget ( targetFolder, 1, 0 );
1149 targetLayout->addWidget ( targetBtn, 1, 1 );
1150 // temporary directory
1151 QGridLayout* tempLayout = new QGridLayout( 2, 2, 0 );
1152 QLabel* tempLab = new QLabel( tr( "Set a directory that should be used for temporary SALOME files:" ), dirPage );
1153 tempFolder = new QLineEdit( dirPage );
1154 tempBtn = new QPushButton( tr( "Browse..." ), dirPage );
1155 setAboutInfo( tempBtn, tr( "Click this button to browse\nthe temporary directory" ) );
1156 tempLayout->addMultiCellWidget( tempLab, 0, 0, 0, 1 );
1157 tempLayout->addWidget ( tempFolder, 1, 0 );
1158 tempLayout->addWidget ( tempBtn, 1, 1 );
1159 // AKL: 13/08/07 - disable temporary directory setting in GUI ==>
1163 // AKL: 13/08/07 - disable temporary directory setting in GUI <==
1165 pageLayout->addItem ( spacer1, 0, 0 );
1166 pageLayout->addLayout( targetLayout, 1, 0 );
1167 pageLayout->addLayout( tempLayout, 2, 0 );
1168 pageLayout->addItem ( spacer2, 3, 0 );
1169 // connecting signals
1170 connect( targetFolder, SIGNAL( textChanged( const QString& ) ),
1171 this, SLOT( directoryChanged( const QString& ) ) );
1172 connect( targetBtn, SIGNAL( clicked() ),
1173 this, SLOT( browseDirectory() ) );
1174 connect( tempFolder, SIGNAL( textChanged( const QString& ) ),
1175 this, SLOT( directoryChanged( const QString& ) ) );
1176 connect( tempBtn, SIGNAL( clicked() ), this, SLOT( browseDirectory() ) );
1179 addPage( dirPage, tr( "Installation directory" ) );
1181 // ================================================================
1183 * SALOME_InstallWizard::setupProductsPage
1184 * Creates products page
1186 // ================================================================
1187 void SALOME_InstallWizard::setupProductsPage()
1190 productsPage = new QWidget( this, "ProductsPage" );
1191 QGridLayout* pageLayout = new QGridLayout( productsPage );
1192 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
1194 // create left column widgets
1196 QVBoxLayout* leftBoxLayout = new QVBoxLayout;
1197 leftBoxLayout->setMargin( 0 ); leftBoxLayout->setSpacing( 6 );
1199 modulesView = new ProductsView( productsPage, "modulesView" );
1200 setAboutInfo( modulesView, tr( "The modules available for the installation" ) );
1201 modulesView->setColumnAlignment( 1, Qt::AlignRight );
1202 leftBoxLayout->addWidget( modulesView );
1203 // ... 'Installation with GUI' checkbox
1204 installGuiBtn = new QMyCheckBox( tr( "Installation with GUI" ), productsPage );
1205 setAboutInfo( installGuiBtn, tr( "Check this option if you want\nto install SALOME with GUI" ) );
1206 leftBoxLayout->addWidget( installGuiBtn );
1207 // ... prerequisites list
1208 prereqsView = new ProductsView( productsPage, "prereqsView" );
1209 prereqsView->renameColumn( 0, "Prerequisite" );
1210 setAboutInfo( prereqsView, tr( "The prerequisites that can be installed" ) );
1211 prereqsView->setColumnAlignment( 1, Qt::AlignRight );
1212 leftBoxLayout->addWidget( prereqsView );
1213 // ... 'Show/Hide prerequisites' button
1214 moreBtn = new QPushButton( tr( "Show prerequisites..." ), productsPage );
1215 setAboutInfo( moreBtn, tr( "Click to show list of prerequisites" ) );
1216 leftBoxLayout->addWidget( moreBtn );
1218 // create right column widgets
1221 productInfo = new QTextBrowser( productsPage );
1222 productInfo->setFrameShape( QFrame::LineEditPanel );
1223 productInfo->setPaletteBackgroundColor( productsPage->paletteBackgroundColor() );
1224 setAboutInfo( productInfo, tr( "Short information about the product being selected" ) );
1225 // ... disk space labels
1226 QLabel* reqLab1 = new QLabel( tr( "Disk space required:" ), productsPage );
1227 setAboutInfo( reqLab1, tr( "Total disk space required for the installation\nof the selected products" ) );
1228 requiredSize = new QLabel( productsPage );
1229 setAboutInfo( requiredSize, tr( "Total disk space required for the installation\nof the selected products" ) );
1230 requiredSize->setAlignment( Qt::AlignRight );
1231 QLabel* reqLab2 = new QLabel( tr( "Space for temporary files:" ), productsPage );
1232 setAboutInfo( reqLab2, tr( "Disk space required for the temporary files" ) );
1233 requiredTemp = new QLabel( productsPage );
1234 setAboutInfo( requiredTemp, tr( "Disk space required for the temporary files" ) );
1235 requiredTemp->setAlignment( Qt::AlignRight );
1236 QLabel* reqLab3 = new QLabel( tr( "Available disk space:" ), productsPage );
1237 setAboutInfo( reqLab3, tr( "Disk space available on the selected device" ) );
1238 availableSize = new QLabel( productsPage );
1239 setAboutInfo( availableSize, tr( "Disk space available on the selected device" ) );
1240 availableSize->setAlignment( Qt::AlignRight );
1241 // layout size widgets
1242 QGridLayout* sizeLayout = new QGridLayout; sizeLayout->setMargin( 0 ); sizeLayout->setSpacing( 6 );
1243 sizeLayout->addWidget( reqLab1, 0, 0 );
1244 sizeLayout->addWidget( requiredSize, 0, 1 );
1245 sizeLayout->addWidget( reqLab2, 1, 0 );
1246 sizeLayout->addWidget( requiredTemp, 1, 1 );
1247 sizeLayout->addWidget( reqLab3, 2, 0 );
1248 sizeLayout->addWidget( availableSize, 2, 1 );
1249 // ... 'single installation directory' check-boxes
1250 oneModDirBtn = new QMyCheckBox( tr( "Install modules to a single directory" ), productsPage );
1251 setAboutInfo( oneModDirBtn, tr( "Check this box if you want to install binaries of\nthe selected SALOME modules into a single directory" ) );
1252 oneProdDirBtn = new QMyCheckBox( tr( "Install prerequisites to a single directory" ), productsPage );
1253 setAboutInfo( oneProdDirBtn, tr( "Check this box if you want to install binaries of\nthe selected prerequisites into a single directory" ) );
1254 oneProdDirBtn->hide(); // temporarily! waiting for correct prerequisites availability
1255 QFrame* split_line = new QFrame( productsPage, "split_line" );
1256 split_line->setFrameStyle( QFrame::HLine | QFrame::Sunken );
1258 // layout common widgets
1259 pageLayout->addMultiCellLayout( leftBoxLayout, 0, 4, 0, 0 );
1260 pageLayout->addWidget ( productInfo, 0, 1 );
1261 pageLayout->addLayout ( sizeLayout, 1, 1 );
1262 pageLayout->addWidget ( split_line, 2, 1 );
1263 pageLayout->addWidget ( oneModDirBtn, 3, 1 );
1264 pageLayout->addWidget ( oneProdDirBtn, 4, 1 );
1267 addPage( productsPage, tr( "Choice of the products to be installed" ) );
1269 // connecting signals
1270 connect( modulesView, SIGNAL( selectionChanged() ),
1271 this, SLOT( onSelectionChanged() ) );
1272 connect( prereqsView, SIGNAL( selectionChanged() ),
1273 this, SLOT( onSelectionChanged() ) );
1274 connect( modulesView, SIGNAL( clicked ( QListViewItem * item ) ),
1275 this, SLOT( onSelectionChanged() ) );
1276 connect( prereqsView, SIGNAL( clicked ( QListViewItem * item ) ),
1277 this, SLOT( onSelectionChanged() ) );
1278 connect( modulesView, SIGNAL( itemToggled( QCheckListItem* ) ),
1279 this, SLOT( onItemToggled( QCheckListItem* ) ) );
1280 connect( prereqsView, SIGNAL( itemToggled( QCheckListItem* ) ),
1281 this, SLOT( onItemToggled( QCheckListItem* ) ) );
1282 connect( installGuiBtn, SIGNAL( toggled( bool ) ),
1283 this, SLOT( onInstallGuiBtn() ) );
1284 connect( moreBtn, SIGNAL( clicked() ), this, SLOT( onMoreBtn() ) );
1285 // start on default - non-advanced mode
1286 prereqsView->hide();
1288 // ================================================================
1290 * SALOME_InstallWizard::setupCheckPage
1291 * Creates prestart page
1293 // ================================================================
1294 void SALOME_InstallWizard::setupCheckPage()
1297 prestartPage = new QWidget( this, "PrestartPage" );
1298 QVBoxLayout* pageLayout = new QVBoxLayout( prestartPage );
1299 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
1301 choices = new QTextEdit( prestartPage );
1302 choices->setReadOnly( true );
1303 choices->setTextFormat( RichText );
1304 choices->setUndoRedoEnabled ( false );
1305 setAboutInfo( choices, tr( "Information about the installation choice you have made" ) );
1306 choices->setPaletteBackgroundColor( prestartPage->paletteBackgroundColor() );
1307 choices->setMinimumHeight( 10 );
1309 pageLayout->addWidget( choices );
1310 pageLayout->setStretchFactor( choices, 5 );
1312 addPage( prestartPage, tr( "Check your choice" ) );
1314 // ================================================================
1316 * SALOME_InstallWizard::setupProgressPage
1317 * Creates progress page
1319 // ================================================================
1320 void SALOME_InstallWizard::setupProgressPage()
1323 progressPage = new QWidget( this, "progressPage" );
1324 QGridLayout* pageLayout = new QGridLayout( progressPage );
1325 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
1327 splitter = new QSplitter( Vertical, progressPage );
1328 splitter->setOpaqueResize( true );
1329 // the parent for the widgets
1330 QWidget* widget = new QWidget( splitter );
1331 QGridLayout* layout = new QGridLayout( widget );
1332 layout->setMargin( 0 ); layout->setSpacing( 6 );
1333 // installation progress view box
1334 installInfo = new InstallInfo( widget );
1335 installInfo->setReadOnly( true );
1336 installInfo->setTextFormat( RichText );
1337 installInfo->setUndoRedoEnabled ( false );
1338 installInfo->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
1339 installInfo->setMinimumSize( 100, 10 );
1340 setAboutInfo( installInfo, tr( "Installation process output" ) );
1341 // parameters for the script
1342 parametersLab = new QLabel( tr( "Enter your answer here:" ), widget );
1343 passedParams = new QLineEdit ( widget );
1344 setAboutInfo( passedParams, tr( "Use this field to enter the answer\nfor the running script when it is necessary") );
1345 // VSR: 10/11/05 - disable answer mode ==>
1346 parametersLab->hide();
1347 passedParams->hide();
1348 // VSR: 10/11/05 - disable answer mode <==
1350 layout->addWidget( installInfo, 0, 0 );
1351 layout->addWidget( parametersLab, 1, 0 );
1352 layout->addWidget( passedParams, 2, 0 );
1353 layout->addRowSpacing( 3, 6 );
1354 // the parent for the widgets
1355 widget = new QWidget( splitter );
1356 layout = new QGridLayout( widget );
1357 layout->setMargin( 0 ); layout->setSpacing( 6 );
1358 // installation results view box
1359 QLabel* resultLab = new QLabel( tr( "Installation Status:" ), widget );
1360 progressView = new ProgressView( widget );
1361 progressView->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
1362 progressView->setMinimumSize( 100, 10 );
1363 // possibility to ignore all errors
1364 ignoreErrCBox = new QCheckBox( tr( "Ignore errors" ), widget );
1365 setAboutInfo( ignoreErrCBox, tr( "Check this option if you want to proceed installation \nprocess even there will be some errors" ) );
1366 ignoreErrCBox->setChecked( false );
1367 // product installation status bar
1368 statusLab = new QLabel( widget );
1369 statusLab->setFrameShape( QButtonGroup::LineEditPanel );
1370 setAboutInfo( progressView, tr( "Installation status on the selected products" ) );
1372 layout->addRowSpacing( 0, 6 );
1373 layout->addWidget( resultLab, 1, 0 );
1374 layout->addWidget( progressView, 2, 0 );
1375 layout->addWidget( ignoreErrCBox, 3, 0 );
1376 layout->addWidget( statusLab, 4, 0 );
1378 pageLayout->addWidget( splitter, 0, 0 );
1380 addPage( progressPage, tr( "Installation progress" ) );
1382 connect( passedParams, SIGNAL( returnPressed() ), this, SLOT( onReturnPressed() ) ) ;
1384 // ================================================================
1386 * SALOME_InstallWizard::setupReadmePage
1387 * Creates readme page
1389 // ================================================================
1390 void SALOME_InstallWizard::setupReadmePage()
1393 readmePage = new QWidget( this, "readmePage" );
1394 QVBoxLayout* pageLayout = new QVBoxLayout( readmePage );
1395 pageLayout->setMargin( 0 ); pageLayout->setSpacing( 6 );
1396 // README info text box
1397 readme = new QTextEdit( readmePage );
1398 readme->setReadOnly( true );
1399 readme->setTextFormat( PlainText );
1400 readme->setFont( QFont( "Fixed", 12 ) );
1401 readme->setUndoRedoEnabled ( false );
1402 setAboutInfo( readme, tr( "README information" ) );
1403 readme->setPaletteBackgroundColor( readmePage->paletteBackgroundColor() );
1404 readme->setMinimumHeight( 10 );
1406 pageLayout->addWidget( readme );
1407 pageLayout->setStretchFactor( readme, 5 );
1409 // Operation buttons
1410 QHBoxLayout* hLayout = new QHBoxLayout( -1, "finishButtons" );
1411 hLayout->setMargin( 0 ); hLayout->setSpacing( 6 );
1412 hLayout->addStretch();
1413 pageLayout->addLayout( hLayout );
1415 // loading README file
1416 QString readmeFile = QDir( rootDirPath() ).filePath( "README" );
1418 if ( readFile( readmeFile, text ) )
1419 readme->setText( text );
1421 readme->setText( tr( "README file has not been found" ) );
1424 addPage( readmePage, tr( "Finish installation" ) );
1426 // ================================================================
1428 * SALOME_InstallWizard::showChoiceInfo
1429 * Displays choice info
1431 // ================================================================
1432 void SALOME_InstallWizard::showChoiceInfo()
1436 long totSize, tempSize;
1437 checkSize( &totSize, &tempSize );
1441 text += tr( "Current Linux platform" )+ ": <b>" + (!curPlatform.isEmpty() ? curPlatform : QString( "Unknown" )) + "</b><br>";
1442 if ( !refPlatform.isEmpty() )
1443 text += tr( "Reference Linux platform" ) + ": <b>" + refPlatform + "</b><br>";
1446 text += tr( "Target directory:" ) + " <b>" + QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) + "</b><br>";
1447 text += tr( "Temporary directory:" ) + " <b>" + QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + "</b><br>";
1450 text += tr( "SALOME modules to be installed" ) + ":<ul>";
1451 QCheckListItem* item = (QCheckListItem*)( modulesView->firstChild() );
1453 if ( productsMap.contains( item ) ) {
1454 if ( item->isOn() ) {
1455 text += "<li><b>" + item->text() + "</b><br>";
1459 item = (QCheckListItem*)( item->nextSibling() );
1461 if ( nbProd == 0 ) {
1462 text += "<li><b>" + tr( "none" ) + "</b><br>";
1466 text += tr( "Prerequisites to be installed" ) + ":<ul>";
1467 item = (QCheckListItem*)( prereqsView->firstChild() );
1469 if ( productsMap.contains( item ) ) {
1470 if ( item->isOn() ) {
1471 text += "<li><b>" + item->text() + " " + productsMap[ item ].getVersion() + "</b><br>";
1475 item = (QCheckListItem*)( item->nextSibling() );
1477 if ( nbProd == 0 ) {
1478 text += "<li><b>" + tr( "none" ) + "</b><br>";
1481 text += tr( "Total disk space required:" ) + " <b>" + QString::number( totSize ) + " KB</b><br>" ;
1482 text += tr( "Space for temporary files required:" ) + " <b>" + QString::number( tempSize ) + " KB</b><br>" ;
1483 choices->setText( text );
1485 // ================================================================
1487 * SALOME_InstallWizard::acceptData
1488 * Validates page when <Next> button is clicked
1490 // ================================================================
1491 bool SALOME_InstallWizard::acceptData( const QString& pageTitle )
1494 QWidget* aPage = InstallWizard::page( pageTitle );
1495 if ( aPage == typePage ) {
1496 // installation type page
1498 this->setAppropriate( platformsPage, false );
1499 if ( installType == Binaries ) { // 'Binary' installation type
1500 // check binaries directory
1501 QFileInfo fib( QDir::cleanDirPath( getBinPath() ) );
1502 if ( !fib.isDir() ) {
1503 QMessageBox::warning( this,
1505 tr( "The directory %1 doesn't exist.\n"
1506 "This directory must contains another one directory with binary archives for current platform.").arg( fib.absFilePath() ),
1508 QMessageBox::NoButton,
1509 QMessageBox::NoButton );
1512 if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
1513 // Unknown platform case
1514 QString aMsg = warnMsg + tr( ".\nBy default the universal binary package will be installed." );
1515 aMsg += tr( "\nIf you want to select another one, please use the following list:" );
1516 warnLab->setText( aMsg );
1518 this->setAppropriate( platformsPage, true );
1521 // Supported platform case
1522 QFileInfo fibp( getPlatformBinPath( curPlatform ) );
1523 if ( !fibp.isDir() ) {
1524 warnLab->setText( tr( "Binaries are absent for current platform." ) );
1525 this->setAppropriate( platformsPage, true );
1529 // check sources directory
1530 QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
1532 if ( QMessageBox::warning( this,
1534 tr( "The directory %1 doesn't exist.\n"
1535 "This directory must contains sources archives.\n"
1536 "Continue?" ).arg( fis.absFilePath() ),
1539 QString::null, 1, 1 ) == 1 )
1542 else { // 'Source' or 'Compile' installation type
1543 // check sources directory
1544 QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
1545 if ( !fis.isDir() ) {
1546 QMessageBox::warning( this,
1548 tr( "The directory %1 doesn't exist.\n"
1549 "This directory must contains sources archives.\n" ).arg( fis.absFilePath() ),
1551 QMessageBox::NoButton,
1552 QMessageBox::NoButton );
1555 else if ( !QDir( fis.filePath(), "*.tar.gz" ).count() ) {
1556 QMessageBox::warning( this,
1558 tr( "The directory %1 doesn't contain source archives.\n" ).arg( fis.absFilePath() ),
1560 QMessageBox::NoButton,
1561 QMessageBox::NoButton );
1564 if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
1565 QString aMsg = warnMsg + ".";
1566 if ( installType == Compile )
1567 aMsg = warnMsg + tr( " and compilation is not tested on this one." );
1568 warnLab->setText( aMsg );
1569 this->setAppropriate( platformsPage, true );
1574 else if ( aPage == platformsPage ) {
1575 // installation platform page
1576 if ( platBtnGrp->id( platBtnGrp->selected() ) == -1 ) {
1577 QMessageBox::warning( this,
1579 tr( "Select installation platform before" ),
1581 QMessageBox::NoButton,
1582 QMessageBox::NoButton );
1585 else if ( installType == Binaries ) {
1586 QString aPlatform = platBtnGrp->selected()->name();
1587 QFileInfo fib( getPlatformBinPath( aPlatform ) );
1588 if ( !fib.isDir() ) {
1589 QMessageBox::warning( this,
1591 tr( "The directory %1 doesn't exist.\n"
1592 "This directory must contains binary archives.\n" ).arg( fib.absFilePath() ),
1594 QMessageBox::NoButton,
1595 QMessageBox::NoButton );
1598 else if ( QDir( fib.filePath(), "*.tar.gz" ).count() == 0 ) {
1599 QMessageBox::warning( this,
1601 tr( "The directory %1 doesn't contain binary archives.\n" ).arg( fib.absFilePath() ),
1603 QMessageBox::NoButton,
1604 QMessageBox::NoButton );
1610 else if ( aPage == dirPage ) {
1611 // installation directory page
1612 // ########## check target and temp directories (existence and available disk space)
1614 QString targetDir = QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() );
1615 QString tempDir = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() );
1616 // check target directory
1617 if ( targetDir.isEmpty() ) {
1618 QMessageBox::warning( this,
1620 tr( "Please, enter valid target directory path" ),
1622 QMessageBox::NoButton,
1623 QMessageBox::NoButton );
1626 QFileInfo fi( QDir::cleanDirPath( targetDir ) );
1627 if ( !fi.isDir() ) {
1629 QMessageBox::warning( this,
1631 tr( "The directory %1 doesn't exist.\n"
1632 "Create directory?" ).arg( fi.absFilePath() ),
1635 QMessageBox::NoButton ) == QMessageBox::Yes;
1638 if ( !makeDir( fi.absFilePath(), tmpstr ) ) {
1639 QMessageBox::critical( this,
1641 tr( "Can't create the directory\n%1").arg( fi.absFilePath() ),
1643 QMessageBox::NoButton,
1644 QMessageBox::NoButton );
1648 if ( !fi.isDir() ) {
1649 QMessageBox::warning( this,
1651 tr( "%1 is not a directory.\n"
1652 "Please, enter valid target directory path" ).arg( fi.absFilePath() ),
1654 QMessageBox::NoButton,
1655 QMessageBox::NoButton );
1658 if ( !fi.isWritable() ) {
1659 QMessageBox::warning( this,
1661 tr( "The directory %1 is not writable.\n"
1662 "Please, enter valid target directory path or change permissions" ).arg( fi.absFilePath() ),
1664 QMessageBox::NoButton,
1665 QMessageBox::NoButton );
1668 if ( hasSpace( fi.absFilePath() ) &&
1669 QMessageBox::warning( this,
1671 tr( "The target directory contains space symbols.\n"
1672 "This may cause problems with compiling or installing of products.\n\n"
1673 "Do you want to continue?"),
1676 QMessageBox::NoButton ) == QMessageBox::No ) {
1679 // check temp directory
1680 if ( tempDir.isEmpty() ) {
1681 QMessageBox::warning( this,
1683 tr( "Please, enter valid temporary directory path" ),
1685 QMessageBox::NoButton,
1686 QMessageBox::NoButton );
1689 QFileInfo fit( QDir::cleanDirPath( tempDir ) );
1690 if ( !makeDir( fit.absFilePath() + TEMPDIRNAME, tmpCreated ) ) {
1691 QMessageBox::critical( this,
1693 tr( "Can't use temporary directory.\nCheck permissions for the %1 directory.").arg( fit.absFilePath() ),
1695 QMessageBox::NoButton,
1696 QMessageBox::NoButton );
1701 else if ( aPage == productsPage ) {
1703 // ########## check if any products are selected to be installed
1704 long totSize, tempSize;
1705 bool anySelected = checkSize( &totSize, &tempSize );
1706 if ( installType == Compile && removeSrcBtn->isOn() ) {
1707 totSize += tempSize;
1709 if ( !anySelected ) {
1710 QMessageBox::warning( this,
1712 tr( "Select one or more products to install" ),
1714 QMessageBox::NoButton,
1715 QMessageBox::NoButton );
1718 // run script that checks available disk space for installing of products // returns 1 in case of error
1719 QDir rd( rootDirPath() );
1720 QFileInfo fi( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) );
1722 script << QUOTE( rd.filePath( "config_files/checkSize.sh" ) );
1723 script << QUOTE( fi.absFilePath() ) << QString::number( totSize );
1724 ___MESSAGE___( "script = " << script.script().latin1() );
1725 if ( system( script.script().latin1() ) ) {
1726 QMessageBox::critical( this,
1727 tr( "Out of space" ),
1728 tr( "There is no available disk space for installing of selected products" ),
1730 QMessageBox::NoButton,
1731 QMessageBox::NoButton );
1734 // AKL: 13/08/07 - skip tmp disk space checking (all files are unpacked into installation directory) ==>
1736 // run script that check available disk space for temporary files
1737 // returns 1 in case of error
1738 QFileInfo fit( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) );
1740 tscript << QUOTE( rd.filePath( "config_files/checkSize.sh" ) );
1741 tscript << QUOTE( fit.absFilePath() ) << QString::number( tempSize );
1742 ___MESSAGE___( "script = " << tscript.script().latin1() );
1743 if ( system( tscript.script().latin1() ) ) {
1744 QMessageBox::critical( this,
1745 tr( "Out of space" ),
1746 tr( "There is no available disk space for the temporary files" ),
1748 QMessageBox::NoButton,
1749 QMessageBox::NoButton );
1753 // AKL: 13/08/07 - skip tmp disk space checking (all files are unpacked into installation directory) <==
1755 // ########## check installation scripts
1756 QCheckListItem* item;
1757 ProductsView* prodsView = modulesView;
1758 for ( int i = 0; i < 2; i++ ) {
1759 item = (QCheckListItem*)( prodsView->firstChild() );
1761 if ( productsMap.contains( item ) && item->isOn() ) {
1762 // check installation script definition
1763 if ( item->text(2).isEmpty() || item->text(2).isNull() ) {
1764 QMessageBox::warning( this,
1766 tr( "The installation script for %1 is not defined.").arg(item->text(0)),
1768 QMessageBox::NoButton,
1769 QMessageBox::NoButton );
1770 if ( !moreMode ) onMoreBtn();
1771 QListView* listView = item->listView();
1772 listView->setCurrentItem( item );
1773 listView->setSelected( item, true );
1774 listView->ensureItemVisible( item );
1777 // check installation script existence
1779 QDir rd( rootDirPath() );
1780 QFileInfo fi( rd.filePath( QString( "config_files/%1" ).arg( item->text(2) ) ) );
1781 if ( !fi.exists() || !fi.isExecutable() ) {
1782 QMessageBox::warning( this,
1784 tr( "The script %1 required for %2 doesn't exist or doesn't have execute permissions.").arg(fi.filePath()).arg(item->text(0)),
1786 QMessageBox::NoButton,
1787 QMessageBox::NoButton );
1788 if ( !moreMode ) onMoreBtn();
1789 QListView* listView = item->listView();
1790 listView->setCurrentItem( item );
1791 listView->setSelected( item, true );
1792 listView->ensureItemVisible( item );
1796 // check installation scripts dependencies
1797 QStringList dependOn = productsMap[ item ].getDependancies();
1798 QString version = productsMap[ item ].getVersion();
1799 for ( int i = 0; i < (int)dependOn.count(); i++ ) {
1800 QCheckListItem* depitem = findItem( dependOn[ i ] );
1802 QMessageBox::warning( this,
1804 tr( "%1 is required for %2 %3 installation.\n"
1805 "This product is missing in the configuration file %4.").arg(dependOn[ i ]).arg(item->text(0)).arg(version).arg(xmlFileName),
1807 QMessageBox::NoButton,
1808 QMessageBox::NoButton );
1813 item = (QCheckListItem*)( item->nextSibling() );
1815 prodsView = prereqsView;
1817 // return true; // return in order to avoid default postValidateEvent() action
1819 return InstallWizard::acceptData( pageTitle );
1821 // ================================================================
1823 * SALOME_InstallWizard::checkSize
1824 * Calculates disk space required for the installation
1826 // ================================================================
1827 bool SALOME_InstallWizard::checkSize( long* totSize, long* tempSize )
1829 long tots = 0, temps = 0;
1833 MapProducts::Iterator mapIter;
1834 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
1835 QCheckListItem* item = mapIter.key();
1836 Dependancies dep = mapIter.data();
1837 if ( !item->isOn() )
1839 tots += ( QStringList::split( " ", item->text(1) )[0] ).toLong();
1840 maxSrcTmp = max( maxSrcTmp, dep.getSize( Compile ) - dep.getSize( Binaries ) );
1841 temps += dep.getTempSize( installType );
1846 if ( installType == Compile && removeSrcBtn->isOn() )
1851 return ( nbSelected > 0 );
1853 // ================================================================
1855 * SALOME_InstallWizard::updateAvailableSpace
1856 * Slot to update 'Available disk space' field
1858 // ================================================================
1859 void SALOME_InstallWizard::updateAvailableSpace()
1861 if ( diskSpaceProc->normalExit() )
1862 availableSize->setText( diskSpaceProc->readLineStdout() + " KB");
1864 // ================================================================
1866 * SALOME_InstallWizard::runModifyLaFiles
1867 * Run the modification of SALOME *.la files
1869 // ================================================================
1870 void SALOME_InstallWizard::runModifyLaFiles()
1872 modifyLaProc->clearArguments();
1873 // ... update status label
1874 statusLab->setText( tr( "Modification of *.la files of SALOME modules..." ) );
1875 // set process arguments
1876 modifyLaProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
1877 modifyLaProc->addArgument( "modifyLaFiles.sh" );
1878 modifyLaProc->addArgument( "modify_la_files" );
1879 modifyLaProc->addArgument( QDir::cleanDirPath( QFileInfo( targetFolder->text().stripWhiteSpace() ).absFilePath() ) );
1881 if ( !modifyLaProc->start() )
1882 ___MESSAGE___( "Error: process could not start!" );
1884 // ================================================================
1886 * SALOME_InstallWizard::checkModifyLaResult
1887 * Slot to take result of modification SALOME *.la files
1889 // ================================================================
1890 void SALOME_InstallWizard::checkModifyLaResult()
1892 if ( modifyLaProc->normalExit() && modifyLaProc->exitStatus() == 1 )
1895 // abort of the current installation
1897 statusLab->setText( tr( "Installation has been aborted" ) );
1898 QMessageBox::critical( this,
1900 tr( "Modification of *.la SALOME files has not been completed."),
1902 QMessageBox::NoButton,
1903 QMessageBox::NoButton );
1904 // enable <Next> button
1905 setNextEnabled( true );
1906 doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
1907 connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
1908 // enable <Back> button
1909 setBackEnabled( true );
1912 // ================================================================
1914 * SALOME_InstallWizard::runCheckFLib
1915 * Run the Fortran and other required libraries checking
1917 // ================================================================
1918 void SALOME_InstallWizard::runCheckFLib()
1920 // Check Fortran libraries
1921 checkFLibProc->clearArguments();
1922 // ... update status label
1923 statusLab->setText( tr( "Check Fortran and other required libraries..." ) );
1924 // ... search "not found" libraries
1925 checkFLibProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
1926 checkFLibProc->addArgument( "checkFortran.sh" );
1927 checkFLibProc->addArgument( "find_libraries" );
1928 checkFLibProc->addArgument( QDir::cleanDirPath( QFileInfo( targetFolder->text().stripWhiteSpace() ).absFilePath() ) );
1930 if ( !checkFLibProc->start() )
1931 ___MESSAGE___( "Error: process could not start!" );
1933 // ================================================================
1935 * SALOME_InstallWizard::checkFLibResult
1936 * Slot to take result of Fortran and other required libraries checking
1938 // ================================================================
1939 void SALOME_InstallWizard::checkFLibResult()
1941 if ( checkFLibProc->normalExit() && checkFLibProc->exitStatus() == 1 ) {
1942 QStringList notFoundLibsList, notFoundOptLibsList;
1943 QString record = "";
1944 QStringList prefOptLibs = getOptionalLibs();
1945 // create list of strings with all 'not found' libraries
1946 while ( checkFLibProc->canReadLineStdout() ) {
1947 record = checkFLibProc->readLineStdout().stripWhiteSpace();
1948 if ( !record.isEmpty() ) {
1949 record = QStringList::split( " ", record )[0];
1950 if ( !notFoundLibsList.contains( record ) &&
1951 !notFoundOptLibsList.contains( record ) ) {
1952 bool isOptional = false;
1953 QStringList::Iterator it_opt;
1954 for ( it_opt = prefOptLibs.begin(); it_opt != prefOptLibs.end(); ++it_opt )
1955 if ( record.startsWith( (*it_opt).stripWhiteSpace(), false ) ) {
1959 isOptional ? notFoundOptLibsList.append( record ) \
1960 : notFoundLibsList.append( record );
1964 QString msg = tr( "Some libraries are absent!<br><br>" );
1965 if ( !notFoundLibsList.isEmpty() ) {
1966 msg += tr( "One or several <b>mandatory</b> libraries listed below are not found. SALOME <u>may not work</u> properly.<br>" );
1967 msg += notFoundLibsList.join( "<br>" );
1970 if ( !notFoundOptLibsList.isEmpty() ) {
1971 msg += tr( "One or several <b>optional</b> libraries listed below are not found. This <u>does not affect</u> on the correct work of SALOME platform.<br>" );
1972 msg += notFoundOptLibsList.join( "<br>" );
1974 if ( !notFoundLibsList.isEmpty() )
1975 QMessageBox::warning( this,
1979 QMessageBox::NoButton,
1980 QMessageBox::NoButton );
1981 else if ( !notFoundOptLibsList.isEmpty() )
1982 QMessageBox::information( this,
1983 tr( "Information" ),
1986 QMessageBox::NoButton,
1987 QMessageBox::NoButton );
1989 // Update GUI and check installation errors
1990 completeInstallation();
1992 // ================================================================
1994 * SALOME_InstallWizard::updateSizeColumn
1995 * Sets required size for each product according to
1996 * installation type and 'Remove SRC & TMP' checkbox state
1998 // ================================================================
1999 void SALOME_InstallWizard::updateSizeColumn()
2002 bool removeSrc = removeSrcBtn->isChecked();
2003 MapProducts::Iterator mapIter;
2004 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
2005 QCheckListItem* item = mapIter.key();
2006 Dependancies dep = mapIter.data();
2007 // get required size for current product
2008 long binSize = dep.getSize( Binaries );
2009 long srcSize = dep.getSize( Sources );
2010 long bldSize = dep.getSize( Compile );
2011 InstallationType instType = getInstType();
2012 if ( instType == Binaries ) {
2013 if ( dep.getType() == "component" )
2014 prodSize = binSize + srcSize;
2016 prodSize = ( binSize != 0 ? binSize : srcSize );
2018 else if ( instType == Sources )
2022 prodSize = ( binSize != 0 ? binSize : srcSize );
2024 prodSize = ( bldSize != 0 ? bldSize : srcSize );
2026 // fill in 'Size' field
2027 item->setText( 1, QString::number( prodSize )+" KB" );
2030 // ================================================================
2032 * SALOME_InstallWizard::checkProductPage
2033 * Checks products page validity (directories and products selection) and
2034 * enabled/disables "Next" button for the Products page
2036 // ================================================================
2037 void SALOME_InstallWizard::checkProductPage()
2039 if ( this->currentPage() != productsPage )
2041 long tots = 0, temps = 0;
2042 // check if any product is selected;
2043 bool isAnyProductSelected = checkSize( &tots, &temps );
2045 // update required size information
2046 requiredSize->setText( QString::number( tots ) + " KB");
2047 requiredTemp->setText( QString::number( temps ) + " KB");
2049 // update available size information
2050 QFileInfo fi( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) );
2051 if ( fi.exists() ) {
2052 diskSpaceProc->clearArguments();
2053 diskSpaceProc->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
2054 diskSpaceProc->addArgument( "diskSpace.sh" );
2055 diskSpaceProc->addArgument( fi.absFilePath() );
2057 diskSpaceProc->start();
2060 // enable/disable "Next" button
2061 setNextEnabled( productsPage, isAnyProductSelected );
2063 // ================================================================
2065 * SALOME_InstallWizard::setPrerequisites
2066 * Sets the product and all products this one depends on to be checked ( recursively )
2068 // ================================================================
2069 void SALOME_InstallWizard::setPrerequisites( QCheckListItem* item )
2071 if ( !productsMap.contains( item ) )
2073 if ( !item->isOn() )
2075 // get all prerequisites
2076 QStringList dependOn = productsMap[ item ].getDependancies();
2077 // install SALOME without GUI case
2078 if ( installGuiBtn->state() != QButton::On &&
2079 woGuiModules.find( item->text(0) ) != woGuiModules.end() &&
2080 woGuiModules[item->text(0)] == True ) {
2081 dependOn.remove( "GUI" );
2083 // setting prerequisites
2084 for ( int i = 0; i < (int)dependOn.count(); i++ ) {
2085 MapProducts::Iterator itProd;
2086 for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
2087 if ( itProd.data().getName() == dependOn[ i ] ) {
2088 if ( itProd.data().getType() == "component" && !itProd.key()->isOn() )
2089 itProd.key()->setOn( true );
2090 else if ( itProd.data().getType() == "prerequisite" ) {
2091 itProd.key()->setOn( true );
2092 itProd.key()->setEnabled( false );
2099 // ================================================================
2101 * SALOME_InstallWizard::unsetPrerequisites
2102 * Unsets all modules which depend of the unchecked product ( recursively )
2104 // ================================================================
2105 void SALOME_InstallWizard::unsetPrerequisites( QCheckListItem* item )
2107 if ( !productsMap.contains( item ) )
2112 // uncheck dependent products
2113 QString itemName = productsMap[ item ].getName();
2114 MapProducts::Iterator itProd;
2115 for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
2116 if ( itProd.data().getType() == productsMap[ item ].getType() ) {
2117 QStringList dependOn = itProd.data().getDependancies();
2118 for ( int i = 0; i < (int)dependOn.count(); i++ ) {
2119 if ( dependOn[ i ] == itemName ) {
2120 if ( itProd.key()->isOn() ) {
2121 itProd.key()->setOn( false );
2128 // uncheck prerequisites
2130 // cout << "item name = " << productsMap[ item ].getName() << endl;
2131 QStringList dependOnList = productsMap[ item ].getDependancies();
2132 for ( int j = 0; j < (int)dependOnList.count(); j++ ) {
2134 MapProducts::Iterator itProd1;
2135 for ( itProd1 = productsMap.begin(); itProd1 != productsMap.end(); ++itProd1 ) {
2136 if ( itProd1.data().getName() == dependOnList[ j ] ) {
2137 if ( itProd1.data().getType() == "prerequisite" ) {
2138 MapProducts::Iterator itProd2;
2139 for ( itProd2 = productsMap.begin(); itProd2 != productsMap.end(); ++itProd2 ) {
2140 if ( itProd2.key()->isOn() ) {
2141 QStringList prereqsList = productsMap[ itProd2.key() ].getDependancies();
2142 for ( int k = 0; k < (int)prereqsList.count(); k++ ) {
2143 if ( prereqsList[ k ] == itProd1.data().getName() ) {
2150 if ( nbDependents == 0 ) {
2151 itProd1.key()->setEnabled( true );
2152 itProd1.key()->setOn( false );
2160 // ================================================================
2162 * SALOME_InstallWizard::launchScript
2163 * Runs installation script
2165 // ================================================================
2166 void SALOME_InstallWizard::launchScript()
2168 // try to find product being processed now
2169 QString prodProc = progressView->findStatus( Processing );
2170 if ( !prodProc.isNull() ) {
2171 ___MESSAGE___( "Found <Processing>: " );
2173 // if found - set status to "completed"
2174 progressView->setStatus( prodProc, Completed );
2175 // ... clear status label
2177 // ... and call this method again
2181 // else try to find next product which is not processed yet
2182 prodProc = progressView->findStatus( Waiting );
2183 if ( !prodProc.isNull() ) {
2184 ___MESSAGE___( "Found <Waiting>: " << prodProc.latin1() );
2185 // if found - set status to "processed" and run script
2186 progressView->setStatus( prodProc, Processing );
2187 progressView->ensureVisible( prodProc );
2189 QCheckListItem* item = 0;
2190 // fill in script parameters
2191 shellProcess->clearArguments();
2193 shellProcess->setWorkingDirectory( QDir( rootDirPath() ).filePath( "config_files" ) );
2194 if ( !extraProducts.contains( prodProc ) ) {
2195 item = findItem( prodProc );
2196 shellProcess->addArgument( item->text(2) );
2199 shellProcess->addArgument( extraProducts[ prodProc ] );
2201 // ... get folder with binaries
2202 QString OS = getPlatform();
2203 if ( refPlatform.isEmpty() && platformsMap.find( curPlatform ) == platformsMap.end() )
2204 OS = commonPlatform;
2205 QString binDir = getPlatformBinPath( OS );
2207 QString tmpFolder = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
2208 //if( !tempFolder->isEnabled() )
2209 // tmpFolder = "/tmp";
2211 // ... not install : try to find preinstalled
2212 if ( notInstall.contains( prodProc ) || prodProc == "gcc" ) {
2213 shellProcess->addArgument( "try_preinstalled" );
2214 shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
2215 shellProcess->addArgument( QDir( rootDirPath() ).filePath( "Products" ) );
2216 statusLab->setText( tr( "Collecting environment for '" ) + prodProc + "'..." );
2219 else if ( installType == Binaries ) {
2220 shellProcess->addArgument( "install_binary" );
2221 shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
2222 shellProcess->addArgument( binDir );
2223 statusLab->setText( tr( "Installing '" ) + prodProc + "'..." );
2225 // ... sources or sources_and_compilation ?
2227 shellProcess->addArgument( installType == Sources ? "install_source" :
2228 "install_source_and_build" );
2229 shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
2230 shellProcess->addArgument( QDir::cleanDirPath( getSrcPath() ) );
2231 statusLab->setText( tr( "Installing '" ) + prodProc + "'..." );
2233 // ... target folder
2234 QString tgtFolder = QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() );
2235 shellProcess->addArgument( QFileInfo( tgtFolder ).absFilePath() );
2236 // ... list of all products
2237 QString depproducts = getAllProducts(productsMap);
2238 depproducts.prepend( QStringList( extraProducts.keys() ).join(" ") + " " );
2239 ___MESSAGE___( "Dependancies"<< depproducts.latin1() );
2240 shellProcess->addArgument( depproducts );
2241 // ... product name - currently installed product
2242 if ( !extraProducts.contains( prodProc ) )
2243 shellProcess->addArgument( item->text(0) );
2245 shellProcess->addArgument( prodProc );
2246 // ... list of products being installed
2247 shellProcess->addArgument( prodSequence.join( " " ) );
2248 // ... sources directory
2249 shellProcess->addArgument( QDir::cleanDirPath( getSrcPath() ) );
2250 // ... remove sources and tmp files or not?
2251 if ( installType == Compile && removeSrcBtn->isOn() )
2252 shellProcess->addArgument( "TRUE" );
2254 shellProcess->addArgument( "FALSE" );
2255 // ... binaries directory
2256 shellProcess->addArgument( binDir );
2257 // ... install SALOME with GUI or not?
2258 if ( woGuiModules.find( prodProc ) != woGuiModules.end() )
2259 ( installGuiBtn->state() != QButton::On && woGuiModules[ prodProc ] == True ) ?
2260 shellProcess->addArgument( "FALSE" ) :
2261 shellProcess->addArgument( "TRUE" );
2262 // ... single installation directory for SALOME modules, if this option was selected
2263 if ( oneModDirBtn->isChecked() ) {
2264 MapProducts::Iterator mapIter;
2265 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter )
2266 if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "component" ) {
2267 shellProcess->addArgument( "TRUE" );
2271 // ... single installation directory for prerequisites, if this option was selected
2272 if ( oneProdDirBtn->isChecked() ) {
2273 if ( prodProc == "DebianLibsForSalome" )
2274 shellProcess->addArgument( oneProdDirName );
2276 MapProducts::Iterator mapIter;
2277 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter )
2278 if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "prerequisite" ) {
2279 shellProcess->addArgument( oneProdDirName );
2286 if ( !shellProcess->start() ) {
2287 // error handling can be here
2288 QStringList args = shellProcess->arguments();
2289 ___MESSAGE___( "error" );
2290 ___MESSAGE___( "cmd: " << args.join(" ").latin1() );
2295 // else try to find aborted product
2296 prodProc = progressView->findStatus( Aborted );
2297 if ( !prodProc.isNull() )
2298 return; // installation has been aborted
2300 ___MESSAGE___( "All products have been installed successfully" );
2301 // all products are installed successfully
2302 MapProducts::Iterator mapIter;
2303 ___MESSAGE___( "starting pick-up environment" );
2304 QString depproducts = QUOTE( getAllProducts(productsMap).prepend( QStringList( extraProducts.keys() ).join(" ") + " " ) );
2305 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
2306 QCheckListItem* item = mapIter.key();
2307 Dependancies dep = mapIter.data();
2308 if ( item->isOn() && dep.pickUpEnvironment() ) {
2309 statusLab->setText( tr( "Pick-up products environment for " ) + dep.getName().latin1() + "..." );
2310 ___MESSAGE___( "... for " << dep.getName().latin1() );
2311 QDir rd( rootDirPath() );
2313 script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
2314 script << item->text(2) << "pickup_env";
2315 script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
2316 script << QUOTE( QFileInfo( QDir::cleanDirPath( QDir( rootDirPath() ).filePath( "Products" ) ) ).absFilePath() );
2317 script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
2318 script << depproducts << item->text(0) << QUOTE( prodSequence.join( " " ) );
2319 ___MESSAGE___( "... --> " << script.script().latin1() );
2320 if ( system( script.script().latin1() ) ) {
2321 ___MESSAGE___( "ERROR" );
2326 if ( installType == Binaries ) {
2327 if ( oneModDirBtn->isChecked() )
2333 // Update GUI and check installation errors
2334 completeInstallation();
2338 // ================================================================
2340 * SALOME_InstallWizard::completeInstallation
2341 * Update GUI and check installation errors
2343 // ================================================================
2344 void SALOME_InstallWizard::completeInstallation()
2346 // update status label
2347 statusLab->setText( tr( "Installation completed" ) );
2349 setNextEnabled( true );
2350 doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
2351 connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
2353 setBackEnabled( true );
2354 // script parameters
2355 passedParams->clear();
2356 passedParams->setEnabled( false );
2357 QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
2358 installInfo->setFinished( true );
2359 if ( isMinimized() )
2363 if ( QMessageBox::warning( this,
2365 tr( "There were some errors during the installation.\n"
2366 "Do you want to save the installation log?" ),
2377 // ================================================================
2379 * SALOME_InstallWizard::onInstallGuiBtn
2380 * <Installation with GUI> check-box slot
2382 // ================================================================
2383 void SALOME_InstallWizard::onInstallGuiBtn()
2385 MapProducts::Iterator itProd;
2386 for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
2387 if ( itProd.data().getType() == "component" ) {
2388 if ( installGuiBtn->state() == QButton::On ) {
2389 itProd.key()->setEnabled( true );
2390 itProd.key()->setOn( true );
2393 QString itemName = itProd.data().getName();
2394 if ( woGuiModules.find( itemName ) == woGuiModules.end() ||
2395 woGuiModules[ itemName ] == False ) {
2396 itProd.key()->setOn( false );
2397 itProd.key()->setEnabled( false );
2400 itProd.key()->setOn( true );
2405 // ================================================================
2407 * SALOME_InstallWizard::onMoreBtn
2408 * <More...> button slot
2410 // ================================================================
2411 void SALOME_InstallWizard::onMoreBtn()
2414 prereqsView->hide();
2415 moreBtn->setText( tr( "Show prerequisites..." ) );
2416 setAboutInfo( moreBtn, tr( "Show list of prerequisites" ) );
2419 prereqsView->show();
2420 moreBtn->setText( tr( "Hide prerequisites" ) );
2421 setAboutInfo( moreBtn, tr( "Hide list of prerequisites" ) );
2423 qApp->processEvents();
2424 moreMode = !moreMode;
2425 InstallWizard::layOut();
2426 qApp->processEvents();
2427 if ( !isMaximized() ) {
2428 qApp->processEvents();
2432 // ================================================================
2434 * SALOME_InstallWizard::onFinishButton
2435 * Operation buttons slot
2437 // ================================================================
2438 void SALOME_InstallWizard::onFinishButton()
2440 const QObject* btn = sender();
2441 ButtonList::Iterator it;
2442 for ( it = buttons.begin(); it != buttons.end(); ++it ) {
2443 if ( (*it).button() && (*it).button() == btn ) {
2444 QDir rd( rootDirPath() );
2446 script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
2447 script << (*it).script() << "execute";
2448 script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
2449 script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
2451 script << ">& /dev/null";
2453 ___MESSAGE___( "script: " << script.script().latin1() );
2454 if ( (*it).script().isEmpty() || system( script.script().latin1() ) ) {
2455 QMessageBox::warning( this,
2457 tr( "Can't perform action!"),
2459 QMessageBox::NoButton,
2460 QMessageBox::NoButton );
2466 // ================================================================
2468 * SALOME_InstallWizard::onAbout
2469 * <About> button slot: shows <About> dialog box
2471 // ================================================================
2472 void SALOME_InstallWizard::onAbout()
2478 // ================================================================
2480 * SALOME_InstallWizard::findItem
2481 * Searches product listview item with given symbolic name
2483 // ================================================================
2484 QCheckListItem* SALOME_InstallWizard::findItem( const QString& sName )
2486 MapProducts::Iterator mapIter;
2487 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
2488 if ( mapIter.data().getName() == sName )
2489 return mapIter.key();
2493 // ================================================================
2495 * SALOME_InstallWizard::abort
2496 * Sets progress state to Aborted
2498 // ================================================================
2499 void SALOME_InstallWizard::abort()
2501 QString prod = progressView->findStatus( Processing );
2502 while ( !prod.isNull() ) {
2503 progressView->setStatus( prod, Aborted );
2504 prod = progressView->findStatus( Processing );
2506 prod = progressView->findStatus( Waiting );
2507 while ( !prod.isNull() ) {
2508 progressView->setStatus( prod, Aborted );
2509 prod = progressView->findStatus( Waiting );
2512 // ================================================================
2514 * SALOME_InstallWizard::reject
2515 * Reject slot, clears temporary directory and closes application
2517 // ================================================================
2518 void SALOME_InstallWizard::reject()
2520 ___MESSAGE___( "REJECTED" );
2521 if ( !exitConfirmed ) {
2522 if ( QMessageBox::information( this,
2524 tr( "Do you want to quit %1?" ).arg( getIWName() ),
2532 exitConfirmed = true;
2535 InstallWizard::reject();
2537 // ================================================================
2539 * SALOME_InstallWizard::accept
2540 * Accept slot, clears temporary directory and closes application
2542 // ================================================================
2543 void SALOME_InstallWizard::accept()
2545 ___MESSAGE___( "ACCEPTED" );
2547 InstallWizard::accept();
2549 // ================================================================
2551 * SALOME_InstallWizard::clean
2552 * Clears and (optionally) removes temporary directory
2554 // ================================================================
2555 void SALOME_InstallWizard::clean(bool rmDir)
2557 WarnDialog::showWarnDlg( 0, false );
2558 myThread->clearCommands();
2560 while ( myThread->running() );
2561 // first remove temporary files
2562 QDir rd( rootDirPath() );
2564 script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
2565 script << "remove_tmp.sh" << QUOTE( tempFolder->text().stripWhiteSpace() + TEMPDIRNAME );
2566 script << QUOTE( getAllProducts( productsMap ) );
2568 script << ">& /dev/null";
2570 ___MESSAGE___( "script = " << script.script().latin1() );
2571 if ( system( script.script().latin1() ) ) {
2574 // then try to remove created temporary directory
2575 //script = "rm -rf " + QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
2576 if ( rmDir && !tmpCreated.isNull() ) {
2578 script << "rm -rf" << QUOTE( tmpCreated );
2580 script << ">& /dev/null";
2582 if ( system( script.script().latin1() ) ) {
2585 ___MESSAGE___( "script = " << script.script().latin1() );
2588 // ================================================================
2590 * SALOME_InstallWizard::pageChanged
2591 * Called when user moves from page to page
2593 // ================================================================
2594 void SALOME_InstallWizard::pageChanged( const QString & mytitle)
2596 doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
2597 connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
2598 cancelButton()->disconnect();
2599 connect( cancelButton(), SIGNAL( clicked()), this, SLOT( reject() ) );
2601 QWidget* aPage = InstallWizard::page( mytitle );
2606 if ( aPage == typePage ) {
2607 // installation type page
2608 if ( buttonGrp->id( buttonGrp->selected() ) == -1 )
2609 // set default installation type
2610 forceSrc ? srcCompileBtn->animateClick() : binBtn->animateClick();
2612 buttonGrp->selected()->animateClick();
2614 else if ( aPage == platformsPage ) {
2615 // installation platforms page
2616 MapXmlFiles::Iterator it;
2617 if ( previousPage == typePage ) {
2618 for ( it = platformsMap.begin(); it != platformsMap.end(); ++it ) {
2619 QString plat = it.key();
2620 QRadioButton* rb = ( (QRadioButton*) platBtnGrp->child( plat ) );
2621 if ( installType == Binaries ) {
2622 QFileInfo fib( getPlatformBinPath( plat ) );
2623 rb->setEnabled( true/*fib.isDir()*/ );
2624 if ( platBtnGrp->id( platBtnGrp->selected() ) == -1 && plat == getBasePlatform() )
2627 // rb->setChecked( rb->isChecked() && rb->isEnabled() );
2628 if ( rb->isChecked() && rb->isEnabled() )
2631 setNextEnabled( platformsPage, platBtnGrp->id( platBtnGrp->selected() ) != -1 );
2634 else if ( aPage == dirPage ) {
2635 // installation and temporary directories page
2636 if ( ( ( this->indexOf( platformsPage ) != -1 && this->appropriate( platformsPage ) ) ?
2637 previousPage == platformsPage : previousPage == typePage )
2639 // clear global variables before reading XML file
2640 modulesView->clear();
2641 prereqsView->clear();
2642 productsMap.clear();
2644 StructureParser* parser = new StructureParser( this );
2645 parser->setProductsLists( modulesView, prereqsView );
2646 if ( targetFolder->text().isEmpty() )
2647 parser->setTargetDir( targetFolder );
2648 if ( tempFolder->text().isEmpty() )
2649 parser->setTempDir( tempFolder );
2650 parser->readXmlFile( xmlFileName );
2651 // create a map of SALOME modules names, that can support installation without GUI mode
2652 if ( woGuiModules.isEmpty() ) {
2653 MapProducts::Iterator mapIter;
2654 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); mapIter++ ) {
2655 Dependancies dep = mapIter.data();
2656 if ( dep.getType() == "component" && dep.supportWoGuiMode() != NotDefined )
2657 woGuiModules[ dep.getName() ] = dep.supportWoGuiMode();
2661 // update required size for each product
2663 // take into account command line parameters
2664 if ( !myTargetPath.isEmpty() )
2665 targetFolder->setText( myTargetPath );
2666 if ( !myTmpPath.isEmpty() )
2667 tempFolder->setText( myTmpPath );
2668 // set all modules to be checked and first module to be selected
2669 installGuiBtn->setState( QButton::Off );
2670 installGuiBtn->setState( QButton::On );
2671 if ( modulesView->childCount() > 0 && !modulesView->selectedItem() )
2672 modulesView->setSelected( modulesView->firstChild(), true );
2673 stateChanged = false;
2675 else if ( rmSrcPrevState != removeSrcBtn->isChecked() ) {
2676 // only update required size for each product
2678 rmSrcPrevState = removeSrcBtn->isChecked();
2680 // add extra products to install list
2681 extraProducts.clear();
2682 //extraProducts.insert( "gcc", "gcc-common.sh" );
2683 if ( refPlatform == commonPlatform && installType == Binaries )
2684 extraProducts.insert( "DebianLibsForSalome", "DEBIANFORSALOME-3.1.sh" );
2686 else if ( aPage == productsPage ) {
2688 onSelectionChanged();
2691 else if ( aPage == prestartPage ) {
2695 else if ( aPage == progressPage ) {
2696 if ( previousPage == prestartPage ) {
2699 progressView->clear();
2700 installInfo->clear();
2701 installInfo->setFinished( false );
2702 passedParams->clear();
2703 passedParams->setEnabled( false );
2704 QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
2705 doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
2706 connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
2707 setNextEnabled( true );
2708 // reconnect Cancel button to terminate process
2709 cancelButton()->disconnect();
2710 connect( cancelButton(), SIGNAL( clicked() ), this, SLOT( tryTerminate() ) );
2713 else if ( aPage == readmePage ) {
2714 ButtonList::Iterator it;
2715 for ( it = buttons.begin(); it != buttons.end(); ++it ) {
2716 if ( (*it).button() ) {
2717 QDir rd( rootDirPath() );
2719 script << "cd" << QUOTE( rd.filePath( "config_files" ) ) << ";";
2720 script << (*it).script() << "check_enabled";
2721 script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
2722 script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
2724 script << ">& /dev/null";
2726 ___MESSAGE___( "script: " << script.script().latin1() );
2727 (*it).button()->setEnabled( !(*it).script().isEmpty() && !system( script.script().latin1() ) );
2730 finishButton()->setEnabled( true );
2732 previousPage = aPage;
2733 ___MESSAGE___( "previousPage = " << previousPage );
2735 // ================================================================
2737 * SALOME_InstallWizard::onButtonGroup
2738 * Called when user selected either installation type or installation platform
2740 // ================================================================
2741 void SALOME_InstallWizard::onButtonGroup( int rbIndex )
2743 int prevType = installType;
2744 QString prevPlat = getPlatform();
2745 QWidget* aPage = InstallWizard::currentPage();
2746 if ( aPage == typePage ) {
2747 installType = InstallationType( rbIndex );
2748 // management of the <Remove source and tmp files> check-box
2749 removeSrcBtn->setEnabled( installType == Compile );
2750 oneModDirBtn->setEnabled( installType == Binaries /*|| installType == Compile*/ );
2751 oneProdDirBtn->setEnabled( installType == Binaries || installType == Compile );
2753 xmlFileName = getXmlFile( curPlatform );
2755 else if ( aPage == platformsPage ) {
2756 refPlatform = platBtnGrp->find( rbIndex )->name();
2757 xmlFileName = getXmlFile( refPlatform );
2758 setNextEnabled( platformsPage, true );
2760 if ( prevType != installType ||
2761 ( indexOf( platformsPage ) != -1 ? prevPlat != getPlatform() : false ) ) {
2762 stateChanged = true;
2763 oneModDirBtn->setChecked( installType == Binaries && singleDir );
2764 oneProdDirBtn->setChecked( false );
2767 // ================================================================
2769 * SALOME_InstallWizard::helpClicked
2772 // ================================================================
2773 void SALOME_InstallWizard::helpClicked()
2775 if ( helpWindow == NULL ) {
2776 helpWindow = HelpWindow::openHelp( this );
2779 helpWindow->installEventFilter( this );
2782 QMessageBox::warning( this,
2783 tr( "Help file not found" ),
2784 tr( "Sorry, help is unavailable" ) );
2788 helpWindow->raise();
2789 helpWindow->setActiveWindow();
2792 // ================================================================
2794 * SALOME_InstallWizard::browseDirectory
2795 * Shows directory selection dialog
2797 // ================================================================
2798 void SALOME_InstallWizard::browseDirectory()
2800 const QObject* theSender = sender();
2801 QLineEdit* theFolder;
2802 if ( theSender == targetBtn )
2803 theFolder = targetFolder;
2804 else if (theSender == tempBtn)
2805 theFolder = tempFolder;
2808 QString typedDir = QFileDialog::getExistingDirectory( QDir::cleanDirPath( theFolder->text().stripWhiteSpace() ), this );
2809 if ( !typedDir.isNull() ) {
2810 theFolder->setText( typedDir );
2811 theFolder->end( false );
2814 // ================================================================
2816 * SALOME_InstallWizard::directoryChanged
2817 * Called when directory path (target or temp) is changed
2819 // ================================================================
2820 void SALOME_InstallWizard::directoryChanged( const QString& /*text*/ )
2824 // ================================================================
2826 * SALOME_InstallWizard::onStart
2827 * <Start> button's slot - runs installation
2829 // ================================================================
2830 void SALOME_InstallWizard::onStart()
2832 if ( nextButton()->text() == tr( "&Stop" ) ) {
2833 statusLab->setText( tr( "Aborting installation..." ) );
2834 shellProcess->kill();
2835 modifyLaProc->kill();
2836 while( shellProcess->isRunning() );
2837 statusLab->setText( tr( "Installation has been aborted by user" ) );
2842 progressView->clear();
2843 installInfo->clear();
2844 installInfo->setFinished( false );
2845 passedParams->clear();
2846 passedParams->setEnabled( false );
2847 // disable 'Ignore errors' checkbox during installation process
2848 ignoreErrCBox->setEnabled( false );
2849 QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
2851 // update status label
2852 statusLab->setText( tr( "Preparing for installation..." ) );
2853 // clear lists of products
2856 toInstall += extraProducts.keys();
2857 // ... and fill it for new process
2858 QCheckListItem* item = (QCheckListItem*)( prereqsView->firstChild() );
2860 if ( productsMap.contains( item ) ) {
2862 toInstall.append( productsMap[item].getName() );
2864 notInstall.append( productsMap[item].getName() );
2866 item = (QCheckListItem*)( item->nextSibling() );
2868 item = (QCheckListItem*)( modulesView->firstChild() );
2870 if ( productsMap.contains( item ) ) {
2872 toInstall.append( productsMap[item].getName() );
2874 notInstall.append( productsMap[item].getName() );
2876 item = (QCheckListItem*)( item->nextSibling() );
2878 // if something at all is selected
2879 if ( (int)toInstall.count() > 0 ) {
2881 if ( installType == Compile ) {
2882 // update status label
2883 statusLab->setText( tr( "Check Fortran compiler..." ) );
2884 // check Fortran compiler.
2885 QDir rd( rootDirPath() );
2887 script << QUOTE( rd.filePath( "config_files/checkFortran.sh" ) ) << "find_compilers";
2888 script << QUOTE( QFileInfo( QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME ).absFilePath() );
2889 ___MESSAGE___( "script = " << script.script().latin1() );
2890 if ( system( script.script().latin1() ) ) {
2891 QMessageBox::critical( this,
2893 tr( "Fortran compiler was not found at current system!\n"
2894 "Installation can not be continued!"),
2896 QMessageBox::NoButton,
2897 QMessageBox::NoButton );
2898 // installation aborted
2900 statusLab->setText( tr( "Installation has been aborted" ) );
2901 // enable <Next> button
2902 setNextEnabled( true );
2903 doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
2904 connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
2905 // enable <Back> button
2906 setBackEnabled( true );
2911 // update status label
2912 statusLab->setText( tr( "Preparing for installation..." ) );
2914 clean(false); // VSR 07/02/05 - bug fix: first we should clear temporary directory
2915 // disable <Next> button
2916 //setNextEnabled( false );
2917 nextButton()->setText( tr( "&Stop" ) );
2918 setAboutInfo( nextButton(), tr( "Abort installation process" ) );
2919 // disable <Back> button
2920 setBackEnabled( false );
2921 // enable script parameters line edit
2922 // VSR commented: 18/09/03: passedParams->setEnabled( true );
2923 // VSR commented: 18/09/03: passedParams->setFocus();
2924 ProgressViewItem* progressItem;
2925 // set status for installed products
2926 for ( int i = 0; i < (int)toInstall.count(); i++ ) {
2927 if ( !extraProducts.contains( toInstall[i] ) ) {
2928 item = findItem( toInstall[i] );
2929 progressView->addProduct( item->text(0), item->text(2) );
2932 progressItem = progressView->addProduct( toInstall[i], extraProducts[toInstall[i]] );
2933 progressItem->setVisible( false );
2935 // set status for not installed products
2936 for ( int i = 0; i < (int)notInstall.count(); i++ ) {
2937 item = findItem( notInstall[i] );
2938 progressItem = progressView->addProduct( item->text(0), item->text(2) );
2939 progressItem->setVisible( false );
2941 // get specified list of products being installed
2942 prodSequence.clear();
2943 for (int i = 0; i<(int)toInstall.count(); i++ ) {
2944 if ( extraProducts.contains( toInstall[i] ) ) {
2945 prodSequence.append( toInstall[i] );
2948 if ( installType == Binaries ) {
2949 prodSequence.append( toInstall[i] );
2951 MapProducts::Iterator mapIter;
2952 for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
2953 if ( mapIter.data().getName() == toInstall[i] && mapIter.data().getType() == "component" ) {
2954 prodSequence.append( toInstall[i] + "_src" );
2959 else if ( installType == Sources )
2960 prodSequence.append( toInstall[i] + "_src" );
2962 prodSequence.append( toInstall[i] );
2963 prodSequence.append( toInstall[i] + "_src" );
2967 // create a backup of 'env_build.csh', 'env_build.sh', 'env_products.csh', 'env_products.sh'
2968 // ( backup of 'salome.csh' and 'salome.sh' is made if pick-up environment is called )
2969 QDir rd( rootDirPath() );
2971 script << QUOTE( rd.filePath( "config_files/backupEnv.sh" ) );
2972 script << QUOTE( QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ) ).absFilePath() );
2973 ___MESSAGE___( "script = " << script.script().latin1() );
2974 if ( system( script.script().latin1() ) ) {
2975 if ( QMessageBox::warning( this,
2977 tr( "Backup environment files have not been created.\n"
2978 "Do you want to continue an installation process?" ),
2981 QString::null, 0, 1 ) == 1 ) {
2982 // installation aborted
2984 statusLab->setText( tr( "Installation has been aborted by user" ) );
2985 // update <Next> button
2986 setNextEnabled( true );
2987 doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
2988 connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
2989 // enable <Back> button
2990 setBackEnabled( true );
2995 // launch install script
2999 // ================================================================
3001 * SALOME_InstallWizard::onReturnPressed
3002 * Called when users tries to pass parameters for the script
3004 // ================================================================
3005 void SALOME_InstallWizard::onReturnPressed()
3007 QString txt = passedParams->text();
3008 installInfo->append( txt );
3010 shellProcess->writeToStdin( txt );
3011 passedParams->clear();
3012 progressView->setFocus();
3013 passedParams->setEnabled( false );
3014 QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
3017 Callback function - as response for the script finishing
3019 void SALOME_InstallWizard::productInstalled()
3021 ___MESSAGE___( "process exited" );
3022 if ( shellProcess->normalExit() ) {
3023 ___MESSAGE___( "...normal exit" );
3024 // normal exit - try to proceed installation further
3028 ___MESSAGE___( "...abnormal exit" );
3029 statusLab->setText( tr( "Installation has been aborted" ) );
3030 // installation aborted
3032 // clear script passed parameters lineedit
3033 passedParams->clear();
3034 passedParams->setEnabled( false );
3035 QFont f = parametersLab->font(); f.setBold( false ); parametersLab->setFont( f );
3036 installInfo->setFinished( true );
3037 // enable <Next> button
3038 setNextEnabled( true );
3039 doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
3040 connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
3041 //doPostActions( tr( "&Next >" ), tr( "Move to the next step of the installation procedure" ) );
3042 //connect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
3043 // enable <Back> button
3044 setBackEnabled( true );
3047 // ================================================================
3049 * SALOME_InstallWizard::tryTerminate
3050 * Slot, called when <Cancel> button is clicked during installation script running
3052 // ================================================================
3053 void SALOME_InstallWizard::tryTerminate()
3055 if ( shellProcess->isRunning() ) {
3056 if ( QMessageBox::information( this,
3058 tr( "Do you want to quit %1?" ).arg( getIWName() ),
3066 exitConfirmed = true;
3067 // if process still running try to terminate it first
3068 shellProcess->tryTerminate();
3070 //QTimer::singleShot( 3000, this, SLOT( onCancel() ) );
3071 connect( shellProcess, SIGNAL( processExited() ), this, SLOT( onCancel() ) );
3074 // else just quit install wizard
3078 // ================================================================
3080 * SALOME_InstallWizard::onCancel
3081 * Kills installation process and quits application
3083 // ================================================================
3084 void SALOME_InstallWizard::onCancel()
3086 shellProcess->kill();
3087 modifyLaProc->kill();
3088 checkFLibProc->kill();
3091 // ================================================================
3093 * SALOME_InstallWizard::onSelectionChanged
3094 * Called when selection is changed in the products list view
3095 * to fill in the 'Information about product' text box
3097 // ================================================================
3098 void SALOME_InstallWizard::onSelectionChanged()
3100 const QObject* snd = sender();
3101 QListViewItem* item = modulesView->selectedItem();
3102 if ( snd == prereqsView )
3103 item = prereqsView->selectedItem();
3106 productInfo->clear();
3107 QCheckListItem* anItem = (QCheckListItem*)item;
3108 if ( !productsMap.contains( anItem ) )
3110 Dependancies dep = productsMap[ anItem ];
3111 QString text = "<b>" + anItem->text(0) + "</b>" + "<br>";
3112 if ( !dep.getVersion().isEmpty() )
3113 text += tr( "Version" ) + ": " + dep.getVersion() + "<br>";
3115 if ( !dep.getDescription().isEmpty() ) {
3116 text += "<i>" + dep.getDescription() + "</i><br><br>";
3118 /* AKL: 07/08/28 - hide required disk space for tmp files for each product ==>
3120 tempSize = dep.getTempSize( installType );
3121 text += tr( "Disk space for tmp files required" ) + ": " + QString::number( tempSize ) + " KB<br>";
3122 AKL: 07/08/28 - hide required disk space for tmp files for each product <==
3124 text += tr( "Disk space required" ) + ": " + item->text(1) + "<br>";
3126 QString req = ( dep.getDependancies().count() > 0 ? dep.getDependancies().join(", ") : tr( "none" ) );
3127 text += tr( "Prerequisites" ) + ": " + req;
3128 productInfo->setText( text );
3130 // ================================================================
3132 * SALOME_InstallWizard::onItemToggled
3133 * Called when user checks/unchecks any product item
3134 * Recursively sets all prerequisites and updates "Next" button state
3136 // ================================================================
3137 void SALOME_InstallWizard::onItemToggled( QCheckListItem* item )
3139 if ( productsMap.contains( item ) ) {
3141 setPrerequisites( item );
3143 unsetPrerequisites( item );
3145 onSelectionChanged();
3148 // ================================================================
3150 * SALOME_InstallWizard::wroteToStdin
3151 * QProcess slot: -->something was written to stdin
3153 // ================================================================
3154 void SALOME_InstallWizard::wroteToStdin( )
3156 ___MESSAGE___( "Something was sent to stdin" );
3158 // ================================================================
3160 * SALOME_InstallWizard::readFromStdout
3161 * QProcess slot: -->something was written to stdout
3163 // ================================================================
3164 void SALOME_InstallWizard::readFromStdout( )
3166 ___MESSAGE___( "Something was sent to stdout" );
3167 QProcess* theProcess = ( QProcess* )sender();
3168 while ( theProcess->canReadLineStdout() ) {
3169 installInfo->append( QString( theProcess->readLineStdout() ) );
3170 installInfo->scrollToBottom();
3172 QString str( theProcess->readStdout() );
3173 if ( !str.isEmpty() ) {
3174 installInfo->append( str );
3175 installInfo->scrollToBottom();
3179 #define OUTLINE_TEXT(x) QString( "<font color=#FF0000><b>" ) + QString( x ) + QString( "</b></font>" )
3181 // ================================================================
3183 * SALOME_InstallWizard::readFromStderr
3184 * QProcess slot: -->something was written to stderr
3186 // ================================================================
3187 void SALOME_InstallWizard::readFromStderr( )
3189 ___MESSAGE___( "Something was sent to stderr" );
3190 QProcess* theProcess = ( QProcess* )sender();
3191 while ( theProcess->canReadLineStderr() ) {
3192 installInfo->append( OUTLINE_TEXT( QString( theProcess->readLineStderr() ) ) );
3193 installInfo->scrollToBottom();
3196 QString str( theProcess->readStderr() );
3197 if ( !str.isEmpty() ) {
3198 installInfo->append( OUTLINE_TEXT( str ) );
3199 installInfo->scrollToBottom();
3203 // stop or proceed installation process
3206 // VSR: 10/11/05 - disable answer mode ==>
3207 // passedParams->setEnabled( true );
3208 // passedParams->setFocus();
3209 // QFont f = parametersLab->font(); f.setBold( true ); parametersLab->setFont( f );
3210 // VSR: 10/11/05 - disable answer mode <==
3212 // ================================================================
3214 * SALOME_InstallWizard::manageInstProc
3215 * QProcess slot: -->stop installation if there is an error in stderr
3217 // ================================================================
3218 void SALOME_InstallWizard::manageInstProc()
3220 if ( !hasErrors || ignoreErrCBox->isChecked() )
3221 return; //proceed installation process
3223 // abort the current installation
3224 statusLab->setText( tr( "Aborting installation..." ) );
3226 statusLab->setText( tr( "Installation has been aborted because some errors" ) );
3227 if ( QMessageBox::critical( this,
3229 tr( "Installation process has been stopped, because an error occured \n"
3230 "during an installation of the current product!\n"
3231 "Please see the installation progress view for more details about the error.\n\n"
3232 "Do you want to save the installation log?" ),
3239 // enable <Next> button
3240 setNextEnabled( true );
3241 doPostActions( tr( "&Start" ), tr( "Start installation process" ) );
3242 connect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
3243 // enable <Back> button
3244 setBackEnabled( true );
3245 installInfo->setFinished( true );
3247 // ================================================================
3249 * SALOME_InstallWizard::setDependancies
3250 * Sets dependancies for the product item
3252 // ================================================================
3253 void SALOME_InstallWizard::setDependancies( QCheckListItem* item, Dependancies dep)
3255 productsMap[item] = dep;
3257 // ================================================================
3259 * SALOME_InstallWizard::doPostActions
3260 * Executes some actions after finish of installation process (successful or not)
3262 // ================================================================
3263 void SALOME_InstallWizard::doPostActions( const QString& btnText,
3264 const QString& btnAboutInfo )
3266 // update <Next> button
3267 nextButton()->setText( btnText );
3268 setAboutInfo( nextButton(), btnAboutInfo );
3269 // reconnect Next button - to use it as Start button
3270 disconnect( this, SIGNAL( nextClicked() ), this, SLOT( next() ) );
3271 disconnect( this, SIGNAL( nextClicked() ), this, SLOT( onStart() ) );
3272 // enable 'Ignore errors' checkbox
3273 ignoreErrCBox->setEnabled( true );
3275 // ================================================================
3277 * SALOME_InstallWizard::addFinishButton
3278 * Add button for the <Finish> page.
3279 * Clear list of buttons if <toClear> flag is true.
3281 // ================================================================
3282 void SALOME_InstallWizard::addFinishButton( const QString& label,
3283 const QString& tooltip,
3284 const QString& script,
3292 buttons.append( Button( label, tooltip, script ) );
3293 // create finish buttons
3294 QButton* b = new QPushButton( tr( buttons.last().label() ), readmePage );
3295 if ( !buttons.last().tootip().isEmpty() )
3296 setAboutInfo( b, tr( buttons.last().tootip() ) );
3297 QHBoxLayout* hLayout = (QHBoxLayout*)readmePage->layout()->child("finishButtons");
3299 // remove previous buttons
3300 ButtonList::Iterator it;
3301 for ( it = btns.begin(); it != btns.end(); ++it ) {
3302 hLayout->removeChild( (*it).button() );
3303 delete (*it).button();
3306 // add buttons to finish page
3307 hLayout->insertWidget( buttons.count()-1, b );
3308 buttons.last().setButton( b );
3309 connect( b, SIGNAL( clicked() ), this, SLOT( onFinishButton() ) );
3311 // ================================================================
3313 * SALOME_InstallWizard::polish
3314 * Polishing of the widget - to set right initial size
3316 // ================================================================
3317 void SALOME_InstallWizard::polish()
3320 InstallWizard::polish();
3322 // ================================================================
3324 * SALOME_InstallWizard::saveLog
3325 * Save installation log to file
3327 // ================================================================
3328 void SALOME_InstallWizard::saveLog()
3330 QString txt = installInfo->text();
3331 if ( txt.length() <= 0 )
3333 QDateTime dt = QDateTime::currentDateTime();
3334 QString fileName = dt.toString("ddMMyy-hhmm");
3335 fileName.prepend("install-"); fileName.append(".html");
3336 fileName = QFileInfo( QDir::cleanDirPath( targetFolder->text().stripWhiteSpace() ), fileName ).absFilePath();
3337 fileName = QFileDialog::getSaveFileName( fileName,
3338 QString( "HTML files (*.htm *.html)" ),
3340 tr( "Save Log file" ) );
3341 if ( !fileName.isEmpty() ) {
3342 QFile f( fileName );
3343 if ( f.open( IO_WriteOnly ) ) {
3344 QTextStream stream( &f );
3349 QMessageBox::critical( this,
3351 tr( "Can't save file %1.\nCheck path and permissions.").arg( fileName ),
3353 QMessageBox::NoButton,
3354 QMessageBox::NoButton );
3358 // ================================================================
3360 * SALOME_InstallWizard::updateCaption
3361 * Updates caption according to the current page number
3363 // ================================================================
3364 void SALOME_InstallWizard::updateCaption()
3366 QWidget* aPage = InstallWizard::currentPage();
3369 InstallWizard::setCaption( tr( myCaption ) + " " +
3370 tr( getIWName() ) + " - " +
3371 tr( "Step %1 of %2").arg( QString::number( this->indexOf( aPage )+1 ) ).arg( QString::number( this->pageCount() ) ) );
3374 // ================================================================
3376 * SALOME_InstallWizard::processValidateEvent
3377 * Processes validation event (<val> is validation code)
3379 // ================================================================
3380 void SALOME_InstallWizard::processValidateEvent( const int val, void* data )
3382 QWidget* aPage = InstallWizard::currentPage();
3383 if ( aPage != productsPage ) {
3384 InstallWizard::processValidateEvent( val, data );
3391 if ( myThread->hasCommands() )
3394 WarnDialog::showWarnDlg( 0, false );
3395 InstallWizard::processValidateEvent( val, data );