Path: blob/devel/ElmerGUI/Application/src/bodypropertyeditor.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 bodypropertyeditor *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 "mainwindow.h"43#include "bodypropertyeditor.h"4445using namespace std;4647BodyPropertyEditor::BodyPropertyEditor(QWidget *parent)48: QDialog(parent)49{50ui.setupUi(this);5152touched = false;5354material = NULL;55initial = NULL;56force = NULL;57equation = NULL;5859connect(ui.applyButton, SIGNAL(clicked()), this, SLOT(applySlot()));6061connect(ui.discardButton, SIGNAL(clicked()), this, SLOT(discardSlot()));6263connect(ui.materialCombo, SIGNAL(currentTextChanged(const QString)), this,64SLOT(materialComboChanged(QString)));6566connect(ui.initialConditionCombo, SIGNAL(currentTextChanged(const QString)), this,67SLOT(initialComboChanged(QString)));6869connect(ui.bodyForceCombo, SIGNAL(currentTextChanged(const QString)), this,70SLOT(forceComboChanged(QString)));7172connect(ui.equationCombo, SIGNAL(currentTextChanged(const QString)), this,73SLOT(equationComboChanged(QString)));7475ui.applyButton->setIcon(QIcon::fromTheme("list-add"));76ui.discardButton->setIcon(QIcon::fromTheme("dialog-error-round"));77}7879BodyPropertyEditor::~BodyPropertyEditor()80{81}8283void BodyPropertyEditor::applySlot()84{85touched = true;86this->close();87}8889void BodyPropertyEditor::discardSlot()90{91touched = false;92this->close();93}9495void BodyPropertyEditor::materialComboChanged(QString text)96{97emit( BodyMaterialComboChanged(this,text) );98}99100void BodyPropertyEditor::initialComboChanged(QString text)101{102emit( BodyInitialComboChanged(this,text) );103}104105void BodyPropertyEditor::forceComboChanged(QString text)106{107emit( BodyForceComboChanged(this,text) );108}109110void BodyPropertyEditor::equationComboChanged(QString text)111{112emit( BodyEquationComboChanged(this,text) );113}114115void BodyPropertyEditor::appendToProject(QDomDocument *projectDoc, QDomElement *item)116{117projectIO.parentWidget = this;118projectIO.appendToProject(projectDoc, item);119}120121void BodyPropertyEditor::readFromProject(QDomDocument *projectDoc, QDomElement *item)122{123projectIO.parentWidget = this;124projectIO.readFromProject(projectDoc, item);125}126127128