Skip to content

Architecture

Samie Bee edited this page Jul 13, 2023 · 7 revisions

Click individual classes in the following diagram to access their individual documentation pages.

View the Architecture diagram here.

View earlier versions of the architecture here.

Key Files and Classes

The script you actually run to launch the ENLIGHTEN application is scripts/Enlighten.py.

This script defines an EnlightenApplication object which instantiates a Controller instance, which is the real heart of the show. This remains a somewhat bloated class and it remains a goal to continue shrinking it down into a more maintainable set of encapsulated objects. Milestones toward achieving that refactoring are the many "Business Objects" which increasingly encapsulate key functions.

The GUI itself is defined in enlighten/assets/enlighten_layout.ui, an XML file you will rarely (but occasionally) want to edit by-hand. Typically you edit it graphically using the Qt Designer utility ("make designer").

(Watch some YouTube videos on "Qt layouts" if you're new to this tool.)

Business Object Architecture

The goal is for a business object to "own" its own GUI elements, which is why many of them take long lists of QWidgets in their constructor. Once passed to the business object, that class is expected to:

  • bind widget callbacks to its own local functions
  • initialize widget values from enlighten.Configuration.Configuration, and save updated values back to that config so they're persisted at shutdown
Clone this wiki locally