Creates a bug-report dialog. Note that you shouldn't have to do this manually, since KisKHelpMenu takes care of the menu item for "Report Bug..." and of creating a KisKBugReport dialog.
83{
84 setWindowTitle(i18n("Submit Bug Report"));
85
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()));
92
95 KGuiItem::assign(buttonBox->button(QDialogButtonBox::Cancel), KStandardGuiItem::close());
96
97 QLabel *tmpLabel;
98 QVBoxLayout *lay = new QVBoxLayout(this);
99
100 KTitleWidget *title = new KTitleWidget(this);
101 title->setText(i18n("Submit Bug Report"));
102
103#if KWIDGETSADDONS_VERSION_MAJOR > 5 || (KWIDGETSADDONS_VERSION_MAJOR == 5 && KWIDGETSADDONS_VERSION_MINOR >= 72)
105#else
107#endif
108
109 lay->addWidget(title);
110
111 QGridLayout *glay = new QGridLayout();
112 lay->addLayout(glay);
113
114 int row = 0;
115
116
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);
123
126
128
129 tmpLabel->setWhatsThis(qwtstr);
130
131
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);
139 }
141 d->
m_version->setTextInteractionFlags(Qt::TextBrowserInteraction);
142
145
146 tmpLabel = new QLabel(i18n("OS:"), this);
147 glay->addWidget(tmpLabel, ++row, 0);
149
150 tmpLabel =
new QLabel(
d->
os,
this);
151 tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
152 glay->addWidget(tmpLabel, row, 1, 1, 2);
153
154
155
156 lay->addSpacing(10);
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>"
163 "</qt>");
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);
169 lay->addSpacing(10);
170
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();
176 sysinfo.close();
177 }
178
179 additionalInformation += "\n---------------------\n";
180
181 QFile log(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/krita.log");
182 if (log.exists()) {
183 log.open(QFile::ReadOnly);
184 additionalInformation += log.readAll();
185 log.close();
186 }
187
188 additionalInformation += "\n---------------------\n";
189
190 QFile crashes(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kritacrash.log");
191 if (crashes.exists()) {
192 crashes.open(QFile::ReadOnly);
193 additionalInformation += crashes.readAll();
194 crashes.close();
195 }
196
197 QTextEdit *buginfo = new QTextEdit(this);
198 buginfo->setText(QString::fromUtf8(additionalInformation));
199 lay->addWidget(buginfo);
200
201 QClipboard *clipboard = QGuiApplication::clipboard();
202 clipboard->setText(QString::fromUtf8(additionalInformation));
203
205
206 QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
207 okButton->setText(i18n("&Submit Bug Report"));
209 lay->addWidget(buttonBox);
210 setMinimumHeight(sizeHint().height() + 20);
211}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
QLabel * lblApplicationName
friend class KisKBugReportPrivate
KisKBugReportPrivate *const d
QIcon loadIcon(const QString &name)