Salome HOME
Modifications in according to improvement 15165.
[tools/install.git] / src / SALOME_ProgressView.cxx
index 6d5e94e7de37ce767891b7050d43b6100985ef71..0e248dbe6d8c6c070fac370b9b7338fc4bcffee6 100644 (file)
 // ================================================================
 ProgressViewItem::ProgressViewItem( ProgressView* parent, 
                                    QString       productName, 
-                                   const QString installType, 
                                    const QString scriptName, 
                                    Status        status  ) 
-     : QListViewItem( parent, productName, installType ), myScript( scriptName )
+     : QListViewItem( parent, productName ), myScript( scriptName )
 {
   setStatus( status );
 }
@@ -39,13 +38,13 @@ void ProgressViewItem::setStatus( Status status )
   myStatus = status; 
   switch ( myStatus ) {
   case Waiting:
-    setText( 2, ProgressView::tr( "Waiting" ) );    break;
+    setText( 1, ProgressView::tr( "Waiting" ) );    break;
   case Processing:
-    setText( 2, ProgressView::tr( "Processing" ) ); break;
+    setText( 1, ProgressView::tr( "Processing" ) ); break;
   case Completed:
-    setText( 2, ProgressView::tr( "Completed" ) );  break;
+    setText( 1, ProgressView::tr( "Completed" ) );  break;
   case Aborted:
-    setText( 2, ProgressView::tr( "Aborted" ) );  break;
+    setText( 1, ProgressView::tr( "Aborted" ) );    break;
   default:
     break;
   }
@@ -64,7 +63,7 @@ void ProgressViewItem::paintCell( QPainter*          painter,
                                  int                align ) 
 {
   QColorGroup acg( cg );
-  if ( column == 2 ) {
+  if ( column == 1 ) {
     switch ( myStatus ) {
     case Waiting:
       acg.setColor( QColorGroup::Text, ( ( ProgressView* )listView() )->getWaitingColor() ); break;
@@ -90,7 +89,7 @@ void ProgressViewItem::paintCell( QPainter*          painter,
 // ================================================================
 ProgressView::ProgressView( QWidget* parent ) : QListView( parent ) 
 {
-  addColumn( tr( "Product" ) ); addColumn( tr( "Type" ) ); addColumn( tr( "Status" ) );
+  addColumn( tr( "Product" ) ); addColumn( tr( "Status" ) );
   header()->hide();
   setSelectionMode( QListView::NoSelection );
   setSorting( -1 );
@@ -116,11 +115,12 @@ void ProgressView::setColors( QColor wColor, QColor pColor, QColor cColor ) {
  *  Adds product item
  */
 // ================================================================
-void ProgressView::addProduct( const QString product, const QString type, const QString script ) {
+ProgressViewItem* ProgressView::addProduct( const QString product, const QString script ) {
   QListViewItem* lastItem = this->lastItem();
-  ProgressViewItem* newItem = new ProgressViewItem( this, product, type, script );
+  ProgressViewItem* newItem = new ProgressViewItem( this, product, script );
   if ( lastItem )
     newItem->moveItem( lastItem );
+  return newItem;
 }
 // ================================================================
 /*!
@@ -183,4 +183,10 @@ QString ProgressView::getScript( const QString product ) {
   }
   return QString::null;
 }
+/*!
+  To get visibility status of an item in the progress list view
+*/
+bool ProgressView::isVisible( const QString product ) {
+  return findItem( product )->isVisible();
+}