desktop()->statusBar()->showMessage( "" );
LightApp_EventFilter::Init();
+
+ onNewDoc();
}
/*!Closeapplication.*/
{
bool result = true;
if( activeStudy() ) {
- int answer = SUIT_MessageBox::question( desktop(),
- tr( "APPCLOSE_CAPTION" ),
+ int answer = SUIT_MessageBox::question( desktop(),
+ tr( "APPCLOSE_CAPTION" ),
tr( "STUDYCLOSE_DESCRIPTION" ),
- tr( "APPCLOSE_SAVE" ),
+ 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;
- }
+ onSaveDoc();
+ closeDoc( false );
+ }
+ else if ( onSaveAsDoc() ) {
+ if( !closeDoc( false ) )
+ result = false;
+ }
+ else
+ result = false;
}
- else if( answer == 1 ) {
+ else if( answer == 1 )
closeDoc( false );
- } else if( answer == 2 ) {
+ else if( answer == 2 )
result = false;
- }
}
return result;
}
QString hdffile;
QStringList pyfiles;
- QString loadStudy;
for (int i = 1; i < qApp->arguments().size(); i++) {
QRegExp rxs ("--study-hdf=(.+)");
SALOME_EventFilter::Init();
setProperty("open_study_from_command_line", true);
- if ( !hdffile.isEmpty() ) // open hdf file given as parameter
+ if ( !hdffile.isEmpty() ) // open hdf file given as parameter
onOpenDoc( hdffile );
- else if ( pyfiles.count() > 0 ) // create new study
- onNewDoc();
- else if (!loadStudy.isEmpty()) {// load study by name
- if (onLoadDoc(loadStudy))
- updateObjectBrowser(true);
- }
setProperty("open_study_from_command_line", QVariant());
#ifndef DISABLE_PYCONSOLE
createAction( ConnectId, tr( "TOT_DESK_CONNECT_STUDY" ), QIcon(),
tr( "MEN_DESK_CONNECT" ), tr( "PRP_DESK_CONNECT" ),
Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+ //no need at this action for mono-study application because study is always exists
+ action( ConnectId )->setVisible( false );
createAction( DisconnectId, tr( "TOT_DESK_DISCONNECT_STUDY" ), QIcon(),
tr( "MEN_DESK_DISCONNECT" ), tr( "PRP_DESK_DISCONNECT" ),
Qt::CTRL+Qt::Key_U, desk, false, this, SLOT( onUnloadDoc() ) );
+ //no need at this action for mono-study application because study is always exists
+ action( DisconnectId )->setVisible( false );
int fileMenu = createMenu( tr( "MEN_DESK_FILE" ), -1 );
*/
bool SalomeApp_Application::checkExistingDoc()
{
- bool result = LightApp_Application::checkExistingDoc();
- /*if ( result && !activeStudy() ) {
- SALOMEDSClient_StudyManager* aMgr = studyMgr();
- if ( aMgr ) {
- std::vector<std::string> List = studyMgr()->GetOpenStudies();
- if( List.size() > 0 ) {
- SUIT_MessageBox::critical( desktop(), tr( "WRN_WARNING" ), tr( "ERR_ACTIVEDOC_LOAD" ));
- result = false;
- }
- }
- }*/ // NB!!!
- return result;
+ return LightApp_Application::checkExistingDoc();
}
SUIT_Desktop* desk = SUIT_Session::session()->activeApplication()->desktop();
bool isBlocked = desk->signalsBlocked();
desk->blockSignals( true );
- studyDS()->Clear();
+ SalomeApp_Application::getStudy()->Clear();
desk->blockSignals( isBlocked );
#ifndef DISABLE_PYCONSOLE
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
<source>WRN_FILE_NOT_EXIST</source>
<translation>The file %1 does not exist.</translation>
</message>
- <message>
- <source>ERR_ACTIVEDOC_LOAD</source>
- <translation>A study is already active in your session, but you are not connected to it. Use the Connect button to load it in the interface.</translation>
- </message>
<message>
<source>WRN_STUDY_LOCKED</source>
<translation>Study is locked.</translation>
<source>WRN_FILE_NOT_EXIST</source>
<translation>Le fichier %1 n'existe pas.</translation>
</message>
- <message>
- <source>ERR_ACTIVEDOC_LOAD</source>
- <translation>Une étude est déjà chargée dans votre session mais vous n'y êtes pas connectée. Utilisez le bouton "Connecter" pour charger l'étude dans l'interface.</translation>
- </message>
<message>
<source>WRN_STUDY_LOCKED</source>
<translation>L'étude est verrouillée</translation>
<source>WRN_FILE_NOT_EXIST</source>
<translation>ファイル %1 は存在しません。</translation>
</message>
- <message>
- <source>ERR_ACTIVEDOC_LOAD</source>
- <translation>A study is already active in your session, but you are not connected to it. Use the Connect button to load it in the interface.
-スタディはあなたのセッション内ですでにアクティブになっていますが、接続できません。インターフェイス内でそれをロードするための接続用ボタンを使用してください。</translation>
- </message>
<message>
<source>WRN_STUDY_LOCKED</source>
<translation>スタディがロックされています</translation>
CORBA::Object_var obj = NS.Resolve( "/Study" );
SALOMEDS::Study_var study = SALOMEDS::Study::_narrow( obj );
if ( !CORBA::is_nil( study ) ) {
- MESSAGE( "/myStudy is found" );
+ MESSAGE( "/Study is found" );
study->ping();
MESSAGE( "Study was activated" );
setStep( ++current * myAttempts );