Changeset View
Changeset View
Standalone View
Standalone View
plugins/patchreview/patchreviewtoolview.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 131 | void PatchReviewToolView::patchChanged() { | |||
---|---|---|---|---|---|
133 | kompareModelChanged(); | 133 | kompareModelChanged(); | ||
134 | 134 | | |||
135 | #ifdef WITH_PURPOSE | 135 | #ifdef WITH_PURPOSE | ||
136 | IPatchSource::Ptr p = m_plugin->patch(); | 136 | IPatchSource::Ptr p = m_plugin->patch(); | ||
137 | if (p) { | 137 | if (p) { | ||
138 | m_exportMenu->model()->setInputData(QJsonObject { | 138 | m_exportMenu->model()->setInputData(QJsonObject { | ||
139 | { QStringLiteral("urls"), QJsonArray { p->file().toString() } }, | 139 | { QStringLiteral("urls"), QJsonArray { p->file().toString() } }, | ||
140 | { QStringLiteral("mimeType"), { QStringLiteral("text/x-patch") } }, | 140 | { QStringLiteral("mimeType"), { QStringLiteral("text/x-patch") } }, | ||
141 | { QStringLiteral("localBaseDir"), { p->baseDir().toString() } } | 141 | { QStringLiteral("localBaseDir"), { p->baseDir().toString() } }, | ||
142 | { QStringLiteral("updateComment"), { i18n("patch updated through KDevelop's patchreview plugin") } } | ||||
apol: i18n? | |||||
142 | }); | 143 | }); | ||
143 | } | 144 | } | ||
144 | #endif | 145 | #endif | ||
145 | } | 146 | } | ||
146 | 147 | | |||
147 | PatchReviewToolView::~PatchReviewToolView() | 148 | PatchReviewToolView::~PatchReviewToolView() | ||
148 | { | 149 | { | ||
149 | } | 150 | } | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 222 | #ifdef WITH_PURPOSE | |||
223 | connect(m_exportMenu, &Purpose::Menu::finished, this, [](const QJsonObject &output, int error, const QString &message) { | 224 | connect(m_exportMenu, &Purpose::Menu::finished, this, [](const QJsonObject &output, int error, const QString &message) { | ||
224 | if (error==0) { | 225 | if (error==0) { | ||
225 | KMessageBox::information(nullptr, i18n("<qt>You can find the new request at:<br /><a href='%1'>%1</a> </qt>", output[QLatin1String("url")].toString()), | 226 | KMessageBox::information(nullptr, i18n("<qt>You can find the new request at:<br /><a href='%1'>%1</a> </qt>", output[QLatin1String("url")].toString()), | ||
226 | QString(), QString(), KMessageBox::AllowLink); | 227 | QString(), QString(), KMessageBox::AllowLink); | ||
227 | } else { | 228 | } else { | ||
228 | QMessageBox::warning(nullptr, i18n("Error exporting"), i18n("Couldn't export the patch.\n%1", message)); | 229 | QMessageBox::warning(nullptr, i18n("Error exporting"), i18n("Couldn't export the patch.\n%1", message)); | ||
229 | } | 230 | } | ||
230 | }); | 231 | }); | ||
232 | // set the model input parameters to avoid terminal warnings | ||||
233 | m_exportMenu->model()->setInputData(QJsonObject { | ||||
234 | { QStringLiteral("urls"), QJsonArray { QString() } }, | ||||
235 | { QStringLiteral("mimeType"), { QStringLiteral("text/x-patch") } } | ||||
236 | }); | ||||
231 | m_exportMenu->model()->setPluginType(QStringLiteral("Export")); | 237 | m_exportMenu->model()->setPluginType(QStringLiteral("Export")); | ||
232 | m_editPatch.exportReview->setMenu( m_exportMenu ); | 238 | m_editPatch.exportReview->setMenu( m_exportMenu ); | ||
233 | #else | 239 | #else | ||
234 | m_editPatch.exportReview->setEnabled(false); | 240 | m_editPatch.exportReview->setEnabled(false); | ||
235 | #endif | 241 | #endif | ||
236 | 242 | | |||
237 | connect( m_editPatch.previousHunk, &QToolButton::clicked, this, &PatchReviewToolView::prevHunk ); | 243 | connect( m_editPatch.previousHunk, &QToolButton::clicked, this, &PatchReviewToolView::prevHunk ); | ||
238 | connect( m_editPatch.nextHunk, &QToolButton::clicked, this, &PatchReviewToolView::nextHunk ); | 244 | connect( m_editPatch.nextHunk, &QToolButton::clicked, this, &PatchReviewToolView::nextHunk ); | ||
▲ Show 20 Lines • Show All 358 Lines • Show Last 20 Lines |
i18n?