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

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

GIT_SILENT
parent d1b346f6
......@@ -26,7 +26,7 @@
<item>
<widget class="QGroupBox" name="localPatchOptions">
<property name="title">
<string>Patch</string>
<string comment="@title:group">Patch</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
......@@ -35,14 +35,14 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Base:</string>
<string comment="@label:textbox">Base directory:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KUrlRequester" name="baseDir">
<property name="placeholderText">
<string>Patch base...</string>
<string comment="@info:placeholder">/path/to/patch/base</string>
</property>
</widget>
</item>
......@@ -53,13 +53,13 @@
</property>
<widget class="QWidget" name="fileTab">
<attribute name="title">
<string>From File</string>
<string comment="@title:tab">From File</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="KUrlRequester" name="filename">
<property name="placeholderText">
<string>Patch location...</string>
<string comment="@info:placeholder">/path/to/patch</string>
</property>
</widget>
</item>
......@@ -67,13 +67,13 @@
</widget>
<widget class="QWidget" name="commandTab">
<attribute name="title">
<string>From Command</string>
<string comment="@title:tab">From Command</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="command">
<property name="placeholderText">
<string>Command's output...</string>
<string comment="@info:placeholder">Enter command to take output from...</string>
</property>
</widget>
</item>
......@@ -84,10 +84,10 @@
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="applied">
<property name="toolTip">
<string>Patch is already applied on local version</string>
<string comment="@info:tooltip">Patch is already applied on local version</string>
</property>
<property name="text">
<string>Already applied</string>
<string comment="@option:check">Already applied</string>
</property>
<property name="checked">
<bool>false</bool>
......
......@@ -415,18 +415,18 @@ void PatchHighlighter::documentReloaded(KTextEditor::Document* doc)
QImage tintedChange = QIcon::fromTheme(QStringLiteral("text-field")).pixmap(markPixmapSize, markPixmapSize).toImage();
KIconEffect::colorize( tintedChange, scheme.foreground( KColorScheme::NegativeText ).color(), 1.0 );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType22, i18n( "Insertion" ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType22, i18nc("@item", "Insertion") );
markIface->setMarkPixmap( KTextEditor::MarkInterface::markType22, QPixmap::fromImage( tintedInsertion ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType23, i18n( "Removal" ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType23, i18nc("@item", "Removal") );
markIface->setMarkPixmap( KTextEditor::MarkInterface::markType23, QPixmap::fromImage( tintedRemoval ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType24, i18n( "Change" ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType24, i18nc("@item", "Change") );
markIface->setMarkPixmap( KTextEditor::MarkInterface::markType24, QPixmap::fromImage( tintedChange ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType25, i18n( "Insertion" ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType25, i18nc("@item", "Insertion" ) );
markIface->setMarkPixmap(KTextEditor::MarkInterface::markType25, QIcon::fromTheme(QStringLiteral("insert-text")).pixmap(markPixmapSize, markPixmapSize));
markIface->setMarkDescription( KTextEditor::MarkInterface::markType26, i18n( "Removal" ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType26, i18nc("@item", "Removal") );
markIface->setMarkPixmap(KTextEditor::MarkInterface::markType26, QIcon::fromTheme(QStringLiteral("edit-delete")).pixmap(markPixmapSize, markPixmapSize));
markIface->setMarkDescription( KTextEditor::MarkInterface::markType27, i18n( "Change" ) );
markIface->setMarkDescription( KTextEditor::MarkInterface::markType27, i18nc("@item", "Change") );
markIface->setMarkPixmap(KTextEditor::MarkInterface::markType27, QIcon::fromTheme(QStringLiteral("text-field")).pixmap(markPixmapSize, markPixmapSize));
for (Diff2::Difference* diff : qAsConst(*m_model->differences())) {
......
......@@ -301,9 +301,9 @@ void PatchReviewPlugin::updateKompareModel() {
return;
} catch ( const QString & str ) {
KMessageBox::error( nullptr, str, i18n( "Kompare Model Update" ) );
KMessageBox::error(nullptr, str, i18nc("@title:window", "Kompare Model Update"));
} catch ( const char * str ) {
KMessageBox::error( nullptr, QLatin1String(str), i18n( "Kompare Model Update" ) );
KMessageBox::error(nullptr, QLatin1String(str), i18nc("@title:window", "Kompare Model Update"));
}
removeHighlighting();
m_modelList.reset( nullptr );
......@@ -451,13 +451,13 @@ void PatchReviewPlugin::updateReview()
}
futureActiveDoc->textDocument()->setReadWrite( false );
futureActiveDoc->setPrettyName( i18n( "Overview" ) );
futureActiveDoc->setPrettyName(i18nc("@title complete patch", "Overview"));
auto* modif = qobject_cast<KTextEditor::ModificationInterface*>(futureActiveDoc->textDocument());
modif->setModifiedOnDiskWarning( false );
docController->activateDocument( futureActiveDoc );
auto* toolView = qobject_cast<PatchReviewToolView*>(ICore::self()->uiController()->findToolView( i18n( "Patch Review" ), m_factory ));
auto* toolView = qobject_cast<PatchReviewToolView*>(ICore::self()->uiController()->findToolView(i18nc("@title:window", "Patch Review"), m_factory));
Q_ASSERT( toolView );
//Open all relates files
......@@ -500,7 +500,7 @@ void PatchReviewPlugin::setPatch( IPatchSource* patch ) {
connect( m_patch.data(), &IPatchSource::patchChanged, this, &PatchReviewPlugin::notifyPatchChanged );
}
QString finishText = i18n( "Finish Review" );
QString finishText = i18nc("@action", "Finish Review");
if( m_patch && !m_patch->finishReviewCustomText().isEmpty() )
finishText = m_patch->finishReviewCustomText();
m_finishReview->setText( finishText );
......@@ -526,7 +526,7 @@ PatchReviewPlugin::PatchReviewPlugin( QObject *parent, const QVariantList & )
m_updateKompareTimer->setInterval(500);
connect( m_updateKompareTimer, &QTimer::timeout, this, &PatchReviewPlugin::updateKompareModel );
m_finishReview = new QAction(i18n("Finish Review"), this);
m_finishReview = new QAction(i18nc("@action", "Finish Review"), this);
m_finishReview->setIcon( QIcon::fromTheme( QStringLiteral("dialog-ok") ) );
actionCollection()->setDefaultShortcut( m_finishReview, Qt::CTRL|Qt::Key_Return );
actionCollection()->addAction(QStringLiteral("commit_or_finish_review"), m_finishReview);
......@@ -537,7 +537,7 @@ PatchReviewPlugin::PatchReviewPlugin( QObject *parent, const QVariantList & )
area->addAction(m_finishReview);
}
core()->uiController()->addToolView( i18n( "Patch Review" ), m_factory, IUiController::None );
core()->uiController()->addToolView(i18nc("@title:window", "Patch Review"), m_factory, IUiController::None);
areaChanged(ICore::self()->uiController()->activeArea());
}
......@@ -601,7 +601,7 @@ KDevelop::ContextMenuExtension PatchReviewPlugin::contextMenuExtension(KDevelop:
if (urls.size() == 1) {
auto* reviewAction = new QAction(QIcon::fromTheme(QStringLiteral("text-x-patch")),
i18n("Review Patch"), parent);
i18nc("@action:inmenu", "Review Patch"), parent);
reviewAction->setData(QVariant(urls[0]));
connect( reviewAction, &QAction::triggered, this, &PatchReviewPlugin::executeFileReviewAction );
ContextMenuExtension cm;
......
......@@ -18,7 +18,7 @@
<item>
<widget class="QToolButton" name="previousFile">
<property name="toolTip">
<string>Previous file</string>
<string comment="@info:tooltip">Previous file</string>
</property>
<property name="icon">
<iconset theme="arrow-left">
......@@ -29,7 +29,7 @@
<item>
<widget class="QToolButton" name="previousHunk">
<property name="toolTip">
<string>Previous difference</string>
<string comment="@info:tooltip">Previous difference</string>
</property>
<property name="icon">
<iconset theme="arrow-up">
......@@ -40,7 +40,7 @@
<item>
<widget class="QToolButton" name="nextHunk">
<property name="toolTip">
<string>Next difference</string>
<string comment="@info:tooltip">Next difference</string>
</property>
<property name="icon">
<iconset theme="arrow-down">
......@@ -51,7 +51,7 @@
<item>
<widget class="QToolButton" name="nextFile">
<property name="toolTip">
<string>Next file</string>
<string comment="@info:tooltip">Next file</string>
</property>
<property name="icon">
<iconset theme="arrow-right">
......@@ -75,7 +75,7 @@
<item>
<widget class="QToolButton" name="updateButton">
<property name="text">
<string>Update</string>
<string comment="@action:button">Update</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
......@@ -89,7 +89,7 @@
<item>
<widget class="QToolButton" name="testsButton">
<property name="text">
<string>Run Tests</string>
<string comment="@action:button">Run Tests</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
......@@ -123,7 +123,7 @@
<item>
<widget class="QToolButton" name="exportReview">
<property name="text">
<string>Export Diff...</string>
<string comment="@action:button">Export Diff...</string>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
......@@ -139,7 +139,7 @@
<item>
<widget class="QToolButton" name="cancelReview">
<property name="text">
<string>Cancel Review</string>
<string comment="@action:button">Cancel Review</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
......@@ -153,7 +153,7 @@
<item>
<widget class="QToolButton" name="finishReview">
<property name="text">
<string>Finish Review</string>
<string comment="@action:button">Finish Review</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextBesideIcon</enum>
......@@ -172,7 +172,7 @@
<item>
<widget class="QGroupBox" name="filesGroup">
<property name="title">
<string>Changes</string>
<string comment="@title:group">Changes</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
......
......@@ -258,9 +258,9 @@ void PatchReviewToolView::showEditDialog() {
connect( m_editPatch.testsButton, &QToolButton::clicked, this, &PatchReviewToolView::runTests );
m_selectAllAction = new QAction(QIcon::fromTheme(QStringLiteral("edit-select-all")), i18n("Select All"), this );
m_selectAllAction = new QAction(QIcon::fromTheme(QStringLiteral("edit-select-all")), i18nc("@action", "Select All"), this );
connect( m_selectAllAction, &QAction::triggered, this, &PatchReviewToolView::selectAll );
m_deselectAllAction = new QAction( i18n("Deselect All"), this );
m_deselectAllAction = new QAction( i18nc("@action", "Deselect All"), this );
connect( m_deselectAllAction, &QAction::triggered, this, &PatchReviewToolView::deselectAll );
}
......
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