Salome HOME
Unicode support
authorvsr <vsr@opencascade.com>
Wed, 18 Jun 2014 08:36:56 +0000 (12:36 +0400)
committervsr <vsr@opencascade.com>
Wed, 18 Jun 2014 08:36:56 +0000 (12:36 +0400)
src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI_GroupDlg.cxx
src/SMESHGUI/SMESHGUI_GroupUtils.cxx

index 9e70d965de2d25a6fcccdaef81f27152f7935771..493b734bb144759ea436447652610fc438a5af65 100644 (file)
@@ -4755,7 +4755,7 @@ void SMESHGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& ti
     _PTR(Study) study = appStudy->studyDS();
     _PTR(SObject) obj = study->FindObjectID( io->getEntry() );
     if ( obj ) {
     _PTR(Study) study = appStudy->studyDS();
     _PTR(SObject) obj = study->FindObjectID( io->getEntry() );
     if ( obj ) {
-      QString aName = QString( obj->GetName().c_str() );
+      QString aName = QString( QString::fromUtf8(obj->GetName().c_str()) );
       while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup
           aName.remove( (aName.length() - 1), 1 );
       title = aName;
       while ( aName.at( aName.length() - 1 ) == ' ' ) // Remove extraspaces in Name of Popup
           aName.remove( (aName.length() - 1), 1 );
       title = aName;
@@ -6735,7 +6735,7 @@ void SMESHGUI::message( const QString& msg )
       _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() );
       QString name;
       if ( obj )
       _PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() );
       QString name;
       if ( obj )
-        name = obj->GetName().c_str();
+        name = QString::fromUtf8(obj->GetName().c_str());
       if ( name.isEmpty() )
         return;
       
       if ( name.isEmpty() )
         return;
       
index 54a1a5c700770693bcfc528ca14a3b566080f644..1293f3e0d37d95c12dea5f6edbc379f453f01313 100644 (file)
@@ -518,7 +518,7 @@ QString SMESHGUI_GroupDlg::GetDefaultName(const QString& theOperation)
   bool isUnique = false;
   while (!isUnique) {
     aName = theOperation + "_" + QString::number(++aNumber);
   bool isUnique = false;
   while (!isUnique) {
     aName = theOperation + "_" + QString::number(++aNumber);
-    isUnique = (aSet.count(aName.toLatin1().data()) == 0);
+    isUnique = (aSet.count(aName.toUtf8().data()) == 0);
   }
 
   return aName;
   }
 
   return aName;
@@ -534,7 +534,7 @@ void  SMESHGUI_GroupDlg::setDefaultName() const
   do
   {
     aResName = aPrefix + QString::number( i++ );
   do
   {
     aResName = aPrefix + QString::number( i++ );
-    anObj = aStudy->FindObject( aResName.toLatin1().data() );
+    anObj = aStudy->FindObject( aResName.toUtf8().data() );
   }
   while ( anObj );
   myName->setText(aResName); 
   }
   while ( anObj );
   myName->setText(aResName); 
@@ -570,7 +570,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_Mesh_ptr theMesh)
   if( !aList.IsEmpty() )
   {
     QString aName = aList.First()->getName();
   if( !aList.IsEmpty() )
   {
     QString aName = aList.First()->getName();
-    myMeshGroupLine->setText(aName);
+    myMeshGroupLine->setText(aName);//??????
     myMeshGroupLine->home( false );
   }
 
     myMeshGroupLine->home( false );
   }
 
@@ -593,14 +593,14 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
 
   myNameChanged = true;
   myName->blockSignals(true);
 
   myNameChanged = true;
   myName->blockSignals(true);
-  myName->setText(theGroup->GetName());
+  myName->setText(QString::fromUtf8(theGroup->GetName()));
   myName->blockSignals(false);
   myName->home(false);
 
   SALOMEDS::Color aColor = theGroup->GetColor();
   setGroupColor( aColor );
 
   myName->blockSignals(false);
   myName->home(false);
 
   SALOMEDS::Color aColor = theGroup->GetColor();
   setGroupColor( aColor );
 
-  myMeshGroupLine->setText(theGroup->GetName());
+  myMeshGroupLine->setText(QString::fromUtf8(theGroup->GetName()));
 
   int aType = 0;
   switch(theGroup->GetType()) {
 
   int aType = 0;
   switch(theGroup->GetType()) {
@@ -685,7 +685,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup,
   {
     myNameChanged = true;
     myName->blockSignals(true);
   {
     myNameChanged = true;
     myName->blockSignals(true);
-    myName->setText(theGroup->GetName());
+    myName->setText(QString::fromUtf8(theGroup->GetName()));
     myName->blockSignals(false);
   }
 
     myName->blockSignals(false);
   }
 
@@ -1038,7 +1038,7 @@ bool SMESHGUI_GroupDlg::onApply()
 
       if (myGeomObjects->length() == 1) {
         myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
 
       if (myGeomObjects->length() == 1) {
         myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
-                                                    myName->text().toLatin1().data(),
+                                                    myName->text().toUtf8().data(),
                                                     myGeomObjects[0]);
       }
       else {
                                                     myGeomObjects[0]);
       }
       else {
@@ -1080,11 +1080,11 @@ bool SMESHGUI_GroupDlg::onApply()
           aNewGeomGroupName += myName->text();
           SALOMEDS::SObject_var aNewGroupSO =
             geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
           aNewGeomGroupName += myName->text();
           SALOMEDS::SObject_var aNewGroupSO =
             geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar,
-                                aNewGeomGroupName.toLatin1().data(), aMeshShape);
+                                aNewGeomGroupName.toUtf8().data(), aMeshShape);
         }
 
         myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
         }
 
         myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType,
-                                                    myName->text().toLatin1().data(),
+                                                    myName->text().toUtf8().data(),
                                                     aGroupVar);
       }
       resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
                                                     aGroupVar);
       }
       resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnGeom );
@@ -1107,7 +1107,7 @@ bool SMESHGUI_GroupDlg::onApply()
         return false;
 
       myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
         return false;
 
       myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
-                                                      myName->text().toLatin1().data(),
+                                                      myName->text().toUtf8().data(),
                                                       myFilter);
 
       resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
                                                       myFilter);
 
       resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
@@ -1148,7 +1148,7 @@ bool SMESHGUI_GroupDlg::onApply()
     }
     else
     {
     }
     else
     {
-      resultGroup->SetName(myName->text().toLatin1().data());
+      resultGroup->SetName(myName->text().toUtf8().data());
 
       if ( aMeshGroupSO )
       {
 
       if ( aMeshGroupSO )
       {
@@ -1162,7 +1162,7 @@ bool SMESHGUI_GroupDlg::onApply()
             if ( !anActor ) return false;
             myActorsList.append( anActor );
           }
             if ( !anActor ) return false;
             myActorsList.append( anActor );
           }
-          anActor->setName(myName->text().toLatin1().data());
+          anActor->setName(myName->text().toUtf8().data());
           QColor c;
           int delta;
           switch ( myTypeId ) {
           QColor c;
           int delta;
           switch ( myTypeId ) {
index 2584d2b4f9929c30365d769045be7c894d55c2d4..ec8fa4ad8d02be3b981d23080475307079650a89 100644 (file)
@@ -42,7 +42,7 @@ namespace SMESH
     SMESH::SMESH_Group_var aGroup;
     try {
       if ( !theMesh->_is_nil() )
     SMESH::SMESH_Group_var aGroup;
     try {
       if ( !theMesh->_is_nil() )
-        aGroup = theMesh->CreateGroup( theType, theGroupName.toLatin1().data() );
+        aGroup = theMesh->CreateGroup( theType, theGroupName.toUtf8().data() );
     }
     catch( const SALOME::SALOME_Exception& S_ex ) {
       SalomeApp_Tools::QtCatchCorbaException( S_ex );
     }
     catch( const SALOME::SALOME_Exception& S_ex ) {
       SalomeApp_Tools::QtCatchCorbaException( S_ex );