// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
#include "SUIT_Session.h"
#include "SUIT_Desktop.h"
#include "SUIT_FileDlg.h"
+#include "SUIT_MessageBox.h"
+
+#include "LightApp_Application.h"
// QT Includes
#include <qapplication.h>
// Purpose : Constructor
//=======================================================================
SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule,
- QWidget* parent,
+ QWidget* parent,
const QValueList<int>& theTypes,
const int theMode,
const char* theName)
- : QDialog( parent, theName, true, WStyle_Customize |
+ : QDialog( parent, theName, false, WStyle_Customize |
WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
mySMESHGUI( theModule )
{
// Purpose : Constructor
//=======================================================================
SMESHGUI_FilterLibraryDlg::SMESHGUI_FilterLibraryDlg (SMESHGUI* theModule,
- QWidget* parent,
+ QWidget* parent,
const int theType,
const int theMode,
const char* theName)
aDlgLay->setStretchFactor(myMainFrame, 1);
+ myHelpFileName = "selection_filter_library.htm";
+
Init(myTypes, myMode);
}
myButtons[ BTN_Cancel ] = new QPushButton(tr("SMESH_BUT_CANCEL"), aGrp);
myButtons[ BTN_Close ] = new QPushButton(tr("SMESH_BUT_CLOSE"), aGrp);
+ myButtons[ BTN_Help ] = new QPushButton(tr("SMESH_BUT_HELP"), aGrp);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
connect(myButtons[ BTN_Cancel ], SIGNAL(clicked()), SLOT(onClose()));
connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose()));
connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply()));
+ connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
QMap<int, QPushButton*>::iterator anIter;
for (anIter = myButtons.begin(); anIter != myButtons.end(); ++anIter)
myListBox->setCurrentItem(0);
}
- int x, y;
- mySMESHGUI->DefineDlgPosition(this, x, y);
- this->move(x, y);
-
this->show();
updateMainButtons();
reject();
}
+//=================================================================================
+// function : onHelp()
+// purpose :
+//=================================================================================
+void SMESHGUI_FilterLibraryDlg::onHelp()
+{
+ LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
+ if (app)
+ app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ else {
+ SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"),
+ QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName),
+ QObject::tr("BUT_OK"));
+ }
+}
+
//=======================================================================
// name : SMESHGUI_FilterLibraryDlg::onDeactivate
// Purpose : SLOT called when dialog must be deativated
SMESH::Filter_ptr SMESHGUI_FilterLibraryDlg::createFilter(const int theType)
{
int n = myTable->NumRows(theType);
- n = 0;
SMESH::Filter::Criteria_var aCriteria = new SMESH::Filter::Criteria;
aCriteria->length(n);
}
}
}
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose :
+//=================================================================================
+void SMESHGUI_FilterLibraryDlg::keyPressEvent( QKeyEvent* e )
+{
+ QDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Key_F1 )
+ {
+ e->accept();
+ onHelp();
+ }
+}