Path: blob/devel/ElmerGUI/Application/src/boundarypropertyeditor.cpp
3203 views
/*****************************************************************************1* *2* Elmer, A Finite Element Software for Multiphysical Problems *3* *4* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland *5* *6* This program is free software; you can redistribute it and/or *7* modify it under the terms of the GNU General Public License *8* as published by the Free Software Foundation; either version 2 *9* of the License, or (at your option) any later version. *10* *11* This program is distributed in the hope that it will be useful, *12* but WITHOUT ANY WARRANTY; without even the implied warranty of *13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *14* GNU General Public License for more details. *15* *16* You should have received a copy of the GNU General Public License *17* along with this program (in file fem/GPL-2); if not, write to the *18* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, *19* Boston, MA 02110-1301, USA. *20* *21*****************************************************************************/2223/*****************************************************************************24* *25* ElmerGUI booundarypropertyeditor *26* *27*****************************************************************************28* *29* Authors: Mikko Lyly, Juha Ruokolainen and Peter R�back *30* Email: [email protected] *31* Web: http://www.csc.fi/elmer *32* Address: CSC - IT Center for Science Ltd. *33* Keilaranta 14 *34* 02101 Espoo, Finland *35* *36* Original Date: 15 Mar 2008 *37* *38*****************************************************************************/3940#include <QtGui>41#include <iostream>42#include "boundarypropertyeditor.h"4344using namespace std;4546BoundaryPropertyEditor::BoundaryPropertyEditor(QWidget *parent)47: QDialog(parent)48{49ui.setupUi(this);50ui.boundaryAsABody->setEnabled(false);51ui.boundaryAsABody->setVisible(false);5253touched = false;54condition = NULL;55bodyProperties = NULL;5657connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot()));58connect(ui.discardButton, SIGNAL(clicked()), this, SLOT(discardSlot()));5960connect(ui.boundaryAsABody, SIGNAL(stateChanged(int)), this,61SLOT(boundaryAsABodyChanged(int)));6263connect(ui.boundaryConditionCombo, SIGNAL(currentTextChanged(const QString)), this,64SLOT(boundaryComboChanged(QString)));6566ui.applyButton->setIcon(QIcon::fromTheme("list-add"));67ui.discardButton->setIcon(QIcon::fromTheme("dialog-error-round"));68}6970BoundaryPropertyEditor::~BoundaryPropertyEditor()71{72}7374void BoundaryPropertyEditor::applySlot()75{76touched = true;77this->close();78}7980void BoundaryPropertyEditor::discardSlot()81{82touched = false;83this->close();84}8586void BoundaryPropertyEditor::boundaryComboChanged(QString text)87{88emit( BoundaryComboChanged(this,text) );89}9091void BoundaryPropertyEditor::boundaryAsABodyChanged(int status)92{93emit( BoundaryAsABodyChanged(this,status) );94}9596void BoundaryPropertyEditor::appendToProject(QDomDocument *projectDoc, QDomElement *item)97{98projectIO.parentWidget = this;99projectIO.appendToProject(projectDoc, item);100}101102void BoundaryPropertyEditor::readFromProject(QDomDocument *projectDoc, QDomElement *item)103{104projectIO.parentWidget = this;105projectIO.readFromProject(projectDoc, item);106}107108109