-// SALOME RegistryDisplay : GUI for Registry server implementation
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// File : RegWidget.h
-// Author : Pascale NOYRET, EDF
-// Module : SALOME
-// $Header$
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef TOOLSGUI_REGWIDGET_H
+#define TOOLSGUI_REGWIDGET_H
-#ifndef __REGWIDGET_H__
-#define __REGWIDGET_H__
-#include <qapplication.h>
-#include <qmainwindow.h>
+#include "ToolsGUI.h"
+
+#include <QMainWindow>
+#include <QMap>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOME_Registry)
-class QTabWidget;
-class QListView;
-class QListViewItem;
-class QWidget;
+class QTreeWidget;
+class QTreeWidgetItem;
class QTimer;
-class QCloseEvent;
-class QTextView;
-#if QT_VERSION > 300
-class QPushButton;
-#endif
-
-#include <Standard_Macro.hxx>
+class QAction;
+class QTextEdit;
-class ToolsGUI_HelpWindow;
-class ToolsGUI_IntervalWindow;
-
-class Standard_EXPORT ToolsGUI_InfoWindow : public QMainWindow
+class TOOLSGUI_EXPORT ToolsGUI_RegWidget : public QMainWindow
{
Q_OBJECT
-public:
- ToolsGUI_InfoWindow( QWidget* parent = 0, const char* name = 0);
+ enum { Refresh, Interval, Close };
+ enum { Clients, History };
- void setText( const QString& text );
- QTextView* textView() const { return myTextView; }
-
-protected:
- void keyPressEvent( QKeyEvent * e );
-
-private:
- QTextView* myTextView;
-};
-
-class Standard_EXPORT ToolsGUI_RegWidget : public QMainWindow
-{
- Q_OBJECT
+ ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent = 0 );
public:
- ToolsGUI_RegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
~ToolsGUI_RegWidget();
- void SetListe();
- void SetListeHistory();
- void InfoReg();
- void InfoHistory();
- bool eventFilter( QObject* object, QEvent* event );
+ static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_ptr orb,
+ QWidget* parent = 0 );
- static ToolsGUI_RegWidget* GetRegWidget( CORBA::ORB_var &orb , QWidget *parent = 0, const char *name = 0 );
+private slots:
+ void refresh();
+ void showDetails( QTreeWidgetItem*, int );
+ void refreshInterval();
-public slots:
- void slotHelp();
- void slotListeSelect();
- void slotClientChanged( QListViewItem* );
- void slotHistoryChanged( QListViewItem* );
- void slotSelectRefresh();
- void slotIntervalOk();
-protected:
- static QString setlongText( const Registry::Infos &c_info );
- int numitem( const QString& name, const QString& pid, const QString& machine, const Registry::AllInfos* c_info );
- void closeEvent( QCloseEvent *e);
+private:
+ static QString getDetails( const Registry::Infos& c_info );
-protected :
- QListView* _clients;
- QListView* _history;
- QWidget* _parent;
- QTabWidget* _tabWidget;
- QPushButton* _refresh;
- QPushButton* _interval;
- QPushButton* _close;
- QTimer* _counter;
- Registry::AllInfos* _serverhistory;
- Registry::AllInfos* _serverclients;
- ToolsGUI_InfoWindow* myInfoWindow;
- ToolsGUI_HelpWindow* myHelpWindow;
- ToolsGUI_IntervalWindow* myIntervalWindow;
- int myRefreshInterval;
-
private:
- const Registry::Components_var _VarComponents;
- static ToolsGUI_RegWidget* myRegWidgetPtr;
+ static ToolsGUI_RegWidget* myRegWidgetPtr;
+
+ CORBA::ORB_var myOrb;
+ QMap<int, Registry::AllInfos*> myData;
+ QMap<int, QAction*> myActions;
+ QMap<int, QTreeWidget*> myViews;
+ QTextEdit* myDetails;
+ QTimer* myTimer;
};
-#endif
+#endif // TOOLSGUI_REGWIDGET_H