00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "ViewModelDialog.h"
00025 #include "Debug.h"
00026
00027
00028 #include <qlayout.h>
00029 #include <qpushbutton.h>
00030
00031
00032
00033 ViewModelDialog::ViewModelDialog(QWidget* parent, QString* nwModelStr) : QDialog(parent) {
00034
00035 networkModelString = nwModelStr;
00036
00037
00038 QVBoxLayout *mainVerticalBox = new QVBoxLayout(this, 5, 10, "vertical1");
00039
00040
00041
00042 modelTextEdit = new QTextEdit(this);
00043 modelTextEdit->setTextFormat(Qt::PlainText);
00044 modelTextEdit->setText(*networkModelString);
00045 modelTextEdit->setReadOnly(true);
00046 mainVerticalBox->addWidget(modelTextEdit);
00047
00048
00049
00050 QHBoxLayout *buttonBox = new QHBoxLayout();
00051 QPushButton* okButton = new QPushButton("Ok", this, "okButton");
00052 QPushButton* cancelButton = new QPushButton("Cancel", this, "cancelButton");
00053 buttonBox->addWidget(okButton);
00054 buttonBox->addWidget(cancelButton);
00055 mainVerticalBox->addLayout(buttonBox);
00056
00057 connect (okButton, SIGNAL(clicked()), this, SLOT(okButtonClicked()));
00058 connect (cancelButton, SIGNAL(clicked()), this, SLOT(cancelButtonClicked()));
00059
00060
00061 this->resize(600, 400);
00062 }
00063
00064
00065
00066 ViewModelDialog::~ViewModelDialog(){
00067 #ifdef MEMORY_DEBUG
00068 cout<<"DESTROYING VIEW MODEL DIALOG"<<endl;
00069 #endif//MEMORY_DEBUG
00070 }
00071
00072
00073
00074
00075
00076
00077
00078 void ViewModelDialog::reloadText(){
00079 modelTextEdit->setText(*networkModelString);
00080 }
00081
00082
00083
00084
00085
00086
00087
00088 void ViewModelDialog::cancelButtonClicked(){
00089 this->hide();
00090 }
00091
00092
00093
00094 void ViewModelDialog::okButtonClicked(){
00095 this->hide();
00096 }
00097
00098
00099
00100