// QT Includes
#include <qinputdialog.h>
+#include <qmessagebox.h>
+#include <qcursor.h>
//VRV: porting on Qt 3.0.5
#if QT_VERSION >= 0x030005
{
SalomeApp_Module::initialize( app );
- QWidget* parent = application()->desktop();
+// QWidget* parent = application()->desktop();
createFilterAction( 111, "OPEN" );
}
}
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+SALOME_FILTER::FILTER_Gen_ptr FilterGUI::InitFilterGen() const
+{
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
+ Engines::Component_var comp =
+ SALOME_LifeCycleCORBA(app->namingService()).FindOrLoad_Component( "FactoryServer", "FILTER" );
+
+ MESSAGE("_________________________________________");
+ SALOME_FILTER::FILTER_Gen_var clr = SALOME_FILTER::FILTER_Gen::_narrow(comp);
+ ASSERT(!CORBA::is_nil(clr));
+ return clr._retn();
+}
+
QString FilterGUI::engineIOR() const
{
-// SALOME_FILTER::MED_Gen_ptr aMedGen = InitMedGen();
-// if ( !CORBA::is_nil( aMedGen) )
-// return QString( getApp()->orb()->object_to_string( aMedGen ));
- return QString( "" );
+ QString anIOR( "" );
+ SALOME_FILTER::FILTER_Gen_ptr aFilterGen = InitFilterGen();
+ if ( !CORBA::is_nil( aFilterGen) ){
+ CORBA::String_var objStr = getApp()->orb()->object_to_string( aFilterGen );
+ anIOR = QString( objStr.in() );
+ }
+ return anIOR;
}
void FilterGUI::windows( QMap<int, int>& mappa ) const
{
MESSAGE("command " << theCommandID << " activated");
- try {
- SelectParams *filter = new SelectParams(_sel);
- QFrame *fr = filter->buildFrame();
- fr->show();
+ if(_sel){
+ SelectParams *filter;
+ try {
+ application()->desktop()->setCursor(QCursor(Qt::WaitCursor));
+ filter = new SelectParams(this,_sel);
+ filter->exec();
+ application()->desktop()->setCursor(QCursor(Qt::ArrowCursor));
+ _sel = NULL;
+ }
+ catch ( SALOME_Exception& S_ex ) {
+ delete _sel;
+ _sel=NULL;
+ MESSAGE("Select an input Field in MED file before filtering!!");
+ QMessageBox::information( application()->desktop(),
+ "Filtering",
+ "Unable to select parameters for filtering.\n"
+ "You must select a reference field in a MED file before." );
+ }
}
- catch ( SALOME_Exception& S_ex ) {
+ else{
+ MESSAGE("Select an input Field in MED file before filtering!!");
+ QMessageBox::information( application()->desktop(),
+ "Filtering",
+ "Unable to select parameters for filtering.\n"
+ "You must select a reference field in a MED file before." );
}
break;
}
filtersList,
tr("FILTER_MEN_IMPORT"),
true);
- if (!file.isEmpty() )
- {
- if(_sel) delete _sel;
- _sel = new SelectField(file);
- QFrame *fr = _sel->buildFrame();
- fr->show();
+ if (!file.isEmpty() ){
+ _sel = new SelectField(this,file);
+ if ( _sel->exec() == QDialog::Rejected ){
+ delete _sel;
+ _sel = NULL;
}
- else{
- if(_sel) delete _sel;
- _sel = NULL;
}
+
break;
}
}