const QString& menu, const QString& tip, const int key,
QObject* parent, const bool toggle, QObject* reciever,
const char* member, const QString& shortcutAction )
+{
+ return createAction( id, text, icon, menu, tip, QKeySequence(key), parent, toggle, reciever, member, shortcutAction );
+}
+
+/*!
+ \brief Create new instance of QtxAction and register action with specified \a id.
+
+ Resulting action ID may differ from the requested one. This can happen if
+ requested ID is already in use.
+
+ If \a id < 0, the action ID is generated automatically.
+
+ \param id required action ID
+ \param text tooltip text
+ \param icon action icon
+ \param menu menu text
+ \param tip status bar tip
+ \param key keyboard accelerator
+ \param parent parent object
+ \param toggle if \c true, the action will be toggled
+ \param reciever action activation signal receiver object
+ \param member action activation signal receiver slot
+*/
+QAction* CAM_Module::createAction( const int id, const QString& text, const QIcon& icon,
+ const QString& menu, const QString& tip, const QKeySequence& key,
+ QObject* parent, const bool toggle, QObject* reciever,
+ const char* member, const QString& shortcutAction )
{
QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
a->setStatusTip( tip );
virtual QAction* createAction( const int, const QString&, const QIcon&, const QString&,
const QString&, const int, QObject* = 0,
const bool = false, QObject* = 0, const char* = 0, const QString& = QString() );
+ virtual QAction* createAction( const int, const QString&, const QIcon&, const QString&,
+ const QString&, const QKeySequence&, QObject* = 0,
+ const bool = false, QObject* = 0, const char* = 0, const QString& = QString() );
QtxActionGroup* createActionGroup( const int, const bool = true );
int createTool( const QString&, const QString& = QString() );
TARGET_LINK_LIBRARIES(DDS ${_link_LIBRARIES})
INSTALL(TARGETS DDS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
-INSTALL(FILES ${DDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
\ No newline at end of file
+INSTALL(FILES ${DDS_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
INSTALL(FILES ${GLViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
-INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
\ No newline at end of file
+INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
//=======================================================================
GraphicsView_Object::~GraphicsView_Object()
{
- QList<QGraphicsItem *> aList = childItems();
- for( QList<QGraphicsItem *>::const_iterator aChild = aList.begin(); aChild != aList.end(); ++aChild )
+ QListIterator<QGraphicsItem*> aChildIter( childItems() );
+ while( aChildIter.hasNext() )
{
- if( *aChild )
+ if( QGraphicsItem* aChild = aChildIter.next() )
{
- removeFromGroup( *aChild );
- if( QGraphicsScene* aScene = (*aChild)->scene() )
- aScene->removeItem( *aChild );
- delete ( *aChild );
+ removeFromGroup( aChild );
+ if( QGraphicsScene* aScene = aChild->scene() )
+ aScene->removeItem( aChild );
+ delete ( aChild );
aChild = 0;
}
}
#include <QVariant>
#include <QStyleOption>
#include <QPaintEvent>
+#include <QTileRules>
+
#include <qwt_plot.h>
#include <qwt_painter.h>
#include <qwt_scale_map.h>
#include <qwt_legend_label.h>
#include <qwt_plot_dict.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-#include <qdrawutil.h>
-#endif
-
const int SPACING = 10;
const int SYMBOL_SIZE = 13;
if(hasDeviationData()) {
painter->save();
int lineW = deviationMarkerLineWidth();
- int tickSz = deviationMarkerTickSize() + qRound(double(lineW/2));
+ int tickSz = deviationMarkerTickSize() + qRound(double(lineW)/2);
double min, max, xi, yi;
int xp, ytop, ybtm, tickl, tickr;
QColor c = isSelected() ? Plot2d_Object::selectionColor() : deviationMarkerColor();
#include <QEvent>
#include <QMouseEvent>
#include <QContextMenuEvent>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QPrinter>
-#else
-#include <QtPrintSupport/QPrinter>
-#endif
#include <QPalette>
#include <QLocale>
#include <QXmlStreamWriter>
#include <qwt_plot_zoomer.h>
#include <qwt_curve_fitter.h>
#include <qwt_plot_renderer.h>
+#include <qwt_legend.h>
+#include <qwt_scale_widget.h>
#include <stdlib.h>
#include <limits>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-#include <qprinter.h>
-#else
-#include <QtPrintSupport/qprinter.h>
-#endif
-
-#include <qwt_legend.h>
-#include <qwt_scale_widget.h>
#define DEFAULT_LINE_WIDTH 0 // (default) line width
#define DEFAULT_MARKER_SIZE 9 // default marker size
*/
int Plot2d_ViewFrame::testOperation( const QMouseEvent& me )
{
- int btn = me.buttons() | me.modifiers();
- const int zoomBtn = Qt::ControlModifier | Qt::LeftButton;
- const int panBtn = Qt::ControlModifier | Qt::MidButton;
- const int fitBtn = Qt::ControlModifier | Qt::RightButton;
+ int btn = (int)me.button() | (int)me.modifiers();
+ const int zoomBtn = (int)Qt::ControlModifier | (int)Qt::LeftButton;
+ const int panBtn = (int)Qt::ControlModifier | (int)Qt::MidButton;
+ const int fitBtn = (int)Qt::ControlModifier | (int)Qt::RightButton;
int op = NoOpId;
if ( btn == zoomBtn ) {
}
}
else {
- int btn = me.buttons() | me.modifiers();
+ int btn = (int)me.button() | (int)me.modifiers();
if (btn == Qt::RightButton) {
QMouseEvent* aEvent = new QMouseEvent(QEvent::MouseButtonPress,
me.pos(), me.button(), me.buttons(), me.modifiers() );
#include <QPaintEvent>
#include <QActionGroup>
#include <QPainter>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QPrinter>
#include <QPrintDialog>
-#else
-#include <QtPrintSupport/QPrinter>
-#include <QtPrintSupport/QPrintDialog>
-#endif
#include <qwt_plot_curve.h>
QApplication::instance()->installEventFilter( this );
}
+/*!
+ \brief Constructor.
+
+ Creates an action owned by \a parent. Parameters \a text,
+ \a icon, \a menuText and \a accel specify the action's attributes.
+ Parameter \a toggle can be used to make the action checkable.
+ Parameter \a shortcutAction can be used to assign the shortcut from
+ preferences. This parameter value corresponds to shortcut action identifier
+ in shortcut preferences.
+
+ \param text tooltip text
+ \param icon iconset
+ \param menuText menu text
+ \param accel shortcut key sequence
+ \param parent parent object
+ \param toggle if \c true the action will be a toggle action
+ \param shortcutAction shortcut action identifier
+*/
+QtxAction::QtxAction( const QString& text, const QIcon& icon, const QString& menuText,
+ const QKeySequence& accel, QObject* parent, bool toggle, const QString& shortcutAction )
+: QWidgetAction( parent )
+{
+ setIcon( icon );
+ setText( menuText );
+ setToolTip( text );
+ setShortcut( accel );
+ setCheckable( toggle );
+ setShortcutActionName(shortcutAction);
+
+ QApplication::instance()->installEventFilter( this );
+}
+
/*!
\brief Constructor.
QApplication::instance()->installEventFilter( this );
}
+/*!
+ \brief Constructor.
+
+ Creates an action owned by \a parent. Parameters \a text,
+ \a menuText and \a accel specify the action's attributes.
+ Parameter \a toggle can be used to make the action checkable.
+ Parameter \a shortcutAction can be used to assign the shortcut from
+ preferences. This parameter value corresponds to shortcut action identifier
+ in shortcut preferences.
+
+ \param text tooltip text
+ \param menuText menu text
+ \param accel shortcut key sequence
+ \param parent parent object
+ \param toggle if \c true the action is a toggle action
+ \param shortcutAction shortcut action identifier
+*/
+QtxAction::QtxAction( const QString& text, const QString& menuText,
+ const QKeySequence& accel, QObject* parent, bool toggle, const QString& shortcutAction )
+: QWidgetAction( parent )
+{
+ setText( menuText );
+ setToolTip( text );
+ setShortcut( accel );
+ setCheckable( toggle );
+ setShortcutActionName(shortcutAction);
+
+ QApplication::instance()->installEventFilter( this );
+}
+
/*!
\brief Destructor.
*/
public:
QtxAction( QObject* = 0, bool = false, const QString& = QString() );
QtxAction( const QString&, const QString&, int, QObject*, bool = false, const QString& = QString() );
+ QtxAction( const QString&, const QString&, const QKeySequence&, QObject*, bool = false, const QString& = QString() );
QtxAction( const QString&, const QIcon&, const QString&, int, QObject*, bool = false, const QString& = QString() );
+ QtxAction( const QString&, const QIcon&, const QString&, const QKeySequence&, QObject*, bool = false, const QString& = QString() );
virtual ~QtxAction();
virtual bool eventFilter( QObject*, QEvent* );
QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set,
strValue( attr, label ),
- QKeySequence( strValue( attr, accel ) )[0],
+ QKeySequence( strValue( attr, accel ) ),
myMgr );
newAct->setToolTip( strValue( attr, tooltip ) );
QString toggleact = strValue( attr, toggle );
set = QIcon( pix );
QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, strValue( attr, label ),
- QKeySequence( strValue( attr, accel ) )[0], myMgr );
+ QKeySequence( strValue( attr, accel ) ), myMgr );
QString toggleact = strValue( attr, toggle );
newAct->setCheckable( !toggleact.isEmpty() );
newAct->setChecked( toggleact.toLower() == "true" );
QApplication::instance()->processEvents();
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
QApplication::syncX();
+#else
+ QApplication::sync();
#endif
int id = buttonId( (QAbstractButton*)mySender );
mySender = 0;
if ( o != menuBar() )
return false;
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- if ( e->type() == QEvent::MenubarUpdated || e->type() == QEvent::Resize )
-#else
if ( e->type() == QEvent::Resize )
-#endif
updateCorner();
if ( e->type() == QEvent::ChildAdded || e->type() == QEvent::ChildRemoved )
#include "QtxPopupMgr.h"
#include "QtxAction.h"
#include "QtxEvalExpr.h"
+#include <QList>
#include <QMenu>
+#include <QVariant>
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+
/*!
\brief Used for comparing of two QVariant values.
\param v1 first argument for comparison
for ( ; anIt1 != aLast1 && anIt2 != aLast2; anIt1++, anIt2++ )
{
if ( (*anIt1) != (*anIt2) )
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return (*anIt1)<(*anIt2);
-#else
- return (*anIt1)<=(*anIt2);
-#endif
+ return (*anIt1) < (*anIt2);
}
return anIt1 == aLast1 && anIt2 != aLast2;
}
return t1 < t2;
}
+#else
+
+bool operator<( const QList<QVariant>& v1, const QList<QVariant>& v2 )
+{
+ QList<QVariant>::const_iterator anIt1 = v1.begin(), aLast1 = v1.end(),
+ anIt2 = v2.begin(), aLast2 = v2.end();
+ for ( ; anIt1 != aLast1 && anIt2 != aLast2; anIt1++, anIt2++ )
+ {
+ if ( (*anIt1) != (*anIt2) )
+ return (*anIt1) < (*anIt2);
+ }
+ return anIt1 == aLast1 && anIt2 != aLast2;
+}
+
+#endif // QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+
/*!
\class QtxPopupMgr::PopupCreator
\internal
QString actLabel = strValue( attr, label );
QtxAction* newAct = new QtxAction( strValue( attr, tooltip ), set, actLabel,
- QKeySequence( strValue( attr, accel ) )[0],
+ QKeySequence( strValue( attr, accel ) ),
myMgr );
newAct->setToolTip( strValue( attr, tooltip ) );
QString toggleact = strValue( attr, toggle );
{
}
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+
/*!
\brief Returns the translation for the key.
\param context message context
\param sourceText message source name
- \param comment message comment (optional)
+ \param disambiguation message comment (optional)
\return Translated text if found or \a sourceText otherwise
*/
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment ) const
+QString QtxTranslator::translate( const char* context, const char* sourceText, const char* disambiguation ) const
{
- QString res = QTranslator::translate( context, sourceText, comment );
- if( res.isNull() )
- res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
+ QString res = QTranslator::translate( context, sourceText, disambiguation );
+ if ( res.isNull() )
+ res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, disambiguation );
return res;
}
+
#else
-QString QtxTranslator::translate( const char* context, const char* sourceText, const char* comment, int n ) const
+
+/*!
+ \brief Returns the translation for the key.
+ \param context message context
+ \param sourceText message source name
+ \param disambiguation message comment (optional)
+ \param n optional numeral to choose the appropriate form of translation
+ \return Translated text if found or \a sourceText otherwise
+*/
+QString QtxTranslator::translate( const char* context, const char* sourceText, const char* disambiguation, int n ) const
{
- QString res = QTranslator::translate( context, sourceText, comment, n );
- if( res.isNull() )
- res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment, n );
+ QString res = QTranslator::translate( context, sourceText, disambiguation, n );
+ if ( res.isNull() )
+ res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, disambiguation, n );
return res;
}
-#endif
+
+#endif // QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
virtual QString translate( const char*, const char*, const char* = 0 ) const;
#else
- virtual QString translate( const char*, const char*, const char* = 0, int n = -1 ) const;
+ virtual QString translate( const char*, const char*, const char* = 0, int = -1 ) const;
#endif
};
QIcon icon;
if ( iconData.isValid() ) {
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- if ( qVariantCanConvert<QIcon>( iconData ) )
- icon = qVariantValue<QIcon>( iconData );
- else if ( qVariantCanConvert<QPixmap>( iconData ) )
- icon = qVariantValue<QPixmap>( iconData );
+ if ( iconData.canConvert( QVariant::Icon ) )
+ icon = iconData.value<QIcon>();
+ else if ( iconData.canConvert( QVariant::Pixmap ) )
+ icon = iconData.value<QPixmap>();
#else
if ( iconData.canConvert( QMetaType::QIcon ) )
icon = iconData.value<QIcon>();
#include <QStatusBar>
#include <QToolBar>
#include <QVBoxLayout>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QWebView>
-#else
-#include <QtWebKitWidgets/QWebView>
-#endif
#include <QProcess>
namespace
icon, // icon
label, // menu text
tooltip, // status-bar text
- QKeySequence( accel )[0], // keyboard accelerator
+ QKeySequence( accel ), // keyboard accelerator
module(), // action owner
toggle ); // toogled action
myHelper->connectAction( action );
icon, // icon
label, // menu text
tooltip, // status-bar text
- QKeySequence( accel )[0], // keyboard accelerator
+ QKeySequence( accel ), // keyboard accelerator
module(), // action owner
toggle ); // toogled action
myHelper->connectAction( action );
icon, // icon
label, // menu text
tooltip, // status-bar text
- QKeySequence( accel )[0], // keyboard accelerator
+ QKeySequence( accel ), // keyboard accelerator
module(), // action owner
toggle ); // toogled action
myHelper->connectAction( action );
#include <QFrame>
#include <QVBoxLayout>
+#include <QMdiSubWindow>
#include <stdarg.h>
*/
SUIT_ViewWindow* STD_MDIDesktop::activeWindow() const
{
- SUIT_ViewWindow* wnd = 0;
-
- QWidget* wid = (QWidget*)myWorkspace->activeSubWindow();
- if ( wid && wid->inherits( "SUIT_ViewWindow" ) )
- wnd = (SUIT_ViewWindow*)wid;
-
- return wnd;
+ return qobject_cast<SUIT_ViewWindow*>( myWorkspace->activeSubWindow()->widget() );
}
/*!
QList<QMdiSubWindow *> children = myWorkspace->subWindowList();
for ( QList<QMdiSubWindow *>::iterator it = children.begin(); it != children.end(); ++it )
{
- SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( (QWidget*)(*it) );
+ SUIT_ViewWindow* vw = ::qobject_cast<SUIT_ViewWindow*>( (*it)->widget() );
if ( vw )
winList.append( vw );
}
* Create new instance of QtxAction and set.
*/
void SUIT_ActionOperation::setAction( const QString& text, const QIcon& icon,
- const QString& menuText, QKeySequence accel,
+ const QString& menuText, QKeySequence accel,
QObject* parent, bool toggle )
{
- setAction( new QtxAction( text, icon, menuText, accel[0], parent, toggle ) );
+ setAction( new QtxAction( text, icon, menuText, accel, parent, toggle ) );
}
/*!Set action.
* Create new instance of QtxAction and set.
*/
void SUIT_ActionOperation::setAction( const QString& text, const QString& menuText,
- QKeySequence accel, QObject* parent, bool toggle )
+ QKeySequence accel, QObject* parent, bool toggle )
{
- setAction( new QtxAction( text, menuText, accel[0], parent, toggle ) );
+ setAction( new QtxAction( text, menuText, accel, parent, toggle ) );
}
/*!Set action.
const QString& menu, const QString& tip, const int key,
QObject* parent, const bool toggle, QObject* reciever,
const char* member, const QString& shortcutAction )
+{
+ return createAction( id, text, icon, menu, tip, QKeySequence(key), parent, toggle, reciever, member, shortcutAction );
+}
+
+/*!
+ Creates action and registers it both in menu manager and tool manager
+ \return new instance of action
+ \param id - proposed SUIT identificator
+ \param text - description
+ \param icon - icon for toolbar
+ \param menu - menu text
+ \param tip - tool tip
+ \param key - shortcut
+ \param parent - parent object
+ \param toggle - if it is TRUE the action will be a toggle action, otherwise it will be a command action
+ \param reciever - object that contains slot
+ \param member - slot to be called when action is activated
+*/
+QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon,
+ const QString& menu, const QString& tip, const QKeySequence& key,
+ QObject* parent, const bool toggle, QObject* reciever,
+ const char* member, const QString& shortcutAction )
{
QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction );
a->setStatusTip( tip );
class QString;
class QAction;
class QWidget;
+class QKeySequence;
class SUIT_Desktop;
class SUIT_ViewManager;
const QString&, const int, QObject* = 0,
const bool = false, QObject* = 0, const char* = 0,
const QString& = QString() );
+ QAction* createAction( const int, const QString&, const QIcon&, const QString&,
+ const QString&, const QKeySequence&, QObject* = 0,
+ const bool = false, QObject* = 0, const char* = 0,
+ const QString& = QString() );
protected slots:
virtual void onDesktopActivated();
#include <QPushButton>
#include <QTextStream>
#include <QFile>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
#include <QPrinter>
-#else
-#include <QtPrintSupport/QPrinter>
-#endif
//#include <QSimpleRichText>
#include <QTextDocument>
#include <QPainter>
/*!Gets CORBA::ORB_var*/
CORBA::ORB_var SalomeApp_Application::orb()
{
- ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- int size = qApp->arguments().size();
- char* argv[size];
- for ( int i = 0; i < size; ++i)
- {
- argv[i] = qApp->arguments()[i].toLatin1().data();
+ static CORBA::ORB_var _orb;
+
+ if ( CORBA::is_nil( _orb ) ) {
+ QStringList args = QApplication::arguments();
+ int argc = args.size();
+ std::vector<std::string> args1(argc);
+ char** argv = new char*[argc];
+ for ( int i = 0; i < argc; ++i ) {
+ args1[i] = args[i].toStdString();
+ argv[i] = const_cast<char*>( args1[i].c_str() );
+ }
+
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ _orb = init( argc, argv );
+
+ delete [] argv;
}
- static CORBA::ORB_var _orb = init( size, argv );
+
return _orb;
}
*/
CORBA::ORB_var SalomeApp_Engine_i::orb()
{
- ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- // TODO: using QApplication here looks ugly, think how to
- // obtain the ORB reference in a nicer way...
- int size = qApp->arguments().size();
- char* argv[size];
- for ( int i = 0; i < size; ++i)
- {
- argv[i] = qApp->arguments()[i].toLatin1().data();
+ static CORBA::ORB_var _orb;
+
+ if ( CORBA::is_nil( _orb ) ) {
+ QStringList args = QApplication::arguments();
+ int argc = args.size();
+ std::vector<std::string> args1(argc);
+ char** argv = new char*[argc];
+ for ( int i = 0; i < argc; ++i ) {
+ args1[i] = args[i].toStdString();
+ argv[i] = const_cast<char*>( args1[i].c_str() );
+ }
+
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ _orb = init( argc, argv );
+
+ delete [] argv;
}
- static CORBA::ORB_var _orb = init( size, argv );
+
return _orb;
}
switch ( type )
{
case QtDebugMsg:
- //MESSAGE( "Debug: " << msg );
+ //MESSAGE( "Debug: " << qPrintable(msg) );
break;
case QtWarningMsg:
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- MESSAGE( "Warning: " << msg );
-#else
- MESSAGE( "Warning: " << msg.toLatin1().data() );
-#endif
+ MESSAGE( "Warning: " << qPrintable(msg) );
break;
case QtFatalMsg:
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- MESSAGE( "Fatal: " << msg );
-#else
- MESSAGE( "Fatal: " << msg.toLatin1().data() );
-#endif
+ MESSAGE( "Fatal: " << qPrintable(msg) );
break;
}
}
qInstallMessageHandler( MessageOutput );
#endif
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
//Set a "native" graphic system in case if application runs on the remote host
QString remote(getenv("REMOTEHOST"));
QString client(getenv("SSH_CLIENT"));
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
if(remote.length() > 0 || client.length() > 0 ) {
QApplication::setGraphicsSystem(QLatin1String("native"));
}
#endif
+
// add $QTDIR/plugins to the pluins search path for image plugins
QString qtdir = qgetenv( "QT_ROOT_DIR" );
if ( qtdir.isEmpty() )
// start check servers
int current = 0;
QString error;
- int argc = QApplication::instance()->arguments().size();
- char* argv[argc];
- for ( int i = 0; i < argc; ++i)
- {
- argv[i] = QApplication::instance()->arguments()[i].toLatin1().data();
+
+ QStringList args = QApplication::arguments();
+ int argc = args.size();
+ std::vector<std::string> args1(argc);
+ char** argv = new char*[argc];
+ for ( int i = 0; i < argc; ++i ) {
+ args1[i] = args[i].toStdString();
+ argv[i] = const_cast<char*>( args1[i].c_str() );
}
+ bool OK = true;
+
// 1. Check naming service
- for ( int i = 0; i < myAttempts; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
try {
- CORBA::ORB_var orb = CORBA::ORB_init( argc, argv );
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ CORBA::ORB_var orb = init( argc, argv );
CORBA::Object_var obj = orb->resolve_initial_references( "NameService" );
CosNaming::NamingContext_var _root_context = CosNaming::NamingContext::_narrow( obj );
if ( !CORBA::is_nil( _root_context ) ) {
if ( i == myAttempts-1 ) {
setError( tr( "Unable to contact the naming service.\n" ) );
- return;
+ OK = false;
+ //return;
}
}
// 2. Check registry server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Registry server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 3. Check data server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Study server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 4. Check module catalogue server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Module catalogue server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 5. Check data server
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Session server is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
// 6. Check C++ container
if ( myCheckCppContainer ) {
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "C++ container is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
}
// 7. Check Python container
if ( myCheckPyContainer ) {
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Python container is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
}
// 8. Check supervision container
if ( myCheckSVContainer ) {
- for ( int i = 0; i < myAttempts ; i++ ) {
+ for ( int i = 0; (i < myAttempts) && OK ; i++ ) {
Locker locker( this );
setStep( current * myAttempts + i );
if ( i == myAttempts-1 ) {
setError( tr( "Supervision container is not found.\n%1" ).arg ( error ) );
- return;
+ OK = false;
+ //return;
}
}
}
+
+ delete [] argv;
}
#include <QSlider>
#include <QMainWindow>
#include <QPixmapCache>
-
-#include <limits.h>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-#include <qdrawutil.h>
-#endif
+#include <QTileRules>
#define SHADOW 1
#define LINE_GR_MARGIN 10
INSTALL(FILES ${GUIVTI_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
FILE(GLOB GUITXT_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.txt")
-INSTALL(FILES ${GUITXT_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
\ No newline at end of file
+INSTALL(FILES ${GUITXT_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})
#ifndef WIN32
#include <QX11Info>
#include <vtkXOpenGLRenderWindow.h>
-//#include <GL/gl.h>
-//#include <GL/glu.h>
-//#include <qgl.h>
#endif
/*!Constructor. Create render window with parant \a parent and name \a name.