5 #include "Utils_ORB_INIT.hxx"
6 #include "Utils_SINGLETON.hxx"
9 #include "SALOME_Selection.h"
10 #include "SALOME_InteractiveObject.hxx"
11 #include "SALOMEGUI_QtCatchCorbaException.hxx"
13 #include "QAD_MessageBox.h"
14 //#include "QAD_Tools.h"
15 //#include "QAD_FileDlg.h"
17 //#include "SMESH_TypeFilter.hxx"
20 #include <qinputdialog.h>
21 #include <qmessagebox.h>
24 // launch HELLO component and return a handle
25 HELLO_ORB::HELLO_Gen_ptr HELLOGUI::InitHELLOGen(QAD_Desktop* parent)
27 Engines::Component_var comp =
28 parent->getEngine("FactoryServer", "HELLO");
29 HELLO_ORB::HELLO_Gen_ptr clr = HELLO_ORB::HELLO_Gen::_narrow(comp);
30 ASSERT(!CORBA::is_nil(clr));
36 bool HELLOGUI::OnGUIEvent (int theCommandID, QAD_Desktop* parent)
38 MESSAGE("HELLOGUI::OnGUIEvent");
40 QAD_Study* myActiveStudy = parent->getActiveStudy();
46 case 901: // call getBanner service
48 MESSAGE("command " << theCommandID << " activated");
50 QString myStudyName = myActiveStudy->getTitle();
51 int myStudyId = myActiveStudy->getStudyId();
55 // Dialog to get the Name
57 myName = QInputDialog::getText( tr("QUE_HELLO_LABEL"), tr("QUE_HELLO_NAME"),
61 if ( ! myName.isEmpty()) // if we got a name, get a HELLO component and ask for makeBanner
63 HELLO_ORB::HELLO_Gen_ptr hellogen = HELLOGUI::InitHELLOGen(parent);
64 QString banner = hellogen->makeBanner(myName);
65 QAD_MessageBox::info1( parent, tr("INF_HELLO_BANNER"), banner, tr("BUT_OK"));
74 case 190: // just a test in File Menu
76 QAD_MessageBox::warn1 (parent,tr("INF_HELLO_BANNER"),tr("INF_HELLO_MENU"),tr("BUT_OK"));
83 bool HELLOGUI::SetSettings (QAD_Desktop* parent)
85 MESSAGE("HELLOGUI::SetSettings");
90 bool HELLOGUI::CustomPopup ( QAD_Desktop* parent,
92 const QString & theContext,
93 const QString & theParent,
94 const QString & theObject )
96 MESSAGE("HELLOGUI::CustomPopup");
100 void HELLOGUI::ActiveStudyChanged( QAD_Desktop* parent )
102 MESSAGE("HELLOGUI::ActiveStudyChanged");
105 void HELLOGUI::DefinePopup( QString & theContext, QString & theParent, QString & theObject )
107 MESSAGE("HELLOGUI::DefinePopup");
117 bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
119 return HELLOGUI::OnGUIEvent(theCommandID, parent);
123 bool SetSettings ( QAD_Desktop* parent )
125 return HELLOGUI::SetSettings( parent );
128 bool customPopup ( QAD_Desktop* parent,
130 const QString & theContext,
131 const QString & theParent,
132 const QString & theObject )
134 return HELLOGUI::CustomPopup( parent, popup, theContext,
135 theParent, theObject );
138 void definePopup ( QString & theContext, QString & theParent, QString & theObject )
140 HELLOGUI::DefinePopup( theContext, theParent, theObject );
143 bool activeStudyChanged ( QAD_Desktop* parent )
145 HELLOGUI::ActiveStudyChanged( parent );