Changeset View
Changeset View
Standalone View
Standalone View
src/kbugreport.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | 93 | { | |||
---|---|---|---|---|---|
98 | return -1; | 98 | return -1; | ||
99 | } | 99 | } | ||
100 | BugDestination bugDestination; | 100 | BugDestination bugDestination; | ||
101 | }; | 101 | }; | ||
102 | 102 | | |||
103 | KBugReport::KBugReport(const KAboutData &aboutData, QWidget *_parent) | 103 | KBugReport::KBugReport(const KAboutData &aboutData, QWidget *_parent) | ||
104 | : QDialog(_parent), d(new KBugReportPrivate(this)) | 104 | : QDialog(_parent), d(new KBugReportPrivate(this)) | ||
105 | { | 105 | { | ||
106 | setWindowTitle(i18n("Submit Bug Report")); | 106 | setWindowTitle(i18nc("@title:window", "Submit Bug Report")); | ||
107 | 107 | | |||
108 | QDialogButtonBox *buttonBox = new QDialogButtonBox(this); | 108 | QDialogButtonBox *buttonBox = new QDialogButtonBox(this); | ||
109 | buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); | 109 | buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); | ||
110 | connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); | 110 | connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); | ||
111 | connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); | 111 | connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); | ||
112 | 112 | | |||
113 | d->m_aboutData = aboutData; | 113 | d->m_aboutData = aboutData; | ||
114 | d->m_process = nullptr; | 114 | d->m_process = nullptr; | ||
Show All 32 Lines | 144 | if (d->bugDestination == KBugReportPrivate::CustomEmail) { | |||
147 | tmpLabel = new QLabel(i18nc("Email sender address", "From:"), this); | 147 | tmpLabel = new QLabel(i18nc("Email sender address", "From:"), this); | ||
148 | glay->addWidget(tmpLabel, row, 0); | 148 | glay->addWidget(tmpLabel, row, 0); | ||
149 | tmpLabel->setWhatsThis(qwtstr); | 149 | tmpLabel->setWhatsThis(qwtstr); | ||
150 | d->m_from = new QLabel(this); | 150 | d->m_from = new QLabel(this); | ||
151 | glay->addWidget(d->m_from, row, 1); | 151 | glay->addWidget(d->m_from, row, 1); | ||
152 | d->m_from->setWhatsThis(qwtstr); | 152 | d->m_from->setWhatsThis(qwtstr); | ||
153 | 153 | | |||
154 | // Configure email button | 154 | // Configure email button | ||
155 | d->m_configureEmail = new QPushButton(i18n("Configure Email..."), | 155 | d->m_configureEmail = new QPushButton(i18nc("@action:button", "Configure Email..."), this); | ||
156 | this); | | |||
157 | connect(d->m_configureEmail, SIGNAL(clicked()), this, | 156 | connect(d->m_configureEmail, SIGNAL(clicked()), this, | ||
158 | SLOT(_k_slotConfigureEmail())); | 157 | SLOT(_k_slotConfigureEmail())); | ||
159 | glay->addWidget(d->m_configureEmail, 0, 2, 3, 1, Qt::AlignTop | Qt::AlignRight); | 158 | glay->addWidget(d->m_configureEmail, 0, 2, 3, 1, Qt::AlignTop | Qt::AlignRight); | ||
160 | 159 | | |||
161 | // To | 160 | // To | ||
162 | qwtstr = i18n("The email address this bug report is sent to."); | 161 | qwtstr = i18n("The email address this bug report is sent to."); | ||
163 | tmpLabel = new QLabel(i18nc("Email receiver address", "To:"), this); | 162 | tmpLabel = new QLabel(i18nc("Email receiver address", "To:"), this); | ||
164 | glay->addWidget(tmpLabel, ++row, 0); | 163 | glay->addWidget(tmpLabel, ++row, 0); | ||
165 | tmpLabel->setWhatsThis(qwtstr); | 164 | tmpLabel->setWhatsThis(qwtstr); | ||
166 | tmpLabel = new QLabel(d->m_aboutData.bugAddress(), this); | 165 | tmpLabel = new QLabel(d->m_aboutData.bugAddress(), this); | ||
167 | tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); | 166 | tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); | ||
168 | glay->addWidget(tmpLabel, row, 1); | 167 | glay->addWidget(tmpLabel, row, 1); | ||
169 | tmpLabel->setWhatsThis(qwtstr); | 168 | tmpLabel->setWhatsThis(qwtstr); | ||
170 | 169 | | |||
171 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), | 170 | KGuiItem::assign(buttonBox->button(QDialogButtonBox::Ok), | ||
172 | KGuiItem(i18n("&Send"), QStringLiteral("mail-send"), i18n("Send bug report."), | 171 | KGuiItem(i18nc("@action:button", "&Send"), QStringLiteral("mail-send"), | ||
173 | i18n("Send this bug report to %1.", d->m_aboutData.bugAddress()))); | 172 | i18nc("@info:tooltip", "Send bug report."), | ||
173 | i18nc("@info:whatsthis", "Send this bug report to %1.", d->m_aboutData.bugAddress()))); | ||||
174 | row++; | 174 | row++; | ||
175 | } else { | 175 | } else { | ||
176 | d->m_configureEmail = nullptr; | 176 | d->m_configureEmail = nullptr; | ||
177 | d->m_from = nullptr; | 177 | d->m_from = nullptr; | ||
178 | } | 178 | } | ||
179 | 179 | | |||
180 | // Program name | 180 | // Program name | ||
181 | 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"); | 181 | 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"); | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
235 | tmpLabel = new QLabel(i18n("Compiler:"), this); | 235 | tmpLabel = new QLabel(i18n("Compiler:"), this); | ||
236 | glay->addWidget(tmpLabel, ++row, 0); | 236 | glay->addWidget(tmpLabel, ++row, 0); | ||
237 | tmpLabel = new QLabel(QLatin1String(XMLGUI_COMPILER_VERSION), this); | 237 | tmpLabel = new QLabel(QLatin1String(XMLGUI_COMPILER_VERSION), this); | ||
238 | tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); | 238 | tmpLabel->setTextInteractionFlags(Qt::TextBrowserInteraction); | ||
239 | glay->addWidget(tmpLabel, row, 1, 1, 2); | 239 | glay->addWidget(tmpLabel, row, 1, 1, 2); | ||
240 | 240 | | |||
241 | if (d->bugDestination == KBugReportPrivate::CustomEmail) { | 241 | if (d->bugDestination == KBugReportPrivate::CustomEmail) { | ||
242 | // Severity | 242 | // Severity | ||
243 | d->m_bgSeverity = new QGroupBox(i18n("Se&verity"), this); | 243 | d->m_bgSeverity = new QGroupBox(i18nc("@title:group", "Se&verity"), this); | ||
244 | 244 | | |||
245 | struct SeverityData { QString name; QString text; }; | 245 | struct SeverityData { QString name; QString text; }; | ||
246 | const std::array<SeverityData, 5> severityData = { { | 246 | const std::array<SeverityData, 5> severityData = { { | ||
247 | { QStringLiteral("critical"), i18nc("bug severity", "Critical") }, | 247 | { QStringLiteral("critical"), i18nc("bug severity", "Critical") }, | ||
248 | { QStringLiteral("grave"), i18nc("bug severity", "Grave") }, | 248 | { QStringLiteral("grave"), i18nc("bug severity", "Grave") }, | ||
249 | { QStringLiteral("normal"), i18nc("bug severity", "Normal") }, | 249 | { QStringLiteral("normal"), i18nc("bug severity", "Normal") }, | ||
250 | { QStringLiteral("wishlist"), i18nc("bug severity", "Wishlist") }, | 250 | { QStringLiteral("wishlist"), i18nc("bug severity", "Wishlist") }, | ||
251 | { QStringLiteral("i18n"), i18nc("bug severity", "Translation") }, | 251 | { QStringLiteral("i18n"), i18nc("bug severity", "Translation") }, | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 294 | } else { | |||
313 | label->setWordWrap(true); | 313 | label->setWordWrap(true); | ||
314 | lay->addWidget(label); | 314 | lay->addWidget(label); | ||
315 | lay->addSpacing(10); | 315 | lay->addSpacing(10); | ||
316 | 316 | | |||
317 | d->appcombo->setFocus(); | 317 | d->appcombo->setFocus(); | ||
318 | 318 | | |||
319 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | 319 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||
320 | if (d->bugDestination == KBugReportPrivate::BugsKdeOrg) { | 320 | if (d->bugDestination == KBugReportPrivate::BugsKdeOrg) { | ||
321 | okButton->setText(i18n("&Launch Bug Report Wizard")); | 321 | okButton->setText(i18nc("@action:button", "&Launch Bug Report Wizard")); | ||
322 | } else { | 322 | } else { | ||
323 | okButton->setText(i18n("&Submit Bug Report")); | 323 | okButton->setText(i18nc("@action:button", "&Submit Bug Report")); | ||
324 | } | 324 | } | ||
325 | okButton->setIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); | 325 | okButton->setIcon(QIcon::fromTheme(QStringLiteral("tools-report-bug"))); | ||
326 | } | 326 | } | ||
327 | 327 | | |||
328 | lay->addWidget(buttonBox); | 328 | lay->addWidget(buttonBox); | ||
329 | setMinimumHeight(sizeHint().height() + 20); // WORKAROUND: prevent "cropped" qcombobox | 329 | setMinimumHeight(sizeHint().height() + 20); // WORKAROUND: prevent "cropped" qcombobox | ||
330 | } | 330 | } | ||
331 | 331 | | |||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | |||||
491 | } | 491 | } | ||
492 | 492 | | |||
493 | void KBugReport::closeEvent(QCloseEvent *e) | 493 | void KBugReport::closeEvent(QCloseEvent *e) | ||
494 | { | 494 | { | ||
495 | if (d->bugDestination == KBugReportPrivate::CustomEmail && | 495 | if (d->bugDestination == KBugReportPrivate::CustomEmail && | ||
496 | ((d->m_lineedit->toPlainText().length() > 0) || d->m_subject->isModified())) { | 496 | ((d->m_lineedit->toPlainText().length() > 0) || d->m_subject->isModified())) { | ||
497 | int rc = KMessageBox::warningYesNo(this, | 497 | int rc = KMessageBox::warningYesNo(this, | ||
498 | i18n("Close and discard\nedited message?"), | 498 | i18n("Close and discard\nedited message?"), | ||
499 | i18n("Close Message"), KStandardGuiItem::discard(), KStandardGuiItem::cont()); | 499 | i18nc("@title:window", "Close Message"), | ||
500 | KStandardGuiItem::discard(), KStandardGuiItem::cont()); | ||||
500 | if (rc == KMessageBox::No) { | 501 | if (rc == KMessageBox::No) { | ||
501 | e->ignore(); | 502 | e->ignore(); | ||
502 | return; | 503 | return; | ||
503 | } | 504 | } | ||
504 | } | 505 | } | ||
505 | QDialog::closeEvent(e); | 506 | QDialog::closeEvent(e); | ||
506 | } | 507 | } | ||
507 | 508 | | |||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |