On 03/06/2012 00:01, Hans-Dieter Hiep wrote:
Is there a reason the InsetParamsDialog doesn't use the
ButtonController, i.e. by inheriting from GuiDialog? Most of
InsetParamsDialog's implementation is a duplicate of
ButtonController's implementation. As such, both InsetParamsDialog and
ButtonController serve the same purpose, except that InsetParamsDialog
only supports one QLineEdit widget and associated QLabel.

My goal was to eventually get rid of the button controller and GuiDialog and convert those to either InsetParamsDialog or DialogView or DockView. Maybe I'll find the time to do that during next meeting :-)

  The
ButtonController is part of a GuiDialog, and InsetParamsDialog is not
a GuiDialog. I think InsetParamsDialog should also inherit from
GuiDialog to enhance maintainability and would like to take on this
task.

GuiDialog is a remnant of the past. It was designed at a common denominator of 3 different GUI toolkit and basically reinvents Qt's own control. It enforces the use of a QDialog, the use of the Button controller, etc. Typically, converting a GuiDialog based dialog for an InsetParams to InsetParamsWidget will divide the number of lines of code by 2 and offers more flexibility for the future. InsetParamsDialog enforces a comon behaviour for the buttons for all InsetParams which give consistency to the user experience. The fact that InsetParamsWidget is a QWidget means that we can embed it anywhere we want: DockWidget, super panel for multiple insets, etc.

So if you'd like to work on this, please continue to fix any design issue or bug that you may that in InsetParamsWidget/Dialog and better, port the older GuiDialog based class to the new classes.
If you insist that GuiDialog is better, well, we can debate a bit more :-)

Thanks and regards,
Abdel.

Reply via email to