- zapit-setup: formatting code using astyle; some manual code nicenings

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-12-06 05:18:19 +01:00
committed by Thilo Graf
parent 42da414020
commit bbd59e63eb
2 changed files with 57 additions and 57 deletions

View File

@@ -28,7 +28,6 @@
#include <config.h>
#endif
#include "zapit_setup.h"
#include <global.h>
@@ -38,7 +37,6 @@
#include <driver/screen_max.h>
CZapitSetup::CZapitSetup()
{
width = 40;
@@ -66,9 +64,10 @@ void CZapitSetup::changeStartChannel(CMenuForwarder* zapit1, CMenuForwarder* zap
int CZapitSetup::showMenu()
{
// menue init
CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT);
zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO);
CMenuWidget *zapit = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT);
zapit->addIntroItems(LOCALE_ZAPITSETUP_HEAD);
COnOffNotifier *miscZapitNotifier = new COnOffNotifier(1);
// zapit
CMenuOptionChooser *mc = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_USE, &g_settings.uselastchannel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, miscZapitNotifier, CRCInput::RC_red);
mc->setHint("", LOCALE_MENU_HINT_LAST_USE);
@@ -83,12 +82,13 @@ int CZapitSetup::showMenu()
zapit2->setHint("", LOCALE_MENU_HINT_LAST_RADIO);
#define CHANNEL_LIST_MODE_OPTION_COUNT 5
const CMenuOptionChooser::keyval CHANNEL_LIST_MODE_OPTIONS[CHANNEL_LIST_MODE_OPTION_COUNT] = {
{ -1, LOCALE_CHANNELLIST_REMEMBER }
, { LIST_MODE_FAV, LOCALE_CHANNELLIST_FAVS }
, { LIST_MODE_PROV, LOCALE_CHANNELLIST_PROVS }
, { LIST_MODE_SAT, LOCALE_CHANNELLIST_SATS }
, { LIST_MODE_ALL, LOCALE_CHANNELLIST_HEAD }
const CMenuOptionChooser::keyval CHANNEL_LIST_MODE_OPTIONS[CHANNEL_LIST_MODE_OPTION_COUNT] =
{
{ -1, LOCALE_CHANNELLIST_REMEMBER },
{ LIST_MODE_FAV, LOCALE_CHANNELLIST_FAVS },
{ LIST_MODE_PROV, LOCALE_CHANNELLIST_PROVS },
{ LIST_MODE_SAT, LOCALE_CHANNELLIST_SATS },
{ LIST_MODE_ALL, LOCALE_CHANNELLIST_HEAD }
};
CMenuOptionChooser *channel_mode = new CMenuOptionChooser(LOCALE_ZAPITSETUP_CHANNELMODE, &g_settings.channel_mode_initial, CHANNEL_LIST_MODE_OPTIONS, CHANNEL_LIST_MODE_OPTION_COUNT, true, NULL, CRCInput::RC_1);
@@ -124,7 +124,6 @@ CSelectChannelWidget::CSelectChannelWidget()
CSelectChannelWidget::~CSelectChannelWidget()
{
}
int CSelectChannelWidget::exec(CMenuTarget *parent, const std::string &actionKey)
@@ -148,18 +147,18 @@ int CSelectChannelWidget::exec(CMenuTarget* parent, const std::string& actionKey
t_channel_id channel_id = 0;
sscanf(&(actionKey[4]), "%u|%" SCNx64 "", &cnr, &channel_id);
if (strncmp(actionKey.c_str(), "ZCT:", 4) == 0)//...tv
if (strncmp(actionKey.c_str(), "ZCT:", 4) == 0) // tv
{
g_settings.StartChannelTV = actionKey.substr(actionKey.find_first_of("#") + 1);
g_settings.startchanneltv_id = channel_id;
}
else if (strncmp(actionKey.c_str(), "ZCR:", 4) == 0)//...radio
else if (strncmp(actionKey.c_str(), "ZCR:", 4) == 0) // radio
{
g_settings.StartChannelRadio = actionKey.substr(actionKey.find_first_of("#") + 1);
g_settings.startchannelradio_id = channel_id;
}
// ...leave bouquet/channel menu and show a refreshed zapit menu with current start channel(s)
// leave bouquet/channel menu and show a refreshed zapit menu with current start channel(s)
g_RCInput->postMsg(CRCInput::RC_timeout, 0);
return menu_return::RETURN_EXIT;
}
@@ -174,7 +173,8 @@ int CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mode
CMenuWidget mctv(LOCALE_TIMERLIST_BOUQUETSELECT, NEUTRINO_ICON_SETTINGS, width);
mctv.addIntroItems();
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) {
for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++)
{
CMenuWidget *mwtv = new CMenuWidget(LOCALE_TIMERLIST_CHANNELSELECT, NEUTRINO_ICON_SETTINGS, width);
toDelete.push_back(mwtv);
mwtv->addIntroItems();
@@ -183,7 +183,8 @@ int CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mode
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
else
g_bouquetManager->Bouquets[i]->getTvChannels(channels);
for(int j = 0; j < (int) channels.size(); j++) {
for (int j = 0; j < (int) channels.size(); j++)
{
CZapitChannel *channel = channels[j];
char cChannelId[60] = {0};
snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode == CZapitClient::MODE_TV) ? 'T' : 'R', channel->number, channel->getChannelID());

View File

@@ -56,7 +56,6 @@ public:
CSelectChannelWidget();
~CSelectChannelWidget();
int exec(CMenuTarget *parent, const std::string &actionKey);
};
#endif