]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Make some GUI changes
authormpa <mpa@opencascade.com>
Thu, 3 Nov 2016 13:07:16 +0000 (16:07 +0300)
committermpa <mpa@opencascade.com>
Thu, 3 Nov 2016 13:07:16 +0000 (16:07 +0300)
src/LightApp/LightApp_Application.cxx
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/resources/SalomeApp_msg_en.ts
src/SalomeApp/resources/SalomeApp_msg_fr.ts
src/SalomeApp/resources/SalomeApp_msg_ja.ts
src/Session/Session_ServerCheck.cxx

index 0f9388e8b90dc3cb2a2d065ff4059418ba04b48a..4fffbcb10fb4b415495895f55bfa9e4edb457f6a 100644 (file)
@@ -444,6 +444,8 @@ void LightApp_Application::start()
   desktop()->statusBar()->showMessage( "" );
 
   LightApp_EventFilter::Init();
+
+  onNewDoc();
 }
 
 /*!Closeapplication.*/
@@ -5095,29 +5097,28 @@ bool LightApp_Application::checkExistingDoc()
 {
   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;
 }
index 6d60921dd7ff364b796773fbdcf3af1e3783d38c..3e4fa7ae6aea854fe39ef225c7c35607ff0b96fb 100644 (file)
@@ -206,7 +206,6 @@ void SalomeApp_Application::start()
 
     QString hdffile;
     QStringList pyfiles;
-    QString loadStudy;
 
     for (int i = 1; i < qApp->arguments().size(); i++) {
       QRegExp rxs ("--study-hdf=(.+)");
@@ -240,14 +239,8 @@ void SalomeApp_Application::start()
     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
@@ -335,10 +328,14 @@ void SalomeApp_Application::createActions()
   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 );
@@ -2058,18 +2055,7 @@ void SalomeApp_Application::afterCloseDoc()
 */
 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();
 }
 
 
index aea2607e1861bd469a8d34dd5d25dcb711de0c04..9027bf160c75da2da2ea54120bcd85ab9ebcb6d6 100644 (file)
@@ -728,7 +728,7 @@ void SalomeApp_Study::closeDocument(bool permanently)
       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() );
index 58fb8acedeb01f3203b83f1eb74a87827c125942..b767eee7a4a4141815fd1b8c7c2b58905af9d09f 100644 (file)
@@ -7,10 +7,6 @@
         <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>
index 5709c9727c75adfc75adf614a05e8fe35a1f7d5f..b3c87d068d2d4f7219f6e3286fb9162c99e99187 100755 (executable)
@@ -7,10 +7,6 @@
         <source>WRN_FILE_NOT_EXIST</source>
         <translation>Le fichier %1 n&apos;existe pas.</translation>
     </message>
-    <message>
-        <source>ERR_ACTIVEDOC_LOAD</source>
-        <translation>Une étude est déjà chargée dans votre session mais vous n&apos;y êtes pas connectée. Utilisez le bouton &quot;Connecter&quot; pour charger l&apos;étude dans l&apos;interface.</translation>
-    </message>
     <message>
         <source>WRN_STUDY_LOCKED</source>
         <translation>L&apos;étude est verrouillée</translation>
index 1d9a98edb8b613b61d1a692509929afcc8e1ba78..ff59df505d4e8c079c6879232bfec489f056bfb5 100644 (file)
@@ -7,11 +7,6 @@
       <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>
index 0c1786b24b58042568ffe8089907be3f56d0ac46..3e3e062fe9270c4b55bb877f8d59977daddff970 100644 (file)
@@ -357,7 +357,7 @@ void Session_ServerCheck::run()
       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 );