feat(el18): Use trim hats as keys for navigation (#3894)
Co-authored-by: elecpower <neilh713@tpg.com.au> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
elecpower
Peter Feerick
parent
b733ec4eae
commit
f40fa1a64b
@@ -129,6 +129,8 @@ void GeneralSettings::init()
|
||||
backlightDelay = 2; // 2 * 5 = 10 secs
|
||||
inactivityTimer = 10;
|
||||
|
||||
hatsMode = HATSMODE_SWITCHABLE;
|
||||
|
||||
// backlightBright = 0; // 0 = 100%
|
||||
|
||||
if (IS_FAMILY_HORUS_OR_T16(board)) {
|
||||
@@ -675,6 +677,42 @@ AbstractStaticItemModel * GeneralSettings::uartSampleModeItemModel()
|
||||
return mdl;
|
||||
}
|
||||
|
||||
QString GeneralSettings::hatsModeToString() const
|
||||
{
|
||||
return hatsModeToString(hatsMode);
|
||||
}
|
||||
|
||||
// static
|
||||
QString GeneralSettings::hatsModeToString(int value)
|
||||
{
|
||||
switch(value) {
|
||||
case HATSMODE_TRIMS_ONLY:
|
||||
return tr("Trims only");
|
||||
case HATSMODE_KEYS_ONLY:
|
||||
return tr("Keys only");
|
||||
case HATSMODE_SWITCHABLE:
|
||||
return tr("Switchable");
|
||||
case HATSMODE_GLOBAL:
|
||||
return tr("Global");
|
||||
default:
|
||||
return CPN_STR_UNKNOWN_ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
AbstractStaticItemModel * GeneralSettings::hatsModeItemModel(bool radio_setup)
|
||||
{
|
||||
AbstractStaticItemModel * mdl = new AbstractStaticItemModel();
|
||||
mdl->setName(AIM_GS_HATSMODE);
|
||||
|
||||
for (int i = 0; i < HATSMODE_COUNT; i++) {
|
||||
mdl->appendToItemList(hatsModeToString(i), i, i == HATSMODE_GLOBAL && radio_setup ? false : true);
|
||||
}
|
||||
|
||||
mdl->loadItemList();
|
||||
return mdl;
|
||||
}
|
||||
|
||||
/*
|
||||
TrainerMix
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user