Broadly speaking, the idea was to create two new classes, SmartLabel and SmartLineEdit replace the inheritance hierarchies of BtLabel and BtLineEdit. Having to create a new (albeit trivial) subclass of each of these for each new type of thing we want to measure was becoming unwieldy. Also, as @mikfire has previously noted, it's a pain to have to remember which version of BtLineEdit etc to use where in the .ui file.
There is slightly more to it, specifically:
BtLabel and all its subclasses (BtColorLabel, BtDensityLabel, etc) -> widgets/SmartLabel
BtLineEdit and all its subclasses (BtGenericEdit, BtMassEdit, etc) -> widgets/SmartLineEdit
BtDigitWidget and its subclasses (BtMassDigit, BtGenericDigit) -> widgets/SmartDigitWidget
UiAmountWithUnits -> SmartField (base class for SmartLineEdit and SmartDigitWidget)
New helper functions in SmartAmounts namespace, plus macros to call them
Various bits of .ui files are simplified as, eg, signal connections are done in code now.
Broadly speaking, the idea was to create two new classes,
SmartLabel
andSmartLineEdit
replace the inheritance hierarchies ofBtLabel
andBtLineEdit
. Having to create a new (albeit trivial) subclass of each of these for each new type of thing we want to measure was becoming unwieldy. Also, as @mikfire has previously noted, it's a pain to have to remember which version ofBtLineEdit
etc to use where in the .ui file.There is slightly more to it, specifically:
BtLabel
and all its subclasses (BtColorLabel
,BtDensityLabel
, etc) ->widgets/SmartLabel
BtLineEdit
and all its subclasses (BtGenericEdit
,BtMassEdit
, etc) ->widgets/SmartLineEdit
BtDigitWidget
and its subclasses (BtMassDigit
,BtGenericDigit
) ->widgets/SmartDigitWidget
UiAmountWithUnits
->SmartField
(base class forSmartLineEdit
andSmartDigitWidget
)SmartAmounts
namespace, plus macros to call themVarious bits of .ui files are simplified as, eg, signal connections are done in code now.
This should fix https://github.com/Brewtarget/brewtarget/issues/733
Also includes fixes for https://github.com/Brewtarget/brewtarget/issues/741 and https://github.com/Brewtarget/brewtarget/issues/743