Skip to content

Commit

Permalink
Renamed "Property Types" to "Custom Types"
Browse files Browse the repository at this point in the history
The name "Property Types" is probably too specific now that the classes
can also be used as the class of any data type.
  • Loading branch information
bjorn committed Jun 17, 2022
1 parent ef5d3b5 commit b4c3288
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
20 changes: 10 additions & 10 deletions docs/manual/custom-properties.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,23 @@ quickly jump to the referenced object.

.. _custom-property-types:

Custom Property Types
---------------------
Custom Types
------------

In addition to the basic property types listed above, you can define custom
property types in your project. Tiled supports :ref:`custom enums
<custom-enums>` and :ref:`custom classes <custom-classes>`.
types in your project. Tiled supports :ref:`custom enums <custom-enums>` and
:ref:`custom classes <custom-classes>`.

.. figure:: images/properties/property-types-editor.png
:alt: Property Types Editor
:alt: Custom Types Editor

Property Types Editor
Custom Types Editor

.. note::

The property types are automatically saved in the
:doc:`project file <projects>`. Hence you need to create a project,
before you can set up your property types.
These types are automatically saved in the :doc:`project file <projects>`.
Hence you need to create a project, before you can set up your custom
types.

.. _custom-enums:

Expand Down Expand Up @@ -108,7 +108,7 @@ names. Classes can have members referring to other classes.

Each data type has a "Class" property, which can be used to refer to a custom
class. The members of this class will then be directly available as custom
properties of that instance (until Tiled 1.9, this feature was only available
properties of that instance (before Tiled 1.9, this feature was only available
for objects and tiles as the "Type" property).

Each class can also have a custom color, which is used to make objects more
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/editing-tilesets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ ID
<div class="new new-prev">Since Tiled 1.0</div>

Class
This property refers to custom classes defined in the :ref:`Property Types Editor <custom-property-types>`.
This property refers to custom classes defined in the :ref:`Custom Types Editor <custom-property-types>`.
See the section about :ref:`typed-tiles` for more information.

Width and Height
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/export-gmx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ properties of the view:
.. hint::

When you're defining views in Tiled, it is useful to add ``view``
as class in the :ref:`Property Types Editor <custom-property-types>`,
as class in the :ref:`Custom Types Editor <custom-property-types>`,
adding the above properties for ease of access. If you frequently use
views with similar settings, you can set up
:doc:`templates <using-templates>` for them.
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/export-yy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ the view object.
.. hint::

When you're defining views in Tiled, it is useful to add ``view``
as class in the :ref:`Property Types Editor <custom-property-types>`,
as class in the :ref:`Custom Types Editor <custom-property-types>`,
adding the above properties for ease of access. If you frequently use
views with similar settings, you can set up
:doc:`templates <using-templates>` for them.
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Automapping Rules File
should be used for all maps while this project is loaded. It is ignored for
maps that have a ``rules.txt`` file saved alongside them.

Any types defined in the :ref:`Property Types Editor <custom-property-types>`
Any types defined in the :ref:`Custom Types Editor <custom-property-types>`
are also saved in the project.

.. _sessions:
Expand Down
4 changes: 2 additions & 2 deletions src/tiled/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
ActionManager::registerAction(mResetToDefaultLayout, "ResetToDefaultLayout");
ActionManager::registerAction(mLockLayout, "LockLayout");

mShowPropertyTypesEditor = new QAction(tr("Property Types Editor"), this);
mShowPropertyTypesEditor = new QAction(tr("Custom Types Editor"), this);
mShowPropertyTypesEditor->setCheckable(true);

mUi->menuView->insertAction(mUi->actionShowGrid, mViewsAndToolbarsAction);
Expand Down Expand Up @@ -2344,7 +2344,7 @@ void MainWindow::retranslateUi()
mViewsAndToolbarsAction->setText(tr("Views and Toolbars"));
mResetToDefaultLayout->setText(tr("Reset to Default Layout"));
mLockLayout->setText(tr("Lock Layout"));
mShowPropertyTypesEditor->setText(tr("Property Types Editor"));
mShowPropertyTypesEditor->setText(tr("Custom Types Editor"));
mActionHandler->retranslateUi();
CommandManager::instance()->retranslateUi();
}
Expand Down
20 changes: 10 additions & 10 deletions src/tiled/propertytypeseditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PersistentMenu : public QMenu


PropertyTypesFilter::PropertyTypesFilter(const QString &lastPath)
: propertyTypesFilter(QCoreApplication::translate("File Types", "Property Types files (*.json)"))
: propertyTypesFilter(QCoreApplication::translate("File Types", "Custom Types files (*.json)"))
, objectTypesJsonFilter(QCoreApplication::translate("File Types", "Object Types JSON (*.json)"))
, objectTypesXmlFilter(QCoreApplication::translate("File Types", "Object Types XML (*.xml)"))
{
Expand Down Expand Up @@ -288,9 +288,9 @@ void PropertyTypesEditor::retranslateUi()
mRenameMemberAction->setText(tr("Rename Member"));

mExportAction->setText(tr("Export..."));
mExportAction->setToolTip(tr("Export Property Types"));
mExportAction->setToolTip(tr("Export Types"));
mImportAction->setText(tr("Import..."));
mImportAction->setToolTip(tr("Import Property Types"));
mImportAction->setToolTip(tr("Import Types"));
}

void PropertyTypesEditor::addPropertyType(PropertyType::Type type)
Expand Down Expand Up @@ -338,7 +338,7 @@ void PropertyTypesEditor::removeSelectedPropertyType()

/**
* Returns the index of the currently selected property type, or an invalid
* index if no or multiple property types are selected.
* index if no or multiple types are selected.
*/
QModelIndex PropertyTypesEditor::selectedPropertyTypeIndex() const
{
Expand Down Expand Up @@ -655,7 +655,7 @@ void PropertyTypesEditor::importPropertyTypes()

PropertyTypesFilter filter(lastPath);
const QString fileName =
QFileDialog::getOpenFileName(this, tr("Import Property Types"),
QFileDialog::getOpenFileName(this, tr("Import Types"),
lastPath,
filter.filters,
&filter.selectedFilter);
Expand Down Expand Up @@ -684,14 +684,14 @@ void PropertyTypesEditor::importPropertyTypes()
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
const auto error = QCoreApplication::translate("File Errors", "Could not open file for reading.");
QMessageBox::critical(this, tr("Error Reading Property Types"), error);
QMessageBox::critical(this, tr("Error Reading Types"), error);
return;
}

QJsonParseError jsonError;
const QJsonDocument document = QJsonDocument::fromJson(file.readAll(), &jsonError);
if (document.isNull()) {
QMessageBox::critical(this, tr("Error Reading Property Types"),
QMessageBox::critical(this, tr("Error Reading Types"),
Utils::Error::jsonParseError(jsonError));
return;
}
Expand All @@ -715,7 +715,7 @@ void PropertyTypesEditor::exportPropertyTypes()

PropertyTypesFilter filter(lastPath);
const QString fileName =
QFileDialog::getSaveFileName(this, tr("Export Property Types"),
QFileDialog::getSaveFileName(this, tr("Export Types"),
lastPath,
filter.filters,
&filter.selectedFilter);
Expand All @@ -740,14 +740,14 @@ void PropertyTypesEditor::exportPropertyTypes()

if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
const auto error = QCoreApplication::translate("File Errors", "Could not open file for writing.");
QMessageBox::critical(this, tr("Error Writing Property Types"), error);
QMessageBox::critical(this, tr("Error Writing Types"), error);
return;
}

file.device()->write(QJsonDocument(types->toJson()).toJson());

if (!file.commit())
QMessageBox::critical(this, tr("Error Writing Property Types"), file.errorString());
QMessageBox::critical(this, tr("Error Writing Types"), file.errorString());
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/tiled/propertytypeseditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Property Types Editor</string>
<string>Custom Types Editor</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
Expand All @@ -23,7 +23,7 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Property Types</string>
<string>Custom Types</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
Expand Down

0 comments on commit b4c3288

Please sign in to comment.