WInstancesTab: Mark strings as translatable
This commit is contained in:
parent
a3bfb3cc7c
commit
d6cbc0d247
|
@ -50,14 +50,14 @@ WInstancesTab::WInstancesTab(CWorldEditor *pEditor, QWidget *parent) :
|
||||||
connect(ui->TypesTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(OnTreeContextMenu(QPoint)));
|
connect(ui->TypesTreeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(OnTreeContextMenu(QPoint)));
|
||||||
|
|
||||||
// Create context menu
|
// Create context menu
|
||||||
mpHideInstance = new QAction("Hide instance", this);
|
mpHideInstance = new QAction(tr("Hide instance"), this);
|
||||||
mpHideType = new QAction("HideType", this);
|
mpHideType = new QAction(tr("HideType"), this);
|
||||||
mpHideAllTypes = new QAction("Hide all types", this);
|
mpHideAllTypes = new QAction(tr("Hide all types"), this);
|
||||||
mpHideAllExceptType = new QAction("HideAllButType", this);
|
mpHideAllExceptType = new QAction(tr("HideAllButType"), this);
|
||||||
mpSeparator = new QAction(this);
|
mpSeparator = new QAction(this);
|
||||||
mpSeparator->setSeparator(true);
|
mpSeparator->setSeparator(true);
|
||||||
mpUnhideAllTypes = new QAction("UnhideAllTypes", this);
|
mpUnhideAllTypes = new QAction(tr("UnhideAllTypes"), this);
|
||||||
mpUnhideAll = new QAction("Unhide all", this);
|
mpUnhideAll = new QAction(tr("Unhide all"), this);
|
||||||
|
|
||||||
QList<QAction*> ActionList;
|
QList<QAction*> ActionList;
|
||||||
ActionList << mpHideInstance << mpHideType << mpHideAllTypes << mpHideAllExceptType << mpSeparator
|
ActionList << mpHideInstance << mpHideType << mpHideAllTypes << mpHideAllExceptType << mpSeparator
|
||||||
|
@ -176,8 +176,8 @@ void WInstancesTab::OnTreeContextMenu(QPoint Pos)
|
||||||
// Set visibility and text
|
// Set visibility and text
|
||||||
if (pObject)
|
if (pObject)
|
||||||
{
|
{
|
||||||
QString Hide = mpMenuObject->MarkedVisible() ? "Hide" : "Unhide";
|
QString Hide = mpMenuObject->MarkedVisible() ? tr("Hide") : tr("Unhide");
|
||||||
mpHideInstance->setText(QString("%1 instance").arg(Hide));
|
mpHideInstance->setText(tr("%1 instance").arg(Hide));
|
||||||
mpHideInstance->setVisible(true);
|
mpHideInstance->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,21 +188,21 @@ void WInstancesTab::OnTreeContextMenu(QPoint Pos)
|
||||||
|
|
||||||
if (mpMenuLayer)
|
if (mpMenuLayer)
|
||||||
{
|
{
|
||||||
QString Hide = mpMenuLayer->IsVisible() ? "Hide" : "Unhide";
|
QString Hide = mpMenuLayer->IsVisible() ? tr("Hide") : tr("Unhide");
|
||||||
mpHideType->setText(QString("%1 layer %2").arg(Hide).arg(TO_QSTRING(mpMenuLayer->Name())));
|
mpHideType->setText(tr("%1 layer %2").arg(Hide).arg(TO_QSTRING(mpMenuLayer->Name())));
|
||||||
mpHideType->setVisible(true);
|
mpHideType->setVisible(true);
|
||||||
|
|
||||||
mpHideAllExceptType->setText(QString("Hide all layers but %1").arg(TO_QSTRING(mpMenuLayer->Name())));
|
mpHideAllExceptType->setText(tr("Hide all layers but %1").arg(TO_QSTRING(mpMenuLayer->Name())));
|
||||||
mpHideAllExceptType->setVisible(true);
|
mpHideAllExceptType->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (mpMenuTemplate)
|
else if (mpMenuTemplate)
|
||||||
{
|
{
|
||||||
QString Hide = mpMenuTemplate->IsVisible() ? "Hide" : "Unhide";
|
QString Hide = mpMenuTemplate->IsVisible() ? tr("Hide") : tr("Unhide");
|
||||||
mpHideType->setText(QString("%1 all %2 objects").arg(Hide).arg(TO_QSTRING(mpMenuTemplate->Name())));
|
mpHideType->setText(tr("%1 all %2 objects").arg(Hide).arg(TO_QSTRING(mpMenuTemplate->Name())));
|
||||||
mpHideType->setVisible(true);
|
mpHideType->setVisible(true);
|
||||||
|
|
||||||
mpHideAllExceptType->setText(QString("Hide all types but %1").arg(TO_QSTRING(mpMenuTemplate->Name())));
|
mpHideAllExceptType->setText(tr("Hide all types but %1").arg(TO_QSTRING(mpMenuTemplate->Name())));
|
||||||
mpHideAllExceptType->setVisible(true);
|
mpHideAllExceptType->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,8 +212,8 @@ void WInstancesTab::OnTreeContextMenu(QPoint Pos)
|
||||||
mpHideAllExceptType->setVisible(false);
|
mpHideAllExceptType->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mpHideAllTypes->setText(QString("Hide all %1").arg(IsLayers ? "layers" : "types"));
|
mpHideAllTypes->setText(tr("Hide all %1").arg(IsLayers ? tr("layers") : tr("types")));
|
||||||
mpUnhideAllTypes->setText(QString("Unhide all %1").arg(IsLayers ? "layers" : "types"));
|
mpUnhideAllTypes->setText(tr("Unhide all %1").arg(IsLayers ? tr("layers") : tr("types")));
|
||||||
|
|
||||||
QPoint GlobalPos = static_cast<QTreeView*>(sender())->viewport()->mapToGlobal(Pos);
|
QPoint GlobalPos = static_cast<QTreeView*>(sender())->viewport()->mapToGlobal(Pos);
|
||||||
mpTreeContextMenu->exec(GlobalPos);
|
mpTreeContextMenu->exec(GlobalPos);
|
||||||
|
|
Loading…
Reference in New Issue