Commit ff617f51 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

problemreporter: add more UI context marker for strings, fix some style

GIT_SILENT
parent 0e230920
......@@ -88,7 +88,7 @@ ProblemReporterPlugin::ProblemReporterPlugin(QObject* parent, const QVariantList
{
KDevelop::ProblemModelSet* pms = core()->languageController()->problemModelSet();
pms->addModel(QStringLiteral("Parser"), i18n("Parser"), m_model);
core()->uiController()->addToolView(i18n("Problems"), m_factory);
core()->uiController()->addToolView(i18nc("@title:window", "Problems"), m_factory);
setXMLFile(QStringLiteral("kdevproblemreporter.rc"));
connect(ICore::self()->documentController(), &IDocumentController::documentClosed, this,
......@@ -182,7 +182,7 @@ void ProblemReporterPlugin::updateHighlight(const KDevelop::IndexedString& url)
void ProblemReporterPlugin::showModel(const QString& id)
{
auto w = qobject_cast<ProblemsView*>(core()->uiController()->findToolView(i18n("Problems"), m_factory));
auto w = qobject_cast<ProblemsView*>(core()->uiController()->findToolView(i18nc("@title:window", "Problems"), m_factory));
if (w)
w->showModel(id);
}
......@@ -223,9 +223,9 @@ KDevelop::ContextMenuExtension ProblemReporterPlugin::contextMenuExtension(KDeve
if (!actions.isEmpty()) {
QString text;
if (title.isEmpty())
text = i18n("Solve Problem");
text = i18nc("@action:inmenu", "Solve Problem");
else {
text = i18n("Solve: %1", KDevelop::htmlToPlainText(title));
text = i18nc("@action:inmenu", "Solve: %1", KDevelop::htmlToPlainText(title));
}
auto* menu = new QMenu(text, parent);
......
......@@ -45,7 +45,7 @@ void ProblemsView::setupActions()
{
m_fullUpdateAction = new QAction(this);
m_fullUpdateAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
m_fullUpdateAction->setText(i18n("Force Full Update"));
m_fullUpdateAction->setText(i18nc("@action", "Force Full Update"));
m_fullUpdateAction->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
connect(m_fullUpdateAction, &QAction::triggered, this, [this]() {
currentView()->model()->forceFullUpdate();
......@@ -62,24 +62,24 @@ void ProblemsView::setupActions()
auto* scopeActions = new QActionGroup(this);
m_currentDocumentAction = new QAction(this);
m_currentDocumentAction->setText(i18n("Current Document"));
m_currentDocumentAction->setText(i18nc("@option:check", "Current Document"));
m_currentDocumentAction->setToolTip(i18nc("@info:tooltip", "Display problems in current document"));
auto* openDocumentsAction = new QAction(this);
openDocumentsAction->setText(i18n("Open Documents"));
openDocumentsAction->setText(i18nc("@option:check", "Open Documents"));
openDocumentsAction->setToolTip(i18nc("@info:tooltip", "Display problems in all open documents"));
auto* currentProjectAction = new QAction(this);
currentProjectAction->setText(i18n("Current Project"));
currentProjectAction->setText(i18nc("@option:check", "Current Project"));
currentProjectAction->setToolTip(i18nc("@info:tooltip", "Display problems in current project"));
auto* allProjectAction = new QAction(this);
allProjectAction->setText(i18n("All Projects"));
allProjectAction->setText(i18nc("@option:check", "All Projects"));
allProjectAction->setToolTip(i18nc("@info:tooltip", "Display problems in all projects"));
m_showAllAction = new QAction(this);
m_showAllAction->setText(i18n("Show All"));
m_showAllAction->setToolTip(i18nc("@info:tooltip", "Display ALL problems"));
m_showAllAction->setText(i18nc("@option:check", "Show All"));
m_showAllAction->setToolTip(i18nc("@info:tooltip", "Display all problems"));
QAction* const actions[] = {
m_currentDocumentAction,
......@@ -108,7 +108,7 @@ void ProblemsView::setupActions()
addAction(m_showImportsAction);
m_showImportsAction->setCheckable(true);
m_showImportsAction->setChecked(false);
m_showImportsAction->setText(i18n("Show Imports"));
m_showImportsAction->setText(i18nc("@option:check", "Show Imports"));
m_showImportsAction->setToolTip(i18nc("@info:tooltip", "Display problems in imported files"));
connect(m_showImportsAction, &QAction::triggered, this, [this](bool checked) {
currentView()->model()->setShowImports(checked);
......@@ -121,17 +121,17 @@ void ProblemsView::setupActions()
m_errorSeverityAction = new QAction(this);
m_errorSeverityAction->setToolTip(i18nc("@info:tooltip", "Display errors"));
m_errorSeverityAction->setIcon(IProblem::iconForSeverity(IProblem::Error));
m_errorSeverityAction->setIconText(i18n("Show Errors"));
m_errorSeverityAction->setIconText(i18nc("@option:check", "Show Errors"));
m_warningSeverityAction = new QAction(this);
m_warningSeverityAction->setToolTip(i18nc("@info:tooltip", "Display warnings"));
m_warningSeverityAction->setIcon(IProblem::iconForSeverity(IProblem::Warning));
m_warningSeverityAction->setIconText(i18n("Show Warnings"));
m_warningSeverityAction->setIconText(i18nc("@option:check", "Show Warnings"));
m_hintSeverityAction = new QAction(this);
m_hintSeverityAction->setToolTip(i18nc("@info:tooltip", "Display hints"));
m_hintSeverityAction->setIcon(IProblem::iconForSeverity(IProblem::Hint));
m_hintSeverityAction->setIconText(i18n("Show Hints"));
m_hintSeverityAction->setIconText(i18nc("@option:check", "Show Hints"));
QAction* const severityActionArray[] = { m_errorSeverityAction, m_warningSeverityAction, m_hintSeverityAction };
for (auto* action : severityActionArray) {
......@@ -151,14 +151,14 @@ void ProblemsView::setupActions()
}
{
m_groupingMenu = new KActionMenu(i18n("Grouping"), this);
m_groupingMenu = new KActionMenu(i18nc("@title:menu", "Grouping"), this);
m_groupingMenu->setDelayed(false);
auto* groupingActions = new QActionGroup(this);
auto* noGroupingAction = new QAction(i18n("None"), this);
auto* pathGroupingAction = new QAction(i18n("Path"), this);
auto* severityGroupingAction = new QAction(i18n("Severity"), this);
auto* noGroupingAction = new QAction(i18nc("@option:check", "None"), this);
auto* pathGroupingAction = new QAction(i18nc("@option:check", "Path"), this);
auto* severityGroupingAction = new QAction(i18nc("@option:check", "Severity"), this);
QAction* const groupingActionArray[] = { noGroupingAction, pathGroupingAction, severityGroupingAction };
for (auto* action : groupingActionArray) {
......@@ -186,7 +186,7 @@ void ProblemsView::setupActions()
m_filterEdit = new KExpandableLineEdit(this);
m_filterEdit->setClearButtonEnabled(true);
m_filterEdit->setPlaceholderText(i18n("Search..."));
m_filterEdit->setPlaceholderText(i18nc("@info:placeholder", "Search..."));
connect(m_filterEdit, &QLineEdit::textChanged,
filterTimer, static_cast<void (QTimer::*)()>(&QTimer::start));
......@@ -291,7 +291,7 @@ void ItemViewWalker::selectIndex(Direction direction)
ProblemsView::ProblemsView(QWidget* parent)
: QWidget(parent)
{
setWindowTitle(i18n("Problems"));
setWindowTitle(i18nc("@title:window", "Problems"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("script-error"), windowIcon()));
auto layout = new QVBoxLayout(this);
......@@ -429,7 +429,7 @@ void ProblemsView::updateTab(int idx, int rows)
return;
const QString name = m_models[idx].name;
const QString tabText = i18nc("%1: tab name, %2: number of problems", "%1 (%2)", name, rows);
const QString tabText = i18nc("@title:tab %1: tab name, %2: number of problems", "%1 (%2)", name, rows);
m_tabWidget->setTabText(idx, tabText);
}
......@@ -467,7 +467,7 @@ void ProblemsView::handleSeverityActionToggled()
void ProblemsView::setScope(int scope)
{
m_scopeMenu->setText(i18n("Scope: %1", m_scopeMenu->menu()->actions().at(scope)->text()));
m_scopeMenu->setText(i18nc("@title:menu", "Scope: %1", m_scopeMenu->menu()->actions().at(scope)->text()));
currentView()->model()->setScope(scope);
}
......
......@@ -106,7 +106,7 @@ ProblemTreeView::ProblemTreeView(QWidget* parent, QAbstractItemModel* itemModel)
, m_proxy(new QSortFilterProxyModel(this))
{
setObjectName(QStringLiteral("Problem Reporter Tree"));
setWhatsThis(i18n("Problems"));
setWhatsThis(i18nc("@info:whatsthis", "Problems"));
setItemDelegate(new ProblemTreeViewItemDelegate(this));
setSelectionBehavior(QAbstractItemView::SelectRows);
......@@ -216,9 +216,9 @@ void ProblemTreeView::contextMenuEvent(QContextMenuEvent* event)
QPointer<QMenu> m = new QMenu(this);
m->addSection(i18n("Problem"));
m->addSection(i18nc("@title:menu", "Problem"));
auto copyDescriptionAction = m->addAction(QIcon::fromTheme(QStringLiteral("edit-copy")),
i18n("&Copy Description"));
i18nc("@action:inmenu", "&Copy Description"));
connect(copyDescriptionAction, &QAction::triggered, this, [problem]() {
QApplication::clipboard()->setText(descriptionFromProblem(problem), QClipboard::Clipboard);
});
......@@ -237,7 +237,7 @@ void ProblemTreeView::contextMenuEvent(QContextMenuEvent* event)
QString title = solution->title();
title = KDevelop::htmlToPlainText(title);
title.replace(QLatin1String("&apos;"), QLatin1String("\'"));
m->addSection(i18n("Solve: %1", title));
m->addSection(i18nc("@title:menu", "Solve: %1", title));
m->addActions(actions);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment