add world properties dialog to World menu by dogboydog · Pull Request #4190 · mapeditor/tiled (original) (raw)

Hey so I was thinking for this PR - maybe showing the list of maps added to the world should be a follow up , so that we can provide a way for custom properties to be edited for worlds in the UI without waiting to implement more features?

Yes, that's reasonable. The list of maps can already be edited through the World Tool anyway.

I have one non-custom property added right now which is the filename for the world, and editing it kind of works except for these issues:

This makes me wonder, why did you add the file name? Is that because we don't have a "Save As" action for worlds? Cause no other asset works this way. You can't just change an asset's file name, you'd have to save it with a different file name instead. We also don't have any "rename" functionality (though it would be nice to have).

I think the file name might be interesting to include as read-only if it is otherwise hard to identify which world the properties are about.

Edit: Oh, also I tried to set the dialog title to include the World's display name, but it doesn't seem to be working. I thought it would work as long as I did it after the setupUi call

That appears to be because your wrong usage of the tr function. The second parameter is the "disambiguation" parameter. You seem to have confused it with QCoreApplication::translate, which does take a context first. But for tr, the context is set in the Q_OBJECT macro that defines the static tr function for that object.