*/
bool QAD_Application::isStudyOpened( const QString& studyName )
{
- QString Name = QAD_Tools::getFileNameFromPath( studyName, false );
+ QString Name = QAD_Tools::getFileNameFromPath( studyName, true );
return (( getStudyByName( studyName ) != NULL ) || (getStudyByName( Name ) != NULL ));
}
void QAD_Application::helpSearch()
{
/* just calls QAD_Desktop::helpSearch() but can have own implementation */
- // getDesktop()->helpSearch();
+// getDesktop()->helpSearch();
}
/*!
void QAD_Application::helpContents()
{
/* just calls QAD_Desktop::helpContents() but can have own implementation */
- // getDesktop()->helpContents();
+// getDesktop()->helpContents();
}
/*!
while ( exist ) {
exist = false;
for (unsigned int ind = 0; ind < List->length();ind++) {
- QString NameS = QAD_Tools::getFileNameFromPath( QString( List[ind] ), false );
+ QString NameS = QAD_Tools::getFileNameFromPath( QString( List[ind] ), true );
if ( NameS.compare( StudyName ) == 0 ) {
StudyName = getDesktop()->getNewStudyName();
exist = true;
/* open StudyDS */
SALOMEDS::Study_var aStudy = myStudyMgr->Open((char*) name.latin1());
+ //MPV: name of the study is set in the study manager now
//NRI DEBUG : 11/02/2002
- aStudy->Name( QAD_Tools::getFileNameFromPath(name,false) );
+ //aStudy->Name( QAD_Tools::getFileNameFromPath(name,true) );
/* create QAD study */
openStudy = new QAD_Study( this, aStudy, fileName );
#include "QAD_ObjectBrowser.h"
#include "QAD_Resource.h"
#include "QAD_FileDlg.h"
-//NRI#include "QAD_HelpWindow.h"
+//NRI #include "QAD_HelpWindow.h"
#include "QAD_DirListDlg.h"
#include "QAD_WaitCursor.h"
#include "SALOMEGUI_OpenWith.h"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SALOMEGUI_AboutDlg.h"
#include "SALOMEGUI_ViewChoiceDlg.h"
+#include "SALOMEGUI_SetValueDlg.h"
#include "utilities.h"
#include "SALOMEGUI_CloseDlg.h"
QAD_ResourceMgr* QAD_Desktop::resourceMgr = 0;
QPalette* QAD_Desktop::palette = 0;
+static QString createString( int theItemId, int thePosId )
+{
+ QString aRetString = QString("item-id=");
+ QString aString;
+ QString aItemId = aString.setNum(theItemId);
+ QString aPosId = aString.setNum(thePosId);
+ aRetString = aRetString + '"'; aRetString = aRetString + aItemId; aRetString = aRetString + '"';
+ aRetString = aRetString + " pos-id="; aRetString = aRetString + '"';
+ aRetString = aRetString + aPosId;
+ aRetString = aRetString + '"'; aRetString = aRetString + ">";
+ return aRetString;
+}
/*!
Creates the resource manager [ static ]
myMainMenu->insertItem ( tr("MEN_DESK_VIEW"), &myViewPopup, 2 ); /* add popup VIEW */
myMainMenu->insertItem ( tr("MEN_DESK_TOOLS"), &myToolsPopup, 5 ); /* add popup TOOLS */
myMainMenu->insertItem ( tr("MEN_DESK_PREF"), &myPrefPopup, 4 ); /* add popup PREF */
- myMainMenu->insertItem ( tr("MEN_DESK_WINDOW"), &myWindowPopup, 6 );/* add popup WINDOW */
+ myMainMenu->insertItem ( tr("MEN_DESK_WINDOW"), &myWindowPopup, 6 ); /* add popup WINDOW */
myMainMenu->insertItem ( tr("MEN_DESK_HELP"), &myHelpPopup, 7 ); /* add popup HELP */
/* Applications will insert their items after 'File' 'Edit' and 'View'
QAD_ASSERT(connect( myQAG, SIGNAL(selected(QActionP * )), this, SLOT(onDefaultViewer(QActionP *) )));
//VRV: T2.5 - add default viewer
+ myPrefPopup.insertSeparator();
+
QActionP* viewerTrihedronAction = new QActionP( "", tr("MEN_DESK_PREF_VIEWER_TRIHEDRON"), 0, this );
QAD_ASSERT(connect( viewerTrihedronAction, SIGNAL(activated()), this, SLOT(onViewerTrihedron() )));
viewerTrihedronAction->addTo( &myPrefPopup );
ASCIISaveAction->addTo( &myPrefPopup );
myStdActions.insert( PrefASCIISave, ASCIISaveAction );
+ /* Undo level */
+ QActionP* UndoLevelAction = new QActionP( "", tr("MEN_DESK_PREF_UNDO_LEVEL"), 0, this );
+ QAD_ASSERT(connect( UndoLevelAction, SIGNAL(activated()), this, SLOT(onUndoLevel() )));
+ UndoLevelAction->addTo( &myPrefPopup );
+ myStdActions.insert( PrefUndoLevelId, UndoLevelAction );
+
myPrefPopup.insertSeparator();
/* External Browser */
QActionP* objectBrowserCHRONO_SORTAction = new QActionP( "", tr("MEN_DESK_PREF_OBJECTBROWSER_CHRONO_SORT"), 0, this, 0, true );
QAD_ASSERT(connect( objectBrowserCHRONO_SORTAction, SIGNAL(activated()), this, SLOT(onObjectBrowser() )));
objectBrowserCHRONO_SORTAction->setToggleAction(true);
- QString showSORT = QAD_CONFIG->getSetting("ObjectBrowser:CHRONO_SORT");
+ QString showSORT = QAD_CONFIG->getSetting("ObjectBrowser:ChronologicalSort");
if ( showSORT.compare( aTrueQString ) == 0 )
objectBrowserCHRONO_SORTAction->setOn(true) ;
objectBrowserCHRONO_SORTAction->addTo( &myObjBrowserPopup );
myStdActions.insert( PrefObjectBrowserCHRONO_SORTId, objectBrowserCHRONO_SORTAction ) ;
+ /* Show or don't Show UseCase browser */
+ QActionP* objectBrowserShowUseCaseAction = new QActionP( "", tr("MEN_DESK_PREF_OBJECTBROWSER_SHOW_USECASE"), 0, this, 0, true );
+ QAD_ASSERT(connect( objectBrowserShowUseCaseAction, SIGNAL(activated()), this, SLOT(onObjectBrowser() )));
+ objectBrowserShowUseCaseAction->setToggleAction(true);
+ QString showUseCase = QAD_CONFIG->getSetting("ObjectBrowser:ShowUseCaseBrowser");
+
+ if ( showUseCase.compare( aTrueQString ) == 0 )
+ objectBrowserShowUseCaseAction->setOn(true) ;
+ else
+ objectBrowserShowUseCaseAction->setOn(false) ;
+
+ objectBrowserShowUseCaseAction->addTo( &myObjBrowserPopup );
+ myStdActions.insert( PrefObjectBrowserShowUseCaseId, objectBrowserShowUseCaseAction ) ;
+
+ /* Resize or don't resize columns automatically */
+ QActionP* objectBrowserNoAutoSizeAction = new QActionP( "", tr("MEN_DESK_PREF_OBJECTBROWSER_NO_AUTOSIZE"), 0, this, 0, true );
+ QAD_ASSERT(connect( objectBrowserNoAutoSizeAction, SIGNAL(activated()), this, SLOT(onObjectBrowser() )));
+ objectBrowserNoAutoSizeAction->setToggleAction(true);
+ QString noAutoSize = QAD_CONFIG->getSetting("ObjectBrowser:NoAutoSizeColumns");
+
+ if ( noAutoSize.compare( aTrueQString ) == 0 )
+ objectBrowserNoAutoSizeAction->setOn(true) ;
+ else
+ objectBrowserNoAutoSizeAction->setOn(false) ;
+
+ objectBrowserNoAutoSizeAction->addTo( &myObjBrowserPopup );
+ myStdActions.insert( PrefObjectBrowserNoAutoSizeColumnsId, objectBrowserNoAutoSizeAction ) ;
+
myPrefPopup.insertSeparator();
QActionP* dirAction = new QActionP( "", tr("MEN_DESK_PREF_DIRICTORIES"), ALT+Key_D, this );
return 0;
}
+/*!
+ Gets value of max undo level for SALOMEDS::Study's from preferences
+*/
+int QAD_Desktop::getUndoLevel()
+{
+ static int MAX_UNDO = 10;
+ int anUndoLevel = MAX_UNDO;
+ QString aLevel = QAD_CONFIG->getSetting("Desktop:UndoLevel");
+ if(!aLevel.isEmpty()) anUndoLevel = aLevel.toInt();
+ return anUndoLevel;
+}
+
/*!
Returns current active application
*/
//don't ask user to remove study permanently
if (app->getStudyByName ( name ) != NULL)
onCloseStudy ( app->getStudyByName ( name ), false );
- else if (app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, false )) != NULL)
- onCloseStudy ( app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, false )), false );
+ else if (app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, true )) != NULL)
+ onCloseStudy ( app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, true )), false );
}
appFound = true;
SALOMEDS::ListOfOpenStudies_var List = myStudyMgr->GetOpenStudies();
for (unsigned int ind = 0; ind < List->length();ind++) {
QString NameExistingStudy(List[ind]);
- QString NameOpeningStudy = QAD_Tools::getFileNameFromPath( name, false );
-
+ QString NameOpeningStudy = QAD_Tools::getFileNameFromPath( name, true );
if ( NameExistingStudy.compare( NameOpeningStudy ) == 0 ) {
if ( QAD_MessageBox::warn2 ( this, tr("WRN_WARNING"),
tr("QUE_DOC_ALREADYEXIST").arg( name ),
//don't ask user to remove study permanently
if (app->getStudyByName ( name ) != NULL)
onCloseStudy ( app->getStudyByName ( name ), false );
- else if (app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, false )) != NULL)
- onCloseStudy ( app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, false )), false );
+ else if (app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, true )) != NULL)
+ onCloseStudy ( app->getStudyByName ( QAD_Tools::getFileNameFromPath( name, true )), false );
}
appFound = true;
if (!CORBA::is_nil(driver)) {
SALOMEDS::StudyBuilder_var B = aStudy->NewBuilder();
if (!CORBA::is_nil(B)) {
- QAD_Operation* op = new QAD_Operation( myActiveStudy );
- op->start();
+// QAD_Operation* op = new QAD_Operation( myActiveStudy );
+// op->start();
B->LoadWith(SCO,driver);
- op->finish();
+// op->finish();
} else {
return false;
}
class RunBrowser: public QThread {
public:
- RunBrowser(QString theApp, QString theParams, QString theHelpFile):
- myApp(theApp), myParams(theParams), myHelpFile(theHelpFile), myStatus(0) {};
+ RunBrowser(QString theApp, QString theParams, QString theHelpFile, QString theContext=NULL):
+ myApp(theApp), myParams(theParams), myHelpFile("file:" + theHelpFile + theContext), myStatus(0) {};
virtual void run()
{
return;
}
}
-
- QString helpFile = QFileInfo( homeDir + "index.html" ).absFilePath();
-
+
+ QString helpFile = QFileInfo( homeDir + "index.html" ).absFilePath();
QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
QString aParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
*/
void QAD_Desktop::onHelpContentsGUI()
{
-
// QCString dir;
// QString root;
// QString homeDir;
// }
// if ( root.isEmpty() )
// root = "./doc/";
-
// QString helpFile = QFileInfo( homeDir + "salomedoc.html" ).absFilePath();
-
// QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
// QString aParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
return;
}
}
-
+
QString helpFile = QFileInfo( homeDir + "index.html" ).absFilePath();
QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
QXmlSimpleReader reader;
reader.setContentHandler( myXmlHandler );
reader.setErrorHandler( myXmlHandler );
+
+ bool IsMaxActStudy = myActiveStudy->getActiveStudyFrame()->isMaximized();
+ if (IsMaxActStudy) {
+ QString aSourceData = source.data();
+ aSourceData = changeXmlInputSourceData( aSourceData, Component );
+ source.setData(aSourceData);
+ }
+
bool ok = reader.parse( source );
file.close();
if ( !ok ) {
return true;
}
+QString QAD_Desktop::changeXmlInputSourceData(QString theData, QString theComponent)
+{
+ if ( theComponent=="Supervision" ) {
+ //Supervision main menu item
+ int aItemId = 300;
+ int aPosId = 3;
+ QString aStrOld = createString( aItemId, aPosId );
+ QString aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+ }
+
+ if ( theComponent == "Visu" ) {
+ //Visualization main menu item
+ int aItemId = 401;
+ int aPosId = 3;
+ QString aStrOld = createString( aItemId, aPosId );
+ QString aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Selection main menu item
+ aItemId = 41;
+ aPosId = 4;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Representation main menu item
+ aItemId = 42;
+ aPosId = 5;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+ }
+
+ if ( theComponent == "SMESH" ) {
+ //Hypotheses main menu item
+ int aItemId = 50;
+ int aPosId = 3;
+ QString aStrOld = createString( aItemId, aPosId );
+ QString aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Mesh main menu item
+ aItemId = 70;
+ aPosId = 4;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Controls main menu item
+ aItemId = 60;
+ aPosId = 5;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Modification main menu item
+ aItemId = 40;
+ aPosId = 6;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Numbering main menu item
+ aItemId = 80;
+ aPosId = 7;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+ }
+
+ if ( theComponent == "Geometry" ) {
+ //New Entity main menu item
+ int aItemId = 70;
+ int aPosId = 3;
+ QString aStrOld = createString( aItemId, aPosId );
+ QString aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Operations main menu item
+ aItemId = 40;
+ aPosId = 4;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Repair main menu item
+ aItemId = 50;
+ aPosId = 5;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+
+ //Measures main menu item
+ aItemId = 60;
+ aPosId = 6;
+ aStrOld = createString( aItemId, aPosId );
+ aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+ }
+
+ if ( theComponent == "Med" ) {
+ //MED main menu item
+ int aItemId = 90;
+ int aPosId = 3;
+ QString aStrOld = createString( aItemId, aPosId );
+ QString aStrNew = createString( aItemId, aPosId+1 );
+ theData = theData.replace( QRegExp(aStrOld), aStrNew );
+ }
+
+ return theData;
+}
+
typedef bool OneDim(int, QAD_Desktop*);
typedef void (*PTR_FACTORY_FUNCTION)( CORBA::ORB_var &orb, QWidget *parent, const char *name ) ;
/*!
*/
void QAD_Desktop::activateComponent(const QString& theName, bool isLoadData){
+
int nbItem = myCombo->count();
int Index = 0;
bool showCHRONO_SORT ;
if ( myStdActions.at( PrefObjectBrowserCHRONO_SORTId )->isOn() ) {
showCHRONO_SORT = true;
- QAD_CONFIG->addSetting( "ObjectBrowser:CHRONO_SORT", "true");
+ QAD_CONFIG->addSetting( "ObjectBrowser:ChronologicalSort", "true");
} else {
showCHRONO_SORT = false;
- QAD_CONFIG->addSetting( "ObjectBrowser:CHRONO_SORT", "false");
+ QAD_CONFIG->addSetting( "ObjectBrowser:ChronologicalSort", "false");
+ }
+
+ /* To show or not to show UseCase browser */
+ bool showUseCase;
+ if ( myStdActions.at( PrefObjectBrowserShowUseCaseId )->isOn() ) {
+ showUseCase = true;
+ QAD_CONFIG->addSetting( "ObjectBrowser:ShowUseCaseBrowser", "true");
+ } else {
+ showUseCase = false;
+ QAD_CONFIG->addSetting( "ObjectBrowser:ShowUseCaseBrowser", "false");
+ }
+
+ /* Resize or don't resize columns automatically */
+ bool autoSize;
+ if ( myStdActions.at( PrefObjectBrowserNoAutoSizeColumnsId )->isOn() ) {
+ autoSize = false;
+ QAD_CONFIG->addSetting( "ObjectBrowser:NoAutoSizeColumns", "true");
+ } else {
+ autoSize = true;
+ QAD_CONFIG->addSetting( "ObjectBrowser:NoAutoSizeColumns", "false");
}
if ( myActiveApp ) {
sf->getLeftFrame()->getObjectBrowser()->setShowValueColumn( showValue );
sf->getLeftFrame()->getObjectBrowser()->setEnableChronoSort( showCHRONO_SORT );
// sf->getLeftFrame()->getObjectBrowser()->setShowIAPP( showIAPP ); // this is done by below updateObjBrowser() call
+ sf->getLeftFrame()->getObjectBrowser()->showUseCaseBrowser( showUseCase );
+ sf->getLeftFrame()->getObjectBrowser()->autoSizeColumns( autoSize );
}
study->updateObjBrowser(true);
}
for ( QAD_Study* study = studies.first(); study; study = studies.next() ) {
int nbSf = study->getStudyFramesCount();
for ( int i = 0; i < nbSf; i++ ) {
- study->getStudyFrame(i)->getRightFrame()->getViewFrame()->SetTrihedronSize((int)dim);
+ study->getStudyFrame(i)->getRightFrame()->getViewFrame()->onAdjustTrihedron();
}
}
}
// }
/* Help Context */
-// void QAD_Desktop::helpContext(const QString& source, const QString& context)
-// {
-// // getHelpWindow()->context(source, context);
-// // getHelpWindow()->show();
-// // getHelpWindow()->raise();
-// // getHelpWindow()->setActiveWindow();
-// }
+//void QAD_Desktop::helpContext(const QString& source, const QString& context)
+//{
+// //getHelpWindow()->context(source, context); //implemented in QAD_HelpWindow::context( const QString& _source, const QString& _context)
+// //getHelpWindow()->show(); //from QMainWindow class
+// //getHelpWindow()->raise(); //from QMainWindow class
+// //getHelpWindow()->setActiveWindow(); //from QMainWindow class
+
+// QString anApp = QAD_CONFIG->getSetting("ExternalBrowser:Application");
+// QString aParams = QAD_CONFIG->getSetting("ExternalBrowser:Parameters");
+
+// RunBrowser* rs = new RunBrowser(anApp, aParams, source, context);
+// rs->start();
+//}
/* Preferences/MultiFile Save */
void QAD_Desktop::onMultiFileSave()
QAD_CONFIG->addSetting( "Desktop:ASCIISave", "false");
}
+/* Preferences / Undo Level */
+void QAD_Desktop::onUndoLevel()
+{
+ static int MAX_UNDO_LEVEL = 1000;
+ bool isAccepted = false;
+ static QString aLabel = QString("Level value (%1 ... %2) : ").
+ arg(1).arg(MAX_UNDO_LEVEL);
+ int anUndoLevel =
+ SALOMEGUI_SetValueDlg::getInteger("Undo Level",aLabel,
+ 1,MAX_UNDO_LEVEL,getUndoLevel(),
+ &isAccepted);
+ if(!isAccepted) return;
+ QAD_CONFIG->addSetting("Desktop:UndoLevel", anUndoLevel);
+ if(!myActiveApp) return;
+ QList<QAD_Study>& studies = myActiveApp->getStudies();
+ int aWasWarning = 0;
+ for(QAD_Study* study = studies.first(); study; study = studies.next()){
+ SALOMEDS::Study_var aStudyDoc = study->getStudyDocument();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudyDoc->NewBuilder();
+ if (!aStudyDoc->GetProperties()->IsLocked()) {
+ aStudyBuilder->UndoLimit(anUndoLevel);
+ } else {
+ if (!aWasWarning) {
+ QAD_MessageBox::warn1 ((QWidget*)QAD_Application::getDesktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED"),
+ QObject::tr("BUT_OK"));
+ aWasWarning = 1;
+ }
+ }
+ }
+}
+
/*********************************************************************
** Class: AppSelectionDlg
** Descr: Dialog for the selection of the application when several
#include "QAD_Application.h"
#include "QAD_OperatorMenus.h"
#include "QAD_Menus.h"
-//NRI #include "QAD_HelpWindow.h"
+//NRI#include "QAD_HelpWindow.h"
#include "QAD_Action.h"
#include "SALOME_NamingService.hxx"
DefaultViewerOCCId, DefaultViewerVTKId, DefaultGraphSupervisorId, DefaultPlot2dId,
//VRV: T2.5 - add default viewer
PrefViewerTrihedronId, PrefConsoleFontId, PrefObjectBrowserEntryId,
- PrefObjectBrowserIAPPId, PrefObjectBrowserValueId, PrefObjectBrowserCHRONO_SORTId,
- PrefDirsId, PrefMultiFileSave, PrefASCIISave, PrefExternalBrowserId, PrefSaveId,
+ PrefObjectBrowserIAPPId, PrefObjectBrowserValueId, PrefObjectBrowserCHRONO_SORTId,PrefObjectBrowserShowUseCaseId,
+ PrefObjectBrowserNoAutoSizeColumnsId,
+ PrefDirsId, PrefMultiFileSave, PrefASCIISave, PrefUndoLevelId, PrefExternalBrowserId, PrefSaveId,
//NRI : SAL2214
WindowNew3dId, ViewOCCId, ViewVTKId, ViewPlot2dId,
//NRI : SAL2214
QWorkspaceP* getMainFrame() const;
QString getNewStudyName();
QAD_Study* findStudy( SALOMEDS::Study_ptr theStudy );
-
+ static int getUndoLevel();
/* help actions */
virtual void helpAbout();
-/* virtual void helpSearch(); */
-/* virtual void helpContents(); */
-/* virtual void helpContext(const QString& path, const QString& dir = QString::null); */
-
+/* virtual void helpSearch();
+ virtual void helpContents();
+ virtual void helpContext(const QString& path, const QString& dir = QString::null);
+*/
bool loadComponent(QString);
+ QString changeXmlInputSourceData(QString theData, QString theComponent);
void activateComponent(const QString& theName, bool isLoadData = true);
void createStudy();
void onObjectBrowser();
void onMultiFileSave();
void onASCIISave();
+ void onUndoLevel();
void onExternalBrowser();
void onActivateApp(QAD_Application* app);
void onHelpContents();
void onHelpContentsGUI();
void onHelpContentsTUI();
-/* void onHelpSearch(); */
+/* void onHelpSearch(); */
void onHelpAbout();
void onNewWindow3d();
void onComboActiveComponent( const QString & , bool isLoadData);
void onCascade();
- //NRI void onHelpWindowClosed();
+/* NRI void onHelpWindowClosed(); */
protected:
QMenuBar* myMainMenu; /* the main menu bar */
QList<QAD_Menus> myMenusList;
QAD_Menus* myActiveMenus;
- //NRI QAD_HelpWindow* myHelpWindow;
+ //NRI QAD_HelpWindow* myHelpWindow;
QList<QToolButton> myComponentButton;
// if ( mySelectedFile.isEmpty() )//VSR- 06/12/02
if ( mySelectedFile.stripWhiteSpace().isEmpty() )//VSR+ 06/12/02
return;
-
+
// if ( QAD_Tools::getFileExtensionFromPath( mySelectedFile ).isEmpty() ) //VSR- 06/12/02
- if ( QAD_Tools::getFileExtensionFromPath( mySelectedFile ).isEmpty() && !mySelectedFile.contains(".") ) //VSR+ 06/12/02
- {
+//ota : 16/12/03 if ( QAD_Tools::getFileExtensionFromPath( mySelectedFile ).isEmpty() ) //VSR+ 06/12/02
+// {
+
#if QT_VERSION < 0x030000
QRegExp r( QString::fromLatin1("([a-zA-Z0-9.*? +;#]*)$") );
int len, index = r.match( selectedFilter(), 0, &len );
// QString wildcard = selectedFilter().mid( index + 1, r.matchedLength()-2 ); //VSR- 06/12/02
QString wildcard = selectedFilter().mid( index + 1, r.matchedLength()-2 ).stripWhiteSpace(); //VSR+ 06/12/02
#endif
- index = wildcard.findRev( '.' );
- if ( index >= 0 )
- mySelectedFile += wildcard.mid( index );
+ if ( mySelectedFile[mySelectedFile.length() - 1] == '.')
+ //if the file name ends with the point remove it
+ mySelectedFile.truncate(mySelectedFile.length() - 1);
+ QString anExt = "." + QAD_Tools::getFileExtensionFromPath( mySelectedFile ).stripWhiteSpace();
+ // From the filters list make a pattern to validate a file extension
+ // Due to transformations from the filter list (*.txt *.*xx *.c++ QAD*.* ) we
+ // will have the pattern (\.txt|\..*xx|\.c\+\+|\..*) (as we validate extension only we remove
+ // stay extension mask only in the pattern
+ QString aPattern(wildcard);
+ QRegExp anExtRExp("("+aPattern.replace(QRegExp("(^| )[0-9a-zA-Z*_?]*\\."), " \\.").
+ stripWhiteSpace().replace(QRegExp("\\s+"), "|").
+ replace(QRegExp("[*]"),".*").replace(QRegExp("[+]"),"\\+") + ")");
+
+ if ( anExtRExp.match(anExt) == -1 ) //if a selected file extension does not match to filter's list
+ { //remove a point if it is at the word end
+ if (anExt[ anExt.length() - 1 ] == '.') anExt.truncate( anExt.length() - 1 );
+ index = wildcard.findRev( '.' );
+ if ( index >= 0 )
+ mySelectedFile += wildcard.mid( index ); //add the extension
+ }
}
- }
+ // }
}
/*!
QCString dir;
QString root;
if ( (dir = getenv("KERNEL_ROOT_DIR")) ) {
- root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- homeDir = root;
- }
- else {
- root = QAD_Tools::addSlash( root + "html" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- homeDir = root;
- }
- else {
- root = QAD_Tools::addSlash( root + "html" );
- if ( QFileInfo( root + "index.html" ).exists() ) {
- homeDir = root;
- }
- }
- }
+ root = QAD_Tools::addSlash( QAD_Tools::addSlash(dir) + QAD_Tools::addSlash("share") + QAD_Tools::addSlash("salome") + "doc" );
+ if ( QFileInfo( root + "index.html" ).exists() ) {
+ homeDir = root;
+ }
+ else {
+ root = QAD_Tools::addSlash( root + "html" );
+ if ( QFileInfo( root + "index.html" ).exists() ) {
+ homeDir = root;
+ }
+ else {
+ root = QAD_Tools::addSlash( root + "html" );
+ if ( QFileInfo( root + "index.html" ).exists() ) {
+ homeDir = root;
+ }
+ }
+ }
}
if ( root.isEmpty() ) {
- if ( QFileInfo( "/usr/local/doc/html/index.html" ).exists() ) {
- homeDir = "/usr/local/doc/html/";
- }
+ if ( QFileInfo( "/usr/local/doc/html/index.html" ).exists() ) {
+ homeDir = "/usr/local/doc/html/";
+ }
}
if ( root.isEmpty() )
- root = "./doc/";
-
+ root = "./doc/";
+
browser->setSource( QFileInfo( homeDir + "index.html" ).absFilePath() );
*/
browser->setFocus();
#include "QAD_Settings.h"
#include "QAD_Tools.h"
#include "QAD_RightFrame.h"
+#include "QAD_LeftFrame.h"
#include "SALOME_Selection.h"
#include "SALOME_InteractiveObject.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#define UC_CLEAR_ID 1000014
#define UC_SET_CURRENT_ID 1000016
+/*!
+ Small button which updates Object Browser's contents
+*/
+Btn::Btn ( QWidget * parent, const char * name ) : QToolButton( parent, name )
+{
+ connect( this, SIGNAL(clicked()), this, SLOT(onClicked()) );
+}
+void Btn::onClicked()
+{
+ QAD_ObjectBrowser* OB = QAD_Application::getDesktop()->getActiveApp()->getActiveStudy()->getActiveStudyFrame()->getLeftFrame()->getObjectBrowser();
+ OB->Update();
+}
+
/*!
Gets selected top-level items (i.e. not including sub-items) [ static ]
*/
QAD_ResourceMgr* resMgr = QAD_Desktop::createResourceManager();
this->setTabPosition( QTabWidget::Bottom );
-
+
/* Reading setting : Columns for Value, OCAF Doc entry, object IOR, OCAF Doc ref entry and Chrono sorting */
QString AddColumn = QAD_CONFIG->getSetting( "ObjectBrowser:AddColumn" );
QString ValueColumn = QAD_CONFIG->getSetting( "ObjectBrowser:ValueColumn" );
- QString ShowCHRONO_SORT = QAD_CONFIG->getSetting( "ObjectBrowser:CHRONO_SORT" );
-
+ QString ShowCHRONO_SORT = QAD_CONFIG->getSetting( "ObjectBrowser:ChronologicalSort" );
+ QString showUseCase = QAD_CONFIG->getSetting("ObjectBrowser:ShowUseCaseBrowser");
+ QString noAutoSizeColumns = QAD_CONFIG->getSetting( "ObjectBrowser:NoAutoSizeColumns" );
+
/* create and setup Object Browser ================================= */
myListView = new QListView( this, "Object Browser");
myListView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
myListView->addColumn( tr( "OBJECT_BROWSER_IOR" ) ); /* Adding Object IOR column */
myListView->addColumn( tr( "OBJECT_BROWSER_REFENTRY" ) ); /* Adding OCAF Doc ref entry column */
myListView->header()->setMovingEnabled( false );
-
+
/* Properties */
myListView->header()->setClickEnabled( TRUE ); /* Enable clicking on the header */
myListView->setShowSortIndicator( TRUE ) ; /* Add user arrows to indicate the sort order : LPN */
myListView->setVScrollBarMode( QScrollView::AlwaysOn ); /* Set scrollbars always visible */
myListView->setHScrollBarMode( QScrollView::AlwaysOn ); /* ... */
+ myListView->setCornerWidget( new Btn( this ) );
/* Connect section */
//VRV: porting on Qt 3.0.5
#if QT_VERSION < 0x030005
this, SLOT( onExpanded( QListViewItem* ) ) );
connect( myListView, SIGNAL( collapsed( QListViewItem* ) ),
this, SLOT( onCollapsed( QListViewItem* ) ) );
-
+
/* create and setup UseCase Browser ================================ */
- QWidget* vBox = new QWidget( this );
- QVBoxLayout* vBoxLayout = new QVBoxLayout( vBox );
+ myVBox = new QWidget( this );
+ QVBoxLayout* vBoxLayout = new QVBoxLayout( myVBox );
- myUseCaseView = new QListView( vBox, "UseCase Browser");
+ myUseCaseView = new QListView( myVBox, "UseCase Browser");
myUseCaseView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
myUseCaseView->setMinimumSize( 1, 1 );
myUseCaseView->setPalette( QAD_Application::getPalette( true ) );
myUseCaseView->setSorting( -1 ) ;
vBoxLayout->addWidget( myUseCaseView );
- myNewBtn = new QToolButton( vBox );
+ myUseCaseView->setCornerWidget( new Btn( this ) );
+
+ myNewBtn = new QToolButton( myVBox );
myNewBtn->setIconSet( resMgr->loadPixmap( "QAD", tr("ICON_UC_NEW") ) );
myNewBtn->setAutoRaise( true );
QToolTip::add( myNewBtn, tr( "UC_NEW_ID" ), QAD_Application::getDesktop()->toolTipGroup(), tr( "UC_NEW_TIP" ) );
- myAddBtn = new QToolButton( vBox );
+ myAddBtn = new QToolButton( myVBox );
myAddBtn->setIconSet( resMgr->loadPixmap( "QAD", tr("ICON_UC_ADD") ) );
myAddBtn->setAutoRaise( true );
QToolTip::add( myAddBtn, tr( "UC_APPEND_ID" ), QAD_Application::getDesktop()->toolTipGroup(), tr( "UC_APPEND_TIP" ) );
- myDelBtn = new QToolButton( vBox );
+ myDelBtn = new QToolButton( myVBox );
myDelBtn->setIconSet( resMgr->loadPixmap( "QAD", tr("ICON_UC_REMOVE") ) );
myDelBtn->setAutoRaise( true );
QToolTip::add( myDelBtn, tr( "UC_REMOVE_ID" ), QAD_Application::getDesktop()->toolTipGroup(), tr( "UC_REMOVE_TIP" ) );
- myClearBtn = new QToolButton( vBox );
+ myClearBtn = new QToolButton( myVBox );
myClearBtn->setIconSet( resMgr->loadPixmap( "QAD", tr("ICON_UC_CLEAR") ) );
myClearBtn->setAutoRaise( true );
QToolTip::add( myClearBtn, tr( "UC_CLEAR_ID" ), QAD_Application::getDesktop()->toolTipGroup(), tr( "UC_CLEAR_TIP" ) );
- myCurrentBtn = new QToolButton( vBox );
+ myCurrentBtn = new QToolButton( myVBox );
myCurrentBtn->setIconSet( resMgr->loadPixmap( "QAD", tr("ICON_UC_SET_CURRENT") ) );
myCurrentBtn->setAutoRaise( true );
QToolTip::add( myCurrentBtn, tr( "UC_SET_CURRENT_ID" ), QAD_Application::getDesktop()->toolTipGroup(), tr( "UC_SET_CURRENT_TIP" ) );
/* add Object Browser and UseCase Browser as pages ================= */
this->addTab( myListView, tr( "TLT_OBJECT_BROWSER" ) );
- this->addTab( vBox, tr( "TLT_USECASE_BROWSER" ) );
-
+ this->addTab( myVBox, tr( "TLT_USECASE_BROWSER" ) );
+
+ if ( showUseCase != "true")
+ this->removePage(myVBox);
+
setShowInfoColumns( AddColumn == "true" );
setShowValueColumn( ValueColumn == "true" );
setEnableChronoSort( ShowCHRONO_SORT == "true" );
+ if ( noAutoSizeColumns == "true" )
+ {
+ for (int i = 0; i < myListView->header()->count(); i++ )
+ myListView->setColumnWidthMode(i, QListView::Manual);
+ }
+
resize( QSize( 100, 400 ) );
}
{
QAD_Desktop* Desktop = (QAD_Desktop*) QAD_Application::getDesktop();
QAD_Study* myActiveStudy = Desktop->getActiveStudy();
+
if ( myStudy->_is_nil() )
return QTabWidget::eventFilter( o, e );
SALOMEDS::UseCaseBuilder_var UCBuilder = myStudy->GetUseCaseBuilder();
- if ( o == myUseCaseView->viewport() ) {
+ if (o == myUseCaseView->viewport()) {
if ( e->type() == QEvent::MouseButtonPress ) {
// Test if clicked on selection and start drag if necessary
QMouseEvent* me = ( QMouseEvent* )e;
QString msg;
QAD_ResourceMgr* resMgr = QAD_Desktop::createResourceManager();
if ( resMgr ) {
- if(resMgr->loadResources( QAD_Application::getDesktop()->getComponentName(QString(aFatherName->Value())), msg )) {
- QPixmap icon ( resMgr->loadPixmap( QAD_Application::getDesktop()->getComponentName(QString(aFatherName->Value())),
+ if(resMgr->loadResources( QString(aFatherName->Value()) + "GUI", msg )) {
+ QPixmap icon ( resMgr->loadPixmap( QString(aFatherName->Value()) + "GUI",
tr(aPixmap->GetPixMap()) /*tr( "ICON_OBJBROWSER_" + theComponent )*/ ));
Item->setPixmap( 0, icon );
}
*/
void QAD_ObjectBrowser::Update()
{
- int x = myListView->contentsX();
- int y = myListView->contentsY();
-
+ int xc = myListView->contentsX();
+ int yc = myListView->contentsY();
+ myListView->viewport()->setUpdatesEnabled( false );
+
myListView->clear();
myListViewMap.clear();
Update (SC, Item);
}
}
- /* Updating UseCase Browser ============================================= */
- UpdateUseCaseBrowser();
+ myListView->setContentsPos(xc,yc);
- myListView->setContentsPos(x,y);
-}
+ myListView->viewport()->setUpdatesEnabled( true );
+ myListView->viewport()->repaint( false );
+ /* Updating UseCase Browser ============================================= */
+ if ( this->count() > 1 )
+ UpdateUseCaseBrowser();
+}
/*!
Removes item with all childs from the map - used to optimize UseCase browser update
*/
void QAD_ObjectBrowser::UpdateUseCaseBrowser() {
// myUseCaseView->clear(); myUseCaseMap.clear();
- if ( myStudy->_is_nil() ) {
+ if ( myStudy->_is_nil() || this->count()<2 ) {
return;
}
myUseCaseView->blockSignals( true );
*/
void QAD_ObjectBrowser::UpdateUCItem( SALOMEDS::SObject_var UCObject, QAD_ObjectBrowserItem* UCItem )
{
- if ( myStudy->_is_nil() || !UCItem )
+ if ( myStudy->_is_nil() || !UCItem )
return;
/* Creating SObjects item */
void QAD_ObjectBrowser::unHighlightAll()
{
myListView->clearSelection();
- myUseCaseView->clearSelection();
+ myUseCaseView->clearSelection();
}
/*!
*/
void QAD_ObjectBrowser::onSelectedItem()
{
+ if (currentPage()==myListView)
+ myUseCaseView->clearSelection();
+
QListView* whoIs;
if ( sender()->inherits("QListView") )
whoIs = (QListView*)sender();
void QAD_ObjectBrowser::setShowInfoColumns( bool show )
{
bool shown = myListView->header()->isResizeEnabled( 2 );
+
if ( show != shown ) {
if ( show ) {
myListView->header()->setResizeEnabled( true, 2 );
void QAD_ObjectBrowser::setShowValueColumn( bool show )
{
bool shown = myListView->header()->isResizeEnabled( 1 );
+
if ( show != shown ) {
if ( show ) {
myListView->header()->setResizeEnabled( true, 1 );
if ( sender() == myCurrentBtn )
onUseCasePopupMenu( UC_SET_CURRENT_ID );
}
+
+/*
+ Show/remove UseCase Browser
+*/
+
+void QAD_ObjectBrowser::showUseCaseBrowser ( bool show )
+{
+ bool shown = (this->count() > 1);
+
+ if (show != shown)
+ {
+ if (show)
+ {
+ this->addTab( myVBox, tr( "TLT_USECASE_BROWSER" ) );
+ UpdateUseCaseBrowser();
+ unHighlightAll();
+ }
+ else
+ this->removePage(myVBox);
+ }
+}
+
+/*!
+ Switch between auto resizing of columns and manual mode
+*/
+void QAD_ObjectBrowser::autoSizeColumns( bool autosize )
+{
+ if (autosize)
+ {
+ for (int i = 0; i < myListView->header()->count(); i++ )
+ if (myListView->header()->isResizeEnabled(i))
+ myListView->setColumnWidthMode(i, QListView::Maximum);
+
+ }
+ else
+ {
+ for (int i = 0; i < myListView->header()->count(); i++ )
+ myListView->setColumnWidthMode(i, QListView::Manual);
+ }
+}
void setShowInfoColumns( bool show );
void setShowValueColumn( bool show );
void setEnableChronoSort( bool enable );
+ void showUseCaseBrowser ( bool show );
+ void autoSizeColumns ( bool autosize );
protected:
void Update( SALOMEDS::SObject_ptr SO,
ItemMap myListViewMap;
ItemMap myUseCaseMap;
QListView* myListView;
+ QWidget* myVBox;
QListView* myUseCaseView;
QPopupMenu* myPopupMenu;
SALOMEDS::Study_ptr myStudy;
QToolButton* myClearBtn;
};
+
+class Btn : public QToolButton
+{
+ Q_OBJECT
+public:
+ Btn ( QWidget * parent, const char * name = 0 );
+public slots:
+ void onClicked();
+};
+
#endif
// QT Include
#include <qapplication.h>
-#define MAX_UNDO 10
/*!
Constructor
*/
{
myStudy = aStudy;
- myTitle = QAD_Tools::getFileNameFromPath( path, false );
+ myTitle = QAD_Tools::getFileNameFromPath( path, true );
myIsActive = false;
myIsSaved = false;
/* set default Undo/Redo limit */
QAD_ASSERT_DEBUG_ONLY( !myStudy->_is_nil() );
SALOMEDS::StudyBuilder_var SB = myStudy->NewBuilder();
- SB->UndoLimit( MAX_UNDO );
+
+ int aLocked = myStudy->GetProperties()->IsLocked();
+ if (aLocked) myStudy->GetProperties()->SetLocked(false);
+ SB->UndoLimit(QAD_Desktop::getUndoLevel());
+ if (aLocked) myStudy->GetProperties()->SetLocked(true);
+
}
/*!
SALOMEDS::SObject_var fatherSF = myStudy->FindObjectID(sf->entry());
if (!fatherSF->_is_nil()) {
SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ int aLocked = myStudy->GetProperties()->IsLocked();
+ if (aLocked) myStudy->GetProperties()->SetLocked(false);
aStudyBuilder->RemoveObject(fatherSF);
+ if (aLocked) myStudy->GetProperties()->SetLocked(true);
}
updateObjBrowser( true );
{
myPath = path;
- QString title = QAD_Tools::getFileNameFromPath( path, false );
+ QString title = QAD_Tools::getFileNameFromPath( path, true );
QAD_ASSERT_DEBUG_ONLY ( !title.isNull() );
for ( QAD_StudyFrame* sf = myStudyFrames.first(); sf ; sf = myStudyFrames.next() )
*/
void QAD_Study::close()
{
+ emit closed();
if ( !myStudy->_is_nil() )
abortAllOperations();
/* clear each study frame */
signals:
void docClosing( QAD_Study* );
void docOperationTerminated( bool );
+ void closed();
public slots:
void onStudyFrameActivated( QAD_StudyFrame* );
*/
void QAD_StudyFrame::closeEvent(QCloseEvent* e)
{
- emit sfBeforeStudyFrameClosing(this);
emit sfStudyFrameClosing(this);
}
signals:
void sfStudyFrameActivated( QAD_StudyFrame* );
void sfStudyFrameClosing( QAD_StudyFrame*);
- void sfBeforeStudyFrameClosing( QAD_StudyFrame*);
public slots:
void onStudyFrameActivated ( QWidget* );
QFont QAD_Tools::stringToFont( const QString& fontDescription )
{
QFont font;
- if ( !font.fromString( fontDescription ) )
+ if ( fontDescription.stripWhiteSpace().isEmpty() || !font.fromString( fontDescription ) )
font = QFont( "Courier", 11 );
return font;
}
virtual QColor backgroundColor() const = 0;
virtual void SetSelectionMode( int mode ) = 0;
-
- virtual void SetTrihedronSize( int dim ) = 0;
+
+ virtual void onAdjustTrihedron() = 0;
/* popup management */
virtual void setPopupServer( QAD_Application* ) = 0;
msgid "ICON_HELP"
msgstr "help.png"
+msgid "QAD_HelpWindow::ICON_APP_HELP_BACK"
+msgstr "back.xpm"
+
+msgid "QAD_HelpWindow::ICON_APP_HELP_FORWARD"
+msgstr "forward.xpm"
+
+msgid "QAD_HelpWindow::ICON_APP_HELP_HOME"
+msgstr "home.xpm"
+
#--------------
# VIEW
#--------------
msgid "MEN_DESK_PREF_OBJECTBROWSER_CHRONO_SORT"
msgstr "Chronological sort of objects"
+msgid "MEN_DESK_PREF_OBJECTBROWSER_SHOW_USECASE"
+msgstr "Show UseCase Browser"
+
+msgid "MEN_DESK_PREF_OBJECTBROWSER_NO_AUTOSIZE"
+msgstr "No autosize columns"
+
msgid "QAD_Desktop::MEN_DESK_SELECTION_MODE"
msgstr "Selection Mode"
# TOOL TIP
#---------------
+#: QAD_HelpWindow.cxx:57
+msgid "QAD_HelpWindow::TOT_HELPWINDOW_BACKWARD"
+msgstr "Backward"
+
+#: QAD_HelpWindow.cxx:60
+msgid "QAD_HelpWindow::TOT_HELPWINDOW_FORWARD"
+msgstr "Forward"
+
+#: QAD_HelpWindow.cxx:63
+msgid "QAD_HelpWindow::TOT_HELPWINDOW_HOME"
+msgstr "Home"
+
+msgid "QAD_HelpWindow::QAD_HELP_CONTENTS"
+msgstr "Contents"
+
#: QAD_Application.cxx:173
msgid "QAD_Application::TOT_APP_EDIT_REDO"
msgstr "Redo last operation"
msgid "TOT_APP_EDIT_COPY"
msgstr "Copy"
+msgid "MEN_DESK_PREF_UNDO_LEVEL"
+msgstr "Undo Level"
+
msgid "MEN_APP_EDIT_COPY"
msgstr "&Copy"
viewFrame->Repaint();
if (isForeignGUIUsed)
- foreignGUI.DlClose();
+ ;//foreignGUI.DlClose(); // VSR: Fix crash on Display objects from non-parent components
myActiveStudy->updateObjBrowser(true);
}
myLabel->setText( label );
}
+void SALOMEGUI_SetValueDlg::accept()
+{
+ const QValidator* v = myLineEdit->validator();
+ if ( v ) {
+ if ( v->inherits( "QIntValidator" ) ) {
+ bool b;
+ int val = myLineEdit->text().toInt( &b );
+ const QIntValidator* iv = dynamic_cast<const QIntValidator*>(v);
+ if ( !b || val < iv->bottom() || val > iv->top())
+ return;
+ }
+ }
+ QDialog::accept();
+}
+
/*!
Gets string value
*/
return v;
}
+/*!
+ Gets integer value
+*/
+int SALOMEGUI_SetValueDlg::getInteger( const QString& caption,
+ const QString& label,
+ int bottom,
+ int top,
+ const int oldValue,
+ bool* ok,
+ QWidget* parent )
+{
+ int v = 0;
+ SALOMEGUI_SetValueDlg* dlg = new SALOMEGUI_SetValueDlg( parent );
+ dlg->setCaption( caption );
+ dlg->setLabel( label );
+ dlg->setValidator( new QIntValidator( bottom, top, dlg ) );
+ dlg->setValue( QString::number( oldValue ) );
+ int result = dlg->exec();
+ if ( result == QDialog::Accepted )
+ v = dlg->value().toInt();
+ if ( ok )
+ *ok = result == QDialog::Accepted;
+ delete dlg;
+ return v;
+}
+
/*!
Gets double value
*/
const int oldValue = 0,
bool* ok = 0,
QWidget* parent = 0 );
+ static int getInteger( const QString& caption,
+ const QString& label,
+ int bottom,
+ int top,
+ const int oldValue = 0,
+ bool* ok = 0,
+ QWidget* parent = 0 );
static double getDouble ( const QString& caption,
const QString& label,
const double oldValue = 0.0,
bool* ok = 0,
QWidget* parent = 0 );
+public slots:
+ void accept();
private:
SALOMEGUI_SetValueDlg( QWidget* parent = 0 );
#: SALOMEGUI_TrihedronSizeDlg.cxx:77
msgid "SALOMEGUI_TrihedronSizeDlg::MEN_TRIHEDRON_SIZE"
-msgstr "Size :"
+msgstr "Size (% of bounding box) :"
#: SALOMEGUI_TrihedronSizeDlg.cxx:36
msgid "SALOMEGUI_TrihedronSizeDlg::MEN_TRIHEDRON"
#---------------
msgid "INF_VERSION"
-msgstr "Version 1.1a"
+msgstr ""
msgid "INF_COPYRIGHT"
msgstr ""
#: SALOMEGUI_TrihedronSizeDlg.cxx:77
msgid "SALOMEGUI_TrihedronSizeDlg::MEN_TRIHEDRON_SIZE"
-msgstr "Size :"
+msgstr "Size (% of bounding box) :"
#: SALOMEGUI_TrihedronSizeDlg.cxx:36
msgid "SALOMEGUI_TrihedronSizeDlg::MEN_TRIHEDRON"
#: SALOMEGUI_AboutDlg.cxx:42
msgid "ABOUT_SALOME_TLT"
-msgstr "About SALOME "
+msgstr "About SALOME Professional"
msgid "SALOMEGUI_OpenWith::OPEN_WITH_TLT"
msgstr "Open With"
{
return QAD_FileDlg::getExistingDirectory(parent, initial, caption);
}
+
+void SalomePyQt::helpContext(const QString& source, const QString& context) {
+ //QAD_Application::getDesktop()->helpContext(source, context);
+}
static QString getExistingDirectory(QWidget* parent,
const QString& initial,
const QString& caption);
+ static void helpContext(const QString& source, const QString& context);
};
#endif
static QString getFileName(QWidget*, const QString&, const QStringList&, const QString&, bool);
static QString getExistingDirectory(QWidget*, const QString&, const QString&);
+ static void helpContext(const QString&, const QString&);
};
try:
if os.access(medFile, os.R_OK) :
+ if not os.access(medFile, os.W_OK) :
+ import random
+ medFileNew = "/tmp/" + str(random.randint(0,1000000)) + "_" + medfile
+ print " -- Copy " + medFile + " to " + medFileNew
+ os.system("cp "+ medFile + " " + medFileNew)
+ medFile = medFileNew
+
if os.access(medFile, os.W_OK) :
med_comp.readStructFileWithFieldType(medFile,studyCurrent)
med_obj = visu_gui.visu.getMedObjectFromStudy()
MESSAGE ( "SUPERVGraph_ViewFrame::SetSelectionMode" )
}
-void SUPERVGraph_ViewFrame::SetTrihedronSize( int dim )
+void SUPERVGraph_ViewFrame::onAdjustTrihedron( )
{
- MESSAGE ( "SUPERVGraph_ViewFrame::SetTrihedronSize" )
+ MESSAGE ( "SUPERVGraph_ViewFrame::onAdjustTrihedron" )
}
void SUPERVGraph_ViewFrame::rename( const Handle(SALOME_InteractiveObject)& IObject,
void SetSelectionMode( int mode );
- void SetTrihedronSize( int dim );
+ void onAdjustTrihedron( );
/* popup management */
void setPopupServer( QAD_Application* );
SALOME::StatSession SALOME_Session_i::GetStatSession()
{
// update Session state
+ //qApp->lock(); // rollback bug
_GUIMutex.lock();
_isGUI = _IAPPThread->running();
_runningStudies = 0;
qApp->unlock();
}
_GUIMutex.unlock();
+ //qApp->unlock();
// getting stat info
SALOME::StatSession_var myStats = new SALOME::StatSession ;
if (_runningStudies)
{
if ( ! PtrSingleton )
{
- MESSAGE("SINGLETON_<TYPE>::Instance( void )") ;
+ //MESSAGE("SINGLETON_<TYPE>::Instance( void )") ;
PtrSingleton = new SINGLETON_<TYPE> ;
new DESTRUCTEUR_DE_<TYPE>( PtrSingleton->_Instance ) ;
}
template <class TYPE> SINGLETON_<TYPE>::SINGLETON_( void )
{
- MESSAGE("CREATION d'un SINGLETON_") ;
+ //MESSAGE("CREATION d'un SINGLETON_") ;
}