1 // Copyright (C) 2007-2020 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, or (at your option) any later version.
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 <QGridLayout>
30 SMESHGUI_FileInfoDlg::SMESHGUI_FileInfoDlg( QWidget* parent, SMESH::MedFileInfo* inf )
31 : QtxDialog( parent, true, true, QtxDialog::OK )
33 setWindowTitle( tr( "CAPTION" ) );
34 setSizeGripEnabled( true );
36 QLineEdit* fname = new QLineEdit( mainFrame() );
37 fname->setReadOnly( true );
38 QLineEdit* fsize = new QLineEdit( mainFrame() );
39 fsize->setReadOnly( true );
40 QLineEdit* medversion = new QLineEdit( mainFrame() );
41 medversion->setReadOnly( true );
42 QLabel* medversionlabel = new QLabel( tr( "MED_VERSION" ), mainFrame() );
43 fname->setMinimumWidth( 300 );
45 QGridLayout* lay = new QGridLayout( mainFrame() );
46 lay->setMargin( 5 ); lay->setSpacing( 5 );
47 lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 );
48 lay->addWidget( fname, 0, 1 );
49 lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 );
50 lay->addWidget( fsize, 1, 1 );
51 lay->addWidget( medversionlabel, 2, 0 );
52 lay->addWidget( medversion, 2, 1 );
54 fname->setText( (char*)inf->fileName );
56 fsize->setText( QString::number( inf->fileSize ) );
58 if ( fname->text().endsWith("med"))
63 version = QString::number( inf->major );
66 version += "." + QString::number( inf->minor );
68 version += "." + QString::number( inf->release );
71 medversion->setText( version );
75 medversionlabel->hide();
80 SMESHGUI_FileInfoDlg::~SMESHGUI_FileInfoDlg()