fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

QtFRED dialogs: consistent reusable attributes and handlers

Open Goober5000 opened this issue 1 year ago • 2 comments

From PR #6322, in regards to void ShipCustomWarpDialog::rejectHandler():

This seems like a common enough pattern that it should be in the superclass or in a utility function somewhere, though maybe that's beyond the scope of this PR.

And also in regards to void ShipCustomWarpDialog::startSoundChanged():

The string wrangling should definitely be in a utility function. If you want to do that in a different PR that's fine; but if string wrangling is necessary, then there should be qtFRED-wide utility functions for converting from Qstring to std::string and vice versa.

More generally, it would be useful to reuse code as much as possible in qtFRED, since a lot of the dialogs involve a lot of boilerplate. Templates and pointers-to-members could help here, so for example a simple get/set of an attribute could use templated logic that applies for all such simple fields in the dialog.

Goober5000 avatar Dec 12 '24 20:12 Goober5000

Assign all these to me and I'll see them done over the next week or so.

TheForce172 avatar Dec 13 '24 05:12 TheForce172

Ok @TheForce172 , you said #6493 implements half of this. Do you have a plan for the other half?

Goober5000 avatar Jan 09 '25 19:01 Goober5000