1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : SalomePyQt.cxx
9 #include "SalomePyQt.hxx"
11 #include "QAD_Application.h"
12 #include "QAD_Desktop.h"
13 #include "QAD_Study.h"
14 #include "QAD_FileDlg.h"
16 #include "QAD_Config.h"
17 #include "QAD_Settings.h"
19 QWidget* SalomePyQt::getDesktop()
21 return (QWidget*)(QAD_Application::getDesktop());
24 QWorkspace* SalomePyQt::getMainFrame()
26 return (QWorkspace*)(QAD_Application::getDesktop()->getMainFrame());
29 QMenuBar* SalomePyQt::getMainMenuBar()
31 return (QMenuBar*)(QAD_Application::getDesktop()->getMainMenuBar());
34 int SalomePyQt::getStudyId()
36 return QAD_Application::getDesktop()->getActiveApp()->getActiveStudy()->getStudyId();
39 SALOME_Selection* SalomePyQt::getSelection()
41 return SALOME_Selection::Selection(QAD_Application::getDesktop()->getActiveApp()->getActiveStudy()->getSelection());
44 void SalomePyQt::putInfo( const QString& msg )
46 QAD_Application::getDesktop()->putInfo(msg);
49 void SalomePyQt::putInfo( const QString& msg, int ms )
51 QAD_Application::getDesktop()->putInfo(msg, ms);
54 void SalomePyQt::updateObjBrowser( int studyId, bool updateSelection)
56 QList<QAD_Study>& studies = QAD_Application::getDesktop()->getActiveApp()->getStudies();
57 for ( QAD_Study* study = studies.first(); study; study = studies.next() ) {
58 if ( study->getStudyId() == studyId ) {
59 study->updateObjBrowser( updateSelection );
65 const QString& SalomePyQt::getActiveComponent()
67 return QAD_Application::getDesktop()->getActiveComponent();
70 void SalomePyQt::addStringSetting(QString _name, QString _value, bool _autoValue)
72 QAD_CONFIG->addSetting(_name, _value, _autoValue);
75 void SalomePyQt::addIntSetting(QString _name, int _value, bool _autoValue)
77 QAD_CONFIG->addSetting(_name, _value, _autoValue);
80 void SalomePyQt::addDoubleSetting(QString _name, double _value, bool _autoValue)
82 QAD_CONFIG->addSetting(_name, _value, _autoValue);
85 bool SalomePyQt::removeSettings(QString name)
87 return QAD_CONFIG->removeSettings( name );
90 QString SalomePyQt::getSetting(QString name)
92 return QAD_CONFIG->getSetting(name);
95 QString SalomePyQt::getFileName(QWidget* parent,
96 const QString& initial,
97 const QStringList& filters,
98 const QString& caption,
101 return QAD_FileDlg::getFileName(parent, initial, filters, caption, open);
104 QString SalomePyQt::getExistingDirectory(QWidget* parent,
105 const QString& initial,
106 const QString& caption)
108 return QAD_FileDlg::getExistingDirectory(parent, initial, caption);
111 void SalomePyQt::helpContext(const QString& source, const QString& context) {
112 //QAD_Application::getDesktop()->helpContext(source, context);