Salome HOME
It is recommended to use standard Qt QInputDialog instead QtxNameDlg
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index 15c9c94cd0a115e8c17fa15033683bc03df3553e..922b55bc7f1fd8f556858395b4dde6292adc96c4 100644 (file)
@@ -81,7 +81,6 @@
 
 #include "SalomeApp_Tools.h"
 #include "SalomeApp_Study.h"
-#include "LightApp_NameDlg.h"
 #include "LightApp_DataOwner.h"
 #include "SalomeApp_Application.h"
 #include "LightApp_Preferences.h"
 #include <qstring.h>
 #include <qwidget.h>
 #include <qaction.h>
+#include <qinputdialog.h>
 
 // BOOST Includes
 #include <boost/shared_ptr.hpp>
@@ -1783,8 +1783,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
           {
             aName = anAttr;
             QString newName = QString(aName->Value().c_str());
-            newName = LightApp_NameDlg::getName( desktop(), newName );
-            if ( !newName.isEmpty() )
+           bool ok;
+           newName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal,
+                                             newName, &ok, desktop() );
+            if ( ok && !newName.isEmpty() )
             {
               //old source: aStudy->renameIObject( IObject, newName );
              aName->SetValue( newName.latin1() );
@@ -2202,7 +2204,10 @@ void SMESHGUI::createPopupItem( const int id,
   QChar lc = QtxPopupMgr::Selection::defEquality();
   QString rule = "(%1) and (%2) and (%3)";
   rule = rule.arg( QString( "%1>0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ) );
-  rule = rule.arg( QString( "%1client in {%2}" ).arg( lc ).arg( clients ) );
+  if( clients.isEmpty() )
+    rule = rule.arg( QString( "true" ) );
+  else
+    rule = rule.arg( QString( "%1client in {%2}" ).arg( lc ).arg( clients ) );
   rule = rule.arg( QString( "%1type in {%2}" ).arg( lc ).arg( types ) );
   rule += theRule;