25 QVBoxLayout *layout =
new QVBoxLayout;
26 layout->setSizeConstraint (QLayout::SetFixedSize);
31 setWindowTitle (tr (
"Error Report"));
32 setWindowIcon(style.standardIcon (QStyle::SP_MessageBoxCritical));
34 QLabel *lblMessage =
new QLabel (tr (
"An unrecoverable error has occurred. Would you like to save an error report that can "
35 "be sent later to the Engauge developers?\n\n"
36 "The original document can be sent as part of the error report, which increases the "
37 "chances of finding and fixing the problem(s). However, if any information is private "
38 "then an anonymized version of the document will be sent."));
39 lblMessage->setWordWrap(
true);
40 layout->addWidget (lblMessage);
42 m_chkOriginal =
new QCheckBox (tr (
"Include original document information, otherwise anonymize the information"));
43 m_chkOriginal->setChecked (
true);
45 layout->addWidget (m_chkOriginal);
46 connect (m_chkOriginal, SIGNAL (stateChanged (
int)),
this, SLOT (slotDocumentCheckboxChanged (
int)));
48 QHBoxLayout *layoutButtons =
new QHBoxLayout;
50 QWidget *panelButtons =
new QWidget;
51 panelButtons->setLayout (layoutButtons);
52 layout->addWidget (panelButtons);
54 m_btnSave =
new QPushButton(tr (
"Save"));
56 layoutButtons->addWidget (m_btnSave);
57 connect (m_btnSave, SIGNAL (released ()),
this, SLOT (slotSave()));
59 m_btnCancel =
new QPushButton(tr (
"Cancel"));
61 layoutButtons->addWidget (m_btnCancel);
62 connect (m_btnCancel, SIGNAL (released ()),
this, SLOT (reject ()));
70void DlgErrorReportLocal::removeFile()
const
75void DlgErrorReportLocal::slotDocumentCheckboxChanged(
int )
80void DlgErrorReportLocal::slotSave()
83 if (m_chkOriginal->isChecked()) {
84 m_xmlToUpload = m_xmlOriginal;
86 m_xmlToUpload = m_xmlAnonymized;
89 done (QDialog::Accepted);
94void DlgErrorReportLocal::updateFile()
96 if (m_chkOriginal->isChecked()) {
105 return m_xmlToUpload;
Base class for dialogs that handle the error report.
QString errorFile() const
File name for output file containing error report.
void saveFile(const QString &xml) const
Save xml into output file named by errorFile.
QString xmlToUpload() const
Xml to be uploaded. Includes document if user has approved.
DlgErrorReportLocal(const QString &xmlWithImage, QWidget *parent=0)
Single constructor. With the original data, the extra context improves debugging. With anonymization,...