X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_FileInfoDlg.cxx;h=5aaa557aa30951b406a35d5c7921bca59dc4cdb0;hb=499f29d24922cec66e41b41a0039a954993bc6df;hp=881cf5970a145be4b26b6fbf29a881c61d2fc9ba;hpb=d2061a67e9ac3fa69be63511f21826a4c66ed732;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx b/src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx index 881cf5970..5aaa557aa 100644 --- a/src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FileInfoDlg.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // 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. +// 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 @@ -23,51 +23,58 @@ // #include "SMESHGUI_FileInfoDlg.h" -#include "MED_Common.hxx" - #include #include #include -SMESHGUI_FileInfoDlg::SMESHGUI_FileInfoDlg( QWidget* parent, SALOME_MED::MedFileInfo* inf ) +SMESHGUI_FileInfoDlg::SMESHGUI_FileInfoDlg( QWidget* parent, SMESH::MedFileInfo* inf ) : QtxDialog( parent, true, true, QtxDialog::OK ) { setWindowTitle( tr( "CAPTION" ) ); setSizeGripEnabled( true ); - + QLineEdit* fname = new QLineEdit( mainFrame() ); fname->setReadOnly( true ); QLineEdit* fsize = new QLineEdit( mainFrame() ); fsize->setReadOnly( true ); QLineEdit* medversion = new QLineEdit( mainFrame() ); medversion->setReadOnly( true ); + QLabel* medversionlabel = new QLabel( tr( "MED_VERSION" ), mainFrame() ); fname->setMinimumWidth( 300 ); - + QGridLayout* lay = new QGridLayout( mainFrame() ); lay->setMargin( 5 ); lay->setSpacing( 5 ); lay->addWidget( new QLabel( tr( "FILE_NAME" ), mainFrame() ), 0, 0 ); lay->addWidget( fname, 0, 1 ); lay->addWidget( new QLabel( tr( "FILE_SIZE" ), mainFrame() ), 1, 0 ); lay->addWidget( fsize, 1, 1 ); - lay->addWidget( new QLabel( tr( "MED_VERSION" ), mainFrame() ), 2, 0 ); + lay->addWidget( medversionlabel, 2, 0 ); lay->addWidget( medversion, 2, 1 ); fname->setText( (char*)inf->fileName ); fname->home( false ); fsize->setText( QString::number( inf->fileSize ) ); - QString version; - if( inf->major>=0 ) + if ( fname->text().endsWith("med")) { - version = QString::number( inf->major ); - if( inf->minor>=0 ) + QString version; + if( inf->major>=0 ) { - version += "." + QString::number( inf->minor ); - if( inf->release>=0 ) - version += "." + QString::number( inf->release ); + version = QString::number( inf->major ); + if( inf->minor>=0 ) + { + version += "." + QString::number( inf->minor ); + if( inf->release>=0 ) + version += "." + QString::number( inf->release ); + } } + medversion->setText( version ); + } + else + { + medversionlabel->hide(); + medversion->hide(); } - medversion->setText( version ); } SMESHGUI_FileInfoDlg::~SMESHGUI_FileInfoDlg()