]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Additional fix for issue 0020613: EDF 1106 : Modify Node Marker in SMESH and VISU
authorouv <ouv@opencascade.com>
Fri, 14 May 2010 08:23:11 +0000 (08:23 +0000)
committerouv <ouv@opencascade.com>
Fri, 14 May 2010 08:23:11 +0000 (08:23 +0000)
doc/salome/gui/SMESH/images/colors_size.png
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.cxx
src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h

index 58210c0bc7456dbd7555b34dfc34fd6376e70a34..53b14620cb6e6fe19d7f8b27ca50cc2a9dd3d66c 100755 (executable)
Binary files a/doc/salome/gui/SMESH/images/colors_size.png and b/doc/salome/gui/SMESH/images/colors_size.png differ
index 85311c6b70492fef6f1ae5b7e6689c16260e7cde..7d03f277971f3154a7b0fa844f746c322e335fc9 100644 (file)
 
 // SALOME GUI includes
 #include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
 #include <QtxColorButton.h>
 #include <VTKViewer_MarkerWidget.h>
+#include <LightApp_Application.h>
 #include <SalomeApp_IntSpinBox.h>
 
 // Qt includes
@@ -45,6 +49,7 @@
 #include <QHBoxLayout>
 #include <QGridLayout>
 #include <QCheckBox>
+#include <QKeyEvent>
 
 #define SPACING 6
 #define MARGIN  11
@@ -186,10 +191,14 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   QPushButton* buttonCancel = new QPushButton( tr( "&Cancel" ), GroupButtons );
   buttonCancel->setAutoDefault( true );
 
+  QPushButton* buttonHelp = new QPushButton( tr( "&Help" ), GroupButtons );
+  buttonHelp->setAutoDefault( true );
+
   GroupButtonsLayout->addWidget( buttonOk );
   GroupButtonsLayout->addSpacing( 10 );
   GroupButtonsLayout->addStretch();
   GroupButtonsLayout->addWidget( buttonCancel );
+  GroupButtonsLayout->addWidget( buttonHelp );
 
   // -------------------------------
   topLayout->addWidget( ButtonGroup1 );
@@ -200,9 +209,12 @@ SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModul
   // -------------------------------
   mySMESHGUI->SetActiveDialogBox( this );
 
+  myHelpFileName = "colors_size_page.html";
+
   /* signals and slots connections */
   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
+  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
 
   connect( mySMESHGUI, SIGNAL ( SignalDeactivateActiveDialog() ),
            this,       SLOT( DeactivateActiveDialog() ) );
@@ -239,6 +251,30 @@ void SMESHGUI_Preferences_ColorDlg::ClickOnCancel()
   reject();
 }
 
+//=================================================================================
+// function : ClickOnHelp()
+// purpose  :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::ClickOnHelp()
+{
+  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+  if (app) 
+    app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+  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(myHelpFileName));
+  }
+}
+
 //=================================================================================
 // function : DeactivateActiveDialog()
 // purpose  :
@@ -447,3 +483,19 @@ int SMESHGUI_Preferences_ColorDlg::getCustomMarkerID() const
 {
   return MarkerWidget->getCustomMarkerID();
 }
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose  :
+//=================================================================================
+void SMESHGUI_Preferences_ColorDlg::keyPressEvent( QKeyEvent* e )
+{
+  QDialog::keyPressEvent( e );
+  if ( e->isAccepted() )
+    return;
+
+  if ( e->key() == Qt::Key_F1 ) {
+    e->accept();
+    ClickOnHelp();
+  }
+}
index dc26a938483fb75f1b571e427bb3247430af798a..aaaa499a60cc979b412a57f449ccab44afb1514d 100644 (file)
@@ -71,10 +71,12 @@ public:
 
 protected:
   void                  closeEvent( QCloseEvent* );
+  void                  keyPressEvent( QKeyEvent* );
 
 private slots:
   void                  ClickOnOk();
   void                  ClickOnCancel();
+  void                  ClickOnHelp();
   void                  DeactivateActiveDialog();
   void                  ActivateThisDialog();
   
@@ -93,6 +95,8 @@ private:
   QtxColorButton*       btnOrientationColor;
   SMESHGUI_SpinBox*     SpinBox_Orientation_Scale;
   QCheckBox*            CheckBox_Orientation_3DVectors;
+
+  QString               myHelpFileName;
 };
 
 #endif // SMESHGUI_PREFERENCES_COLORDLG_H