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

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

GIT_SILENT
parent 379c7d4d
......@@ -86,11 +86,11 @@ QVariant FilterModel::headerData(int section, Qt::Orientation orientation, int r
Q_ASSERT(section >= 0 && section < NUM_COLUMNS);
if (section == Pattern) {
return i18n("Pattern");
return i18nc("@title:column", "Pattern");
} else if (section == Targets) {
return i18n("Targets");
return i18nc("@title:column", "Targets");
} else if (section == Inclusive) {
return i18n("Action");
return i18nc("@title:column", "Action");
}
return QVariant();
......@@ -137,17 +137,17 @@ QVariant FilterModel::data(const QModelIndex& index, int role) const
if (role == Qt::DecorationRole) {
return QIcon::fromTheme(QStringLiteral("document-open"));
}
return i18n("Files and Folders");
return i18nc("@item", "Files and Folders");
} else if (filter.targets & Filter::Folders) {
if (role == Qt::DecorationRole) {
return QIcon::fromTheme(QStringLiteral("folder"));
}
return i18n("Folders");
return i18nc("@item", "Folders");
} else {
if (role == Qt::DecorationRole) {
return QIcon::fromTheme(QStringLiteral("text-plain"));
}
return i18n("Files");
return i18nc("@item", "Files");
}
} else if (column == Inclusive) {
if (role == Qt::EditRole) {
......@@ -159,12 +159,12 @@ QVariant FilterModel::data(const QModelIndex& index, int role) const
if (role == Qt::DecorationRole) {
return QIcon::fromTheme(QStringLiteral("list-add"));
}
return i18n("Include");
return i18nc("@item", "Include");
} else {
if (role == Qt::DecorationRole) {
return QIcon::fromTheme(QStringLiteral("list-remove"));
}
return i18n("Exclude");
return i18nc("@item", "Exclude");
}
}
......
......@@ -53,14 +53,14 @@ ProjectFilterConfigPage::ProjectFilterConfigPage(ProjectFilterProvider* provider
m_ui->filters->header()->setSectionResizeMode(FilterModel::Inclusive, QHeaderView::ResizeToContents);
m_ui->filters->setItemDelegateForColumn(FilterModel::Targets,
new ComboBoxDelegate(QVector<ComboBoxDelegate::Item>{
{i18n("Files"), static_cast<int>(Filter::Files)},
{i18n("Folders"), static_cast<int>(Filter::Folders)},
{i18n("Files and Folders"), static_cast<int>(Filter::Folders | Filter::Files)}}
{i18nc("@item", "Files"), static_cast<int>(Filter::Files)},
{i18nc("@item", "Folders"), static_cast<int>(Filter::Folders)},
{i18nc("@item", "Files and Folders"), static_cast<int>(Filter::Folders | Filter::Files)}}
, this));
m_ui->filters->setItemDelegateForColumn(FilterModel::Inclusive,
new ComboBoxDelegate(QVector<ComboBoxDelegate::Item>{
{i18n("Exclude"), false},
{i18n("Include"), true}}
{i18nc("@item", "Exclude"), false},
{i18nc("@item", "Include"), true}}
, this));
m_ui->filters->installEventFilter(this);
m_ui->filters->setDragEnabled(true);
......@@ -200,7 +200,7 @@ void ProjectFilterConfigPage::emitChanged()
QString ProjectFilterConfigPage::fullName() const
{
return i18n("Configure Project Filter");
return i18nc("@title:tab", "Configure Project Filter");
}
QIcon ProjectFilterConfigPage::icon() const
......@@ -210,5 +210,5 @@ QIcon ProjectFilterConfigPage::icon() const
QString ProjectFilterConfigPage::name() const
{
return i18n("Project Filter");
return i18nc("@title:tab", "Project Filter");
}
......@@ -88,8 +88,8 @@ ContextMenuExtension ProjectFilterProvider::contextMenuExtension(Context* contex
}
auto* action = new QAction(QIcon::fromTheme(QStringLiteral("view-filter")),
i18np("Exclude Item From Project",
"Exclude Items From Project",
i18ncp("@action:inmenu", "Exclude Item from Project",
"Exclude Items from Project",
items.size()), parent);
action->setData(QVariant::fromValue(items));
connect(action, &QAction::triggered, this, &ProjectFilterProvider::addFilterFromContextMenu);
......@@ -129,7 +129,7 @@ void ProjectFilterProvider::addFilterFromContextMenu()
KMessageBox::information(ICore::self()->uiController()->activeMainWindow(),
i18np("A filter for the item was added. To undo, use the project filter settings.",
"A filter for the items was added. To undo, use the project filter settings.",
items.size()), i18n("Project Filter Added"), QStringLiteral("projectfilter-addfromctxmenu"));
items.size()), i18nc("@title:window", "Project Filter Added"), QStringLiteral("projectfilter-addfromctxmenu"));
}
void ProjectFilterProvider::updateProjectFilters(IProject* project)
......
......@@ -31,7 +31,7 @@
<item>
<widget class="QPushButton" name="add">
<property name="text">
<string>Add</string>
<string comment="@action:button">Add</string>
</property>
<property name="icon">
<iconset theme="list-add">
......@@ -46,7 +46,7 @@
<item>
<widget class="QPushButton" name="remove">
<property name="text">
<string>Remove</string>
<string comment="@action:button">Remove</string>
</property>
<property name="icon">
<iconset theme="edit-delete">
......@@ -58,7 +58,7 @@
<item>
<widget class="QPushButton" name="moveUp">
<property name="text">
<string>Move Up</string>
<string comment="@action:button">Move Up</string>
</property>
<property name="icon">
<iconset theme="arrow-up">
......@@ -70,7 +70,7 @@
<item>
<widget class="QPushButton" name="moveDown">
<property name="text">
<string>Move Down</string>
<string comment="@action:button">Move Down</string>
</property>
<property name="icon">
<iconset theme="arrow-down">
......
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