Salome HOME
Merge improvements from SALOME_3 branch
authorvsr <vsr@opencascade.com>
Tue, 27 Dec 2005 09:40:40 +0000 (09:40 +0000)
committervsr <vsr@opencascade.com>
Tue, 27 Dec 2005 09:40:40 +0000 (09:40 +0000)
bin/SALOME_InstallWizard
doc/readme.html
src/SALOME_InstallWizard.cxx
src/SALOME_InstallWizard.hxx

index 529ce35e0d0390f297f75bb89ff01477b5a4152a..2ed236e3c674f44cf8c4303a9c0fb3ccc8765ba9 100755 (executable)
Binary files a/bin/SALOME_InstallWizard and b/bin/SALOME_InstallWizard differ
index 9141215b88ef4ba481aad44af3e54aeaf34bcc16..ef86d3b70172aabfaa517a2607b2f7c2501e7730 100755 (executable)
@@ -142,9 +142,11 @@ For example, in order to install <b><i>pyqt</i></b> it's necessary to have
 <b><i>gcc, python</i></b>,<b><i> qt</i></b> and <b><i>sip</i></b> installed.
 Therefore all these products will be marked when you check on <b><i>pyqt</i></b>. 
 This feature can be switched off by clicking <i>"Auto set prerequisites products"</i>
- checkbox. <br>
+ checkbox. Turn on this checkbox if you want all pre-requisite
+ products to be automatically checked when you select some product to
+ be installed. Turn off this checkbox if you want to disable this feature.<br><br>
   Special button in the right part of the page - <i>"Unselect All" </i>-
-allows to reset quickly all products to the <i>"not install"</i> state. <br>
+allows to reset quickly all products to the <i>"not install"</i> state. <br><br>
   If you want to use native products (for example, for Linux Red Hat 8.0 these are gcc, tcl, 
 Python, Qt, Sip and PyQt), select <i>"use native" </i>option. </p>
 
index df52630c313347e718eeb36bbd8207fd008ec2fe..437aa98431d4dab031f33b5ee9e53f9b744540de 100644 (file)
@@ -1183,15 +1183,19 @@ void SALOME_InstallWizard::checkProductPage()
   int totBin = 0, selBin = 0;
   MapProducts::Iterator itProd;
   for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
-    if ( itProd.data().getContext() == "salome sources" ) {
-      totSrc++;
-      if ( productsView->isSources( itProd.key() ) )
-       selSrc++;
-    }
-    if ( itProd.data().getContext() == "salome binaries" ) {
-      totBin++;
-      if ( productsView->isBinaries( itProd.key() ) )
-       selBin++;
+    bool srcctx = itProd.data().hasContext( "salome sources" );
+    bool binctx = itProd.data().hasContext( "salome binaries" );
+    if ( srcctx ) totSrc++;
+    if ( binctx ) totBin++;
+    if ( srcctx && !binctx && productsView->isSources( itProd.key() ) )
+      selSrc++;
+    if ( !srcctx && binctx && productsView->isBinaries( itProd.key() ) )
+      selBin++;
+    if ( srcctx && binctx && 
+        ( productsView->isSources( itProd.key() ) || 
+          productsView->isBinaries( itProd.key() ) ) ) {
+      selSrc++;
+      selBin++;
     }
   }
   selectSrcBtn->blockSignals( true );
@@ -1890,11 +1894,14 @@ void SALOME_InstallWizard::onProdBtn()
       checkBox->setState( QButton::On );
     MapProducts::Iterator itProd;
     for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
-      if ( itProd.data().getContext() == "salome sources" ) {
+      if ( itProd.data().hasContext( "salome sources" ) ) {
        if ( checkBox->state() == QButton::Off )
          productsView->setNone( itProd.key() );
-       else
+       else {
          productsView->setSources( itProd.key() );
+         if ( prerequisites->isChecked() )
+           setPrerequisites( itProd.key() );
+       }
       }
     }
   }
@@ -1904,11 +1911,14 @@ void SALOME_InstallWizard::onProdBtn()
       checkBox->setState( QButton::On );
     MapProducts::Iterator itProd;
     for ( itProd = productsMap.begin(); itProd != productsMap.end(); ++itProd ) {
-      if ( itProd.data().getContext() == "salome binaries" ) {
+      if ( itProd.data().hasContext( "salome binaries" ) ) {
        if ( checkBox->state() == QButton::Off )
          productsView->setNone( itProd.key() );
-       else
+       else {
          productsView->setBinaries( itProd.key() );
+         if ( prerequisites->isChecked() )
+           setPrerequisites( itProd.key() );
+       }
       }
     }
   }
index 551e43c20fb513246462b9a7483854f758b5796b..dd9e4d76a706851baef3ea376d44ddf771ee95ca 100644 (file)
@@ -53,13 +53,22 @@ class Dependancies
   // gets dependancies
   QStringList getDependancies() const { return dependsOn; }
   // gets disk space required
-  long        getSize(bool sources = false) const { return ( sources ? sizeSourcesTotal : sizeBinaryTotal ); }
+  long        getSize(bool sources = false) const 
+  { 
+    return ( sources ? sizeSourcesTotal : sizeBinaryTotal ); 
+  }
   // gets temporary disk space required
   long        getTempSize() const     { return sizeTemp;   }
   // gets product's description
   QString     getDescription() const  { return description; }
   // gets product's context
   QString     getContext() const      { return context; }
+  // returns true if product supports given context
+  bool        hasContext( const QString& ctx ) const
+  {
+    QStringList cl = QStringList::split(",",context);
+    return cl.find( ctx ) != cl.end();
+  }
   // gets default mode
   QString     getDefault() const      { return defaultMode; }
   // returns true if this product needs to pick-up environment