]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Qt4
authorvsr <vsr@opencascade.com>
Wed, 16 May 2007 13:51:56 +0000 (13:51 +0000)
committervsr <vsr@opencascade.com>
Wed, 16 May 2007 13:51:56 +0000 (13:51 +0000)
src/Qtx/Makefile.am
src/Qtx/Qtx.pro
src/Qtx/QtxMRUAction.h
src/SalomeApp/Makefile.am
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx [new file with mode: 0644]
src/SalomeApp/SalomeApp_LoadStudiesDlg.h [new file with mode: 0644]

index 4ea4b66da06bfe73868b1c10d55bb69bb13ac104..17027f074a826bdd99d883dac581f8ba223048d5 100755 (executable)
@@ -39,6 +39,7 @@ salomeinclude_HEADERS=                \
        QtxDockWidget.h         \
        QtxMainWindow.h         \
        QtxMap.h                \
+       QtxMRUAction.h          \
        QtxResourceMgr.h        \
        QtxToolBar.h            \
        QtxWorkstack.h
@@ -56,7 +57,6 @@ salomeinclude_HEADERS=                \
        QtxListResourceEdit.h   \
        QtxListView.h           \
        QtxLogoMgr.h            \
-       QtxMRUAction.h          \
        QtxMenuButton.h         \
        QtxOperations.h         \
        QtxParser.h             \
@@ -88,6 +88,7 @@ dist_libqtx_la_SOURCES=               \
        QtxDockAction.cxx       \
        QtxDockWidget.cxx       \
        QtxMainWindow.cxx       \
+       QtxMRUAction.cxx        \
        QtxResourceMgr.cxx      \
        QtxToolBar.cxx          \
        QtxWorkstack.cxx
@@ -105,7 +106,6 @@ dist_libqtx_la_SOURCES=             \
        QtxListResourceEdit.cxx \
        QtxListView.cxx         \
        QtxLogoMgr.cxx          \
-       QtxMRUAction.cxx        \
        QtxMenuButton.cxx       \
        QtxOperations.cxx       \
        QtxParser.cxx           \
@@ -132,6 +132,7 @@ MOC_FILES=                          \
        QtxDockAction_moc.cxx           \
        QtxDockWidget_moc.cxx           \
        QtxMainWindow_moc.cxx           \
+       QtxMRUAction_moc.cxx            \
        QtxToolBar_moc.cxx              \
        QtxWorkstack_moc.cxx
 
@@ -147,7 +148,6 @@ MOC_FILES=                          \
        QtxListResourceEdit_moc.cxx     \
        QtxListView_moc.cxx             \
        QtxLogoMgr_moc.cxx              \
-       QtxMRUAction_moc.cxx            \
        QtxMenuButton_moc.cxx           \
        QtxPathDialog_moc.cxx           \
        QtxPopupMenu_moc.cxx            \
index 173f579091fe143e5b45b8511d6f227fb91d0e58..445db0ebb20f1ee62c51707147528482627a4387 100644 (file)
@@ -23,6 +23,7 @@ HEADERS += QtxDockAction.h
 HEADERS += QtxDockWidget.h
 HEADERS += QtxMainWindow.h
 HEADERS += QtxMap.h
+HEADERS += QtxMRUAction.h
 HEADERS += QtxResourceMgr.h
 HEADERS += QtxToolBar.h
 HEADERS += QtxWorkstack.h
@@ -37,7 +38,6 @@ HEADERS += QtxWorkstack.h
 #HEADERS += QtxListResourceEdit.h
 #HEADERS += QtxListView.h
 #HEADERS += QtxLogoMgr.h
-#HEADERS += QtxMRUAction.h
 #HEADERS += QtxMenuButton.h
 #HEADERS += QtxOperations.h
 #HEADERS += QtxParser.h
@@ -63,6 +63,7 @@ SOURCES += QtxDialog.cxx
 SOURCES += QtxDockAction.cxx
 SOURCES += QtxDockWidget.cxx
 SOURCES += QtxMainWindow.cxx
+SOURCES += QtxMRUAction.cxx
 SOURCES += QtxResourceMgr.cxx
 SOURCES += QtxToolBar.cxx
 SOURCES += QtxWorkstack.cxx
@@ -77,7 +78,6 @@ SOURCES += QtxWorkstack.cxx
 #SOURCES += QtxListResourceEdit.cxx
 #SOURCES += QtxListView.cxx
 #SOURCES += QtxLogoMgr.cxx
-#SOURCES += QtxMRUAction.cxx
 #SOURCES += QtxMenuButton.cxx
 #SOURCES += QtxOperations.cxx
 #SOURCES += QtxParser.cxx
index db19c903b8cb48f74ad8ab24bcfe23ae7fa25cb5..913d7f552c40d5b0ea851581650bae28b5395183 100755 (executable)
@@ -24,7 +24,6 @@
 
 #include "QtxAction.h"
 
-#include <QMap>
 #include <QStringList>
 
 class QtxResourceMgr;
index 7fe6176f6e49b1f89a6446e576eaa1585df1858e..f8a49cf2272d438f8df6cba1091219f06d4c68c7 100755 (executable)
@@ -36,6 +36,7 @@ salomeinclude_HEADERS= \
        SalomeApp_Application.h \
        SalomeApp_DataModel.h \
        SalomeApp_DataObject.h \
+       SalomeApp_LoadStudiesDlg.h \
        SalomeApp_Module.h \
        SalomeApp_Study.h \
        SalomeApp_ExceptionHandler.h \
@@ -53,6 +54,7 @@ dist_libSalomeApp_la_SOURCES= \
        SalomeApp_Application.cxx \
        SalomeApp_DataModel.cxx \
        SalomeApp_DataObject.cxx \
+       SalomeApp_LoadStudiesDlg.cxx \
        SalomeApp_Study.cxx \
        SalomeApp_ExceptionHandler.cxx \
        SalomeApp_EventFilter.cxx \
@@ -70,6 +72,7 @@ MOC_FILES= \
        SalomeApp_Application_moc.cxx \
        SalomeApp_DataModel_moc.cxx \
        SalomeApp_Module_moc.cxx \
+       SalomeApp_LoadStudiesDlg_moc.cxx \
        SalomeApp_Study_moc.cxx \
        SalomeApp_StudyPropertiesDlg_moc.cxx \
        SalomeApp_ListView_moc.cxx \
@@ -102,4 +105,4 @@ libSalomeApp_la_LIBADD= $(KERNEL_LDFLAGS) -lOpUtil -lSALOMELocalTrace -lSalomeDS
        ../PythonConsole/libPythonConsole.la ../LogWindow/libLogWindow.la \
        ../LightApp/libLightApp.la ../TOOLSGUI/libToolsGUI.la $(CAS_KERNEL)
 
-EXTRA_DIST+=SalomeApp_PyInterp.h
\ No newline at end of file
+EXTRA_DIST+=SalomeApp_PyInterp.h
index 643aab33344be24d7312e939484d3a3cc0c57872..4b6ba17cd54ee880df8cd9bf7b9d8ff0ff18db00 100644 (file)
@@ -39,7 +39,7 @@
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_NameDlg.h"
 
-#include "STD_LoadStudiesDlg.h"
+#include "SalomeApp_LoadStudiesDlg.h"
 
 #include <SUIT_Tools.h>
 #include <SUIT_Session.h>
@@ -382,7 +382,7 @@ void SalomeApp_Application::onLoadDoc()
 {
   QString name, studyname, ext;
 
-  STD_LoadStudiesDlg aDlg( desktop(), TRUE);
+  SalomeApp_LoadStudiesDlg aDlg( desktop(), TRUE);
 
   std::vector<std::string> List = studyMgr()->GetOpenStudies();
 
diff --git a/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx b/src/SalomeApp/SalomeApp_LoadStudiesDlg.cxx
new file mode 100644 (file)
index 0000000..1cf810e
--- /dev/null
@@ -0,0 +1,84 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// 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
+//
+#include "SalomeApp_LoadStudiesDlg.h"
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistbox.h>
+#include <qpushbutton.h>
+
+#define SPACING_SIZE             6
+#define MARGIN_SIZE             11
+#define MIN_LISTBOX_WIDTH      150
+#define MIN_LISTBOX_HEIGHT     100
+
+/*!
+* \brief creates a Load study dialog box
+* \param parent a parent widget
+* \param modal bool argument, if true the dialog box is a modal dialog box
+* \param f style flags
+*/
+
+SalomeApp_LoadStudiesDlg::SalomeApp_LoadStudiesDlg( QWidget* parent,  bool modal, WFlags fl )
+: QDialog( parent, "SalomeApp_LoadStudiesDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+{
+    resize( 321, 181 ); 
+    setCaption( tr("DLG_LOAD_STUDY_CAPTION") );
+    setSizeGripEnabled( TRUE );
+
+    QGridLayout* aTopLayout = new QGridLayout(this);
+    aTopLayout->setMargin(MARGIN_SIZE);
+    aTopLayout->setSpacing(SPACING_SIZE);
+
+    TextLabel1 = new QLabel( this, "TextLabel1" );
+    TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) ); 
+    TextLabel1->setText( tr( "MEN_STUDIES_CHOICE"  ) );
+
+    QHBoxLayout* aBtnLayout = new QHBoxLayout;
+    aBtnLayout->setSpacing( SPACING_SIZE );
+    aBtnLayout->setMargin( 0 );
+    
+    buttonOk = new QPushButton( this, "buttonOk" );
+    buttonOk->setText( tr( "BUT_OK"  ) );
+    buttonOk->setAutoDefault( true );
+    buttonOk->setDefault( true );
+    
+    buttonCancel = new QPushButton( this, "buttonCancel" );
+    buttonCancel->setText( tr( "BUT_CANCEL"  ) );
+    buttonCancel->setAutoDefault( true ); 
+  
+    aBtnLayout->addWidget( buttonOk );
+    aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
+    aBtnLayout->addWidget( buttonCancel );
+
+    ListComponent = new QListBox( this, "ListComponent" );
+    ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
+    ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
+    ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+    ListComponent->setSelectionMode(QListBox::Single);
+
+    aTopLayout->addWidget(TextLabel1,    0, 0);
+    aTopLayout->addWidget(ListComponent, 1, 0);
+    aTopLayout->addLayout(aBtnLayout,    2, 0);
+
+    // signals and slots connections
+    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
diff --git a/src/SalomeApp/SalomeApp_LoadStudiesDlg.h b/src/SalomeApp/SalomeApp_LoadStudiesDlg.h
new file mode 100644 (file)
index 0000000..0fe6439
--- /dev/null
@@ -0,0 +1,69 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// 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
+//
+#ifndef STD_LOADSTUDIESDLG_H
+#define STD_LOADSTUDIESDLG_H
+
+#include <STD.h>
+
+#include <qdialog.h>
+#include <qvariant.h>
+
+class QLabel;
+class QListBox;
+class QPushButton;
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QListBoxItem;
+
+/*!\class SalomeApp_LoadStudiesDlg
+ * \brief Describes a dialog box that gives a list of opened studies.
+ * 
+ */
+class STD_EXPORT SalomeApp_LoadStudiesDlg : public QDialog
+{ 
+   Q_OBJECT
+
+public:
+   SalomeApp_LoadStudiesDlg( QWidget* parent = 0, bool modal = FALSE, WFlags fl = 0 );
+   ~SalomeApp_LoadStudiesDlg() {}
+
+  /*!\var TextLabel1
+   * \brief stores a dialog text label
+   */
+  QLabel* TextLabel1;
+  
+  /*!\var buttonOk
+   * \brief stores a dialog button OK
+   */
+  QPushButton* buttonOk;
+
+  /*!\var buttonCancel
+   * \brief stores a dialog button Cancel
+   */  
+  QPushButton* buttonCancel;
+
+  /*!\var ListComponent
+   * \brief stores a dialog list compoent
+   */ 
+   QListBox* ListComponent;
+
+};
+
+#endif // STD_LOADSTUDIESDLG_H