Closed damithc closed 7 years ago
'Jump to nth card' shortcut triggers an NPE although the jump still happens.
Would it be better if the Dialog
contains the loading/configurations and handles a Controller
? i.e. separate the restructured dialog into loader
and controller
.
Good point. That's the first design I tried i.e. each component had three parts.
[*UiPart]---->[*View] {this is the loader]
|
----------->[*Controller]
But after implementing it (this was how I spent my entire Saturday!) I realized
UiPart
was merely holding the other two objects and not doing anything elseController
Then I tried collapsing all three into one class and naming it *UiPart
instead of *Controller
but it turns out a controller cannot load itself. That's how I ended up with the separate loader.
Instead of the UI part having reference to both objects, I was thinking more along this line:
[MainWindow] ---> [*Dialog] ----> [*Controller]
The dialog here thus:
Tag
)BaseDialog
class/implements interface which contains a load()
/configure()
This might be better, and we can abstract away methods such as setEscKeyToDismiss
into the base class.
EDIT: Removed the UiPart
since I misunderstood its purpose.
Experimental restructuring of UI. Objectives:
Controller
to refer to the class that represents a part of the UIUiPartLoader
Just wanted to see if this is viable. I think I broke a few tests in the process (had to move fast).