# SUBDIRS += RegistryDisplay TOOLSGUI \
# Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT
# VSR: already migrated to Qt4 packages
- SUBDIRS += RegistryDisplay
+ SUBDIRS += RegistryDisplay TOOLSGUI
endif
--- /dev/null
+TEMPLATE = lib
+TARGET = ToolsGUI
+DESTDIR = ../../lib
+MOC_DIR = ../../moc
+OBJECTS_DIR = ../../obj/$$TARGET
+
+CASROOT = $$(CASROOT)
+CAS_CPPFLAGS = $${CASROOT}/inc
+
+BOOST_CPPFLAGS = $$(BOOSTDIR)/include
+
+KERNEL_CXXFLAGS = $$(KERNEL_ROOT_DIR)/include/salome
+
+CORBA_INCLUDES = $$(OMNIORBDIR)/include $$(OMNIORBDIR)/include/omniORB4 $$(OMNIORBDIR)/include/COS
+
+CAS_KERNEL = -L$${CASROOT}/Linux/lib -lTKernel
+
+KERNEL_LDFLAGS = -L$$(KERNEL_ROOT_DIR)/lib/salome
+
+INCLUDEPATH += $${CAS_CPPFLAGS} $${BOOST_CPPFLAGS} $${KERNEL_CXXFLAGS} $${CORBA_INCLUDES} ../../salome_adm/unix ../../idl ../Qtx ../SUIT
+LIBS += -L../../lib -lsuit -lSalomeNS -lOpUtil $${CAS_KERNEL} $${KERNEL_LDFLAGS}
+
+CONFIG -= debug release debug_and_release
+CONFIG += qt thread debug dll shared
+
+win32:DEFINES += WIN32
+DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS
+
+HEADERS = ToolsGUI.h
+HEADERS += ToolsGUI_RegWidget.h
+HEADERS += ToolsGUI_CatalogGeneratorDlg.h
+
+SOURCES = ToolsGUI_CatalogGeneratorDlg.cxx
+SOURCES += ToolsGUI_HelpWindow.cxx
+SOURCES += ToolsGUI_RegWidget.cxx
+SOURCES += ToolsGUI_IntervalWindow.cxx
+SOURCES += ToolsGUI.cxx
+
+TRANSLATIONS = resources/ToolsGUI_icons.ts \
+ resources/ToolsGUI_msg_en.ts
+
+ICONS = resources/*.png
+
+includes.files = $$HEADERS
+includes.path = ../../include
+
+resources.files = $$ICONS resources/*.qm
+resources.path = ../../resources
+
+INSTALLS += includes resources
#include "ToolsGUI_CatalogGeneratorDlg.h"
#include "SUIT_Application.h"
-#include "SUIT_Desktop.h"
#include "SUIT_MessageBox.h"
-#include "SUIT_Tools.h"
+//#include "SUIT_Tools.h"
#include "SUIT_Session.h"
#include <stdlib.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qvalidator.h>
-#include <qfile.h>
+
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QStringList>
+#include <QRegExp>
+#include <QIntValidator>
+#include <QFile>
#include <OSD_Process.hxx>
#include <OSD_Path.hxx>
Constructor
*/
ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, const char* name )
- : QDialog( parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+ : QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
+ setObjectName( name );
+ setModal( TRUE );
+
if ( !name )
- setName( "ToolsGUI_CatalogGeneratorDlg" );
+ setObjectName( "ToolsGUI_CatalogGeneratorDlg" );
resize( 322, 120 );
- setCaption( tr( "TOOLS_CATALOG_GENERATOR" ) );
+ setWindowTitle( tr( "TOOLS_CATALOG_GENERATOR" ) );
setSizeGripEnabled( TRUE );
QGridLayout* aTopLayout = new QGridLayout(this);
aTopLayout->setMargin(MARGIN_SIZE);
aTopLayout->setSpacing(SPACING_SIZE);
- QGroupBox* filesGrp = new QGroupBox( tr( "TOOLS_FILES") , this, "filesGrp" );
- filesGrp->setColumnLayout( 0, Qt::Vertical );
- filesGrp->layout()->setSpacing( 0 );
- filesGrp->layout()->setMargin( 0 );
- QGridLayout* filesGrpLayout = new QGridLayout( filesGrp->layout() );
+ QGroupBox* filesGrp = new QGroupBox( tr( "TOOLS_FILES") , this );
+ filesGrp->setObjectName( "filesGrp" );
+ QGridLayout* filesGrpLayout = new QGridLayout( filesGrp );
filesGrpLayout->setAlignment( Qt::AlignTop );
filesGrpLayout->setSpacing( SPACING_SIZE );
filesGrpLayout->setMargin( MARGIN_SIZE );
- myIdlEdit = new QLineEdit( filesGrp, "myIdlEdit" );
+ myIdlEdit = new QLineEdit( filesGrp );
+ myIdlEdit->setObjectName( "myIdlEdit" );
myIdlEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myIdlEdit->setMinimumSize( MIN_EDIT_SIZE, 0 );
- myXmlEdit = new QLineEdit( filesGrp, "myXmlEdit" );
+ myXmlEdit = new QLineEdit( filesGrp );
+ myXmlEdit->setObjectName( "myXmlEdit" );
myXmlEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myXmlEdit->setMinimumSize( MIN_EDIT_SIZE, 0 );
- myBrowseIdlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp, "myBrowseIdlBtn" );
- myBrowseXmlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp, "myBrowseXmlBtn" );
+ myBrowseIdlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp );
+ myBrowseIdlBtn->setObjectName( "myBrowseIdlBtn" );
+ myBrowseXmlBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), filesGrp );
+ myBrowseXmlBtn->setObjectName( "myBrowseXmlBtn" );
// QFontMetrics fm(myBrowseIdlBtn->font());
// myBrowseIdlBtn->setFixedWidth(fm.width(myBrowseIdlBtn->text()) + 10);
// myBrowseXmlBtn->setFixedWidth(fm.width(myBrowseXmlBtn->text()) + 10);
filesGrpLayout->addWidget( myXmlEdit, 1, 1 );
filesGrpLayout->addWidget( myBrowseXmlBtn, 1, 2 );
- QGroupBox* supplGrp = new QGroupBox(tr( "TOOLS_SUPPLEMENT" ) , this, "SupplGrp" );
- supplGrp->setColumnLayout( 0, Qt::Vertical );
- supplGrp->layout()->setSpacing( 0 );
- supplGrp->layout()->setMargin( 0 );
- QGridLayout* supplGrpLayout = new QGridLayout( supplGrp->layout() );
+ QGroupBox* supplGrp = new QGroupBox(tr( "TOOLS_SUPPLEMENT" ) , this );
+ supplGrp->setObjectName( "SupplGrp" );
+ QGridLayout* supplGrpLayout = new QGridLayout( supplGrp );
supplGrpLayout->setAlignment( Qt::AlignTop );
supplGrpLayout->setSpacing( SPACING_SIZE );
supplGrpLayout->setMargin( MARGIN_SIZE );
QSize myMinimumSize(int(MIN_EDIT_SIZE*0.3), 0);
- myAuthorEdit = new QLineEdit( supplGrp , "myAuthorEdit" );
+ myAuthorEdit = new QLineEdit( supplGrp );
+ myAuthorEdit->setObjectName( "myAuthorEdit" );
myAuthorEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myAuthorEdit->setMinimumSize( myMinimumSize );
OSD_Process aProcess;
myAuthorEdit->setText(aProcess.UserName().ToCString());
- myVersionEdit = new QLineEdit(supplGrp , "myVersion" );
+ myVersionEdit = new QLineEdit( supplGrp );
+ myVersionEdit->setObjectName( "myVersion" );
myVersionEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myVersionEdit->setMinimumSize( myMinimumSize );
- QStringList aList = QStringList::split(QRegExp("\\s+"),tr( "INF_VERSION" ));
+ QStringList aList = tr( "INF_VERSION" ).split(QRegExp("\\s+"), QString::SkipEmptyParts);
myVersionEdit->setText(aList.last());
- myPngEdit = new QLineEdit(supplGrp , "myCompIcon" );
+ myPngEdit = new QLineEdit( supplGrp );
+ myPngEdit->setObjectName( "myCompIcon" );
myPngEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myPngEdit->setMinimumSize( MIN_EDIT_SIZE, 0 );
- myBrowsePngBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), supplGrp, "myBrowsePngBtn" );
+ myBrowsePngBtn = new QPushButton( tr( "TOOLS_BUT_BROWSE" ), supplGrp );
+ myBrowsePngBtn->setObjectName( "myBrowsePngBtn" );
- myCompName = new QLineEdit(supplGrp , "myCompName");
+ myCompName = new QLineEdit( supplGrp );
+ myCompName->setObjectName( "myCompName" );
myCompName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myCompName->setMinimumSize( myMinimumSize );
- myCompUserName = new QLineEdit(supplGrp , "myCompUserName");
+ myCompUserName = new QLineEdit( supplGrp );
+ myCompUserName->setObjectName( "myCompUserName" );
myCompUserName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myCompUserName->setMinimumSize( (int)(MIN_EDIT_SIZE*0.3), 0 );
- myCompType = new QLineEdit(supplGrp , "myCompType");
+ myCompType = new QLineEdit( supplGrp );
+ myCompType->setObjectName( "myCompType" );
myCompType->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myCompType->setMinimumSize( myMinimumSize );
myCompType->setText("OTHER");
- myCompMultiStd = new QLineEdit(supplGrp , "myCompMultiStd");
+ myCompMultiStd = new QLineEdit( supplGrp );
+ myCompMultiStd->setObjectName( "myCompMultiStd" );
myCompMultiStd->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myCompMultiStd->setMinimumSize( myMinimumSize );
myCompMultiStd->setText("1");
supplGrpLayout->addWidget( new QLabel( tr( "TOOLS_COMP_TYPE" ), supplGrp ), 1, 4);
supplGrpLayout->addWidget(myCompType,1,5);
supplGrpLayout->addWidget( new QLabel( tr( "TOOLS_PNG_FILE" ), supplGrp ), 2, 0);
- supplGrpLayout->addMultiCellWidget( myPngEdit, 2,2,1,4 );
+ supplGrpLayout->addWidget( myPngEdit, 2,1,1,4 );
supplGrpLayout->addWidget( myBrowsePngBtn, 2, 5 );
aBtnLayout->setSpacing( SPACING_SIZE );
aBtnLayout->setMargin( 0 );
- myApplyBtn = new QPushButton( tr( "TOOLS_BUT_APPLY" ), this, "myApplyBtn" );
+ myApplyBtn = new QPushButton( tr( "TOOLS_BUT_APPLY" ), this );
+ myApplyBtn->setObjectName( "myApplyBtn" );
myApplyBtn->setAutoDefault( true );
myApplyBtn->setDefault( true );
- myCloseBtn = new QPushButton( tr( "TOOLS_BUT_CLOSE" ), this, "myCloseBtn" );
+ myCloseBtn = new QPushButton( tr( "TOOLS_BUT_CLOSE" ), this );
+ myCloseBtn->setObjectName( "myCloseBtn" );
myCloseBtn->setAutoDefault( true );
aBtnLayout->addWidget( myApplyBtn );
*/
QString ToolsGUI_CatalogGeneratorDlg::getIdlFile()
{
- return myIdlEdit->text().stripWhiteSpace();
+ return myIdlEdit->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getXmlFile()
{
- return myXmlEdit->text().stripWhiteSpace();
+ return myXmlEdit->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getPngFile()
{
- return myPngEdit->text().stripWhiteSpace();
+ return myPngEdit->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getAuthor()
{
- return myAuthorEdit->text().stripWhiteSpace();
+ return myAuthorEdit->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getVersion()
{
- return myVersionEdit->text().stripWhiteSpace();
+ return myVersionEdit->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getCompName()
{
- return myCompName->text().stripWhiteSpace();
+ return myCompName->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getCompUserName()
{
- return myCompUserName->text().stripWhiteSpace();
+ return myCompUserName->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getCompMultiStd()
{
- return myCompMultiStd->text().stripWhiteSpace();
+ return myCompMultiStd->text().trimmed();
}
/*!
*/
QString ToolsGUI_CatalogGeneratorDlg::getCompType()
{
- return myCompType->text().stripWhiteSpace();
+ return myCompType->text().trimmed();
}
/*!
SUIT_Application* app = SUIT_Session::session()->activeApplication();
if ( send == myBrowseIdlBtn ) {
- QString file = app->getFileName( true, myIdlEdit->text().stripWhiteSpace(), tr("TOOLS_MEN_IMPORT_IDL"), tr("TOOLS_MEN_IMPORT"), 0 );
+ QString file = app->getFileName( true, myIdlEdit->text().trimmed(), tr("TOOLS_MEN_IMPORT_IDL"), tr("TOOLS_MEN_IMPORT"), 0 );
if ( !file.isEmpty() ) {
myIdlEdit->setText(file);
}
}
else if ( send == myBrowseXmlBtn ) {
- QString file = app->getFileName( false, myXmlEdit->text().stripWhiteSpace(), tr("TOOLS_MEN_EXPORT_XML"), tr("TOOLS_MEN_EXPORT"), 0 );
+ QString file = app->getFileName( false, myXmlEdit->text().trimmed(), tr("TOOLS_MEN_EXPORT_XML"), tr("TOOLS_MEN_EXPORT"), 0 );
if ( !file.isEmpty() ) {
myXmlEdit->setText(file);
}
} else if ( send == myBrowsePngBtn ) {
- QString file = app->getFileName( true, myPngEdit->text().stripWhiteSpace(), tr("TOOLS_MEN_IMPORT_PNG"), tr("TOOLS_MEN_IMPORT"), 0 );
+ QString file = app->getFileName( true, myPngEdit->text().trimmed(), tr("TOOLS_MEN_IMPORT_PNG"), tr("TOOLS_MEN_IMPORT"), 0 );
if ( !file.isEmpty() ) {
myPngEdit->setText(file);
*/
void ToolsGUI_CatalogGeneratorDlg::updateButtonState()
{
- myApplyBtn->setEnabled( !myIdlEdit->text().stripWhiteSpace().isEmpty() &&
- !myXmlEdit->text().stripWhiteSpace().isEmpty() );
+ myApplyBtn->setEnabled( !myIdlEdit->text().trimmed().isEmpty() &&
+ !myXmlEdit->text().trimmed().isEmpty() );
}
/*!
if (!Author.isEmpty()) command += ",author=" + Author;
if (!Version.isEmpty()) command += ",version=" + Version;
if (!PngFile.isEmpty()) {
- OSD_Path aPath((Standard_CString)PngFile.latin1());
+ OSD_Path aPath((Standard_CString)PngFile.toLatin1().constData());
TCollection_AsciiString aFile = aPath.Name() + aPath.Extension();
command += QString(",icon=") + QString(aFile.ToCString());
}
if (!CompType.isEmpty()) command += ",type=" + CompType;
if (!CompMultiStd.isEmpty()) command += ",multistudy=" + CompMultiStd;
command += " " + IdlFile;
- MESSAGE( "shell command is : " << command );
+ MESSAGE( "shell command is : " << command.toLatin1().constData() );
int res;
- res = system( ( char* )( command.latin1() ) );
+ res = system( ( char* )( command.toLatin1().constData() ) );
if ( res == -1 ) {
MESSAGE( "work failed (system command result = " << res );
} else if (res == 217) {
#ifndef DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H
#define DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H
-#include <qdialog.h>
+#include <QDialog>
#include <Standard_Macro.hxx>
# include "ToolsGUI_HelpWindow.h"
# include "utilities.h"
-# include <qtextview.h>
-# include <qpushbutton.h>
-# include <qtextstream.h>
-# include <qfile.h>
+# include <QTextEdit>
+# include <QTextStream>
+# include <QFile>
using namespace std;
Constructor
*/
ToolsGUI_HelpWindow::ToolsGUI_HelpWindow(QWidget* parent, const char* name )
- : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose )
+ : QMainWindow( parent, Qt::Window )
{
BEGIN_OF("Constructeur ToolsGUI_HelpWindow");
- setCaption( tr( "Help" ) );
+ setObjectName( name );
+ setAttribute( Qt::WA_DeleteOnClose );
- myTextView = new QTextView( this, "myTextView" );
+ setWindowTitle( tr( "Help" ) );
+
+ myTextView = new QTextEdit( this );
+ myTextView->setObjectName( "myTextView" );
+ myTextView->setReadOnly( true );
QPalette pal = myTextView->palette();
- QColorGroup cg = pal.active();
- cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
- cg.setColor( QColorGroup::HighlightedText, Qt::white );
- cg.setColor( QColorGroup::Base, QColor( 255,255,220 ) );
- cg.setColor( QColorGroup::Text, Qt::black );
- pal.setActive ( cg );
- cg = pal.inactive();
- cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
- cg.setColor( QColorGroup::HighlightedText, Qt::white );
- cg.setColor( QColorGroup::Base, QColor( 255,255,220 ) );
- cg.setColor( QColorGroup::Text, Qt::black );
- pal.setInactive( cg );
- cg = pal.disabled();
- cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
- cg.setColor( QColorGroup::HighlightedText, Qt::white );
- cg.setColor( QColorGroup::Base, QColor( 255,255,220 ) );
- cg.setColor( QColorGroup::Text, Qt::black );
- pal.setDisabled( cg );
+
+ pal.setBrush( QPalette::Active, QPalette::Highlight, QBrush( QColor( 0, 0, 128 ) ) );
+ pal.setBrush( QPalette::Active, QPalette::HighlightedText, QBrush( Qt::white ) );
+ pal.setBrush( QPalette::Active, QPalette::Base, QBrush( QColor( 255,255,220 ) ) );
+ pal.setBrush( QPalette::Active, QPalette::Text, QBrush( Qt::black ) );
+
+ pal.setBrush( QPalette::Inactive, QPalette::Highlight, QBrush( QColor( 0, 0, 128 ) ) );
+ pal.setBrush( QPalette::Inactive, QPalette::HighlightedText, QBrush( Qt::white ) );
+ pal.setBrush( QPalette::Inactive, QPalette::Base, QBrush( QColor( 255,255,220 ) ) );
+ pal.setBrush( QPalette::Inactive, QPalette::Text, QBrush( Qt::black ) );
+
+ pal.setBrush( QPalette::Disabled, QPalette::Highlight, QBrush( QColor( 0, 0, 128 ) ) );
+ pal.setBrush( QPalette::Disabled, QPalette::HighlightedText, QBrush( Qt::white ) );
+ pal.setBrush( QPalette::Disabled, QPalette::Base, QBrush( QColor( 255,255,220 ) ) );
+ pal.setBrush( QPalette::Disabled, QPalette::Text, QBrush( Qt::black ) );
+
myTextView->setPalette( pal );
setCentralWidget( myTextView );
setMinimumSize( 450, 250 );
QFile f ( "tmp.txt" );
- if ( f.open( IO_ReadOnly ) )
+ if ( f.open( QIODevice::ReadOnly ) )
{
QTextStream t( &f );
- while ( !t.eof() )
+ while ( !t.atEnd() )
{
myTextView->append(t.readLine());
}
# ifndef __HELPWINDOW_H__
# define __HELPWINDOW_H__
-# include <qapplication.h>
-# include <qmainwindow.h>
+# include <QMainWindow>
-class QTextView;
+class QTextEdit;
class ToolsGUI_HelpWindow : public QMainWindow
{
~ToolsGUI_HelpWindow();
void setText( const QString& text );
- QTextView* textView() const { return myTextView; }
+ QTextEdit* textView() const { return myTextView; }
private:
- QTextView* myTextView;
+ QTextEdit* myTextView;
};
# endif /* __HELPWINDOW_H__ */
#include "ToolsGUI_IntervalWindow.h"
-#include <qbuttongroup.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <QWidget>
+#include <QLabel>
+#include <QPushButton>
+#include <QSpinBox>
+#include <QGridLayout>
+#include <QGroupBox>
# include "utilities.h"
#define MARGIN_SIZE 11
Constructor
*/
ToolsGUI_IntervalWindow::ToolsGUI_IntervalWindow ( QWidget* parent )
-: QDialog( parent, "ToolsGUI_IntervalWindow" , true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
{
BEGIN_OF("ToolsGUI_IntervalWindow constructor")
- setCaption( tr( "Refresh Interval" ) );
+
+ setObjectName( "ToolsGUI_IntervalWindow" );
+ setModal( true );
+ setAttribute( Qt::WA_DeleteOnClose );
+
+ setWindowTitle( tr( "Refresh Interval" ) );
setSizeGripEnabled( true );
QGridLayout* topLayout = new QGridLayout( this );
topLayout->setSpacing( SPACING_SIZE );
topLayout->setMargin( MARGIN_SIZE );
- QGroupBox* intervalGrp = new QGroupBox( this, "intervalGrp" );
- intervalGrp->setColumnLayout( 0, Qt::Horizontal );//Vertical
- intervalGrp->layout()->setSpacing( 0 );
- intervalGrp->layout()->setMargin( 0 );
- QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp->layout() );
+ QGroupBox* intervalGrp = new QGroupBox( this );
+ intervalGrp->setObjectName( "intervalGrp" );
+ QGridLayout* intervalGrpLayout = new QGridLayout( intervalGrp );
intervalGrpLayout->setAlignment( Qt::AlignTop );
intervalGrpLayout->setSpacing( SPACING_SIZE );
intervalGrpLayout->setMargin( MARGIN_SIZE );
aBtnLayout->setSpacing( SPACING_SIZE );
aBtnLayout->setMargin( 0 );
- myButtonOk = new QPushButton( this, "buttonOk" );
+ myButtonOk = new QPushButton( this );
+ myButtonOk->setObjectName( "buttonOk" );
myButtonOk->setText( tr( "BUT_OK" ) );
myButtonOk->setAutoDefault( TRUE );
myButtonOk->setDefault( TRUE );
- myButtonCancel = new QPushButton( this, "buttonCancel" );
+ myButtonCancel = new QPushButton( this );
+ myButtonCancel->setObjectName( "buttonCancel" );
myButtonCancel->setText( tr( "BUT_CANCEL" ) );
myButtonCancel->setAutoDefault( TRUE );
- QLabel* TextLabel = new QLabel( intervalGrp, "TextLabel" );
+ QLabel* TextLabel = new QLabel( intervalGrp );
+ TextLabel->setObjectName( "TextLabel" );
TextLabel->setText( tr( "Please, enter a number of seconds:" ) );
- mySpinBox = new QSpinBox( 1, 999999999, 1, intervalGrp, "SpinBox" );
+ mySpinBox = new QSpinBox( intervalGrp );
+ mySpinBox->setMinimum( 1 );
+ mySpinBox->setMaximum( 999999999 );
+ mySpinBox->setSingleStep( 1 );
+ mySpinBox->setObjectName( "SpinBox" );
mySpinBox->setValue( 100 );
mySpinBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
mySpinBox->setMinimumWidth(MIN_SPIN_WIDTH);
#ifndef IntervalWindow_HeaderFile
#define IntervalWindow_HeaderFile
-# include <qwidget.h>
-# include <qdialog.h>
-# include <qpushbutton.h>
-# include <qspinbox.h>
+# include <QDialog>
+
+class QWidget;
+class QPushButton;
+class QSpinBox;
#ifndef WIN32
using namespace std;
// Module : SALOME
// $Header$
-# include <qpushbutton.h>
-# include <qlistview.h>
-# include <qtabwidget.h>
-# include <qstatusbar.h>
-# include <qtextview.h>
-# include <qtimer.h>
-# include <qinputdialog.h>
-# include <qtoolbar.h>
-# include <qdir.h>
-# include <qtooltip.h>
+# include <QAction>
+# include <QPushButton>
+# include <QTreeWidget>
+# include <QTabWidget>
+# include <QStatusBar>
+# include <QTextEdit>
+# include <QTimer>
+# include <QToolBar>
+//# include <QDir>
+//# include <QToolTip>
+# include <QEvent>
+# include <QKeyEvent>
+# include <QCloseEvent>
+# include <QFileInfo>
# include "SALOME_NamingService.hxx"
# include "ServiceUnreachable.hxx"
return myRegWidgetPtr;
}
+/*!
+ Reimplement this virtual function to disable popup menu on dock areas
+ (instead of QMainWindow::setDockMenuEnabled( false ) method calling in Qt3)
+*/
+QMenu* ToolsGUI_RegWidget::createPopupMenu()
+{
+ QMenu* aPopup = 0;
+ return aPopup;
+}
+
/*!
Constructor
*/
ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, const char *name )
- : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose ),
+ : QMainWindow( parent, Qt::Window ),
_VarComponents( MakeRegistry(orb) ),
_clients(0), _history(0), _parent( parent ),
_tabWidget(0), _refresh(0), _interval(0),
myInfoWindow(0), myHelpWindow(0), myIntervalWindow(0)
{
+ setObjectName( name );
+ setAttribute( Qt::WA_DeleteOnClose );
+
QString aFile = findFile("default.png");
/* char* dir = getenv( "CSF_ResourcesDefaults" );
QString path( "" );
}*/
QPixmap pm ( aFile );
if ( !pm.isNull() )
- setIcon( pm );
+ setWindowIcon( pm );
// pixmap for buttons
QPixmap image_refresh ( ( const char** ) refresh_data );
// Buttons definition
QToolBar* topbar = new QToolBar( tr("Toolbar"), this );
- setDockEnabled( topbar, DockTornOff, false );
- setDockMenuEnabled( false );
-
- _refresh = new QPushButton( tr( "Refresh" ), topbar );
- _refresh->setIconSet( image_refresh );
- _refresh->setFocusPolicy( NoFocus );
- connect( _refresh, SIGNAL( clicked() ), this, SLOT( slotListeSelect() ) );
- QToolTip::add( _refresh, "", toolTipGroup(), tr("Immediately updates list of components") );
+ topbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
+ addToolBar( Qt::TopToolBarArea, topbar );
+
+ _refresh = topbar->addAction(image_refresh, tr( "Refresh" ), this, SLOT( slotListeSelect() ));
+ _refresh->setToolTip( "" );
+ _refresh->setStatusTip( tr("Immediately updates list of components") );
/* PAL5540 - this button is needless
QPushButton* help = new QPushButton( tr( "Help" ), topbar );
QToolTip::add( help, "", toolTipGroup(), tr("Opens Help window") );
*/
- _interval = new QPushButton( tr( "Interval" ), topbar );
- _interval->setIconSet( image_interval );
- _interval->setFocusPolicy( NoFocus );
- connect( _interval, SIGNAL( clicked() ), this, SLOT( slotSelectRefresh() ) );
- QToolTip::add( _interval, "", toolTipGroup(), tr("Changes refresh interval") );
+ _interval = topbar->addAction(image_interval, tr( "Interval" ), this, SLOT( slotSelectRefresh() ));
+ _interval->setToolTip( "" );
+ _interval->setStatusTip( tr("Changes refresh interval") );
topbar->addSeparator();
- _close = new QPushButton( tr("Close"), topbar );
- _close->setIconSet( image_close );
- _close->setFocusPolicy( NoFocus );
- connect( _close, SIGNAL( clicked() ), this, SLOT( close() ) );
- QToolTip::add( _close, "", toolTipGroup(), tr("Closes Registry window") );
+
+ _close = topbar->addAction( image_close, tr("Close"), this, SLOT( close() ));
+ _close->setToolTip( "" );
+ _close->setStatusTip( tr("Closes Registry window") );
// Display area and associated slots definition
_tabWidget = new QTabWidget( this );
- _clients = new QListView( _tabWidget );
+ _clients = new QTreeWidget( _tabWidget );
SetListe();
- _history = new QListView( _tabWidget );
+ _history = new QTreeWidget( _tabWidget );
SetListeHistory();
_tabWidget->addTab( _clients, tr( "Running" ) );
_tabWidget->addTab( _history, tr( "History" ) );
connect( _tabWidget, SIGNAL( currentChanged( QWidget* )), this, SLOT( slotListeSelect() ) );
- connect( _clients, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( slotClientChanged( QListViewItem* ) ) );
- connect( _history, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( slotHistoryChanged( QListViewItem* ) ) );
+ connect( _clients, SIGNAL( clicked( QTreeWidgetItem* ) ), this, SLOT( slotClientChanged( QTreeWidgetItem* ) ) );
+ connect( _history, SIGNAL( clicked( QTreeWidgetItem* ) ), this, SLOT( slotHistoryChanged( QTreeWidgetItem* ) ) );
setCentralWidget( _tabWidget );
// Timer definition (used to automaticaly refresh the display area)
PIXELS largeur = 800 ;
PIXELS hauteur = 350 ;
setGeometry( xpos, ypos, largeur, hauteur ) ;
- setCaption( name ) ;
- statusBar()->message(" ");
+ setWindowTitle( name ) ;
+ statusBar()->showMessage(" ");
}
/*!
}
else if ( object == _clients && event->type() == QEvent::KeyPress ) {
QKeyEvent* ke = (QKeyEvent*)event;
- if ( ke->key() == Key_Enter || ke->key() == Key_Return ) {
+ if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
slotClientChanged( _clients->currentItem() );
}
}
else if ( object == _history && event->type() == QEvent::KeyPress ) {
QKeyEvent* ke = (QKeyEvent*)event;
- if ( ke->key() == Key_Enter || ke->key() == Key_Return ) {
+ if ( ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) {
slotHistoryChanged( _history->currentItem() );
}
}
{
BEGIN_OF("SetListe");
_clients->installEventFilter( this );
+ _clients->setColumnCount(6);
_clients->setAllColumnsShowFocus( true );
- _clients->addColumn( tr( "Component" ), -1);
- _clients->addColumn( tr( "PID" ), -1 );
- _clients->addColumn( tr( "User Name" ), -1 );
- _clients->addColumn( tr( "Machine" ), -1 );
- _clients->addColumn( tr( "begins" ), -1 );
- _clients->addColumn( tr( "hello" ) , -1 );
- _clients->setColumnAlignment( 1, Qt::AlignRight );
+ QStringList aLabels;
+ aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("hello");
+ _clients->setHeaderLabels( aLabels );
+ //_clients->setColumnAlignment( 1, Qt::AlignRight );
END_OF("SetListe");
}
{
BEGIN_OF("SetListeHistory")
_history->installEventFilter( this );
+ _history->setColumnCount(6);
_history->setAllColumnsShowFocus( true );
- _history->addColumn( tr( "Component" ), -1);
- _history->addColumn( tr( "PID" ), -1 );
- _history->addColumn( tr( "User Name" ), -1 );
- _history->addColumn( tr( "Machine" ), -1 );
- _history->addColumn( tr( "begins" ), -1 );
- _history->addColumn( tr( "ends" ), -1 );
- _history->setColumnAlignment( 1, Qt::AlignRight );
+ QStringList aLabels;
+ aLabels << tr("Component") << tr("PID") << tr("User Name") << tr("Machine") << tr("begins") << tr("ends");
+ _history->setHeaderLabels( aLabels );
+ //_history->setColumnAlignment( 1, Qt::AlignRight );
END_OF("SetListeHistory")
}
aTime = time_t(c_info.tc_end);
char * t2 = (char * )duplicate(ctime(&aTime));
t2 [strlen(t2) -1 ] = ' ';
- QListViewItem * item = new QListViewItem(_history, QString(c_info.name),\
- a, QString(c_info.pwname), QString(c_info.machine), \
- QString(t1), QString(t2));
+ QStringList anItem;
+ anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
+ QTreeWidgetItem * item = new QTreeWidgetItem(_history, anItem);
item=0 ;
delete [] t1;
delete [] t2;
_refresh->setDisabled( TRUE ) ;
_counter->stop();
MESSAGE("Sorry, No more Registry Server") ;
- statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
+ statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
}
END_OF("InfoHistory")
}
aTime = time_t(c_info.tc_hello);
char * t2 = (char * )duplicate(ctime(&aTime));
t2 [strlen(t2) -1 ] = ' ';
- QListViewItem * item = new QListViewItem(_clients, QString(c_info.name),\
- a, QString(c_info.pwname), QString(c_info.machine), \
- QString(t1), QString(t2));
+ QStringList anItem;
+ anItem << QString(c_info.name) << a << QString(c_info.pwname) << QString(c_info.machine) << QString(t1) << QString(t2);
+ QTreeWidgetItem * item = new QTreeWidgetItem(_clients, anItem);
item=0 ;
delete [] t1;
delete [] t2;
_refresh->setDisabled( TRUE ) ;
_counter->stop();
MESSAGE("Sorry, No more Registry Server") ;
- statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
+ statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
}
END_OF("InfoReg")
}
{
try
{
- ASSERT(_tabWidget->currentPage() != NULL);
- if (_tabWidget->currentPage () == _clients) InfoReg();
- else if (_tabWidget->currentPage () == _history) InfoHistory();
+ ASSERT(_tabWidget->currentWidget() != NULL);
+ if (_tabWidget->currentWidget () == _clients) InfoReg();
+ else if (_tabWidget->currentWidget () == _history) InfoHistory();
}
catch( ... )
{
MESSAGE("Sorry, No more Registry Server") ;
- statusBar()->message( tr( "Sorry, No more Registry Server" ) ) ;
+ statusBar()->showMessage( tr( "Sorry, No more Registry Server" ) ) ;
}
}
{
BEGIN_OF("slotIntervalOk");
myRefreshInterval = myIntervalWindow->getValue();
- _counter->changeInterval( myRefreshInterval * 1000 );
+ _counter->start( myRefreshInterval * 1000 );
SCRUTE(myRefreshInterval);
myIntervalWindow->close();
END_OF("slotIntervalOk");
}
myHelpWindow->show();
myHelpWindow->raise();
- myHelpWindow->setActiveWindow();
+ myHelpWindow->activateWindow();
END_OF("slotHelp()") ;
}
/*!
Called when user clicks on item in <Running> list
*/
-void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item )
+void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item )
{
BEGIN_OF("slotClientChanged()") ;
int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverclients);
SCRUTE(numeroItem) ;
- SCRUTE(item->text(1)) ;
+ SCRUTE(item->text(1).toLatin1().constData()) ;
ASSERT(numeroItem>=0) ;
ASSERT((size_t)numeroItem<_serverclients->length()) ;
myInfoWindow->installEventFilter( this );
}
QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
- myInfoWindow->setCaption(a);
+ myInfoWindow->setWindowTitle(a);
myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info) );
myInfoWindow->show();
myInfoWindow->raise();
- myInfoWindow->setActiveWindow();
+ myInfoWindow->activateWindow();
blockSignals( false ); // enabling signals again
/*!
Called when user clicks on item in <History> list
*/
-void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item )
+void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item )
{
BEGIN_OF("slotHistoryChanged()") ;
int numeroItem = numitem(item->text(0), item->text(1), item->text(3), _serverhistory);
SCRUTE(numeroItem) ;
- SCRUTE(item->text(1)) ;
+ SCRUTE(item->text(1).toLatin1().constData()) ;
ASSERT(numeroItem>=0) ;
ASSERT((size_t)numeroItem<_serverhistory->length()) ;
const Registry::Infos & c_info=(*_serverhistory)[numeroItem];
myInfoWindow->installEventFilter( this );
}
QString a = tr( "More about" ) + QString( " " ) + QString( c_info.name );
- myInfoWindow->setCaption(a);
+ myInfoWindow->setWindowTitle(a);
myInfoWindow->setText( ToolsGUI_RegWidget::setlongText( c_info ) );
myInfoWindow->show();
myInfoWindow->raise();
- myInfoWindow->setActiveWindow();
+ myInfoWindow->activateWindow();
blockSignals( false ); // enabling signals again
Constructor
*/
ToolsGUI_InfoWindow::ToolsGUI_InfoWindow( QWidget* parent, const char* name )
- : QMainWindow( parent, name, WType_TopLevel | WDestructiveClose )
+ : QMainWindow( parent, Qt::Window )
{
BEGIN_OF("InfoWindow");
- myTextView = new QTextView( this, "myTextView" );
+
+ setObjectName( name );
+ setAttribute( Qt::WA_DeleteOnClose );
+
+ myTextView = new QTextEdit( this );
+ myTextView->setObjectName( "myTextView" );
+ myTextView->setReadOnly( true );
setCentralWidget( myTextView );
setMinimumSize( 450, 250 );
END_OF("InfoWindow");
void ToolsGUI_InfoWindow::keyPressEvent( QKeyEvent * e )
{
QMainWindow::keyPressEvent( e );
- if ( e->key() == Key_Escape )
+ if ( e->key() == Qt::Key_Escape )
close();
}
dir.sprintf( "%s", cenv );
if ( !dir.isEmpty() )
{
- QStringList dirList = QStringList::split( SEPARATOR, dir, false ); // skip empty entries
+ QStringList dirList = dir.split( SEPARATOR, QString::SkipEmptyParts ); // skip empty entries
for ( int i = 0; i < (int)dirList.count(); i++ )
{
QFileInfo fileInfo( addSlash( dirList[ i ] ) + filename );
#ifndef __REGWIDGET_H__
#define __REGWIDGET_H__
-#include <qapplication.h>
-#include <qmainwindow.h>
+#include <QMainWindow>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Registry)
class QTabWidget;
-class QListView;
-class QListViewItem;
+class QTreeWidget;
+class QTreeWidgetItem;
class QWidget;
class QTimer;
class QCloseEvent;
-class QTextView;
-class QPushButton;
+class QTextEdit;
+class QAction;
#include <Standard_Macro.hxx>
ToolsGUI_InfoWindow( QWidget* parent = 0, const char* name = 0);
void setText( const QString& text );
- QTextView* textView() const { return myTextView; }
+ QTextEdit* textView() const { return myTextView; }
protected:
void keyPressEvent( QKeyEvent * e );
private:
- QTextView* myTextView;
+ QTextEdit* myTextView;
};
class Standard_EXPORT ToolsGUI_RegWidget : public QMainWindow
static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
+ virtual QMenu* createPopupMenu();
+
public slots:
void slotHelp();
void slotListeSelect();
- void slotClientChanged( QListViewItem* );
- void slotHistoryChanged( QListViewItem* );
+ void slotClientChanged( QTreeWidgetItem* );
+ void slotHistoryChanged( QTreeWidgetItem* );
void slotSelectRefresh();
void slotIntervalOk();
protected:
void closeEvent( QCloseEvent *e);
protected :
- QListView* _clients;
- QListView* _history;
+ QTreeWidget* _clients;
+ QTreeWidget* _history;
QWidget* _parent;
QTabWidget* _tabWidget;
- QPushButton* _refresh;
- QPushButton* _interval;
- QPushButton* _close;
+ QAction* _refresh;
+ QAction* _interval;
+ QAction* _close;
QTimer* _counter;
Registry::AllInfos* _serverhistory;
Registry::AllInfos* _serverclients;
SUBDIRS += Event
SUBDIRS += ResExporter
SUBDIRS += RegistryDisplay
+SUBDIRS += TOOLSGUI