]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for IPAL20744, IPAL20745 and IPAL20747
authorrnv <rnv@opencascade.com>
Tue, 9 Dec 2008 12:27:18 +0000 (12:27 +0000)
committerrnv <rnv@opencascade.com>
Tue, 9 Dec 2008 12:27:18 +0000 (12:27 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_NoteBookDlg.cxx
src/SalomeApp/SalomeApp_NoteBookDlg.h
src/SalomeApp/resources/SalomeApp_msg_en.ts

index b0b149203f5c830958c1f7bc2e9e833d01e341f1..dc61774f7ce4976d71ac0840881867a2e7d3e5f5 100644 (file)
@@ -720,10 +720,8 @@ void SalomeApp_Application::onNoteBook()
   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
   if ( appStudy ) {
     _PTR(Study) aStudy = appStudy->studyDS();
-    SalomeApp_NoteBookDlg aDlg(desktop(),aStudy);
-    aDlg.exec();
-    updateCommandsStatus();
-    updateDesktopTitle();
+    SalomeApp_NoteBookDlg *aDlg = new SalomeApp_NoteBookDlg(desktop(),aStudy);
+    aDlg->show();
   }
 }
 
index 6d6c69fbad8e1a1e7385292684bd7ac50c04627d..fd7c139b0e8b74817d9fc5d9db4f37b811569d4e 100644 (file)
@@ -30,6 +30,7 @@
 #include <CAM_Module.h>
 
 #include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 
 #include <PyConsole_Console.h>
@@ -659,7 +660,8 @@ SalomeApp_NoteBookDlg::SalomeApp_NoteBookDlg(QWidget * parent, _PTR(Study) theSt
   QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
   myStudy(theStudy)
 {
-  setModal(true);
+  setModal(false);
+  setAttribute( Qt::WA_DeleteOnClose);
   setObjectName("SalomeApp_NoteBookDlg");
   setWindowTitle(tr("NOTEBOOK_TITLE"));
   QGridLayout* aLayout = new QGridLayout(this);
@@ -674,8 +676,9 @@ SalomeApp_NoteBookDlg::SalomeApp_NoteBookDlg(QWidget * parent, _PTR(Study) theSt
   myRemoveButton = new QPushButton(tr("BUT_REMOVE"));
   aLayout->addWidget(myRemoveButton, 1, 0, 1, 1);
 
+
   QSpacerItem* spacer =
-    new QSpacerItem(SPACER_SIZE, 5 , QSizePolicy::Expanding, QSizePolicy::Minimum);
+    new QSpacerItem(DEFAULT_SPACING, 5 , QSizePolicy::Expanding, QSizePolicy::Minimum);
   aLayout->addItem(spacer, 1, 1, 2, 1);
 
   myUpdateStudyBtn = new QPushButton(tr("BUT_UPDATE_STUDY"));
@@ -688,18 +691,17 @@ SalomeApp_NoteBookDlg::SalomeApp_NoteBookDlg(QWidget * parent, _PTR(Study) theSt
   aLayout1->setMargin(DEFAULT_MARGIN);
   aLayout1->setSpacing(DEFAULT_SPACING);
 
-  myOkBtn = new QPushButton(tr("BUT_OK"));
+  myOkBtn = new QPushButton(tr("BUT_APPLY_AND_CLOSE"));
   aLayout1->addWidget(myOkBtn, 0, 0, 1, 1);
   
   myApplyBtn = new QPushButton(tr("BUT_APPLY"));
   aLayout1->addWidget(myApplyBtn, 0, 1, 1, 1);  
 
-  QSpacerItem* spacer1 =
-    new QSpacerItem(SPACER_SIZE, 5, QSizePolicy::Expanding, QSizePolicy::Minimum);
-  aLayout1->addItem(spacer1, 0, 2, 1, 1);
-
+  myHelpBtn = new QPushButton(tr("BUT_HELP"));
+  aLayout1->addWidget(myHelpBtn, 0, 2, 1, 1);
+  
 
-  myCancelBtn = new QPushButton(tr("BUT_CANCEL"));
+  myCancelBtn = new QPushButton(tr("BUT_CLOSE"));
   aLayout1->addWidget(myCancelBtn, 0, 3, 1, 1);
 
   aLayout->addWidget(groupBox, 2, 0, 1, 3);
@@ -709,7 +711,8 @@ SalomeApp_NoteBookDlg::SalomeApp_NoteBookDlg(QWidget * parent, _PTR(Study) theSt
   connect( myCancelBtn, SIGNAL(clicked()), this, SLOT(onCancel()) );
   connect( myUpdateStudyBtn, SIGNAL(clicked()), this, SLOT(onUpdateStudy()) );
   connect( myRemoveButton, SIGNAL(clicked()), this, SLOT(onRemove()));
-
+  connect( myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
+  
   myTable->Init(myStudy);
 }
 
@@ -733,6 +736,32 @@ void SalomeApp_NoteBookDlg::onOK()
     accept();
 }
 
+//============================================================================
+/*! Function : onHelp
+ *  Purpose  : [slot]
+ */
+//============================================================================
+void SalomeApp_NoteBookDlg::onHelp()
+{
+  QString aHelpFileName("using_notebook.html");
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app)
+    app->onHelpContextModule("GUI",aHelpFileName);
+  else {
+    QString platform;
+#ifdef WIN32
+    platform = "winapplication";
+#else
+    platform = "application";
+#endif
+    SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+                             arg(app->resourceMgr()->stringValue("ExternalBrowser",
+                                                                 platform)).
+                             arg(aHelpFileName));
+  }
+
+}
 //============================================================================
 /*! Function : onApply
  *  Purpose  : [slot]
@@ -797,8 +826,12 @@ void SalomeApp_NoteBookDlg::onApply()
        myStudy->SetBoolean(string(aName.toLatin1().constData()),aBVal);
     }
   }
-
   myTable->ResetMaps();
+
+  SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
+  if(app)
+    app->updateActions();
+
 }
 
 //============================================================================
index acb18f653ffacfb60c0f0f4959bd4858211d98e0..529b9245e5893edce2b8f1a8305102bd994fde39 100644 (file)
@@ -145,6 +145,7 @@ class SALOMEAPP_EXPORT SalomeApp_NoteBookDlg : public QDialog
    void onCancel();
    void onRemove();
    void onUpdateStudy();
+   void onHelp();
 
  protected:
    bool updateStudy();
@@ -157,6 +158,7 @@ class SALOMEAPP_EXPORT SalomeApp_NoteBookDlg : public QDialog
   QPushButton*     myOkBtn;
   QPushButton*     myApplyBtn;
   QPushButton*     myCancelBtn;
+  QPushButton*     myHelpBtn;
   
   _PTR(Study)      myStudy;
 };
index faf5d0e6759e219871afae62d6d2127d5308169b..7b89f17262bb1a07a6c3c21524a746f37e5b5079 100644 (file)
@@ -255,7 +255,7 @@ Do you want to reload it ?</translation>
     </message>
     <message>
         <source>MEN_DESK_FILE_NOTEBOOK</source>
-        <translation>Notebook</translation>
+        <translation>Notebook...</translation>
     </message>
     <message>
         <source>PRP_DESK_FILE_NOTEBOOK</source>
@@ -395,6 +395,14 @@ Do you really want to rename it?</translation>
            <source>BUT_REMOVE</source>
            <translation>Remove</translation>
        </message>
+        <message>
+           <source>BUT_APPLY_AND_CLOSE</source>
+           <translation>A&amp;pply and Close</translation>
+       </message>
+        <message>
+           <source>BUT_HELP</source>
+           <translation>&amp;Help</translation>
+       </message>
         <message>
            <source>INCORRECT_DATA</source>
            <translation>At least one variable has been defined incorrectly.