7 #include "PvlEditDialog.h"
12 #include <QFileDialog>
13 #include <QListWidget>
15 #include <QMessageBox>
16 #include <QPushButton>
19 #include <QVBoxLayout>
21 #include "IException.h"
41 p_textEdit =
new QTextEdit;
45 input.open(pvl.
fileName().toLatin1().data(), ios::in);
49 getline(input, output);
52 p_textEdit->append(QString::fromStdString(output));
55 getline(input, output);
60 p_saveButton =
new QPushButton(
"Save Changes &As...");
61 p_saveButton->setEnabled(
false);
62 QPushButton *closeButton =
new QPushButton(
"&Close");
64 QHBoxLayout *buttonLayout =
new QHBoxLayout;
65 buttonLayout->addWidget(p_saveButton);
66 buttonLayout->addWidget(closeButton);
70 QVBoxLayout *vLayout =
new QVBoxLayout;
71 vLayout->addWidget(p_textEdit);
72 vLayout->addLayout(buttonLayout);
75 QString titleBar =
"Pvl File: " + QString(pvl.
fileName()) ;
76 setWindowTitle(titleBar);
80 connect(p_saveButton, SIGNAL(clicked()),
this, SLOT(
saveTextEdit()));
81 connect(closeButton, SIGNAL(clicked()),
this, SLOT(reject()));
93 p_saveButton->setEnabled(
true);
110 string textEditContents = p_textEdit->toPlainText().toStdString();
113 ss << textEditContents;
122 QMessageBox::warning((
QWidget *)parent(),
"Error", message);
128 QString filter =
"Select registration template (*.def *.pvl);;";
130 QString pvlFile = QFileDialog::getSaveFileName((
QWidget *)parent(),
131 "Select a registration template",
134 if(!pvlFile.isEmpty()) {
136 QString saveFile = pvlFile;
143 QMessageBox::warning((
QWidget *)parent(),
"Error", message);
149 setWindowTitle(
"Pvl File: " + pvlFile);