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

custom-definesandincludes: add more UI string context marker, fix some style

GIT_SILENT
parent 422a96d4
......@@ -46,7 +46,7 @@ class NoCompiler : public ICompiler
{
public:
NoCompiler():
ICompiler(i18n("None"), QString(), QString(), false)
ICompiler(i18nc("@item no compiler", "None"), QString(), QString(), false)
{}
QHash< QString, QString > defines(Utils::LanguageType, const QString&) const override
......
......@@ -131,10 +131,10 @@ TreeItem* manualRootItem(TreeItem* root)
CompilersModel::CompilersModel(QObject* parent)
: QAbstractItemModel(parent)
, m_rootItem(new TreeItem({i18n("Name"), i18n("Type")}))
, m_rootItem(new TreeItem({i18nc("@title:column", "Name"), i18nc("@title:column", "Type")}))
{
m_rootItem->appendChild(new TreeItem( QList<QVariant>{i18n("Auto-detected"), QString()}, m_rootItem));
m_rootItem->appendChild(new TreeItem( QList<QVariant>{i18n("Manual"), QString()}, m_rootItem));
m_rootItem->appendChild(new TreeItem( QList<QVariant>{i18nc("@item", "Auto-detected"), QString()}, m_rootItem));
m_rootItem->appendChild(new TreeItem( QList<QVariant>{i18nc("@item", "Manual"), QString()}, m_rootItem));
}
CompilersModel::~CompilersModel()
......
......@@ -64,7 +64,7 @@ CompilersWidget::CompilersWidget(QWidget* parent)
connect(m_ui->removeButton, &QPushButton::clicked, this, &CompilersWidget::deleteCompiler);
auto delAction = new QAction( i18n("Delete compiler"), this );
auto delAction = new QAction(i18nc("@action", "Delete Compiler"), this);
delAction->setShortcut( QKeySequence( QStringLiteral("Del") ) );
delAction->setShortcutContext( Qt::WidgetWithChildrenShortcut );
m_ui->compilers->addAction( delAction );
......@@ -229,12 +229,12 @@ void CompilersWidget::defaults()
QString CompilersWidget::name() const
{
return i18n("C/C++ Compilers");
return i18nc("@title:tab", "C/C++ Compilers");
}
QString CompilersWidget::fullName() const
{
return i18n("Configure C/C++ Compilers");
return i18nc("@title:tab", "Configure C/C++ Compilers");
}
QIcon CompilersWidget::icon() const
......
......@@ -22,7 +22,7 @@
<item>
<widget class="QPushButton" name="addButton">
<property name="text">
<string>&amp;Add</string>
<string comment="@action:button">&amp;Add</string>
</property>
<property name="icon">
<iconset theme="list-add"/>
......@@ -32,7 +32,7 @@
<item>
<widget class="QPushButton" name="removeButton">
<property name="text">
<string>&amp;Remove</string>
<string comment="@action:button">&amp;Remove</string>
</property>
<property name="icon">
<iconset theme="edit-delete"/>
......@@ -57,13 +57,13 @@
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
<string notr="true"/>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
<string comment="@label:textbox">Name:</string>
</property>
</widget>
</item>
......@@ -73,7 +73,7 @@
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Compiler executable:</string>
<string comment="@label:chooser">Compiler executable:</string>
</property>
</widget>
</item>
......
......@@ -79,12 +79,12 @@ void DefinesAndIncludesConfigPage::apply()
QString DefinesAndIncludesConfigPage::name() const
{
return i18n("Language Support");
return i18nc("@title:tab", "Language Support");
}
QString DefinesAndIncludesConfigPage::fullName() const
{
return i18n("Configure Language Support");
return i18nc("@title:tab", "Configure Language Support");
}
QIcon DefinesAndIncludesConfigPage::icon() const
......
......@@ -76,9 +76,9 @@ QVariant DefinesModel::headerData(int section, Qt::Orientation orientation, int
if( orientation == Qt::Horizontal && role == Qt::DisplayRole ) {
switch( section ) {
case 0:
return i18n("Define");
return i18nc("@title:column", "Define");
case 1:
return i18n("Value");
return i18nc("@title:column", "Value");
default:
Q_ASSERT_X( 0, "DefinesModel::headerData", "Invalid column requested" );
break;
......
......@@ -38,7 +38,7 @@ DefinesWidget::DefinesWidget( QWidget* parent )
connect(definesModel, &DefinesModel::rowsInserted, this, QOverload<>::of(&DefinesWidget::definesChanged));
connect(definesModel, &DefinesModel::rowsRemoved, this, QOverload<>::of(&DefinesWidget::definesChanged));
auto* delDefAction = new QAction( i18n("Delete Define"), this );
auto* delDefAction = new QAction(i18nc("@action", "Delete Define"), this);
delDefAction->setShortcut( QKeySequence(Qt::Key_Delete) );
delDefAction->setShortcutContext( Qt::WidgetWithChildrenShortcut );
delDefAction->setIcon( QIcon::fromTheme(QStringLiteral("edit-delete")) );
......
......@@ -58,7 +58,7 @@ IncludesWidget::IncludesWidget( QWidget* parent )
connect(includesModel, &IncludesModel::rowsInserted, this, QOverload<>::of(&IncludesWidget::includesChanged));
connect(includesModel, &IncludesModel::rowsRemoved, this, QOverload<>::of(&IncludesWidget::includesChanged));
auto* delIncAction = new QAction( i18n("Delete Include Path"), this );
auto* delIncAction = new QAction(i18nc("@action", "Delete Include Path"), this);
delIncAction->setShortcut( QKeySequence( Qt::Key_Delete ) );
delIncAction->setShortcutContext( Qt::WidgetWithChildrenShortcut );
ui->includePaths->addAction( delIncAction );
......
......@@ -28,10 +28,10 @@
<item>
<widget class="KUrlRequester" name="includePathRequester">
<property name="toolTip">
<string>Add the currently displayed URL to the list of includes if it is not in the list yet.</string>
<string comment="@info:tooltip">Add the currently displayed URL to the list of includes if it is not in the list yet.</string>
</property>
<property name="clickMessage" stdset="0">
<string>A new include path/file to use for parsing files under given directory</string>
<property name="placeholderText">
<string comment="@info:placeholder">A new include path/file to use for parsing files under given directory</string>
</property>
</widget>
</item>
......@@ -41,7 +41,7 @@
<bool>true</bool>
</property>
<property name="toolTip">
<string>Create a new include path entry from this URL.</string>
<string comment="@info:tooltip">Create a new include path entry from this URL</string>
</property>
<property name="text">
<string/>
......@@ -59,7 +59,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
<string>Delete current include path entry.</string>
<string comment="@info:tooltip">Delete current include path entry</string>
</property>
<property name="text">
<string/>
......
......@@ -17,23 +17,23 @@
<item row="1" column="0">
<widget class="QCheckBox" name="parseHeadersInPlainC">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Check this if you want &lt;code&gt;*.h&lt;/code&gt; headers to be parsed in plain C mode. By default they are parsed as C++ headers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Check this if you want &lt;code&gt;*.h&lt;/code&gt; headers to be parsed in plain C mode. By default they are parsed as C++ headers.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Parse *.h headers in plain C</string>
<string comment="@option:check">Parse *.h headers in plain C</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
<string notr="true"/>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>C++ Profi&amp;le:</string>
<string comment="@label:listbox">C++ profi&amp;le:</string>
</property>
<property name="buddy">
<cstring>languageStandardsCpp</cstring>
......@@ -49,41 +49,41 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Custom</string>
<string comment="@item:inlistbox language standard">Custom</string>
</property>
</item>
<item>
<property name="text">
<string>c++98</string>
<string notr="true">c++98</string>
</property>
</item>
<item>
<property name="text">
<string>c++03</string>
<string notr="true">c++03</string>
</property>
</item>
<item>
<property name="text">
<string>c++11</string>
<string notr="true">c++11</string>
</property>
</item>
<item>
<property name="text">
<string>c++14</string>
<string notr="true">c++14</string>
</property>
</item>
<item>
<property name="text">
<string>c++17</string>
<string notr="true">c++17</string>
</property>
</item>
<item>
<property name="text">
<string>c++2a</string>
<string notr="true">c++2a</string>
</property>
</item>
</widget>
......@@ -91,7 +91,7 @@
<item row="1" column="0">
<widget class="QLabel" name="argumentsLabel">
<property name="text">
<string>C++ co&amp;mmand-line arguments:</string>
<string comment="@label:textbox">C++ co&amp;mmand-line arguments:</string>
</property>
<property name="buddy">
<cstring>parserOptionsCpp</cstring>
......@@ -117,7 +117,7 @@
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>C Profi&amp;le:</string>
<string comment="@label:listbox">C profi&amp;le:</string>
</property>
<property name="buddy">
<cstring>languageStandardsC</cstring>
......@@ -133,41 +133,41 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Custom</string>
<string comment="@item:inlistbox language standard">Custom</string>
</property>
</item>
<item>
<property name="text">
<string>c89</string>
<string notr="true">c89</string>
</property>
</item>
<item>
<property name="text">
<string>gnu89</string>
<string notr="true">gnu89</string>
</property>
</item>
<item>
<property name="text">
<string>c99</string>
<string notr="true">c99</string>
</property>
</item>
<item>
<property name="text">
<string>gnu99</string>
<string notr="true">gnu99</string>
</property>
</item>
<item>
<property name="text">
<string>c11</string>
<string notr="true">c11</string>
</property>
</item>
<item>
<property name="text">
<string>gnu11</string>
<string notr="true">gnu11</string>
</property>
</item>
</widget>
......@@ -175,7 +175,7 @@
<item row="4" column="0">
<widget class="QLabel" name="argumentsLabel_2">
<property name="text">
<string>C co&amp;mmand-line arguments:</string>
<string comment="@label:textbox">C co&amp;mmand-line arguments:</string>
</property>
<property name="buddy">
<cstring>parserOptionsC</cstring>
......@@ -201,7 +201,7 @@
<item row="6" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>OpenCL C &amp;Profile:</string>
<string comment="@label:listbox">OpenCL C &amp;profile:</string>
</property>
<property name="buddy">
<cstring>languageStandardsOpenCl</cstring>
......@@ -217,26 +217,26 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Custom</string>
<string comment="@item:inlistbox language standard">Custom</string>
</property>
</item>
<item>
<property name="text">
<string>CL1.1</string>
<string notr="true">CL1.1</string>
</property>
</item>
<item>
<property name="text">
<string>CL1.2</string>
<string notr="true">CL1.2</string>
</property>
</item>
<item>
<property name="text">
<string>CL2.0</string>
<string notr="true">CL2.0</string>
</property>
</item>
</widget>
......@@ -244,7 +244,7 @@
<item row="7" column="0">
<widget class="QLabel" name="argumentsLabel_3">
<property name="text">
<string>OpenCL C comma&amp;nd-line arguments:</string>
<string comment="@label:textbox">OpenCL C comma&amp;nd-line arguments:</string>
</property>
<property name="buddy">
<cstring>parserOptionsOpenCl</cstring>
......@@ -270,7 +270,7 @@
<item row="9" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>CUDA C P&amp;rofile:</string>
<string comment="@label:listbox">CUDA C P&amp;rofile:</string>
</property>
<property name="buddy">
<cstring>languageStandardsCuda</cstring>
......@@ -286,31 +286,31 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Choose language profile. &lt;/p&gt;&lt;p&gt;Use &amp;quot;Custom&amp;quot; profile to modify parser command-line arguments&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>Custom</string>
<string comment="@item:inlistbox language standard">Custom</string>
</property>
</item>
<item>
<property name="text">
<string>c++03</string>
<string notr="true">c++03</string>
</property>
</item>
<item>
<property name="text">
<string>c++11</string>
<string notr="true">c++11</string>
</property>
</item>
<item>
<property name="text">
<string>c++14</string>
<string notr="true">c++14</string>
</property>
</item>
<item>
<property name="text">
<string>c99</string>
<string notr="true">c99</string>
</property>
</item>
</widget>
......@@ -318,7 +318,7 @@
<item row="10" column="0">
<widget class="QLabel" name="argumentsLabel_4">
<property name="text">
<string>CUDA C comman&amp;d-line arguments:</string>
<string comment="@label:textbox">CUDA C comman&amp;d-line arguments:</string>
</property>
<property name="buddy">
<cstring>parserOptionsCuda</cstring>
......
......@@ -187,7 +187,7 @@ void ProjectPathsWidget::clear()
void ProjectPathsWidget::addProjectPath()
{
const QUrl directory = pathsModel->data(pathsModel->index(0, 0), ProjectPathsModel::FullUrlDataRole).toUrl();
QPointer<QFileDialog> dlg = new QFileDialog(this, i18n("Select Project Path"), directory.toLocalFile());
QPointer<QFileDialog> dlg = new QFileDialog(this, i18nc("@title:window", "Select Project Path"), directory.toLocalFile());
dlg->setFileMode(QFileDialog::Directory);
dlg->setOption(QFileDialog::ShowDirsOnly);
if (dlg->exec()) {
......@@ -237,7 +237,7 @@ void ProjectPathsWidget::batchEdit()
auto includes = pathsModel->data(midx, ProjectPathsModel::IncludesDataRole).toStringList();
be.textEdit->setPlainText(includes.join(QLatin1Char('\n')));
dialog->setWindowTitle(i18n("Edit include directories/files"));
dialog->setWindowTitle(i18nc("@title:window", "Edit Include Directories/Files"));
} else {
auto defines = pathsModel->data(midx, ProjectPathsModel::DefinesDataRole).value<Defines>();
......@@ -245,7 +245,7 @@ void ProjectPathsWidget::batchEdit()
be.textEdit->appendPlainText(it.key() + QLatin1Char('=') + it.value());
}
dialog->setWindowTitle(i18n("Edit defined macros"));
dialog->setWindowTitle(i18nc("@title:window", "Edit Defined Macros"));
}
if (dialog->exec() != QDialog::Accepted) {
......
......@@ -26,10 +26,10 @@
<item>
<widget class="QCheckBox" name="kcfg_reparse">
<property name="toolTip">
<string>Check this if you want the project to be reparsed to apply the changes.</string>
<string comment="@info:tooltip">Check this if you want the project to be reparsed to apply the changes.</string>
</property>
<property name="text">
<string>Reparse the project</string>
<string comment="@option:check">Reparse the project</string>
</property>
<property name="checked">
<bool>true</bool>
......@@ -67,17 +67,17 @@
<item>
<widget class="QLabel" name="label">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select compiler that will be used to retrieve standard include directories and defined macros.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select compiler that will be used to retrieve standard include directories and defined macros.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Compiler for path:</string>
<string comment="@label:listbox">Compiler for path:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="compiler">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select compiler that will be used to retrieve standard include directories and defined macros.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string comment="@info:tooltip">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select compiler that will be used to retrieve standard include directories and defined macros.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
......@@ -87,10 +87,10 @@
<item>
<widget class="QPushButton" name="batchEdit">
<property name="toolTip">
<string>Edit multiply includes/defines at the same time.</string>
<string comment="@info:tooltip">Edit multiple includes/defines at the same time.</string>
</property>
<property name="text">
<string>&amp;Batch Edit...</string>
<string comment="@action:button">&amp;Batch Edit...</string>
</property>
<property name="icon">
<iconset theme="format-list-unordered"/>
......@@ -116,7 +116,7 @@
<item>
<widget class="QPushButton" name="addPath">
<property name="toolTip">
<string>Add a new sub-project path entry.</string>
<string comment="@info:tooltip">Add a new sub-project path entry.</string>
</property>
<property name="text">
<string/>
......@@ -132,7 +132,7 @@
<bool>false</bool>
</property>
<property name="toolTip">
<string>Delete current sub-project path entry.</string>
<string comment="@info:tooltip">Delete current sub-project path entry.</string>
</property>
<property name="text">
<string/>
......@@ -162,7 +162,7 @@
</property>
<widget class="QWidget" name="includePathsPage">
<attribute name="title">
<string>Includes/Imports</string>
<string comment="@title:tab">Includes/Imports</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
......@@ -179,7 +179,7 @@
</widget>
<widget class="QWidget" name="definesPage">
<attribute name="title">
<string>Defines</string>
<string comment="@title:tab">Defines</string>
</attribute>
<layout class="QVBoxLayout" name="gridLayout_2">
<item>
......@@ -196,7 +196,7 @@
</widget>
<widget class="QWidget" name="parserPage">
<attribute name="title">
<string>C/C++ Parser</string>
<string comment="@title:tab">C/C++ Parser</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
......
......@@ -36,7 +36,7 @@ NoProjectCustomIncludePaths::NoProjectCustomIncludePaths(QWidget* parent)
m_ui->setupUi(this);
m_ui->storageDirectory->setMode(KFile::Directory);
setWindowTitle(i18n("Setup Custom Include Paths"));
setWindowTitle(i18nc("@title:window", "Setup Custom Include Paths"));
connect(m_ui->directorySelector, &QPushButton::clicked, this, &NoProjectCustomIncludePaths::openAddIncludeDirectoryDialog);
}
......@@ -74,7 +74,7 @@ void NoProjectCustomIncludePaths::setCustomIncludePaths(const QStringList& paths
void NoProjectCustomIncludePaths::openAddIncludeDirectoryDialog()
{
const QString dirName = QFileDialog::getExistingDirectory(this, i18n("Select directory to include"));
const QString dirName = QFileDialog::getExistingDirectory(this, i18nc("@title:window", "Select Directory to Include"));
if (dirName.isEmpty())
return;
......
......@@ -14,7 +14,7 @@
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Storage Directory:</string>
<string comment="@title:group">Storage Directory:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
......@@ -22,7 +22,7 @@
<item>
<widget class="KUrlRequester" name="storageDirectory">
<property name="toolTip">
<string>The custom include-path will be stored in a special file called &quot;.kdev_include_paths&quot; stored within a source directory.</string>
<string comment="@info:tooltip">The custom include-path will be stored in a special file called &quot;.kdev_include_paths&quot; stored within a source directory.</string>
</property>