X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSalomeApp%2FSalomeApp_StudyPropertiesDlg.cxx;h=5e37e61832de2119a098539203ce109be4731367;hb=3a4b698ac7ed25240f496594293eeab6a839c7d6;hp=62bed3cc6b19e239f71980299c767e43c6bdf4e5;hpb=bb8609caf7881d966fbb88dec0a7822736da93f5;p=modules%2Fgui.git diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index 62bed3cc6..5e37e6183 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // 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 @@ -25,6 +25,7 @@ // Author : Roman NIKOLAEV #include "SalomeApp_StudyPropertiesDlg.h" +#include "SalomeApp_Application.h" #include "SalomeApp_Study.h" #include "SUIT_Session.h" @@ -62,19 +63,13 @@ SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myIsChanged(false) { - setModal( TRUE ); + setModal( true ); setWindowTitle(tr("TLT_STUDY_PROPERTIES")); setSizeGripEnabled( true ); setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint ); - // Display study properties - SalomeApp_Study* study = - dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if (study) - myStudyDoc = study->studyDS(); - //Author QLabel* authorLbl = new QLabel(tr("PRP_AUTHOR"),this); myAuthor = new QLineEdit(this); @@ -173,10 +168,10 @@ SalomeApp_StudyPropertiesDlg::~SalomeApp_StudyPropertiesDlg() */ void SalomeApp_StudyPropertiesDlg::initData() { - bool hasData = myStudyDoc; + bool hasData = (SalomeApp_Application::getStudy() != NULL); _PTR(AttributeStudyProperties) propAttr; if (hasData) - propAttr = myStudyDoc->GetProperties(); + propAttr = SalomeApp_Application::getStudy()->GetProperties(); hasData = hasData && propAttr; if (hasData) { @@ -231,7 +226,7 @@ void SalomeApp_StudyPropertiesDlg::initData() std::vector aMins, aHours, aDays, aMonths, aYears; propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); int aCnt = aUsers.size(); - for ( int i = 0; i < aCnt; i++ ) { + for ( int i = 0; i < (int)aCnt; i++ ) { QString date; date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", aDays [i], @@ -248,7 +243,7 @@ void SalomeApp_StudyPropertiesDlg::initData() //Component versions std::vector aComponents = propAttr->GetStoredComponents(); - for ( int i = 0; i < aComponents.size(); i++ ) { + for ( int i = 0; i < (int)aComponents.size(); i++ ) { std::vector aMins, aHours, aDays, aMonths, aYears; std::vector aVersions = propAttr->GetComponentVersions(aComponents[i]); QStringList aData; @@ -268,7 +263,7 @@ void SalomeApp_StudyPropertiesDlg::initData() */ void SalomeApp_StudyPropertiesDlg::clickOnOk() { - _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties(); + _PTR(AttributeStudyProperties) propAttr = SalomeApp_Application::getStudy()->GetProperties(); //Firstly, store locked flag if(propAttr) { bool bLocked = myLocked->isChecked();