mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
- zapit-setup: formatting code using astyle; some manual code nicenings
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -28,7 +28,6 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "zapit_setup.h"
|
#include "zapit_setup.h"
|
||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
@@ -38,7 +37,6 @@
|
|||||||
|
|
||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
|
|
||||||
|
|
||||||
CZapitSetup::CZapitSetup()
|
CZapitSetup::CZapitSetup()
|
||||||
{
|
{
|
||||||
width = 40;
|
width = 40;
|
||||||
@@ -66,9 +64,10 @@ void CZapitSetup::changeStartChannel(CMenuForwarder* zapit1, CMenuForwarder* zap
|
|||||||
int CZapitSetup::showMenu()
|
int CZapitSetup::showMenu()
|
||||||
{
|
{
|
||||||
// menue init
|
// menue init
|
||||||
CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT);
|
CMenuWidget *zapit = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT);
|
||||||
zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO);
|
zapit->addIntroItems(LOCALE_ZAPITSETUP_HEAD);
|
||||||
COnOffNotifier *miscZapitNotifier = new COnOffNotifier(1);
|
COnOffNotifier *miscZapitNotifier = new COnOffNotifier(1);
|
||||||
|
|
||||||
// zapit
|
// 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);
|
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);
|
mc->setHint("", LOCALE_MENU_HINT_LAST_USE);
|
||||||
@@ -83,12 +82,13 @@ int CZapitSetup::showMenu()
|
|||||||
zapit2->setHint("", LOCALE_MENU_HINT_LAST_RADIO);
|
zapit2->setHint("", LOCALE_MENU_HINT_LAST_RADIO);
|
||||||
|
|
||||||
#define CHANNEL_LIST_MODE_OPTION_COUNT 5
|
#define CHANNEL_LIST_MODE_OPTION_COUNT 5
|
||||||
const CMenuOptionChooser::keyval CHANNEL_LIST_MODE_OPTIONS[CHANNEL_LIST_MODE_OPTION_COUNT] = {
|
const CMenuOptionChooser::keyval CHANNEL_LIST_MODE_OPTIONS[CHANNEL_LIST_MODE_OPTION_COUNT] =
|
||||||
{ -1, LOCALE_CHANNELLIST_REMEMBER }
|
{
|
||||||
, { LIST_MODE_FAV, LOCALE_CHANNELLIST_FAVS }
|
{ -1, LOCALE_CHANNELLIST_REMEMBER },
|
||||||
, { LIST_MODE_PROV, LOCALE_CHANNELLIST_PROVS }
|
{ LIST_MODE_FAV, LOCALE_CHANNELLIST_FAVS },
|
||||||
, { LIST_MODE_SAT, LOCALE_CHANNELLIST_SATS }
|
{ LIST_MODE_PROV, LOCALE_CHANNELLIST_PROVS },
|
||||||
, { LIST_MODE_ALL, LOCALE_CHANNELLIST_HEAD }
|
{ 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);
|
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()
|
CSelectChannelWidget::~CSelectChannelWidget()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CSelectChannelWidget::exec(CMenuTarget *parent, const std::string &actionKey)
|
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;
|
t_channel_id channel_id = 0;
|
||||||
sscanf(&(actionKey[4]), "%u|%" SCNx64 "", &cnr, &channel_id);
|
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 = actionKey.substr(actionKey.find_first_of("#") + 1);
|
||||||
g_settings.startchanneltv_id = channel_id;
|
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 = actionKey.substr(actionKey.find_first_of("#") + 1);
|
||||||
g_settings.startchannelradio_id = channel_id;
|
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);
|
g_RCInput->postMsg(CRCInput::RC_timeout, 0);
|
||||||
return menu_return::RETURN_EXIT;
|
return menu_return::RETURN_EXIT;
|
||||||
}
|
}
|
||||||
@@ -174,7 +173,8 @@ int CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mode
|
|||||||
CMenuWidget mctv(LOCALE_TIMERLIST_BOUQUETSELECT, NEUTRINO_ICON_SETTINGS, width);
|
CMenuWidget mctv(LOCALE_TIMERLIST_BOUQUETSELECT, NEUTRINO_ICON_SETTINGS, width);
|
||||||
mctv.addIntroItems();
|
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);
|
CMenuWidget *mwtv = new CMenuWidget(LOCALE_TIMERLIST_CHANNELSELECT, NEUTRINO_ICON_SETTINGS, width);
|
||||||
toDelete.push_back(mwtv);
|
toDelete.push_back(mwtv);
|
||||||
mwtv->addIntroItems();
|
mwtv->addIntroItems();
|
||||||
@@ -183,7 +183,8 @@ int CSelectChannelWidget::InitZapitChannelHelper(CZapitClient::channelsMode mode
|
|||||||
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
|
g_bouquetManager->Bouquets[i]->getRadioChannels(channels);
|
||||||
else
|
else
|
||||||
g_bouquetManager->Bouquets[i]->getTvChannels(channels);
|
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];
|
CZapitChannel *channel = channels[j];
|
||||||
char cChannelId[60] = {0};
|
char cChannelId[60] = {0};
|
||||||
snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode == CZapitClient::MODE_TV) ? 'T' : 'R', channel->number, channel->getChannelID());
|
snprintf(cChannelId, sizeof(cChannelId), "ZC%c:%d|%" PRIx64 "#", (mode == CZapitClient::MODE_TV) ? 'T' : 'R', channel->number, channel->getChannelID());
|
||||||
|
@@ -56,7 +56,6 @@ public:
|
|||||||
CSelectChannelWidget();
|
CSelectChannelWidget();
|
||||||
~CSelectChannelWidget();
|
~CSelectChannelWidget();
|
||||||
int exec(CMenuTarget *parent, const std::string &actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user