Skip to content

Commit

Permalink
- keybind-setup: fix/introduce g_settings.bouquetlist_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vanhofen committed Dec 9, 2021
1 parent d19c6aa commit 7961b56
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 11 deletions.
5 changes: 2 additions & 3 deletions data/y-web/Y_Settings_buttons.yhtm
Expand Up @@ -232,9 +232,8 @@ function do_submit()
<td>&nbsp;OK-Taste f&uuml;r</td>
<td>
<select name="bouquetlist_mode" title="OK-Button for...">
<option value="0" selected="selected">Bouquet-Kan&auml;le</option>
<option value="1">Bouquetliste</option>
<option value="2">Kanalliste</option>
<option value="0" selected="selected">Kanalliste</option>
<option value="1">Favoriten</option>
</select>
</td>
</tr>
Expand Down
11 changes: 9 additions & 2 deletions src/gui/keybind_setup.cpp
Expand Up @@ -146,6 +146,13 @@ int CKeybindSetup::exec(CMenuTarget *parent, const std::string &actionKey)
return res;
}

#define KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT 2
const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT] =
{
{ SNeutrinoSettings::CHANNELLIST, LOCALE_KEYBINDINGMENU_CHANNELLIST },
{ SNeutrinoSettings::FAVORITES, LOCALE_KEYBINDINGMENU_FAVORITES }
};

#define KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT 3
const CMenuOptionChooser::keyval KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS[KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT] =
{
Expand Down Expand Up @@ -500,10 +507,10 @@ void CKeybindSetup::showKeyBindModeSetup(CMenuWidget *bindSettings_modes)
void CKeybindSetup::showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist)
{
bindSettings_chlist->addIntroItems(LOCALE_KEYBINDINGMENU_CHANNELLIST);
#if 0

CMenuOptionChooser *oj = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_BOUQUETHANDLING, &g_settings.bouquetlist_mode, KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS, KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT, true);
bindSettings_chlist->addItem(oj);
#endif

for (int i = NKEY_LIST_START; i <= NKEY_CURRENT_TRANSPONDER; i++)
{
CMenuForwarder *mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]);
Expand Down
31 changes: 26 additions & 5 deletions src/neutrino.cpp
Expand Up @@ -1619,6 +1619,11 @@ void CNeutrinoApp::upgradeSetup(const char * fname)
configfile.setString("usermenu_tv_yellow", g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items);
}
}
if (g_settings.version_pseudo < "20211209230000")
{
g_settings.bouquetlist_mode = SNeutrinoSettings::CHANNELLIST;
}


g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO;
configfile.setString("version_pseudo", g_settings.version_pseudo);
Expand Down Expand Up @@ -3858,10 +3863,26 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu)

if(msg == CRCInput::RC_ok)
{
if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0)
nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP!
else
nNewChannel = bouquetList->exec(true);
switch (g_settings.bouquetlist_mode)
{
case SNeutrinoSettings::FAVORITES:
{
SetChannelMode(LIST_MODE_FAV);
if (bouquetList->Bouquets.empty())
SetChannelMode(LIST_MODE_PROV);
nNewChannel = bouquetList->exec(true);
break;
}
case SNeutrinoSettings::CHANNELLIST:
default:
{
if( !bouquetList->Bouquets.empty() && bouquetList->Bouquets[old_b]->channelList->getSize() > 0)
nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP!
else
nNewChannel = bouquetList->exec(true);
break;
}
}
} else if(msg == CRCInput::RC_sat) {
SetChannelMode(LIST_MODE_SAT);
nNewChannel = bouquetList->exec(true);
Expand Down Expand Up @@ -5942,7 +5963,7 @@ void CNeutrinoApp::loadKeys(const char *fname)
g_settings.mpkey_time = tconfig->getInt32("mpkey.time", CRCInput::RC_timeshift);

// key options
g_settings.bouquetlist_mode = tconfig->getInt32("bouquetlist_mode", 1);
g_settings.bouquetlist_mode = tconfig->getInt32("bouquetlist_mode", SNeutrinoSettings::CHANNELLIST);
g_settings.menu_left_exit = tconfig->getInt32("menu_left_exit", 0);
g_settings.repeat_blocker = tconfig->getInt32("repeat_blocker", 450);
g_settings.repeat_genericblocker = tconfig->getInt32("repeat_genericblocker", 100);
Expand Down
6 changes: 6 additions & 0 deletions src/system/settings.h
Expand Up @@ -1268,6 +1268,12 @@ struct SNeutrinoSettings
INFOBAR = 3
};

enum BOUQUETHANDLING_SETTINGS
{
CHANNELLIST = 0,
FAVORITES = 2
};

int mode_left_right_key_tv;
};

Expand Down
2 changes: 1 addition & 1 deletion version_pseudo.h
@@ -1 +1 @@
#define NEUTRINO_VERSION_PSEUDO "20210801210000"
#define NEUTRINO_VERSION_PSEUDO "20211209230000"

0 comments on commit 7961b56

Please sign in to comment.