From b07c3a1dd8d9bd71c03e0e19eb123a68af11162b Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 7 Jun 2007 13:16:02 +0000 Subject: [PATCH] Porting to Qt4. --- src/Makefile.am | 2 +- src/TOOLSGUI/TOOLSGUI.pro | 50 ++++++ src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx | 127 +++++++------ src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h | 2 +- src/TOOLSGUI/ToolsGUI_HelpWindow.cxx | 56 +++--- src/TOOLSGUI/ToolsGUI_HelpWindow.h | 9 +- src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx | 42 +++-- src/TOOLSGUI/ToolsGUI_IntervalWindow.h | 9 +- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 170 ++++++++++-------- src/TOOLSGUI/ToolsGUI_RegWidget.h | 31 ++-- src/src.pro | 1 + 11 files changed, 296 insertions(+), 203 deletions(-) create mode 100644 src/TOOLSGUI/TOOLSGUI.pro diff --git a/src/Makefile.am b/src/Makefile.am index abd3ee61a..ee4e422ca 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -98,5 +98,5 @@ if GUI_ENABLE_CORBA # SUBDIRS += RegistryDisplay TOOLSGUI \ # Session SalomeApp SALOME_SWIG SALOME_PY SALOME_PYQT # VSR: already migrated to Qt4 packages - SUBDIRS += RegistryDisplay + SUBDIRS += RegistryDisplay TOOLSGUI endif diff --git a/src/TOOLSGUI/TOOLSGUI.pro b/src/TOOLSGUI/TOOLSGUI.pro new file mode 100644 index 000000000..9d4cb4a9b --- /dev/null +++ b/src/TOOLSGUI/TOOLSGUI.pro @@ -0,0 +1,50 @@ +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 diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx index 19bf74bed..c8536d782 100755 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.cxx @@ -30,21 +30,21 @@ #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 -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -63,36 +63,41 @@ using namespace std; 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); @@ -104,50 +109,56 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con 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"); @@ -167,7 +178,7 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con 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 ); @@ -175,10 +186,12 @@ ToolsGUI_CatalogGeneratorDlg::ToolsGUI_CatalogGeneratorDlg( QWidget* parent, con 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 ); @@ -213,7 +226,7 @@ ToolsGUI_CatalogGeneratorDlg::~ToolsGUI_CatalogGeneratorDlg() */ QString ToolsGUI_CatalogGeneratorDlg::getIdlFile() { - return myIdlEdit->text().stripWhiteSpace(); + return myIdlEdit->text().trimmed(); } /*! @@ -221,7 +234,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getIdlFile() */ QString ToolsGUI_CatalogGeneratorDlg::getXmlFile() { - return myXmlEdit->text().stripWhiteSpace(); + return myXmlEdit->text().trimmed(); } /*! @@ -229,7 +242,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getXmlFile() */ QString ToolsGUI_CatalogGeneratorDlg::getPngFile() { - return myPngEdit->text().stripWhiteSpace(); + return myPngEdit->text().trimmed(); } /*! @@ -237,7 +250,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getPngFile() */ QString ToolsGUI_CatalogGeneratorDlg::getAuthor() { - return myAuthorEdit->text().stripWhiteSpace(); + return myAuthorEdit->text().trimmed(); } /*! @@ -245,7 +258,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getAuthor() */ QString ToolsGUI_CatalogGeneratorDlg::getVersion() { - return myVersionEdit->text().stripWhiteSpace(); + return myVersionEdit->text().trimmed(); } /*! @@ -253,7 +266,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getVersion() */ QString ToolsGUI_CatalogGeneratorDlg::getCompName() { - return myCompName->text().stripWhiteSpace(); + return myCompName->text().trimmed(); } /*! @@ -261,7 +274,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getCompName() */ QString ToolsGUI_CatalogGeneratorDlg::getCompUserName() { - return myCompUserName->text().stripWhiteSpace(); + return myCompUserName->text().trimmed(); } /*! @@ -269,7 +282,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getCompUserName() */ QString ToolsGUI_CatalogGeneratorDlg::getCompMultiStd() { - return myCompMultiStd->text().stripWhiteSpace(); + return myCompMultiStd->text().trimmed(); } /*! @@ -277,7 +290,7 @@ QString ToolsGUI_CatalogGeneratorDlg::getCompMultiStd() */ QString ToolsGUI_CatalogGeneratorDlg::getCompType() { - return myCompType->text().stripWhiteSpace(); + return myCompType->text().trimmed(); } /*! @@ -324,18 +337,18 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked() 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); @@ -349,8 +362,8 @@ void ToolsGUI_CatalogGeneratorDlg::onBrowseBtnClicked() */ void ToolsGUI_CatalogGeneratorDlg::updateButtonState() { - myApplyBtn->setEnabled( !myIdlEdit->text().stripWhiteSpace().isEmpty() && - !myXmlEdit->text().stripWhiteSpace().isEmpty() ); + myApplyBtn->setEnabled( !myIdlEdit->text().trimmed().isEmpty() && + !myXmlEdit->text().trimmed().isEmpty() ); } /*! @@ -388,7 +401,7 @@ void ToolsGUI_CatalogGeneratorDlg::onApply() 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()); } @@ -397,9 +410,9 @@ void ToolsGUI_CatalogGeneratorDlg::onApply() 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) { diff --git a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h index 9169f0dde..b73884b57 100755 --- a/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h +++ b/src/TOOLSGUI/ToolsGUI_CatalogGeneratorDlg.h @@ -29,7 +29,7 @@ #ifndef DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H #define DIALOGBOX_TOOLSGUI_CATALOGGENERATORDLG_H -#include +#include #include diff --git a/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx b/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx index 4581ab882..0387e720c 100755 --- a/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx +++ b/src/TOOLSGUI/ToolsGUI_HelpWindow.cxx @@ -29,10 +29,9 @@ # include "ToolsGUI_HelpWindow.h" # include "utilities.h" -# include -# include -# include -# include +# include +# include +# include using namespace std; @@ -40,42 +39,45 @@ 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()); } diff --git a/src/TOOLSGUI/ToolsGUI_HelpWindow.h b/src/TOOLSGUI/ToolsGUI_HelpWindow.h index b4849baf0..93b3407d9 100755 --- a/src/TOOLSGUI/ToolsGUI_HelpWindow.h +++ b/src/TOOLSGUI/ToolsGUI_HelpWindow.h @@ -29,10 +29,9 @@ # ifndef __HELPWINDOW_H__ # define __HELPWINDOW_H__ -# include -# include +# include -class QTextView; +class QTextEdit; class ToolsGUI_HelpWindow : public QMainWindow { @@ -43,10 +42,10 @@ public: ~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__ */ diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx b/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx index 7d4fcb0da..3025d35ce 100755 --- a/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx +++ b/src/TOOLSGUI/ToolsGUI_IntervalWindow.cxx @@ -22,10 +22,12 @@ #include "ToolsGUI_IntervalWindow.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include # include "utilities.h" #define MARGIN_SIZE 11 @@ -36,21 +38,24 @@ 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 ); @@ -59,19 +64,26 @@ ToolsGUI_IntervalWindow::ToolsGUI_IntervalWindow ( QWidget* parent ) 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); diff --git a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h index 4055e102f..41046905c 100755 --- a/src/TOOLSGUI/ToolsGUI_IntervalWindow.h +++ b/src/TOOLSGUI/ToolsGUI_IntervalWindow.h @@ -23,10 +23,11 @@ #ifndef IntervalWindow_HeaderFile #define IntervalWindow_HeaderFile -# include -# include -# include -# include +# include + +class QWidget; +class QPushButton; +class QSpinBox; #ifndef WIN32 using namespace std; diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index d9c62a9bf..b8f55668c 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -26,16 +26,20 @@ // Module : SALOME // $Header$ -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include +# include +# include +# include +# include +# include +# include +# include +# include +//# include +//# include +# include +# include +# include +# include # include "SALOME_NamingService.hxx" # include "ServiceUnreachable.hxx" @@ -182,16 +186,29 @@ ToolsGUI_RegWidget* ToolsGUI_RegWidget::GetRegWidget( CORBA::ORB_var &orb , QWid 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( "" ); @@ -201,7 +218,7 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con }*/ QPixmap pm ( aFile ); if ( !pm.isNull() ) - setIcon( pm ); + setWindowIcon( pm ); // pixmap for buttons QPixmap image_refresh ( ( const char** ) refresh_data ); @@ -210,14 +227,12 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con // 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 ); @@ -225,31 +240,28 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con 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) @@ -263,8 +275,8 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget(CORBA::ORB_var &orb, QWidget *parent, con PIXELS largeur = 800 ; PIXELS hauteur = 350 ; setGeometry( xpos, ypos, largeur, hauteur ) ; - setCaption( name ) ; - statusBar()->message(" "); + setWindowTitle( name ) ; + statusBar()->showMessage(" "); } /*! @@ -294,13 +306,13 @@ bool ToolsGUI_RegWidget::eventFilter( QObject* object, QEvent* event ) } 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() ); } } @@ -432,14 +444,12 @@ void ToolsGUI_RegWidget::SetListe() { 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"); } @@ -450,14 +460,12 @@ void ToolsGUI_RegWidget::SetListeHistory() { 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") } @@ -485,9 +493,9 @@ void ToolsGUI_RegWidget::InfoHistory() 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; @@ -500,7 +508,7 @@ void ToolsGUI_RegWidget::InfoHistory() _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") } @@ -528,9 +536,9 @@ void ToolsGUI_RegWidget::InfoReg() 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; @@ -543,7 +551,7 @@ void ToolsGUI_RegWidget::InfoReg() _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") } @@ -555,14 +563,14 @@ void ToolsGUI_RegWidget::slotListeSelect() { 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" ) ) ; } } @@ -588,7 +596,7 @@ void ToolsGUI_RegWidget::slotIntervalOk() { BEGIN_OF("slotIntervalOk"); myRefreshInterval = myIntervalWindow->getValue(); - _counter->changeInterval( myRefreshInterval * 1000 ); + _counter->start( myRefreshInterval * 1000 ); SCRUTE(myRefreshInterval); myIntervalWindow->close(); END_OF("slotIntervalOk"); @@ -606,7 +614,7 @@ void ToolsGUI_RegWidget::slotHelp() } myHelpWindow->show(); myHelpWindow->raise(); - myHelpWindow->setActiveWindow(); + myHelpWindow->activateWindow(); END_OF("slotHelp()") ; } @@ -614,7 +622,7 @@ void ToolsGUI_RegWidget::slotHelp() /*! Called when user clicks on item in list */ -void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item ) +void ToolsGUI_RegWidget::slotClientChanged( QTreeWidgetItem* item ) { BEGIN_OF("slotClientChanged()") ; @@ -625,7 +633,7 @@ void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item ) 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()) ; @@ -637,11 +645,11 @@ void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item ) 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 @@ -652,7 +660,7 @@ void ToolsGUI_RegWidget::slotClientChanged( QListViewItem* item ) /*! Called when user clicks on item in list */ -void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item ) +void ToolsGUI_RegWidget::slotHistoryChanged( QTreeWidgetItem* item ) { BEGIN_OF("slotHistoryChanged()") ; @@ -665,7 +673,7 @@ void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item ) 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]; @@ -676,11 +684,11 @@ void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item ) 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 @@ -692,10 +700,16 @@ void ToolsGUI_RegWidget::slotHistoryChanged( QListViewItem* item ) 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"); @@ -715,7 +729,7 @@ void ToolsGUI_InfoWindow::setText( const QString& text ) void ToolsGUI_InfoWindow::keyPressEvent( QKeyEvent * e ) { QMainWindow::keyPressEvent( e ); - if ( e->key() == Key_Escape ) + if ( e->key() == Qt::Key_Escape ) close(); } @@ -804,7 +818,7 @@ QString findFile( QString filename ) 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 ); diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.h b/src/TOOLSGUI/ToolsGUI_RegWidget.h index c3c746e40..946de52bb 100755 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.h +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.h @@ -28,20 +28,19 @@ #ifndef __REGWIDGET_H__ #define __REGWIDGET_H__ -#include -#include +#include #include #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 @@ -56,13 +55,13 @@ public: 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 @@ -81,11 +80,13 @@ public: 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: @@ -94,13 +95,13 @@ 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; diff --git a/src/src.pro b/src/src.pro index 2c3e66c3d..05049242f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -22,3 +22,4 @@ SUBDIRS += SOCC SUBDIRS += Event SUBDIRS += ResExporter SUBDIRS += RegistryDisplay +SUBDIRS += TOOLSGUI -- 2.39.2