84 setWindowTitle(i18n(
"Submit Bug Report"));
86 QDialogButtonBox *buttonBox =
new QDialogButtonBox(
this);
87 buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
88 KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
89 KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
91 connect(buttonBox, SIGNAL(rejected()),
this, SLOT(reject()));
95 KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), KStandardGuiItem::close());
98 QVBoxLayout *lay =
new QVBoxLayout(
this);
100 KTitleWidget *title =
new KTitleWidget(
this);
101 title->setText(i18n(
"Submit Bug Report"));
103#if KWIDGETSADDONS_VERSION_MAJOR > 5 || (KWIDGETSADDONS_VERSION_MAJOR == 5 && KWIDGETSADDONS_VERSION_MINOR >= 72)
109 lay->addWidget(title);
111 QGridLayout *glay =
new QGridLayout();
112 lay->addLayout(glay);
117 QString qwtstr = i18n(
"The application for which you wish to submit a bug report - if incorrect, please use the Report Bug menu item of the correct application");
118 tmpLabel =
new QLabel(i18n(
"Application: "),
this);
119 glay->addWidget(tmpLabel, row, 0);
120 tmpLabel->setWhatsThis(qwtstr);
129 tmpLabel->setWhatsThis(qwtstr);
132 qwtstr = i18n(
"The version of this application - please make sure that no newer version is available before sending a bug report");
133 tmpLabel =
new QLabel(i18n(
"Version:"),
this);
134 glay->addWidget(tmpLabel, ++row, 0);
135 tmpLabel->setWhatsThis(qwtstr);
141 d->
m_version->setTextInteractionFlags(Qt::TextBrowserInteraction);
146 tmpLabel =
new QLabel(i18n(
"OS:"),
this);
147 glay->addWidget(tmpLabel, ++row, 0);
150 tmpLabel =
new QLabel(
d->
os,
this);
151 tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
152 glay->addWidget(tmpLabel, row, 1, 1, 2);
157 QString text = i18n(
"<qt>"
158 "<p>Please read <b><a href=\"https://docs.krita.org/en/untranslatable_pages/reporting_bugs.html\">this guide</a></b> for reporting bugs first!</p>"
159 "<p>To submit a bug report, click on the button below. This will open a web browser "
160 "window on <a href=\"https://bugs.kde.org\">https://bugs.kde.org</a> where you will find "
161 "a form to fill in. </p>"
162 "<p><b>Please paste the following information into the bug report!</b></p>"
164 QLabel *label =
new QLabel(text,
this);
165 label->setOpenExternalLinks(
true);
166 label->setTextInteractionFlags(Qt::LinksAccessibleByMouse | Qt::LinksAccessibleByKeyboard);
167 label->setWordWrap(
true);
168 lay->addWidget(label);
171 QByteArray additionalInformation;
172 QFile sysinfo(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
"/krita-sysinfo.log");
173 if (sysinfo.exists()) {
174 sysinfo.open(QFile::ReadOnly);
175 additionalInformation += sysinfo.readAll();
179 additionalInformation +=
"\n---------------------\n";
181 QFile log(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
"/krita.log");
183 log.open(QFile::ReadOnly);
184 additionalInformation += log.readAll();
188 additionalInformation +=
"\n---------------------\n";
190 QFile crashes(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
"/kritacrash.log");
191 if (crashes.exists()) {
192 crashes.open(QFile::ReadOnly);
193 additionalInformation += crashes.readAll();
197 QTextEdit *buginfo =
new QTextEdit(
this);
198 buginfo->setText(QString::fromUtf8(additionalInformation));
199 lay->addWidget(buginfo);
201 QClipboard *clipboard = QGuiApplication::clipboard();
202 clipboard->setText(QString::fromUtf8(additionalInformation));
206 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
207 okButton->setText(i18n(
"&Submit Bug Report"));
209 lay->addWidget(buttonBox);
210 setMinimumHeight(sizeHint().height() + 20);