mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-08 21:17:53 +00:00
Editor: Mark remaining undo command strings as translatable
Ensures that we're marking the remnant potential display strings properly.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
#include "CAddLinkCommand.h"
|
||||
#include <Core/Resource/Script/CLink.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CAddLinkCommand::CAddLinkCommand(CWorldEditor *pEditor, CLink Link)
|
||||
: IUndoCommand("Add Link")
|
||||
: IUndoCommand(QCoreApplication::translate("CAddLinkCommand", "Add Link"))
|
||||
, mpEditor(pEditor)
|
||||
, mLink(Link)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "CChangeLayerCommand.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CChangeLayerCommand::CChangeLayerCommand(CWorldEditor *pEditor, const QList<CScriptNode*>& rkNodeList, CScriptLayer *pNewLayer)
|
||||
: IUndoCommand("Change Layer")
|
||||
: IUndoCommand(QCoreApplication::translate("CChangeLayerCommand", "Change Layer"))
|
||||
, mpNewLayer(pNewLayer)
|
||||
, mpEditor(pEditor)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Editor/INodeEditor.h"
|
||||
#include <Core/Scene/CSceneNode.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CClearSelectionCommand : public IUndoCommand
|
||||
{
|
||||
CNodeSelection *mpSelection;
|
||||
@@ -14,7 +16,7 @@ class CClearSelectionCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
explicit CClearSelectionCommand(CNodeSelection *pSelection)
|
||||
: IUndoCommand("Clear Selection"),
|
||||
: IUndoCommand(QCoreApplication::translate("CClearSelectionCommand", "Clear Selection")),
|
||||
mpSelection(pSelection)
|
||||
{
|
||||
for (CSelectionIterator It(pSelection); It; ++It)
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "CCloneSelectionCommand.h"
|
||||
#include "Editor/CSelectionIterator.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CCloneSelectionCommand::CCloneSelectionCommand(INodeEditor *pEditor)
|
||||
: IUndoCommand("Clone")
|
||||
: IUndoCommand(QCoreApplication::translate("CCloneSelectionCommand", "Clone"))
|
||||
, mpEditor(qobject_cast<CWorldEditor*>(pEditor)) // todo: fix this! bad assumption! (clone handling code is in INodeEditor but active area is in CWorldEditor)
|
||||
{
|
||||
mOriginalSelection = mpEditor->Selection()->SelectedNodeList();
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "CCreateInstanceCommand.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CCreateInstanceCommand::CCreateInstanceCommand(CWorldEditor *pEditor, CScriptTemplate *pTemplate, CScriptLayer *pLayer, const CVector3f& rkPosition)
|
||||
: IUndoCommand("Create Instance")
|
||||
: IUndoCommand(QCoreApplication::translate("CCreateInstanceCommand", "Create Instance"))
|
||||
, mpEditor(pEditor)
|
||||
, mpScene(pEditor->Scene())
|
||||
, mpArea(pEditor->ActiveArea())
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#include "CDeleteLinksCommand.h"
|
||||
#include <Core/Resource/Script/CLink.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CDeleteLinksCommand::CDeleteLinksCommand(CWorldEditor *pEditor, CScriptObject *pObject, ELinkType Type, const QList<uint32>& rkIndices)
|
||||
: IUndoCommand("Delete Links")
|
||||
: IUndoCommand(QCoreApplication::translate("CDeleteLinksCommand", "Delete Links"))
|
||||
, mpEditor(pEditor)
|
||||
{
|
||||
mAffectedInstances.push_back(pObject);
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Editor/WorldEditor/CWorldEditor.h"
|
||||
#include <Core/Scene/CSceneNode.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
// todo: currently only supports deleting script nodes; needs support for light nodes as well
|
||||
// plus maybe it should be extensible enough to support other possible types
|
||||
class CDeleteSelectionCommand : public IUndoCommand
|
||||
@@ -47,7 +49,7 @@ class CDeleteSelectionCommand : public IUndoCommand
|
||||
QList<SDeletedLink> mDeletedLinks;
|
||||
|
||||
public:
|
||||
explicit CDeleteSelectionCommand(CWorldEditor *pEditor, const QString& rkCommandName = "Delete");
|
||||
explicit CDeleteSelectionCommand(CWorldEditor *pEditor, const QString& rkCommandName = QCoreApplication::translate("CDeleteSelectionCommand", "Delete"));
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
bool AffectsCleanState() const override { return true; }
|
||||
|
||||
@@ -6,13 +6,15 @@
|
||||
#include "Editor/INodeEditor.h"
|
||||
#include <Core/Scene/CSceneNode.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CDeselectNodeCommand : public IUndoCommand
|
||||
{
|
||||
CNodePtr mpNode;
|
||||
CNodeSelection *mpSelection;
|
||||
public:
|
||||
CDeselectNodeCommand(CNodeSelection *pSelection, CSceneNode *pNode)
|
||||
: IUndoCommand("Deselect")
|
||||
: IUndoCommand(QCoreApplication::translate("CDeselectNodeCommand", "Deselect"))
|
||||
, mpNode(pNode)
|
||||
, mpSelection(pSelection)
|
||||
{}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CEDITINTRINSICPROPERTYCOMMAND_H
|
||||
|
||||
#include "IEditPropertyCommand.h"
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CEditIntrinsicPropertyCommand : public IEditPropertyCommand
|
||||
{
|
||||
@@ -13,7 +14,7 @@ public:
|
||||
const QList<void*>& kDataPointers,
|
||||
CPropertyModel* pModel,
|
||||
QModelIndex Index = QModelIndex(),
|
||||
const QString& kCommandName = "Edit Property")
|
||||
const QString& kCommandName = QCoreApplication::translate("CEditIntrinsicPropertyCommand", "Edit Property"))
|
||||
: IEditPropertyCommand(pProperty, pModel, Index, kCommandName)
|
||||
, mDataPointers(kDataPointers)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "CEditLinkCommand.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CEditLinkCommand::CEditLinkCommand(CWorldEditor *pEditor, CLink *pLink, CLink NewLink)
|
||||
: IUndoCommand("Edit Link")
|
||||
: IUndoCommand(QCoreApplication::translate("CEditLinkCommand", "Edit Link"))
|
||||
, mpEditor(pEditor)
|
||||
, mpEditLink(pLink)
|
||||
, mOldLink(*pLink)
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "ObjReferences.h"
|
||||
#include "Editor/WorldEditor/CWorldEditor.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CEditScriptPropertyCommand : public IEditPropertyCommand
|
||||
{
|
||||
protected:
|
||||
@@ -16,7 +18,7 @@ public:
|
||||
const QList<CScriptObject*>& kInstances,
|
||||
CPropertyModel* pModel,
|
||||
QModelIndex Index = QModelIndex(),
|
||||
const QString& kCommandName = "Edit Property")
|
||||
const QString& kCommandName = QCoreApplication::translate("CEditScriptPropertyCommand", "Edit Property"))
|
||||
: IEditPropertyCommand(pProperty, pModel, Index, kCommandName)
|
||||
, mIndex(Index)
|
||||
{
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Editor/INodeEditor.h"
|
||||
#include <Core/Scene/CSceneNode.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CInvertSelectionCommand : public IUndoCommand
|
||||
{
|
||||
CNodeSelection *mpSelection;
|
||||
@@ -14,7 +16,7 @@ class CInvertSelectionCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CInvertSelectionCommand(CNodeSelection *pSelection, CScene *pScene, FNodeFlags NodeFlags)
|
||||
: IUndoCommand("Invert Selection")
|
||||
: IUndoCommand(QCoreApplication::translate("CInvertSelectionCommand", "Invert Selection"))
|
||||
, mpSelection(pSelection)
|
||||
{
|
||||
for (CSceneIterator It(pScene, NodeFlags); It; ++It)
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <Core/GameProject/CResourceStore.h>
|
||||
#include <Core/GameProject/CVirtualDirectory.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CMoveDirectoryCommand : public IUndoCommand
|
||||
{
|
||||
CResourceStore *mpStore;
|
||||
@@ -16,7 +18,7 @@ class CMoveDirectoryCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CMoveDirectoryCommand(CResourceStore *pStore, CVirtualDirectory *pDir, CVirtualDirectory *pNewParent)
|
||||
: IUndoCommand("Move Directory")
|
||||
: IUndoCommand(QCoreApplication::translate("CMoveDirectoryCommand", "Move Directory"))
|
||||
, mpStore(pStore)
|
||||
, mTargetDir(pDir->FullPath())
|
||||
, mOldParent(pDir->Parent()->FullPath())
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||
#include <Core/GameProject/CResourceEntry.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CMoveResourceCommand : public IUndoCommand
|
||||
{
|
||||
CResourceEntry *mpEntry;
|
||||
@@ -15,7 +17,7 @@ class CMoveResourceCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CMoveResourceCommand(CResourceEntry *pEntry, CVirtualDirectory *pNewDir)
|
||||
: IUndoCommand("Move Resource")
|
||||
: IUndoCommand(QCoreApplication::translate("CMoveResourceCommand", "Move Resource"))
|
||||
, mpEntry(pEntry)
|
||||
, mOldDirPath(pEntry->DirectoryPath())
|
||||
, mNewDirPath(pNewDir->FullPath())
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "CPasteNodesCommand.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CPasteNodesCommand::CPasteNodesCommand(CWorldEditor *pEditor, CScriptLayer *pLayer, CVector3f PastePoint)
|
||||
: IUndoCommand("Paste")
|
||||
: IUndoCommand(QCoreApplication::translate("CPasteNodesCommand", "Paste"))
|
||||
, mpEditor(pEditor)
|
||||
, mpLayer(pLayer)
|
||||
, mPastePoint(PastePoint)
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||
#include <Core/GameProject/CVirtualDirectory.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CRenameDirectoryCommand : public IUndoCommand
|
||||
{
|
||||
CVirtualDirectory *mpDir;
|
||||
@@ -14,7 +16,7 @@ class CRenameDirectoryCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CRenameDirectoryCommand(CVirtualDirectory *pDir, const TString& rkNewName)
|
||||
: IUndoCommand("Rename Directory")
|
||||
: IUndoCommand(QCoreApplication::translate("CRenameDirectoryCommand", "Rename Directory"))
|
||||
, mpDir(pDir)
|
||||
, mOldName(pDir->Name())
|
||||
, mNewName(rkNewName)
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Editor/ResourceBrowser/CResourceBrowser.h"
|
||||
#include <Core/GameProject/CResourceEntry.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CRenameResourceCommand : public IUndoCommand
|
||||
{
|
||||
CResourceEntry *mpEntry;
|
||||
@@ -15,7 +17,7 @@ class CRenameResourceCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CRenameResourceCommand(CResourceEntry *pEntry, const TString& rkNewName)
|
||||
: IUndoCommand("Rename Resource")
|
||||
: IUndoCommand(QCoreApplication::translate("CRenameResourceCommand", "Rename Resource"))
|
||||
, mpEntry(pEntry)
|
||||
, mOldName(pEntry->Name())
|
||||
, mNewName(rkNewName)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define CRESIZESCRIPTARRAYCOMMAND_H
|
||||
|
||||
#include "CEditScriptPropertyCommand.h"
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CResizeScriptArrayCommand : public CEditScriptPropertyCommand
|
||||
{
|
||||
@@ -14,7 +15,7 @@ public:
|
||||
const QList<CScriptObject*>& rkInstances,
|
||||
CPropertyModel* pModel,
|
||||
QModelIndex Index = QModelIndex(),
|
||||
const QString& rkCommandName = "Resize Array"
|
||||
const QString& rkCommandName = QCoreApplication::translate("CResizeScriptArrayCommand", "Resize Array")
|
||||
)
|
||||
: CEditScriptPropertyCommand(pProperty, rkInstances, pModel, Index, rkCommandName)
|
||||
{
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
#include "EUndoCommand.h"
|
||||
#include "Editor/INodeEditor.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CRotateNodeCommand::CRotateNodeCommand()
|
||||
: IUndoCommand("Rotate")
|
||||
: IUndoCommand(QCoreApplication::translate("CRotateNodeCommand", "Rotate"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -16,7 +18,7 @@ CRotateNodeCommand::CRotateNodeCommand(
|
||||
const CQuaternion& rkDelta,
|
||||
ETransformSpace TransformSpace
|
||||
)
|
||||
: IUndoCommand("Rotate"),
|
||||
: IUndoCommand(QCoreApplication::translate("CRotateNodeCommand", "Rotate")),
|
||||
mpEditor(pEditor)
|
||||
{
|
||||
mNodeList.reserve(rkNodes.size());
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "IUndoCommand.h"
|
||||
#include <Core/GameProject/CResourceStore.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
/** Command that calls ConditionalSaveStore on a resource store.
|
||||
* This is meant to be added to undo macros that modify the resource store
|
||||
* in order to trigger the store to resave when the macro is complete.
|
||||
@@ -14,7 +16,7 @@ class CSaveStoreCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
explicit CSaveStoreCommand(CResourceStore* pInStore)
|
||||
: IUndoCommand("Save Store")
|
||||
: IUndoCommand(QCoreApplication::translate("CSaveStoreCommand", "Save Store"))
|
||||
, mpStore(pInStore)
|
||||
{}
|
||||
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "EUndoCommand.h"
|
||||
#include "Editor/INodeEditor.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CScaleNodeCommand::CScaleNodeCommand()
|
||||
: IUndoCommand("Scale")
|
||||
: IUndoCommand(QCoreApplication::translate("CScaleNodeCommand", "Scale"))
|
||||
{
|
||||
}
|
||||
|
||||
CScaleNodeCommand::CScaleNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, bool UsePivot, const CVector3f& rkPivot, const CVector3f& rkDelta)
|
||||
: IUndoCommand("Scale"),
|
||||
: IUndoCommand(QCoreApplication::translate("CScaleNodeCommand", "Scale")),
|
||||
mpEditor(pEditor)
|
||||
{
|
||||
mNodeList.reserve(rkNodes.size());
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "Editor/INodeEditor.h"
|
||||
#include <Core/Scene/CSceneNode.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CSelectAllCommand : public IUndoCommand
|
||||
{
|
||||
CNodePtrList mOldSelection;
|
||||
@@ -15,7 +17,7 @@ class CSelectAllCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CSelectAllCommand(CNodeSelection *pSelection, CScene *pScene, FNodeFlags NodeFlags)
|
||||
: IUndoCommand("Select All")
|
||||
: IUndoCommand(QCoreApplication::translate("CSelectAllCommand", "Select All"))
|
||||
, mpSelection(pSelection)
|
||||
{
|
||||
for (CSelectionIterator It(pSelection); It; ++It)
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include "Editor/INodeEditor.h"
|
||||
#include <Core/Scene/CSceneNode.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class CSelectNodeCommand : public IUndoCommand
|
||||
{
|
||||
CNodePtr mpNode;
|
||||
@@ -13,7 +15,7 @@ class CSelectNodeCommand : public IUndoCommand
|
||||
|
||||
public:
|
||||
CSelectNodeCommand(CNodeSelection *pSelection, CSceneNode *pNode)
|
||||
: IUndoCommand("Select")
|
||||
: IUndoCommand(QCoreApplication::translate("CSelectNodeCommand", "Select"))
|
||||
, mpNode(pNode)
|
||||
, mpSelection(pSelection)
|
||||
{}
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "EUndoCommand.h"
|
||||
#include "Editor/INodeEditor.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
CTranslateNodeCommand::CTranslateNodeCommand()
|
||||
: IUndoCommand("Translate")
|
||||
: IUndoCommand(QCoreApplication::translate("CTranslateNodeCommand", "Translate"))
|
||||
{
|
||||
}
|
||||
|
||||
CTranslateNodeCommand::CTranslateNodeCommand(INodeEditor *pEditor, const QList<CSceneNode*>& rkNodes, const CVector3f& Delta, ETransformSpace TransformSpace)
|
||||
: IUndoCommand("Translate"),
|
||||
: IUndoCommand(QCoreApplication::translate("CTranslateNodeCommand", "Translate")),
|
||||
mpEditor(pEditor)
|
||||
{
|
||||
mNodeList.reserve(rkNodes.size());
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <Core/GameProject/CResourceStore.h>
|
||||
#include <Core/GameProject/CVirtualDirectory.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class ICreateDeleteDirectoryCommand : public IUndoCommand
|
||||
{
|
||||
protected:
|
||||
@@ -64,7 +66,7 @@ class CCreateDirectoryCommand : public ICreateDeleteDirectoryCommand
|
||||
{
|
||||
public:
|
||||
CCreateDirectoryCommand(CResourceStore *pStore, TString ParentPath, TString DirName)
|
||||
: ICreateDeleteDirectoryCommand("Create Directory", pStore, ParentPath, DirName)
|
||||
: ICreateDeleteDirectoryCommand(QCoreApplication::translate("CCreateDirectoryCommand", "Create Directory"), pStore, ParentPath, DirName)
|
||||
{}
|
||||
|
||||
void undo() override { DoDelete(); }
|
||||
@@ -75,7 +77,7 @@ class CDeleteDirectoryCommand : public ICreateDeleteDirectoryCommand
|
||||
{
|
||||
public:
|
||||
CDeleteDirectoryCommand(CResourceStore *pStore, TString ParentPath, TString DirName)
|
||||
: ICreateDeleteDirectoryCommand("Delete Directory", pStore, ParentPath, DirName)
|
||||
: ICreateDeleteDirectoryCommand(QCoreApplication::translate("CDeleteDirectoryCommand", "Delete Directory"), pStore, ParentPath, DirName)
|
||||
{
|
||||
mpDir = pStore->GetVirtualDirectory(ParentPath + DirName, false);
|
||||
ASSERT(mpDir);
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <Core/GameProject/CResourceEntry.h>
|
||||
#include <Core/GameProject/CResourceStore.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class ICreateDeleteResourceCommand : public IUndoCommand
|
||||
{
|
||||
protected:
|
||||
@@ -49,7 +51,7 @@ class CCreateResourceCommand : public ICreateDeleteResourceCommand
|
||||
{
|
||||
public:
|
||||
explicit CCreateResourceCommand(CResourceEntry* pEntry)
|
||||
: ICreateDeleteResourceCommand("Create Resource", pEntry)
|
||||
: ICreateDeleteResourceCommand(QCoreApplication::translate("CCreateResourceCommand", "Create Resource"), pEntry)
|
||||
{}
|
||||
|
||||
void undo() override { DoDelete(); }
|
||||
@@ -60,7 +62,7 @@ class CDeleteResourceCommand : public ICreateDeleteResourceCommand
|
||||
{
|
||||
public:
|
||||
explicit CDeleteResourceCommand(CResourceEntry* pEntry)
|
||||
: ICreateDeleteResourceCommand("Delete Resource", pEntry)
|
||||
: ICreateDeleteResourceCommand(QCoreApplication::translate("CDeleteResourceCommand", "Delete Resource"), pEntry)
|
||||
{}
|
||||
|
||||
void undo() override { DoCreate(); }
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "EUndoCommand.h"
|
||||
#include "Editor/PropertyEdit/CPropertyModel.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
class IEditPropertyCommand : public IUndoCommand
|
||||
{
|
||||
protected:
|
||||
@@ -30,7 +32,7 @@ public:
|
||||
IProperty* pProperty,
|
||||
CPropertyModel* pModel,
|
||||
const QModelIndex& kIndex,
|
||||
const QString& kCommandName = "Edit Property"
|
||||
const QString& kCommandName = QCoreApplication::translate("IEditPropertyCommand", "Edit Property")
|
||||
);
|
||||
|
||||
~IEditPropertyCommand() override = default;
|
||||
|
||||
Reference in New Issue
Block a user