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

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

GIT_SILENT
parent 3132bd5a
......@@ -41,7 +41,7 @@ EditExternalScript::EditExternalScript(ExternalScriptItem* item, QWidget* parent
shortcutWidget->layout()->setContentsMargins(0, 0, 0, 0);
//BEGIN setup tooltips
QString tooltip = i18n(
QString tooltip = i18nc("@info:tooltip",
"<p>Defines the command that should be executed when this script is run. Basic shell features of your platform should be available.</p>\n"
"<p>There are a few placeholders you can use in the command:</p>\n"
"<dl>\n"
......@@ -67,19 +67,19 @@ EditExternalScript::EditExternalScript(ExternalScriptItem* item, QWidget* parent
commandEdit->setToolTip(tooltip);
commandLabel->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines what the external script should get as input (via <code>STDIN</code>).</p>"
);
stdinCombo->setToolTip(tooltip);
stdinLabel->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines what should be done with the output (i.e. <code>STDOUT</code>) of the script.</p>"
);
stdoutCombo->setToolTip(tooltip);
stdoutLabel->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines what should be done with the errors (i.e. <code>STDERR</code>) of the script.</p>"
"<p>Note: if the action is the same as that chosen for the output, the channels will be merged "
"and handled together.</p>"
......@@ -87,29 +87,29 @@ EditExternalScript::EditExternalScript(ExternalScriptItem* item, QWidget* parent
stderrCombo->setToolTip(tooltip);
stderrLabel->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines the name of the script. Just for displaying purposes.</p>"
);
nameEdit->setToolTip(tooltip);
nameLabel->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines the shortcut(s) you can use to execute this external script.</p>"
);
shortcutLabel->setToolTip(tooltip);
shortcutWidget->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines whether documents should be saved before the script gets executed.</p>"
);
saveLabel->setToolTip(tooltip);
saveCombo->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines whether the output of the script should be shown in a tool view.</p>"
);
showOutputBox->setToolTip(tooltip);
tooltip = i18n(
tooltip = i18nc("@info:tooltip",
"<p>Defines what type of filtering should be applied to the output. E.g. to indicate errors by red text.</p>"
);
outputFilterLabel->setToolTip(tooltip);
......@@ -118,9 +118,9 @@ EditExternalScript::EditExternalScript(ExternalScriptItem* item, QWidget* parent
//BEGIN item to UI copying
if (item->text().isEmpty()) {
setWindowTitle(i18n("Create new external script"));
setWindowTitle(i18nc("@title:window", "Create New External Script"));
} else {
setWindowTitle(i18n("Edit external script '%1'", item->text()));
setWindowTitle(i18nc("@title:window", "Edit External Script '%1'", item->text()));
}
nameEdit->setText(item->text());
commandEdit->setText(item->command());
......
......@@ -16,7 +16,7 @@
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>&amp;Name:</string>
<string comment="@label:textbox">&amp;Name:</string>
</property>
<property name="buddy">
<cstring>nameEdit</cstring>
......@@ -26,21 +26,15 @@
<item row="0" column="1">
<widget class="QLineEdit" name="nameEdit">
<property name="toolTip">
<string>&lt;p&gt;The name will also be used as the identifier during code completion.&lt;/p&gt;
<string comment="@info:tooltip">&lt;p&gt;The name will also be used as the identifier during code completion.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; No spaces allowed.&lt;/p&gt;</string>
</property>
<property name="placeholderText">
<string>please insert a name</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="commandLabel">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Command:</string>
<string comment="@label:textbox">&amp;Command:</string>
</property>
<property name="buddy">
<cstring>commandEdit</cstring>
......@@ -49,18 +43,12 @@
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="commandEdit">
<property name="placeholderText">
<string>please insert a command to execute</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="stdinLabel">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Input:</string>
<string comment="@label:listbox">&amp;Input:</string>
</property>
<property name="buddy">
<cstring>stdinCombo</cstring>
......@@ -71,33 +59,30 @@
<widget class="QComboBox" name="stdinCombo">
<item>
<property name="text">
<string>nothing</string>
<string comment="@item:inlistbox input source">Nothing</string>
</property>
</item>
<item>
<property name="text">
<string>selection in current file or nothing</string>
<string comment="@item:inlistbox input source">Selection in Current File or Nothing</string>
</property>
</item>
<item>
<property name="text">
<string>selection in current file or whole file</string>
<string comment="@item:inlistbox input source">Selection in Current File or Whole File</string>
</property>
</item>
<item>
<property name="text">
<string>contents of current file</string>
<string comment="@item:inlistbox input source">Contents of Current File</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="stdoutLabel">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>&amp;Output:</string>
<string comment="@label:listbox">&amp;Output:</string>
</property>
<property name="buddy">
<cstring>stdoutCombo</cstring>
......@@ -108,32 +93,32 @@
<widget class="QComboBox" name="stdoutCombo">
<item>
<property name="text">
<string>ignore</string>
<string comment="@item:inlistbox handle output">Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>insert at cursor position of current file</string>
<string comment="@item:inlistbox handle output">Insert at Cursor Position of Current File</string>
</property>
</item>
<item>
<property name="text">
<string>replace selection of current file or insert at cursor position</string>
<string comment="@item:inlistbox handle output">Replace Selection of Current File or Insert at Cursor Position</string>
</property>
</item>
<item>
<property name="text">
<string>replace selection of current file or whole file</string>
<string comment="@item:inlistbox handle output">Replace Selection of Current File or Whole File</string>
</property>
</item>
<item>
<property name="text">
<string>replace contents of current file</string>
<string comment="@item:inlistbox handle output">Replace Contents of Current File</string>
</property>
</item>
<item>
<property name="text">
<string>create new file</string>
<string comment="@item:inlistbox handle output">Create New File</string>
</property>
</item>
</widget>
......@@ -141,7 +126,7 @@
<item row="4" column="0">
<widget class="QLabel" name="stderrLabel">
<property name="text">
<string>Errors:</string>
<string comment="@label:listbox">Errors:</string>
</property>
<property name="buddy">
<cstring>stderrCombo</cstring>
......@@ -152,37 +137,37 @@
<widget class="QComboBox" name="stderrCombo">
<item>
<property name="text">
<string>ignore</string>
<string comment="@item:inlistbox handle errors">Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>merge with normal output</string>
<string comment="@item:inlistbox handle errors">Merge with Normal Output</string>
</property>
</item>
<item>
<property name="text">
<string>insert at cursor position of current file</string>
<string comment="@item:inlistbox handle errors">Insert at Cursor Position of Current File</string>
</property>
</item>
<item>
<property name="text">
<string>replace selection of current file or insert at cursor position</string>
<string comment="@item:inlistbox handle errors">Replace Selection of Current File or Insert at Cursor Position</string>
</property>
</item>
<item>
<property name="text">
<string>replace selection of current file or whole file</string>
<string comment="@item:inlistbox handle errors">Replace Selection of Current File or Whole File</string>
</property>
</item>
<item>
<property name="text">
<string>replace contents of current file</string>
<string comment="@item:inlistbox handle errors">Replace Contents of Current File</string>
</property>
</item>
<item>
<property name="text">
<string>create new file</string>
<string comment="@item:inlistbox handle errors">Create New File</string>
</property>
</item>
</widget>
......@@ -190,7 +175,7 @@
<item row="5" column="0">
<widget class="QLabel" name="saveLabel">
<property name="text">
<string>Save &amp;mode:</string>
<string comment="@label:listbox">Save &amp;mode:</string>
</property>
<property name="buddy">
<cstring>saveCombo</cstring>
......@@ -201,17 +186,17 @@
<widget class="QComboBox" name="saveCombo">
<item>
<property name="text">
<string>save nothing</string>
<string comment="@item:inlistbox save mode">Save Nothing</string>
</property>
</item>
<item>
<property name="text">
<string>save active document</string>
<string comment="@item:inlistbox save mode">Save Active Document</string>
</property>
</item>
<item>
<property name="text">
<string>save all open documents</string>
<string comment="@item:inlistbox save mode">Save All Open Documents</string>
</property>
</item>
</widget>
......@@ -219,7 +204,7 @@
<item row="6" column="0">
<widget class="QLabel">
<property name="text">
<string>Show out&amp;put:</string>
<string comment="@option:check">Show out&amp;put:</string>
</property>
<property name="buddy">
<cstring>showOutputBox</cstring>
......@@ -236,7 +221,7 @@
<item row="7" column="0">
<widget class="QLabel" name="outputFilterLabel">
<property name="text">
<string>Output filter:</string>
<string comment="@label:listbox">Output filter:</string>
</property>
<property name="buddy">
<cstring>outputFilterCombo</cstring>
......@@ -247,22 +232,22 @@
<widget class="QComboBox" name="outputFilterCombo">
<item>
<property name="text">
<string>no filter</string>
<string comment="@item:inlistbox output filter">No Filter</string>
</property>
</item>
<item>
<property name="text">
<string>compiler filter</string>
<string comment="@item:inlistbox output filter">Compiler Filter</string>
</property>
</item>
<item>
<property name="text">
<string>script error filter</string>
<string comment="@item:inlistbox output filter">Script Error Filter</string>
</property>
</item>
<item>
<property name="text">
<string>static analysis error filter</string>
<string comment="@item:inlistbox output filter">Static Analysis Filter</string>
</property>
</item>
</widget>
......@@ -270,10 +255,10 @@
<item row="8" column="0">
<widget class="QLabel" name="shortcutLabel">
<property name="toolTip">
<string>&lt;p&gt;Defines shortcuts you can use to execute this script.&lt;/p&gt;</string>
<string comment="@info:tooltip">Defines shortcuts you can use to execute this script.</string>
</property>
<property name="text">
<string>Shortcut:</string>
<string comment="@label:chooser">Shortcut:</string>
</property>
</widget>
</item>
......
......@@ -250,7 +250,7 @@ KDevelop::ContextMenuExtension ExternalScriptPlugin::contextMenuExtension(KDevel
}
if (!menu) {
menu = new QMenu(i18n("External Scripts"), parent);
menu = new QMenu(i18nc("@title:menu", "External Scripts"), parent);
}
auto* scriptAction = new QAction(item->text(), menu);
......
......@@ -41,7 +41,7 @@ ExternalScriptView::ExternalScriptView(ExternalScriptPlugin* plugin, QWidget* pa
Ui::ExternalScriptViewBase::setupUi(this);
setFocusProxy(filterText);
setWindowTitle(i18n("External Scripts"));
setWindowTitle(i18nc("@title:window", "External Scripts"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("dialog-scripts"), windowIcon()));
m_model = new QSortFilterProxyModel(this);
......@@ -59,16 +59,16 @@ ExternalScriptView::ExternalScriptView(ExternalScriptPlugin* plugin, QWidget* pa
this, &ExternalScriptView::contextMenu);
m_addScriptAction =
new QAction(QIcon::fromTheme(QStringLiteral("document-new")), i18n("Add External Script"), this);
new QAction(QIcon::fromTheme(QStringLiteral("document-new")), i18nc("@action", "Add External Script"), this);
connect(m_addScriptAction, &QAction::triggered, this, &ExternalScriptView::addScript);
addAction(m_addScriptAction);
m_editScriptAction = new QAction(QIcon::fromTheme(QStringLiteral("document-edit")), i18n(
m_editScriptAction = new QAction(QIcon::fromTheme(QStringLiteral("document-edit")), i18nc("@action",
"Edit External Script"), this);
connect(m_editScriptAction, &QAction::triggered, this, &ExternalScriptView::editScript);
addAction(m_editScriptAction);
m_removeScriptAction = new QAction(QIcon::fromTheme(QStringLiteral("document-close")), i18n(
m_removeScriptAction = new QAction(QIcon::fromTheme(QStringLiteral("document-close")), i18nc("@action",
"Remove External Script"), this);
connect(m_removeScriptAction, &QAction::triggered, this, &ExternalScriptView::removeScript);
addAction(m_removeScriptAction);
......@@ -159,7 +159,7 @@ void ExternalScriptView::removeScript()
"<p>Do you really want to remove the external script configuration for <i>%1</i>?</p>"
"<p><i>Note:</i> The script itself will not be removed.</p>",
item->text()),
i18n("Confirm External Script Removal")
i18nc("@title:window", "Confirm External Script Removal")
);
if (ret == KMessageBox::Yes) {
m_plugin->model()->removeRow(
......
......@@ -31,11 +31,8 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Define filter here</string>
</property>
<property name="placeholderText">
<string>Filter...</string>
<string comment="@info:placeholder">Filter...</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
......
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