]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0022752: [EDF] Provide explicit feedback on what has been done by Shape Processing...
authorvsr <vsr@opencascade.com>
Fri, 26 Dec 2014 15:39:04 +0000 (18:39 +0300)
committervsr <vsr@opencascade.com>
Fri, 26 Dec 2014 15:39:04 +0000 (18:39 +0300)
Additional changes:
- Add "Select All" check box to quickly select/deselect all operators.

src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx
src/RepairGUI/RepairGUI_ShapeProcessDlg.h

index 7ee84ce0c7b5b23a1d9c5552081e705b25c9aa0b..87ee386b37c482d924a95dfe74bca073c0daa1e8 100644 (file)
@@ -6768,6 +6768,10 @@ Would you like to continue?</translation>
         <source>TO_MERGE_SOLIDS</source>
         <translation>To merge solids</translation>
     </message>
+    <message>
+        <source>SELECT_ALL</source>
+        <translation>Select All</translation>
+    </message>
 </context>
 <context>
     <name>GEOMToolsGUI_DeleteDlg</name>
index 9648154f736cf45d9961ba3dde2d808254b34295..1e6cbdd4cef1e3f353130a2a6bd8d0430b804142 100644 (file)
@@ -6696,6 +6696,22 @@ Fermez cette boîte d&apos;alerte et choisissez les arêtes à recoller.</transl
         <translation>L&apos;activation de cette option peut résulter en une perte de temps sur certains objets.
 Voulez-vous continuer?</translation>
     </message>
+    <message>
+        <source>WIDTH_FACTOR_TOL</source>
+        <translation type="unfinished">Width factor tol.</translation>
+    </message>
+    <message>
+        <source>VOLUME_TOL</source>
+        <translation type="unfinished">Volume tol.</translation>
+    </message>
+    <message>
+        <source>TO_MERGE_SOLIDS</source>
+        <translation type="unfinished">To merge solids</translation>
+    </message>
+    <message>
+        <source>SELECT_ALL</source>
+        <translation>Tout sélectionner</translation>
+    </message>
 </context>
 <context>
     <name>GEOMToolsGUI_DeleteDlg</name>
index a0f4c94bb263ab1de0ba17be1463feace7b18728..458bfcd44c75d142dca2726700d7f4b801886b49 100644 (file)
       <source>TIME_CONSUMING</source>
       <translation>このオプションを有効にすると、特定のオブジェクトを時間の無駄が可能性があります。続行しますか。</translation>
     </message>
+    <message>
+      <source>WIDTH_FACTOR_TOL</source>
+      <translation type="unfinished">Width factor tol.</translation>
+    </message>
+    <message>
+      <source>VOLUME_TOL</source>
+      <translation type="unfinished">Volume tol.</translation>
+    </message>
+    <message>
+      <source>TO_MERGE_SOLIDS</source>
+      <translation type="unfinished">To merge solids</translation>
+    </message>
+    <message>
+      <source>SELECT_ALL</source>
+      <translation>全選択</translation>
+    </message>
   </context>
   <context>
     <name>GEOMToolsGUI_DeleteDlg</name>
index 716b792861552b02e85b8e704c089cbd60e940bd..dc32f058e203615d502b65b65fd98d5a447a1fad 100755 (executable)
@@ -97,6 +97,10 @@ void RepairGUI_ShapeProcessDlg::init()
   // layout the two group boxes in the middle, add a list of operations
   QGroupBox* anOperGr = new QGroupBox( tr( "GEOM_OPERATIONS" ), centralWidget() );
 
+  // "select all" button
+  mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), anOperGr );
+  mySelectAll->setTristate( true );
+  
   // operations list widget
   myOpList = new QListWidget( anOperGr );
   myOpList->setSortingEnabled( false );
@@ -104,6 +108,7 @@ void RepairGUI_ShapeProcessDlg::init()
 
   QVBoxLayout* aOperLay = new QVBoxLayout( anOperGr );
   aOperLay->setMargin( 9 );
+  aOperLay->addWidget( mySelectAll );
   aOperLay->addWidget( myOpList );
 
   QGroupBox* aParamsGr = new QGroupBox( tr( "GEOM_PARAMETERS" ), centralWidget() );
@@ -347,6 +352,7 @@ void RepairGUI_ShapeProcessDlg::init()
 
   connect( myOpList, SIGNAL( currentRowChanged( int )),      myStack, SLOT( setCurrentIndex( int )));
   connect( myOpList, SIGNAL( itemChanged( QListWidgetItem* )),  this, SLOT( operatorChecked( QListWidgetItem* )));
+  connect( mySelectAll, SIGNAL( stateChanged( int ) ), this, SLOT( onSelectAll( int )));
 
   adjustSize();
   loadDefaults(); // init dialog fields with values from resource file
@@ -357,6 +363,7 @@ void RepairGUI_ShapeProcessDlg::init()
 
   initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ));
   selectionChanged();
+  updateSelectAll();
 }
 
 //=================================================================================
@@ -952,4 +959,32 @@ void RepairGUI_ShapeProcessDlg::operatorChecked( QListWidgetItem * item )
   {
     myStack->setCurrentIndex( myOpList->row( item ));
   }
+  updateSelectAll();
+}
+
+void RepairGUI_ShapeProcessDlg::updateSelectAll()
+{
+  Qt::CheckState state = myOpList->count() > 0 ? myOpList->item(0)->checkState() : Qt::Unchecked;
+  for ( int i = 1; i < myOpList->count(); i++ ) {
+    if ( myOpList->item(i)->checkState() != state ) {
+      state = Qt::PartiallyChecked;
+      break;
+    }
+  }
+  mySelectAll->blockSignals( true );
+  mySelectAll->setCheckState( state );
+  mySelectAll->blockSignals( false );
+}
+
+void RepairGUI_ShapeProcessDlg::onSelectAll( int state )
+{
+  if ( state == Qt::PartiallyChecked ) { 
+    mySelectAll->setCheckState( Qt::Checked );
+    return;
+  }
+  myOpList->blockSignals( true );
+  for ( int i = 0; i < myOpList->count(); i++ ) {
+    myOpList->item(i)->setCheckState( (Qt::CheckState)state  );
+  }
+  myOpList->blockSignals( false );
 }
index 2049a0d62027e0d8f72cd315ceb55cd1c8d56ccc..61ce42c79077b567b7cc8d4477566ae827603a78 100755 (executable)
@@ -80,6 +80,7 @@ private:
   //QDict<QString,QWidget*>            myCtrlMap;  // map of controls (values) of parameters
   void                               initParamsValues(); // initialize the data structures
   void                               initSelection();
+  void                               updateSelectAll();
 
 private:
   QStringList                        myOpLst; // list of available Shape Healing Operators
@@ -88,6 +89,7 @@ private:
   GEOM::ListOfGO_var                 myObjects;  // selected objects
   
   DlgRef_1Sel*                       mySelectWdgt;
+  QCheckBox*                         mySelectAll;
   QListWidget*                       myOpList;
   QStackedLayout*                    myStack;
   
@@ -141,6 +143,7 @@ private slots:
   void                               selectClicked();
   void                               advOptionToggled( bool );
   void                               operatorChecked( QListWidgetItem * item );
+  void                               onSelectAll( int );
 };
 
 #endif // REPAIRGUI_SHAPEPROCESSDLG_H