@ENVSCRIPT@
cd $DIR
-
-PYTHONPATH=${PYTHONPATH}:${SALOME_HOME_DIR}/bin
#============================================================
# omiidl ====================================================
-omniidl -bIDLparser -I ${SALOME_SRC_DIR}/idl $@
+omniidl -bIDLparser -I ${KERNEL_ROOT_DIR}/idl/salome $@
#============================================================
*/
struct IAPP_Affich
{
- string modulename; /*!<Name of the module.*/
+ string modulename; /*!<Name of the module.*/
string moduleusername; /*!<UserName of the module.*/
- string moduleicone; /*!<Icone representing the module.*/
+ string moduleicone; /*!<Icone representing the module.*/
+ string moduleversion; /*!<Version of the module.*/
+ string modulecomment; /*!<Comment to the module.*/
};
/*!
List of pair GUI elements (component name, component icone)
shstr += " " ;
shstr += _argv[ 3 ] ;
}
- shstr += " > /tmp/" ;
- shstr += ContainerName ;
- shstr += ".log 2>&1 &" ;
+
+ // asv : 16.11.04 : creation of log file in /tmp/logs/$USER dir.
+ // "/tmp/logs/$USER" was created by runSalome.py -> orbmodule.py.
+ string tempfilename = "/tmp/logs/";
+ tempfilename += getenv( "USER" ) ;
+ tempfilename += "/" ;
+ tempfilename += ContainerName ;
+ tempfilename += ".log" ;
+ FILE* f = fopen ( tempfilename.c_str(), "a" );
+ if ( f ) { // check if file can be opened for writing
+ fclose( f );
+ shstr += " > " ;
+ shstr += tempfilename;
+ shstr += " 2>&1 &" ;
+ }
+ else { // if file can't be opened - use a guaranteed temp file name
+ char* tmpFileName = tempnam( NULL, ContainerName );
+ shstr += " > ";
+ shstr += tmpFileName;
+ shstr += " 2>&1 &";
+ free( tmpFileName );
+ }
+
MESSAGE("system(" << shstr << ")") ;
int status = system( shstr.c_str() ) ;
if (status == -1) {
// Get the PID of the Container
-CORBA::Long Engines_Container_i::getPID() {
+long Engines_Container_i::getPID() {
return (long)getpid();
}
#include "InquireServersQThread.h"
using namespace std;
+void MessageOutput( QtMsgType type, const char *msg )
+{
+ switch ( type ) {
+ case QtDebugMsg:
+ MESSAGE( "Debug: " << msg );
+ break;
+ case QtWarningMsg:
+ MESSAGE( "Warning: " << msg );
+ break;
+ case QtFatalMsg:
+ MESSAGE( "Fatal: " << msg );
+ break;
+ }
+}
+
int main(int argc, char **argv)
{
- CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
- LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb);
+ qInstallMsgHandler( MessageOutput );
//VRV: T2.4 - Trace management improvement
QApplication myQApp(argc, argv) ;
InquireServersGUI myIS;
//VRV: T2.4 - Trace management improvement
if (myIS.withGUI()) {
try
- {
+ {
+ CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
+
SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
NS.init_orb( orb ) ;
{
INFOS("Caught unknown exception.");
}
+ return 0 ;
}
INFOS("Normal Exit"); // without this trace, Splash remains on screen !
- delete myThreadTrace;
+// delete myThreadTrace;
return 0 ;
}
test_component_multistudy = "component-multistudy";
test_component_icon = "component-icone" ;
test_component_impltype = "component-impltype";
+ test_component_version = "component-version";
+ test_component_comment = "component-comment";
test_interface_name = "component-interface-name" ;
return true;
}
+ // tag test_component_version
+ if((qName.compare(test_component_version)==0)) {
+ _aModule.version = content ;
+ return true;
+ }
+
+ // tag test_component_comment
+ if((qName.compare(test_component_comment)==0)) {
+ _aModule.comment = content ;
+ return true;
+ }
+
// interface identification
// tag test_interface_name
QString test_component_multistudy ;
QString test_component_icon ;
QString test_component_impltype;
+ QString test_component_version;
+ QString test_component_comment;
QString test_interface_name;
ParserInterfaces interfaces;
ParserPathPrefixes prefixes;
bool implementationType;
+ std::string version;
+ std::string comment;
};
typedef std::vector<ParserComponent> ParserComponents ;
_list_components_icone[ind].modulename=(_personal_module_list[ind].name).c_str();
_list_components_icone[ind].moduleusername=(_personal_module_list[ind].username).c_str();
_list_components_icone[ind].moduleicone=(_personal_module_list[ind].icon).c_str();
+ _list_components_icone[ind].moduleversion=(_personal_module_list[ind].version).c_str();
+ _list_components_icone[ind].modulecomment=(_personal_module_list[ind].comment).c_str();
//if(MYDEBUG) SCRUTE(_list_components_icone[ind].modulename);
//if(MYDEBUG) SCRUTE(_list_components_icone[ind].moduleicone);
}
_list_components_icone[indice].modulename=_general_module_list[ind].name.c_str();
_list_components_icone[indice].moduleusername=_general_module_list[ind].username.c_str();
_list_components_icone[indice].moduleicone=_general_module_list[ind].icon.c_str();
+ _list_components_icone[indice].moduleversion=_general_module_list[ind].version.c_str();
+ _list_components_icone[indice].modulecomment=_general_module_list[ind].comment.c_str();
//if(MYDEBUG) SCRUTE(_list_components_icone[indice].modulename) ;
//if(MYDEBUG) SCRUTE(_list_components_icone[indice].moduleicone);
Plot2d_Curve* curve = getCurveByIO( IObject );
if ( curve )
eraseCurve( curve, update );
+ // it can be table or container object selected
+ QAD_Study* activeStudy = QAD_Application::getDesktop()->getActiveStudy();
+ SALOMEDS::SObject_var aSO = activeStudy->getStudyDocument()->FindObjectID(IObject->getEntry());
+ if ( !aSO->_is_nil() ) {
+ SALOMEDS::ChildIterator_var aIter = activeStudy->getStudyDocument()->NewChildIterator( aSO );
+ for ( ; aIter->More(); aIter->Next() ) {
+ SALOMEDS::SObject_var aChildSO = aIter->Value();
+ SALOMEDS::SObject_var refSO;
+ if ( aChildSO->ReferencedObject( refSO ) && !refSO->_is_nil() )
+ aChildSO = refSO;
+ curve = getCurveByIO( new SALOME_InteractiveObject( aChildSO->GetID(), "", "" ) );
+ if ( curve )
+ eraseCurve( curve, update );
+ }
+ }
}
/*!
Actually this method just re-displays all curves which are presented in the viewer
#include <qlineedit.h>
#include <qdatetime.h>
#include <qthread.h>
-
+#include <qtooltip.h>
#include <qstringlist.h>
#if QT_VERSION > 300
QString iconfile = CORBA::string_dup(list_composants[ind].moduleicone) ;
QString modulename = CORBA::string_dup(list_composants[ind].modulename) ;
QString moduleusername = CORBA::string_dup(list_composants[ind].moduleusername) ;
+ QString moduleversion = CORBA::string_dup(list_composants[ind].moduleversion) ;
+ QString modulecomment = CORBA::string_dup(list_composants[ind].modulecomment) ;
// MESSAGE ( " MODULE = " << modulename )
// MESSAGE ( " MODULE icon = " << iconfile )
QToolButton * toolb =
new QToolButton( QIconSet( Icone ), moduleusername, QString::null, this,
SLOT( onButtonActiveComponent () ),tbComponent );
+ QString ttip = QString("<b>") + moduleusername + QString("</b>");
+ if ( !moduleversion.isEmpty() ) ttip += QString("<br>Version: ") + moduleversion;
toolb->setToggleButton( true );
+ QToolTip::add(toolb, ttip, this->toolTipGroup(), modulecomment);
myComponentButton.append(toolb);
}
else
/*!
Validates entered path, returns true if OK
*/
+#ifndef WNT
+#include <pwd.h>
+#endif
bool QAD_DirListDlg::validate() {
if (myEdited) {
QString dirPath = myEdit->text().stripWhiteSpace();
+#ifndef WNT
+ if ( dirPath.startsWith( "~") ) {
+ dirPath = dirPath.remove(0,1);
+ QString user;
+ int slashPos = dirPath.find("/");
+ if ( slashPos >= 0 ) {
+ user = dirPath.left(slashPos);
+ dirPath = dirPath.mid(slashPos);
+ }
+ else {
+ user = dirPath;
+ dirPath = "";
+ }
+ if ( user.isEmpty() )
+ user = getenv( "USER" );
+
+ struct passwd* user_data = getpwnam( user.latin1() );
+ if ( user_data == NULL ) {
+ // unknown user or something another error
+ QAD_MessageBox::error1(this,
+ tr("ERR_ERROR"),
+ tr("Unknown user %1").arg(user),
+ tr("BUT_OK"));
+ myEdit->setFocus();
+ return false;
+ }
+ dirPath = user_data->pw_dir + dirPath;
+ }
+#endif
QDir dir(dirPath);
QListBoxItem* found = 0;
for (unsigned i = 0; i < myDirList->count()-1; i++) {
}
/*!
- Called when a Mouse release event
+ Called when any event occures. The function is redefined to handle MousePress events
+ in order to provide the following behaviour: on middle mouse button press a previously
+ selected text (by mouse drag or left mouse button double click) is appended to the last
+ paragraph. This behaviour is similar to standard Unix terminal editor behaviour.
*/
+bool QAD_PyEditor::eventFilter( QObject *o, QEvent *e )
+{
+ const int t = e->type();
+ if ( t == QEvent::MouseButtonPress || t == QEvent::MouseButtonRelease ) {
+ QMouseEvent * event = (QMouseEvent*)e;
+ if ( event->button() == MidButton ) {
+ if ( t == QEvent::MouseButtonPress ) {
+ QString selection = selectedText();
+ QClipboard *cb = QApplication::clipboard();
+ if ( !selection.isNull() && !selection.isEmpty() )
+ cb->setText( selection );
+ const int endPara = paragraphs()-1;
+ insertAt( cb->text(), endPara, paragraphLength( endPara )-1 );
+ return true; // don't allow futher event processing
+ }
+ // code from old mouseReleaseEvent() function.
+ else if ( t == QEvent::MouseButtonRelease ) {
+ int curPara, curCol; // for cursor position
+ int endPara, endCol; // for last edited line
+ getCursorPosition(&curPara, &curCol);
+ endPara = paragraphs() -1;
+ return ( curPara != endPara || curCol < SIZEPR );
+ }
+ }
+ }
+ return QTextEdit::eventFilter( o, e );
+}
+
+/*!
+ Called when a Mouse release event
+
void QAD_PyEditor::mouseReleaseEvent ( QMouseEvent * e )
{
// MESSAGE("mouseReleaseEvent");
else if ((curPara == endPara) && (curCol >= SIZEPR))
QTextEdit::mouseReleaseEvent(e);
}
+*/
/*!
Called when a drop event (Drag & Drop)
protected:
virtual void keyPressEvent (QKeyEvent * e);
virtual void mousePressEvent (QMouseEvent * e);
- virtual void mouseReleaseEvent (QMouseEvent * e);
+ //virtual void mouseReleaseEvent (QMouseEvent * e);
virtual void dropEvent (QDropEvent *e);
virtual void customEvent (QCustomEvent *e);
+ virtual bool eventFilter(QObject *o, QEvent *e);
public slots:
void handleReturn();
// !!! first column contains units !!!
for ( int i = 0; i < tlts.count(); i++ ) {
myOrientation == Horizontal ?
- myTable->horizontalHeader()->setLabel( i+1, tlts[i] ) :
- myTable->verticalHeader()->setLabel( i+1, tlts[i] );
+ myTable->horizontalHeader()->setLabel( i+1, tlts[i].isNull() ? "" : tlts[i] ) :
+ myTable->verticalHeader()->setLabel( i+1, tlts[i].isNull() ? "" : tlts[i] );
}
+ setUnitsTitle( tr( "UNITS_TLT" ) );
}
/*!
Sets columns titles
*/
void SALOMEGUI_TableWidget::setUnitsTitle( const QString& tlt ) {
// !!! first column contains units !!!
- myOrientation == Horizontal ? myTable->horizontalHeader()->setLabel( 0, tlt ) : myTable->verticalHeader()->setLabel( 0, tlt );
+ myOrientation == Horizontal ? myTable->horizontalHeader()->setLabel( 0, tlt.isNull() ? "" : tlt ) : myTable->verticalHeader()->setLabel( 0, tlt.isNull() ? "" : tlt );
}
/*!
Sets units
void SALOMEGUI_TableWidget::setUnits( QStringList& units )
{
for ( int i = 0; i < units.count(); i++ ) {
- myOrientation == Horizontal ? myTable->setText( i, 0, units[i] ) : myTable->setText( 0, i, units[i] );
+ myOrientation == Horizontal ? myTable->setText( i, 0, units[i].isNull() ? "" : units[i] ) : myTable->setText( 0, i, units[i].isNull() ? "" : units[i] );
}
}
/*!
static int MYDEBUG = 0;
#endif
+void MessageOutput( QtMsgType type, const char *msg )
+{
+ switch ( type ) {
+ case QtDebugMsg:
+ MESSAGE( "Debug: " << msg );
+ break;
+ case QtWarningMsg:
+ MESSAGE( "Warning: " << msg );
+ break;
+ case QtFatalMsg:
+ MESSAGE( "Fatal: " << msg );
+ break;
+ }
+}
+
int main(int argc, char **argv)
{
- SALOME_Event::GetSessionThread();
- ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
- int orbArgc = 1;
- CORBA::ORB_var &orb = init( orbArgc , argv ) ;
- LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb);
+ qInstallMsgHandler( MessageOutput );
try
{
+ SALOME_Event::GetSessionThread();
+
+ ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
+ ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()) ;
+ int orbArgc = 1;
+ CORBA::ORB_var &orb = init( orbArgc , argv ) ;
+
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
INFOS("Caught unknown exception.");
}
MESSAGE("End of SALOME_Session_Server");
- delete myThreadTrace;
+// delete myThreadTrace;
return 0 ;
}