- bouqueteditor_channels: allow to navigate with left/right through the bouquets

add corresponding context-icons to header
This commit is contained in:
svenhoefer
2017-09-27 14:13:28 +02:00
committed by Jacek Jendrzej
parent c00013ea52
commit e94e0780b0
3 changed files with 32 additions and 0 deletions

View File

@@ -355,6 +355,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
CBEChannelWidget* channelWidget = new CBEChannelWidget(ChannelWidgetCaption, selected);
channelWidget->exec(this, "");
selected = channelWidget->getBouquet();
if (channelWidget->hasChanged())
bouquetsChanged = true;
delete channelWidget;

View File

@@ -70,6 +70,8 @@ CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bou
status_icon_width = std::max(status_icon_width, iw);
frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &iw, &ih);
status_icon_width = std::max(status_icon_width, iw);
header.addContextButton(CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT);
}
CBEChannelWidget::~CBEChannelWidget()
@@ -416,6 +418,34 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
paintFoot();
paintItems();
}
else if (msg == CRCInput::RC_left || msg == CRCInput::RC_right)
{
unsigned int bouquet_size = g_bouquetManager->Bouquets.size();
if (msg == CRCInput::RC_left)
{
if (bouquet == 0)
bouquet = bouquet_size - 1;
else
bouquet--;
}
else
{
if (bouquet < bouquet_size - 1)
bouquet++;
else
bouquet = 0;
}
Channels = mode == CZapitClient::MODE_TV ? &(g_bouquetManager->Bouquets[bouquet]->tvChannels) : &(g_bouquetManager->Bouquets[bouquet]->radioChannels);
caption = g_bouquetManager->Bouquets[bouquet]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[bouquet]->Name;
selected = 0;
paintHead();
paintBody();
paintFoot();
paintItems();
}
else if (msg == CRCInput::RC_ok)
{
if (state == beDefault)

View File

@@ -89,6 +89,7 @@ class CBEChannelWidget : public CBEGlobals, public CMenuTarget, public CListHelp
ZapitChannelList * Channels;
int exec(CMenuTarget* parent, const std::string & actionKey);
bool hasChanged();
unsigned int getBouquet() { return bouquet; };
};
#endif