\image html set_rotation_point_dialog2.png
-Unchecking <b>Use Bounding Box Center</b> checkbox allows you to
+Disabling <b>Use Bounding Box Center</b> check-box allows you to
define the coordinates of the rotation point manually.
- <b>Set to Origin</b> button restores the default rotation point
coordinates.
-- <b>Gravity Center of Select Object</b> button allows to choose Point, Edge, Face or Solid in drop-down menu.
- As soon as corresponding object is selected in the viewer, its gravity center will be used as center of the rotation point.
+- <b>Gravity Center of Selected Object</b> button allows using the gravity center of the object selected in the viewer as the center of the rotation point.
+When you click this button, you should first choose the type of selectable object: Point, Edge, Face or Solid and only then proceed with selection in the viewer.
<hr>
\anchor settings
\image html plot2d_view_settings.png
-The options are as follows:
+The following options are available:
-- <b>Main title</b> the title of the XY plot. By default, it will
- consist of the names of the tables, on the basis of which the curve
- lines have been constructed.
+- <b>Main title</b> is the XY plot title. By default, it contains the names of tables, from which the curve
+ lines are constructed.
-- <b>Curve type</b> you can select from \em Points, \em Lines or
- \em Spline.
+- <b>Curve type</b> allows selecting from \em Points, \em Lines or \em Spline.
- <b>Marker size</b> - size of the points (markers) forming curve lines.
- <b>Background color</b> of the XY plot.
-- <b>Selection color</b> - this submenu allows to select the color of selected object in the viewer.
+- <b>Selection color</b> - defines the color of selected object in the viewer.
-- <b>Legend</b> allows specifying the properties of the legend.
+- <b>Legend</b> specifies the legend properties.
- - <b>Show legend</b> - this options specifies if it's necessary to show legend by default.
+ - <b>Show legend</b> - specifies if the legend is shown by default.
- - <b>Legend Position</b> here you can define the position of the
- description table on the XY plot (to the \em Left, to the \em Right,
+ - <b>Legend Position</b> allows positioning the
+ description table on XY plot (to the \em Left, to the \em Right,
on \em Top or on \em Bottom).
- - <b>Symbol type</b> you can select the type of legend item symbol from "Marker on line" or "Marker above line"
+ - <b>Symbol type</b> allows positioning the legend item symbol: "Marker on line" or "Marker above line".
- - <b>Legend font</b> here you can set type, face and color for the
- font of Legend item.
+ - <b>Legend font</b> allows setting font variant, size and style for legend items.
- - <b>Legend font color</b> - this allows to select the color of the font of the legend item.
+ - <b>Legend font color</b> allows selecting the font color for legend items.
- - <b>Highlighted legend font color</b> - this submenu allows to select the color of the font of the selected legend item.
+ - <b>Highlighted legend font color</b> allows selecting font color for selected legend items.
-- <b>Deviation marker</b> allows specifying the properties of the
- marker, which is used for drawing deviations data.
+- <b>Deviation marker</b> specifies the properties of the marker, which is used for drawing deviations data.
- <b>Line width</b> line width of the marker.
- - <b>Tick size</b> size of the upper and lower horizontal lines of
- the marker.
+ - <b>Tick size</b> size of the upper and lower horizontal lines of the marker.
- <b>Color</b> color of the marker.
- <b>Set to Origin</b> button restores the default rotation point
coordinates.
-- <b>Gravity Center of Select Object</b> button allows to choose Point, Edge, Face or Volume in drop-down menu.
- As soon as corresponding object is selected in the viewer, its gravity center will be used as center of the rotation point.
+- <b>Gravity Center of Selected Object</b> button allows using the gravity center of the object selected in the viewer as the center of the rotation point.
+When you click this button, you should first choose the type of selectable object: Point, Edge, Face or Solid and only then proceed with selection in the viewer.
<hr>
//asl: fix for 0020515
if ( activeStudy() ) {
saveDockWindowsState();
+ }
+
#ifdef SINGLE_DESKTOP
- if ( !closeDoc() )
- return;
+ if ( !checkExistingDoc() )
+ return;
#endif
- }
CAM_Application::onNewDoc();
}
{
SUIT_Study* study = activeStudy();
saveDockWindowsState();
- if (study) {
+
#ifdef SINGLE_DESKTOP
- if ( !closeDoc() )
- return;
+ if ( !checkExistingDoc() )
+ return;
#endif
- }
-
+
CAM_Application::onOpenDoc();
-
+
if ( !study ) // new study will be create in THIS application
{
updateWindows();
*/
bool LightApp_Application::onOpenDoc( const QString& aName )
{
- if ( activeStudy() ) {
#ifdef SINGLE_DESKTOP
- if ( !closeDoc() )
- return false;
+ if ( !checkExistingDoc() )
+ return false;
#endif
- }
// We should take mru action first because this application instance can be deleted later.
QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
-
+
bool res = CAM_Application::onOpenDoc( aName );
if ( mru )
aStudy->setVisibilityStateForAll( Qtx::UnpresentableState );
}
}
+
+/*!
+ Check existing document.
+*/
+bool LightApp_Application::checkExistingDoc() {
+ return true;
+}
+
void updateVisibilityState( DataObjectList& theList,
SUIT_ViewModel* theViewModel );
+ virtual bool checkExistingDoc();
+
signals:
void studyOpened();
void studySaved();
virtual void onHelpContextModule( const QString&, const QString&, const QString& = QString() );
virtual void onNewDoc();
virtual void onOpenDoc();
+
virtual void onHelpAbout();
virtual bool onOpenDoc( const QString& );
virtual void onCopy();
</message>
<message>
<source>PREF_CURRENT_LOCALE</source>
- <translation>Use C locale</translation>
+ <translation>Use "C" locale</translation>
</message>
<message>
<source>PREF_GROUP_LOOK_AND_FEEL</source>
" ",
" "};
-QPixmap* QtxResourceMgr::myDefaultPix = NULL;
-
/*!
\class QtxResourceMgr::Resources
\internal
QtxResourceMgr::QtxResourceMgr( const QString& appName, const QString& resVarTemplate )
: myAppName( appName ),
myCheckExist( true ),
+ myDefaultPix( 0 ),
myIsPixmapCached( true ),
myHasUserValues( true ),
myWorkingMode( AllowUserValues )
qDeleteAll( myResources );
qDeleteAll( myFormats );
+
+ delete myDefaultPix;
}
/*!
\return default pixmap
\sa setDefaultPixmap(), loadPixmap()
*/
-QPixmap QtxResourceMgr::defaultPixmap()
+QPixmap QtxResourceMgr::defaultPixmap() const
{
- QPixmap res;
- if(!myDefaultPix)
- myDefaultPix = new QPixmap( pixmap_not_found_xpm );
-
- if ( myDefaultPix && !myDefaultPix->isNull() )
- res = *myDefaultPix;
- return res;
+ static QPixmap* defpx = 0;
+ if ( !defpx )
+ defpx = new QPixmap( pixmap_not_found_xpm );
+
+ return myDefaultPix ? *myDefaultPix : *defpx;
}
/*!
if ( pix.isNull() )
myDefaultPix = 0;
else
- myDefaultPix = new QPixmap( pix );
+ myDefaultPix = new QPixmap( pix );
}
/*!
QString option( const QString& ) const;
void setOption( const QString&, const QString& );
- static QPixmap defaultPixmap();
- static void setDefaultPixmap( const QPixmap& );
+ QPixmap defaultPixmap() const;
+ virtual void setDefaultPixmap( const QPixmap& );
QString resSection() const;
QString langSection() const;
ResList myResources; //!< resources list
bool myCheckExist; //!< "check existance" flag
TransListMap myTranslator; //!< map of loaded translators
- static QPixmap* myDefaultPix; //!< default icon
+ QPixmap* myDefaultPix; //!< default icon
bool myIsPixmapCached; //!< "cached pixmaps" flag
bool myHasUserValues; //!< \c true if user preferences has been read
#include <SALOME_LifeCycleCORBA.hxx>
#include <Container_init_python.hxx>
+#include <QCoreApplication>
+
//
// NB: Python requests.
// General rule for Python requests created by Python-based GUI modules
extern "C" {
SALOME_PYQT_EXPORT CAM_Module* createModule()
{
- static bool alreadyInitialized = false;
+ QCoreApplication* app = QCoreApplication::instance();
+ bool alreadyInitialized = app && app->property( "salome_pyqt_gui_light_initialized" ).toBool();
if ( !alreadyInitialized ) {
PyLockWrapper lck; // GIL acquisition
INIT_FUNCTION();
- alreadyInitialized = !alreadyInitialized;
+ if ( app ) app->setProperty( "salome_pyqt_gui_light_initialized", true );
}
return new SALOME_PYQT_Module();
#include <Container_init_python.hxx>
#endif
+#include <QCoreApplication>
+
// Py_ssize_t for old Pythons
// This code is as recommended by"
// http://www.python.org/dev/peps/pep-0353/#conversion-guidelines
{
SALOME_PYQT_LIGHT_EXPORT CAM_Module* createModule()
{
- static bool alreadyInitialized = false;
+ QCoreApplication* app = QCoreApplication::instance();
+ bool alreadyInitialized = app && app->property( "salome_pyqt_gui_light_initialized" ).toBool();
// make initialization only once (see comment above) !
if ( !alreadyInitialized ) {
PyLockWrapper lck; // GIL acquisition
INIT_FUNCTION();
- alreadyInitialized = !alreadyInitialized;
+ if ( app ) app->setProperty( "salome_pyqt_gui_light_initialized", true );
}
return new SALOME_PYQT_ModuleLight();
Py_Initialize(); // Initialize the interpreter
PySys_SetArgv(argc, argv);
PyEval_InitThreads(); // Create (and acquire) the interpreter lock - can be called many times
+ SUIT_PYTHON::initialized = true;
}
tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
/*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
- //SRN: BugID IPAL9021, add an action "Load"
- createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
- resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
- tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
- Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
- //SRN: BugID IPAL9021: End
+ //rnv commented : implementation of the mono-study in GUI
+ //
+ //createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
+ // resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
+ // tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
+ // Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+
#ifdef WITH_SIMANIO
if (myIsSiman) {
// creation of menu item is moved to VISU
// createMenu( SaveGUIStateId, fileMenu, 10, -1 );
- createMenu( FileLoadId, fileMenu, 0 ); //SRN: BugID IPAL9021, add a menu item "Load"
+ // createMenu( FileLoadId, fileMenu, 0 );
#ifdef WITH_SIMANIO
if (myIsSiman) {
std::vector<std::string> List = studyMgr()->GetOpenStudies();
+ // rnv: According to the single-study approach on the server side
+ // can be only one study. So if it is exists connect to them,
+ // overwise show warning message: "No active study on the server"
+
+ /*
SUIT_Session* aSession = SUIT_Session::session();
QList<SUIT_Application*> aAppList = aSession->applications();
if ( !isAlreadyOpen )
unloadedStudies << studyName;
}
-
studyName = SalomeApp_LoadStudiesDlg::selectStudy( desktop(), unloadedStudies );
if ( studyName.isEmpty() )
return;
+ */
+
+ if(List.size() <= 0) {
+ SUIT_MessageBox::warning( desktop(),
+ QObject::tr("WRN_WARNING"),
+ QObject::tr("WRN_NO_STUDY_ON SERV") );
+ return;
+ }
+
+ studyName = List[0].c_str();
#ifndef WIN32
// this code replaces marker of windows drive and path become invalid therefore
{
int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ), tr( "APPCLOSE_DESCRIPTION" ).arg( docName ),
tr ("APPCLOSE_SAVE"), tr ("APPCLOSE_CLOSE"),
- tr ("APPCLOSE_UNLOAD"), tr ("APPCLOSE_CANCEL"), 0 );
+ //tr ("APPCLOSE_UNLOAD"),
+ tr ("APPCLOSE_CANCEL"), 0 );
int res = CloseCancel;
if ( answer == 0 )
res = CloseSave;
else if ( answer == 1 )
res = CloseDiscard;
- else if ( answer == 2 )
- res = CloseUnload;
+ // else if ( answer == 2 )
+ // res = CloseUnload;
return res;
}
QMap<int, QString> SalomeApp_Application::activateModuleActions() const
{
QMap<int, QString> opmap = LightApp_Application::activateModuleActions();
- opmap.insert( LoadStudyId, tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+
+ // rnv commented : implementation of the mono-study in GUI
+ // opmap.insert( LoadStudyId, tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+
opmap.insert( NewAndScriptId, tr( "ACTIVATE_MODULE_OP_SCRIPT" ) );
return opmap;
}
{
LightApp_Application::onStudyCreated( study );
-#ifndef DISABLE_PYCONSOLE
- desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
- windowDock( getWindow( WT_ObjectBrowser ) ) );
-#endif
+//#ifndef DISABLE_PYCONSOLE
+// desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
+// windowDock( getWindow( WT_ObjectBrowser ) ) );
+//#endif
loadDockWindowsState();
{
LightApp_Application::onStudyOpened( study );
-#ifndef DISABLE_PYCONSOLE
- desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
- windowDock( getWindow( WT_ObjectBrowser ) ) );
-#endif
+//#ifndef DISABLE_PYCONSOLE
+// desktop()->tabifyDockWidget( windowDock( getWindow( WT_NoteBook ) ),
+// windowDock( getWindow( WT_ObjectBrowser ) ) );
+//#endif
loadDockWindowsState();
#endif
LightApp_Application::afterCloseDoc();
}
+
+/*
+ Asks to close existing document.
+*/
+bool SalomeApp_Application::checkExistingDoc() {
+ bool result = true;
+ if( activeStudy() ) {
+ int answer = SUIT_MessageBox::question( desktop(),
+ tr( "APPCLOSE_CAPTION" ),
+ tr( "STUDYCLOSE_DESCRIPTION" ),
+ tr( "APPCLOSE_SAVE" ),
+ tr( "APPCLOSE_CLOSE" ),
+ tr( "APPCLOSE_CANCEL" ), 0 );
+ if(answer == 0) {
+ if ( activeStudy()->isSaved() ) {
+ onSaveDoc();
+ closeDoc( false );
+ } else if ( onSaveAsDoc() ) {
+ if( !closeDoc( false ) ) {
+ result = false;
+ }
+ } else {
+ result = false;
+ }
+ }
+ else if( answer == 1 ) {
+ closeDoc( false );
+ } else if( answer == 2 ) {
+ result = false;
+ }
+ } else {
+ SALOMEDSClient_StudyManager* aMgr = studyMgr();
+ if( aMgr ) {
+ std::vector<std::string> List = studyMgr()->GetOpenStudies();
+ if( List.size() > 0 ) {
+ int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_ACTIVEDOC_LOAD" ),
+ SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
+ if ( answer == SUIT_MessageBox::Yes ) {
+ onLoadDoc();
+ }
+ result = false;
+ }
+ }
+ }
+ return result;
+}
virtual bool checkDataObject(LightApp_DataObject* theObj);
virtual void setDesktop( SUIT_Desktop* );
+
+ virtual bool checkExistingDoc();
static CORBA::ORB_var orb();
static SALOMEDSClient_StudyManager* studyMgr();
<source>WRN_FILE_NOT_EXIST</source>
<translation>The file %1 does not exist.</translation>
</message>
+ <message>
+ <source>QUE_ACTIVEDOC_LOAD</source>
+ <translation>There is an active study in the session.
+Do you want to load it?
+</translation>
+ </message>
+ <message>
+ <source>STUDYCLOSE_DESCRIPTION</source>
+ <translation>You should close an existing study before.
+Do you want to close it?
+</translation>
+ </message>
<message>
<source>WRN_STUDY_LOCKED</source>
<translation>Study is locked.</translation>
</message>
+ <message>
+ <source>WRN_NO_STUDY_ON SERV</source>
+ <translation>No active study in this session.</translation>
+ </message>
<message>
<source>CLOSE_LOCKED_STUDY</source>
<translation>Close locked study?</translation>
</message>
<message>
<source>APPCLOSE_DESCRIPTION</source>
- <translation>Do you want to close or unload study before closing?</translation>
+ <translation>Do you want to save study before closing?</translation>
</message>
<message>
<source>PRP_DESK_PROPERTIES</source>