From e4a548bae738063ebf961b6fc9d34d80a618e5de Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 28 Nov 2005 09:22:47 +0000 Subject: [PATCH] It is recommended to use standard Qt QInputDialog instead QtxNameDlg --- src/SUPERVGUI/SUPERVGUI.cxx | 8 +++++--- src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx | 10 +++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 27243a4..cd78482 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -40,7 +40,6 @@ using namespace boost; #include "OB_ListItem.h" #include "SalomeApp_Application.h" #include "SalomeApp_ImportOperation.h" -#include "LightApp_NameDlg.h" #include "LightApp_SelectionMgr.h" #include "SalomeApp_Study.h" #include "SUIT_Desktop.h" @@ -61,6 +60,7 @@ using namespace boost; #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) +#include #include int SUPERVGUI::factory = 0; @@ -514,8 +514,10 @@ void SUPERVGUI::renameDataflow() { if ( obj->FindAttribute(anAttr, "AttributeName") ) { _PTR(AttributeName) aName ( anAttr ); QString nm = QString( aName->Value().c_str() ); - nm = LightApp_NameDlg::getName( application()->desktop(), nm ); - if ( !nm.isEmpty() ) { + bool ok; + nm = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal, + nm, &ok, application()->desktop() ); + if ( ok && !nm.isEmpty() ) { // sak : 24.11.04 : fix for PAL6898 : if rename fails (study locked), // a message box is displayed, and cursor is "wait cursor". We think that "wait cursor" // is not neccessary here, because the rename operation is fast. diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx index 8e0f8f5..66bf49b 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx @@ -18,11 +18,12 @@ using namespace std; #include "SUPERVGUI_Information.h" #include "SUPERVGUI_Library.h" -#include "LightApp_NameDlg.h" #include "SUIT_MessageBox.h" #include "LogWindow.h" #include "SUIT_Session.h" +#include + SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell): QObject(theParent), @@ -350,9 +351,12 @@ bool SUPERVGUI_CanvasNode::setNodeName(QString aName) { } void SUPERVGUI_CanvasNode::rename() { - QString aName = LightApp_NameDlg::getName( SUIT_Session::session()->activeApplication()->desktop(), myNode->Name() ); + bool ok; + QString aName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal, + myNode->Name(), &ok, SUIT_Session::session()->activeApplication()->desktop() ); + //mkr : modifications for fixing bug IPAL9972 - if (!aName.isEmpty() && aName.compare( myNode->Name() ) != 0) { + if( ok && !aName.isEmpty() && aName.compare( myNode->Name() ) != 0) { setNodeName(aName); } } -- 2.39.2