1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SMESH SMESHGUI : GUI for SMESH component
21 // File : SMESHGUI_FileInfoDlg.cxx
22 // Author : Alexandre SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
24 #include "SMESHGUI_FileInfoDlg.h"
26 #include <MED_Common.hxx>
28 #include <QGridLayout>
32 SMESHGUI_FileInfoDlg::SMESHGUI_FileInfoDlg( QWidget* parent, SALOME_MED::MedFileInfo* inf )
33 : QtxDialog( parent, true, true, QtxDialog::OK )
35 setWindowTitle( tr( "CAPTION" ) );
36 setSizeGripEnabled( true );
38 QLineEdit* fname = new QLineEdit( mainFrame() );
39 fname->setReadOnly( true );
40 QLineEdit* fsize = new QLineEdit( mainFrame() );
41 fsize->setReadOnly( true );
42 QLineEdit* medversion = new QLineEdit( mainFrame() );
43 medversion->setReadOnly( true );
44 fname->setMinimumWidth( 300 );
46 QGridLayout* lay = new QGridLayout( mainFrame() );
47 lay->setMargin( 5 ); lay->setSpacing( 5 );
48 lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 );
49 lay->addWidget( fname, 0, 1 );
50 lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 );
51 lay->addWidget( fsize, 1, 1 );
52 lay->addWidget( new QLabel( tr( "MED_VERSION" ), mainFrame() ), 2, 0 );
53 lay->addWidget( medversion, 2, 1 );
55 fname->setText( (char*)inf->fileName );
57 fsize->setText( QString::number( inf->fileSize ) );
62 version = QString::number( inf->major );
65 version += "." + QString::number( inf->minor );
67 version += "." + QString::number( inf->release );
70 medversion->setText( version );
73 SMESHGUI_FileInfoDlg::~SMESHGUI_FileInfoDlg()