Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 748ac5faf482b3a475f75530f972074d8e724bad (commit)
via ca75825eda2c655bbbfa44ff7720061e6e81c24a (commit)
via e3067794a3d9cacc8eef78134abcadf7bb238780 (commit)
via 44e467d2069f39618e488cacdbeb8071c76e3436 (commit)
via e825376f3a58902806c4cf96e278bb49b039211f (commit)
via be9752cd5487884fca4bd20d43b849eefeba1b4e (commit)
via a744299f0b646b36c6a1e1d185d76efd7fdcd4eb (commit)
via 98515b993e9fd66795b9e4e83f29d9a914fc4ae0 (commit)
via 8d66985acb23003f08c2adffb5a88208c9220dff (commit)
via 758d8b7e1c3a50b5545aedca33f090045c7063b8 (commit)
via a08eebdc9b737e9987da12a6b906d5f74542303f (commit)
via d680e1d391ea0433d9d979858ca63f3151574f85 (commit)
via e70d4041d96883016bc1a4efe40853194f13ccf6 (commit)
from 2577990c6e8effa45d04738e87c8082cf3ffe52d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 748ac5faf482b3a475f75530f972074d8e724bad
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Mon Jun 17 22:42:08 2013 +0200
Neutrino CMenuWidget: move duplicate code into new method updateSelection()
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/widget/menue.cpp
b/tuxbox/neutrino/src/gui/widget/menue.cpp
index 0d16b68..99a7d30 100644
--- a/tuxbox/neutrino/src/gui/widget/menue.cpp
+++ b/tuxbox/neutrino/src/gui/widget/menue.cpp
@@ -430,27 +430,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
else
pos = (selected +
count) % items.size();
- CMenuItem* item = items[pos];
-
- if (item->isSelectable())
- {
- if ((pos <
page_start[current_page + 1]) &&
- (pos >=
page_start[current_page]))
- { // Item is currently
on screen
- //clear prev.
selected
-
items[selected]->paint(false);
- //select new
-
item->paint(true);
- selected = pos;
- break;
- }
- else
- {
- selected = pos;
- paintItems();
- break;
- }
- }
+ if (updateSelection(pos))
+ break;
}
break;
}
@@ -507,22 +488,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
pos =
page_start[current_page] - 1;
for (unsigned int count
= pos; count > 0; count--)
{
- CMenuItem* item
= items[pos];
- if
(item->isSelectable())
- {
- if
((pos < page_start[current_page + 1]) && (pos >= page_start[current_page]))
- {
-
items[selected]->paint(false);
-
item->paint(true);
-
selected = pos;
- }
- else
- {
-
selected = pos;
-
paintItems();
- }
+ if
(updateSelection(pos))
break;
- }
pos--;
}
}
@@ -531,22 +498,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
pos = 0;
for (unsigned int count
= 0; count < items.size(); count++)
{
- CMenuItem* item
= items[pos];
- if
(item->isSelectable())
- {
- if
((pos < page_start[current_page + 1]) && (pos >= page_start[current_page]))
- {
-
items[selected]->paint(false);
-
item->paint(true);
-
selected = pos;
- }
- else
- {
-
selected = pos;
-
paintItems();
- }
+ if
(updateSelection(pos))
break;
- }
pos++;
}
}
@@ -558,22 +511,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
pos = items.size() - 1;
for (unsigned int count = pos;
count < items.size(); count++)
{
- CMenuItem* item =
items[pos];
- if
(item->isSelectable())
- {
- if ((pos <
page_start[current_page + 1]) && (pos >= page_start[current_page]))
- {
-
items[selected]->paint(false);
-
item->paint(true);
-
selected = pos;
- }
- else
- {
-
selected = pos;
-
paintItems();
- }
+ if
(updateSelection(pos))
break;
- }
pos++;
}
}
@@ -732,7 +671,7 @@ void CMenuWidget::paintItems()
}
else
{
- ypos = item->paint(selected==((signed int)
count) );
+ ypos = item->paint(selected == count);
}
}
else
@@ -743,6 +682,30 @@ void CMenuWidget::paintItems()
}
}
+bool CMenuWidget::updateSelection(int pos)
+{
+ CMenuItem* item = items[pos];
+ if (item->isSelectable())
+ {
+ if ((pos < page_start[current_page + 1]) &&
+ (pos >= page_start[current_page]))
+ { // Item is currently on screen
+ //clear prev. selected
+ items[selected]->paint(false);
+ //select new
+ item->paint(true);
+ selected = pos;
+ }
+ else
+ {
+ selected = pos;
+ paintItems();
+ }
+ return true;
+ }
+ return false;
+}
+
/*adds the typical menu intro with optional subhead, separator, back button
and separatorline to menu*/
void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text,
neutrino_locale_t section_text, int buttontype)
{
diff --git a/tuxbox/neutrino/src/gui/widget/menue.h
b/tuxbox/neutrino/src/gui/widget/menue.h
index bb0d6c4..c1be247 100644
--- a/tuxbox/neutrino/src/gui/widget/menue.h
+++ b/tuxbox/neutrino/src/gui/widget/menue.h
@@ -320,6 +320,7 @@ class CMenuWidget : public CMenuTarget
unsigned int total_pages;
virtual void paintItems();
+ virtual bool updateSelection(int pos);
public:
CMenuWidget();
commit ca75825eda2c655bbbfa44ff7720061e6e81c24a
Author: Stefan Seyfried <se...@tuxbox-git.slipkontur.de>
Date: Mon Jun 17 20:43:49 2013 +0200
Neutrino CMenuWidget: make page_start[] int, avoids lots of casts
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/widget/menue.cpp
b/tuxbox/neutrino/src/gui/widget/menue.cpp
index bd4db51..0d16b68 100644
--- a/tuxbox/neutrino/src/gui/widget/menue.cpp
+++ b/tuxbox/neutrino/src/gui/widget/menue.cpp
@@ -434,8 +434,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
if (item->isSelectable())
{
- if ((pos <
(int)page_start[current_page + 1]) &&
- (pos >=
(int)page_start[current_page]))
+ if ((pos <
page_start[current_page + 1]) &&
+ (pos >=
page_start[current_page]))
{ // Item is currently
on screen
//clear prev.
selected
items[selected]->paint(false);
@@ -504,13 +504,13 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
{
if (current_page)
{
- pos =
(int)page_start[current_page] - 1;
+ pos =
page_start[current_page] - 1;
for (unsigned int count
= pos; count > 0; count--)
{
CMenuItem* item
= items[pos];
if
(item->isSelectable())
{
- if
((pos < (int)page_start[current_page + 1]) && (pos >=
(int)page_start[current_page]))
+ if
((pos < page_start[current_page + 1]) && (pos >= page_start[current_page]))
{
items[selected]->paint(false);
item->paint(true);
@@ -534,7 +534,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
CMenuItem* item
= items[pos];
if
(item->isSelectable())
{
- if
((pos < (int)page_start[current_page + 1]) && (pos >=
(int)page_start[current_page]))
+ if
((pos < page_start[current_page + 1]) && (pos >= page_start[current_page]))
{
items[selected]->paint(false);
item->paint(true);
@@ -553,7 +553,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
}
else if (msg ==
g_settings.key_menu_pagedown)
{
- pos =
(int)page_start[current_page + 1];
+ pos = page_start[current_page +
1];
if (pos >= (int)items.size())
pos = items.size() - 1;
for (unsigned int count = pos;
count < items.size(); count++)
@@ -561,7 +561,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const
std::string &)
CMenuItem* item =
items[pos];
if
(item->isSelectable())
{
- if ((pos <
(int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page]))
+ if ((pos <
page_start[current_page + 1]) && (pos >= page_start[current_page]))
{
items[selected]->paint(false);
item->paint(true);
@@ -703,9 +703,9 @@ void CMenuWidget::paintItems()
//Item not currently on screen
if (selected >= 0)
{
- while(selected < (int)page_start[current_page])
+ while(selected < page_start[current_page])
current_page--;
- while(selected >= (int)page_start[current_page + 1])
+ while(selected >= page_start[current_page + 1])
current_page++;
}
@@ -717,7 +717,7 @@ void CMenuWidget::paintItems()
}
frameBuffer->paintBoxRel(x,item_start_y, width,item_height,
COL_MENUCONTENT_PLUS_0);
int ypos=item_start_y;
- for (unsigned int count = 0; count < items.size(); count++)
+ for (int count = 0; count < (int)items.size(); count++)
{
CMenuItem* item = items[count];
diff --git a/tuxbox/neutrino/src/gui/widget/menue.h
b/tuxbox/neutrino/src/gui/widget/menue.h
index 1a0de0a..bb0d6c4 100644
--- a/tuxbox/neutrino/src/gui/widget/menue.h
+++ b/tuxbox/neutrino/src/gui/widget/menue.h
@@ -303,7 +303,7 @@ class CMenuWidget : public CMenuTarget
std::string nameString;
CFrameBuffer *frameBuffer;
std::vector<CMenuItem*> items;
- std::vector<unsigned int> page_start;
+ std::vector<int> page_start;
std::string iconfile;
int width;
commit e3067794a3d9cacc8eef78134abcadf7bb238780
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Mon Jun 17 18:38:04 2013 +0200
Neutrino: don't restore old selection in bouquets if cancelled
this is not needed because current bouquet and channel are selected
automatically after closing the channel list, so let's keep current
position in all other bouquets
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/channellist.cpp
b/tuxbox/neutrino/src/gui/channellist.cpp
index bc41c5c..7b64849 100644
--- a/tuxbox/neutrino/src/gui/channellist.cpp
+++ b/tuxbox/neutrino/src/gui/channellist.cpp
@@ -108,8 +108,10 @@ CChannelList::CChannelList(const char * const Name, bool
hMode, bool UsedInBouqu
CChannelList::~CChannelList()
{
if (!usedInBouquet)
+ {
for (std::vector<CChannel *>::iterator it = chanlist.begin();
it != chanlist.end(); ++it)
delete (*it);
+ }
chanlist.clear();
}
@@ -360,7 +362,8 @@ int CChannelList::show()
if (msg == CRCInput::RC_timeout || msg ==
g_settings.key_channelList_cancel)
{
- selected = oldselected;
+ if (!usedInBouquet)
+ selected = oldselected;
loop=false;
}
else if (msg_repeatok == CRCInput::RC_up || msg_repeatok ==
g_settings.key_channelList_pageup)
@@ -414,7 +417,8 @@ int CChannelList::show()
(CRCInput::isNumeric(msg)) )
{
//pushback key if...
- selected = oldselected;
+ if (!usedInBouquet)
+ selected = oldselected;
g_RCInput->postMsg( msg, data );
loop=false;
}
commit 44e467d2069f39618e488cacdbeb8071c76e3436
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Sun Jun 16 19:39:49 2013 +0200
Neutrino: store channels only once in memory
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/bouquetlist.h
b/tuxbox/neutrino/src/gui/bouquetlist.h
index a541c3c..c5a2d10 100644
--- a/tuxbox/neutrino/src/gui/bouquetlist.h
+++ b/tuxbox/neutrino/src/gui/bouquetlist.h
@@ -61,7 +61,7 @@ class CBouquet
{
unique_key = Unique_key;
bLocked = locked;
- channelList = new CChannelList(Name);
+ channelList = new CChannelList(Name, false, true);
}
~CBouquet()
diff --git a/tuxbox/neutrino/src/gui/channellist.cpp
b/tuxbox/neutrino/src/gui/channellist.cpp
index a729c39..bc41c5c 100644
--- a/tuxbox/neutrino/src/gui/channellist.cpp
+++ b/tuxbox/neutrino/src/gui/channellist.cpp
@@ -88,7 +88,7 @@ CChannelList::CChannel::CChannel(const int _key, const int
_number, const std::s
}
-CChannelList::CChannelList(const char * const Name, bool hMode)
+CChannelList::CChannelList(const char * const Name, bool hMode, bool
UsedInBouquet)
{
frameBuffer = CFrameBuffer::getInstance();
if (pig == NULL)
@@ -101,15 +101,15 @@ CChannelList::CChannelList(const char * const Name, bool
hMode)
tuned=0xfffffff;
zapProtection = NULL;
this->historyMode = hMode;
+ usedInBouquet = UsedInBouquet;
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
}
CChannelList::~CChannelList()
{
- for (std::vector<CChannel *>::iterator it = chanlist.begin(); it !=
chanlist.end(); ++it)
- {
- delete (*it);
- }
+ if (!usedInBouquet)
+ for (std::vector<CChannel *>::iterator it = chanlist.begin();
it != chanlist.end(); ++it)
+ delete (*it);
chanlist.clear();
}
diff --git a/tuxbox/neutrino/src/gui/channellist.h
b/tuxbox/neutrino/src/gui/channellist.h
index a39c033..510d9c3 100644
--- a/tuxbox/neutrino/src/gui/channellist.h
+++ b/tuxbox/neutrino/src/gui/channellist.h
@@ -111,6 +111,7 @@ class CChannelList
CEPGData epgData;
bool historyMode;
+ bool usedInBouquet;
bool displayNext;
bool displayList;
@@ -136,7 +137,7 @@ class CChannelList
void processTextToArray(std::string text);
public:
- CChannelList(const char * const Name, bool historyMode = false
);
+ CChannelList(const char * const Name, bool historyMode = false,
bool UsedInBouquet = false);
~CChannelList();
void addChannel(int key, int number, const std::string& name,
const t_satellite_position satellitePosition, t_channel_id ids = 0); // UTF-8
void addChannel(CChannel* chan);
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index b8f7791..232465e 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -1480,7 +1480,7 @@ void CNeutrinoApp::channelsInit(int init_mode, int _mode)
for (uint j = 0; j < zapitChannels.size(); j++)
{
- CChannelList::CChannel* channel = new
CChannelList::CChannel(zapitChannels[j].nr, zapitChannels[j].nr,
zapitChannels[j].name, zapitChannels[j].satellitePosition,
zapitChannels[j].channel_id); // UTF-8
+ CChannelList::CChannel* channel =
channelListTV->getChannel(zapitChannels[j].nr);
/* observe that "bouquetList->Bouquets[i]" refers to
the bouquet we just created using bouquetList->addBouquet */
bouquetListTV->Bouquets[i]->channelList->addChannel(channel);
@@ -1528,7 +1528,7 @@ void CNeutrinoApp::channelsInit(int init_mode, int _mode)
for (uint j = 0; j < zapitChannels.size(); j++)
{
- CChannelList::CChannel* channel = new
CChannelList::CChannel(zapitChannels[j].nr, zapitChannels[j].nr,
zapitChannels[j].name, zapitChannels[j].satellitePosition,
zapitChannels[j].channel_id); // UTF-8
+ CChannelList::CChannel* channel =
channelListRADIO->getChannel(zapitChannels[j].nr);
/* observe that "bouquetList->Bouquets[i]" refers to
the bouquet we just created using bouquetList->addBouquet */
bouquetListRADIO->Bouquets[i]->channelList->addChannel(channel);
@@ -1604,7 +1604,7 @@ void CNeutrinoApp::channelsInit4Record(void)
for (uint j = 0; j < zapitChannels.size(); j++)
{
channel_nr++;
- CChannelList::CChannel* channel = new
CChannelList::CChannel(channel_nr, channel_nr, zapitChannels[j].name,
zapitChannels[j].satellitePosition, zapitChannels[j].channel_id); // UTF-8
+ CChannelList::CChannel* channel =
channelListRecord->getChannel(channel_nr);
/* observe that "bouquetList->Bouquets[i]" refers to
the bouquet we just created using bouquetList->addBouquet */
bouquetListRecord->Bouquets[i]->channelList->addChannel(channel);
commit e825376f3a58902806c4cf96e278bb49b039211f
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Sun Jun 16 16:31:05 2013 +0200
Neutrino: fix numbering of channels in bouquets while recording
this also fixes some segfaults in channel list when switching channels or
navigating through bouquets while recording
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/bouquetlist.cpp
b/tuxbox/neutrino/src/gui/bouquetlist.cpp
index 3a28a1f..c8f35dd 100644
--- a/tuxbox/neutrino/src/gui/bouquetlist.cpp
+++ b/tuxbox/neutrino/src/gui/bouquetlist.cpp
@@ -102,7 +102,7 @@ void CBouquetList::adjustToChannel( int nChannelNr)
{
for (uint i=0; i<Bouquets.size(); i++)
{
- int nChannelPos = CNeutrinoApp::getInstance ()->recordingstatus
?nChannelNr-1: Bouquets[i]->channelList->hasChannel(nChannelNr);
+ int nChannelPos =
Bouquets[i]->channelList->hasChannel(nChannelNr);
if (nChannelPos > -1)
{
selected = i;
diff --git a/tuxbox/neutrino/src/gui/channellist.cpp
b/tuxbox/neutrino/src/gui/channellist.cpp
index 5663cab..a729c39 100644
--- a/tuxbox/neutrino/src/gui/channellist.cpp
+++ b/tuxbox/neutrino/src/gui/channellist.cpp
@@ -1315,7 +1315,7 @@ void CChannelList::paintItem(int pos)
title_offset=6;
}
- snprintf((char*) tmp, sizeof(tmp), "%d", this->historyMode ?
pos : CNeutrinoApp::getInstance ()->recordingstatus ? curr+1 : chan->number);
+ snprintf((char*) tmp, sizeof(tmp), "%d", this->historyMode ?
pos : chan->number);
CChannelEvent *p_event = NULL;
if (displayNext) {
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 3f4774b..b8f7791 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -1504,8 +1504,8 @@ void CNeutrinoApp::channelsInit(int init_mode, int _mode)
// same for the RADIO channels
if (channelListRADIO)
delete channelListRADIO;
-
channelListRADIO = new
CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
+
g_Zapit->getChannels(zapitChannels, CZapitClient::MODE_RADIO,
CZapitClient::SORT_BOUQUET, true); // UTF-8
for(uint i=0; i<zapitChannels.size(); i++)
{
@@ -1571,22 +1571,26 @@ void CNeutrinoApp::channelsInit4Record(void)
CZapitClient::BouquetChannelList zapitChannels;
CZapitClient::BouquetList zapitBouquets;
+ int channel_nr = 0;
//deleting old channelList for mode-switching.
if (channelListRecord)
delete channelListRecord;
-
channelListRecord = new
CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
+
g_Zapit->getChannels(zapitChannels, CZapitClient::MODE_CURRENT,
CZapitClient::SORT_BOUQUET, true); // UTF-8
for(uint i=0; i<zapitChannels.size(); i++)
{
- channelListRecord->addChannel(zapitChannels[i].nr,
zapitChannels[i].nr, zapitChannels[i].name, zapitChannels[i].satellitePosition,
zapitChannels[i].channel_id); // UTF-8
+ channel_nr++;
+ channelListRecord->addChannel(channel_nr, channel_nr,
zapitChannels[i].name, zapitChannels[i].satellitePosition,
zapitChannels[i].channel_id); // UTF-8
}
+ channel_nr = 0;
+
if (bouquetListRecord)
delete bouquetListRecord;
bouquetListRecord = new CBouquetList();
- bouquetListRecord ->orgChannelList = channelListRecord;
+ bouquetListRecord->orgChannelList = channelListRecord;
/* load non-empty bouquets only */
g_Zapit->getBouquets(zapitBouquets, false, true); // UTF-8
@@ -1599,7 +1603,8 @@ void CNeutrinoApp::channelsInit4Record(void)
for (uint j = 0; j < zapitChannels.size(); j++)
{
- CChannelList::CChannel* channel = new
CChannelList::CChannel(zapitChannels[j].nr, zapitChannels[j].nr,
zapitChannels[j].name, zapitChannels[j].satellitePosition,
zapitChannels[j].channel_id); // UTF-8
+ channel_nr++;
+ CChannelList::CChannel* channel = new
CChannelList::CChannel(channel_nr, channel_nr, zapitChannels[j].name,
zapitChannels[j].satellitePosition, zapitChannels[j].channel_id); // UTF-8
/* observe that "bouquetList->Bouquets[i]" refers to
the bouquet we just created using bouquetList->addBouquet */
bouquetListRecord->Bouquets[i]->channelList->addChannel(channel);
@@ -2457,9 +2462,9 @@ void CNeutrinoApp::RealRun(CMenuWidget &menu)
int nNewChannel =
bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->show();
if(nNewChannel>-1)
{
- recordingstatus ?
channelList->zapTo(nNewChannel):
channelList->zapTo(bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->getKey(nNewChannel)-1);
+
channelList->zapTo(bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->getKey(nNewChannel)-1);
}
- else if(nNewChannel == -1 &&
recordingstatus == 0)
+ else if(nNewChannel == -1)
{
bouquetList->adjustToChannel(channelList->getActiveChannelNumber());
}
commit be9752cd5487884fca4bd20d43b849eefeba1b4e
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Sat Jun 15 15:39:12 2013 +0200
Neutrino: always show bouquet of current channel first in channel list
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index e13acf2..3f4774b 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -2459,6 +2459,10 @@ void CNeutrinoApp::RealRun(CMenuWidget &menu)
{
recordingstatus ?
channelList->zapTo(nNewChannel):
channelList->zapTo(bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->getKey(nNewChannel)-1);
}
+ else if(nNewChannel == -1 &&
recordingstatus == 0)
+ {
+
bouquetList->adjustToChannel(channelList->getActiveChannelNumber());
+ }
}
else
{
commit a744299f0b646b36c6a1e1d185d76efd7fdcd4eb
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Sat Jun 15 15:37:44 2013 +0200
Neutrino channel list: don't paint PIG multiple times
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/channellist.cpp
b/tuxbox/neutrino/src/gui/channellist.cpp
index c0f4a8c..5663cab 100644
--- a/tuxbox/neutrino/src/gui/channellist.cpp
+++ b/tuxbox/neutrino/src/gui/channellist.cpp
@@ -1545,7 +1545,9 @@ void CChannelList::paint()
if (g_settings.channellist_additional == ADDITIONAL_MTV) // with miniTV
{
- if(CNeutrinoApp::getInstance()->getMode() ==
NeutrinoMessages::mode_tv) {
+ if (CNeutrinoApp::getInstance()->getMode() ==
NeutrinoMessages::mode_tv &&
+ pig->getStatus() == CPIG::HIDE)
+ {
// paint PIG
#if defined BOXMODEL_DM500 || defined HAVE_IPBOX_HARDWARE
// the dm500 seems to like only half / quarter
resolution...
commit 98515b993e9fd66795b9e4e83f29d9a914fc4ae0
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Sat Jun 15 15:35:39 2013 +0200
Neutrino channel list: make member 'pig' static
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/channellist.cpp
b/tuxbox/neutrino/src/gui/channellist.cpp
index bb3c215..c0f4a8c 100644
--- a/tuxbox/neutrino/src/gui/channellist.cpp
+++ b/tuxbox/neutrino/src/gui/channellist.cpp
@@ -74,6 +74,8 @@ extern "C" int tuxtxt_stop();
#define ConnectLineBox_Width 12
+CPIG * CChannelList::pig = NULL;
+
CChannelList::CChannel::CChannel(const int _key, const int _number, const
std::string& _name, const t_satellite_position _satellitePosition, const
t_channel_id ids)
{
key = _key;
@@ -89,7 +91,8 @@ CChannelList::CChannel::CChannel(const int _key, const int
_number, const std::s
CChannelList::CChannelList(const char * const Name, bool hMode)
{
frameBuffer = CFrameBuffer::getInstance();
- pig = new CPIG(0);
+ if (pig == NULL)
+ pig = new CPIG(0);
x = y = 0;
info_height = 0;
name = Name;
@@ -108,7 +111,6 @@ CChannelList::~CChannelList()
delete (*it);
}
chanlist.clear();
- delete pig;
}
int CChannelList::exec()
diff --git a/tuxbox/neutrino/src/gui/channellist.h
b/tuxbox/neutrino/src/gui/channellist.h
index 17393d8..a39c033 100644
--- a/tuxbox/neutrino/src/gui/channellist.h
+++ b/tuxbox/neutrino/src/gui/channellist.h
@@ -93,7 +93,7 @@ class CChannelList
int eventFont;
int ffheight;
- CPIG *pig;
+ static CPIG *pig;
std::string name;
std::vector<CChannel*> chanlist;
commit 8d66985acb23003f08c2adffb5a88208c9220dff
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Sun Jun 9 19:09:10 2013 +0200
Neutrino: use defines for styles in CNeutrinoApp::SetupFonts()
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 59fcc33..e13acf2 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -1767,7 +1767,7 @@ void CNeutrinoApp::SetupFonts()
else{
font.filename = strdup(g_settings.font_file);
}
- style[0] = g_fontRenderer->AddFont(font.filename);
+ style[FONT_STYLE_REGULAR] = g_fontRenderer->AddFont(font.filename);
if(font.name != NULL)
free((void *)font.name);
@@ -1776,9 +1776,9 @@ void CNeutrinoApp::SetupFonts()
printf("[neutrino] font family %s\n", font.name);
- style[1] = "Bold Regular";
+ style[FONT_STYLE_BOLD] = "Bold Regular";
- style[2] = g_fontRenderer->AddFont(font.filename, true); // make
italics
+ style[FONT_STYLE_ITALIC] = g_fontRenderer->AddFont(font.filename,
true); // make italics
for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++)
{
commit 758d8b7e1c3a50b5545aedca33f090045c7063b8
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Fri Jun 7 21:33:30 2013 +0200
Neutrino image info: fix paint with new standard font
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/src/gui/imageinfo.cpp
b/tuxbox/neutrino/src/gui/imageinfo.cpp
index e8dc842..9e52ef5 100644
--- a/tuxbox/neutrino/src/gui/imageinfo.cpp
+++ b/tuxbox/neutrino/src/gui/imageinfo.cpp
@@ -607,7 +607,7 @@ void CImageInfo::paint()
ypos += iheight;
//license lines
- ypos += sheight;
+ ypos += iheight;
paintLicense(ypos);
//paint foot
commit a08eebdc9b737e9987da12a6b906d5f74542303f
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Fri Jun 7 19:39:03 2013 +0200
Neutrino: fix memleaks when using getFont()
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/lcdapi.cpp
b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/lcdapi.cpp
index bc8fc68..722313d 100755
--- a/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/lcdapi.cpp
+++ b/tuxbox/neutrino/daemons/nhttpd/tuxboxapi/lcdapi.cpp
@@ -97,6 +97,7 @@ void CLCDAPI::DrawText(int px, int py, int psize, int pcolor,
int pfont, char *p
return;
}
font->RenderString(px, py, 130, pmsg, color, 0, true); // UTF-8
+ delete font;
}
bool CLCDAPI::ShowPng(char *filename)
diff --git a/tuxbox/neutrino/src/driver/lcdd.cpp
b/tuxbox/neutrino/src/driver/lcdd.cpp
index 39b4926..3ecd059 100644
--- a/tuxbox/neutrino/src/driver/lcdd.cpp
+++ b/tuxbox/neutrino/src/driver/lcdd.cpp
@@ -68,6 +68,9 @@ CLCD::CLCD()
m_progressLocal = 0;
#endif // LCD_UPDATE
fontRenderer = NULL;
+ fonts.menu = NULL;
+ fonts.time = NULL;
+ fonts.channelname = NULL;
muted = false;
percentOver = 0;
volume = 0;
@@ -199,8 +202,10 @@ const char * const background_path[NUMBER_OF_PATHS] = {
bool CLCD::lcdInit(const char *fontfile, const char *fontfile2, const char
*fontfile3)
{
- if (fontRenderer != NULL)
- delete fontRenderer;
+ delete fonts.menu;
+ delete fonts.time;
+ delete fonts.channelname;
+ delete fontRenderer;
fontRenderer = new LcdFontRenderClass(&display);
const char * style_name = fontRenderer->AddFont(fontfile);
commit d680e1d391ea0433d9d979858ca63f3151574f85
Author: Christian Schuett <gaucho...@hotmail.com>
Date: Wed Jun 5 18:44:04 2013 +0200
zapit: only change saved last and start channels if needed
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/dvb/zapit/src/zapit.cpp b/dvb/zapit/src/zapit.cpp
index 8375692..8f90097 100644
--- a/dvb/zapit/src/zapit.cpp
+++ b/dvb/zapit/src/zapit.cpp
@@ -716,10 +716,16 @@ void saveSettings(bool write)
if (write) {
config.setBool("saveLastChannel", saveLastChannel);
config.setInt32("lastChannelMode", (currentMode & RADIO_MODE) ?
1 : 0);
- config.setInt32("lastChannelRadio", lastChannelRadio);
- config.setInt32("lastChannelTV", lastChannelTV);
- config.setInt32("startChannelRadio", startChannelRadio);
- config.setInt32("startChannelTV", startChannelTV);
+ if (saveLastChannel)
+ {
+ config.setInt32("lastChannelRadio", lastChannelRadio);
+ config.setInt32("lastChannelTV", lastChannelTV);
+ }
+ else
+ {
+ config.setInt32("startChannelRadio", startChannelRadio);
+ config.setInt32("startChannelTV", startChannelTV);
+ }
config.setBool("saveAudioPIDs", save_audioPIDs);
config.setBool("makeRemainingChannelsBouquet",
bouquetManager->remainingChannelsBouquet);
commit e70d4041d96883016bc1a4efe40853194f13ccf6
Author: GetAway <get-a...@t-online.de>
Date: Sun Jun 9 14:21:36 2013 +0200
neutrino: move select font from console to menu
Standard Font is now LiberationSans-Regular.
micron_italic.ttf is no longer installed.
FT can handle BOLD and ITALICS by itself.
The command line syntax to select a font for LCD has changed.
Please use now:
[--lcdfont /dir/menu.ttf [/dir/time.ttf [/dir/channelname.ttf]]]
Signed-off-by: Christian Schuett <gaucho...@hotmail.com>
Signed-off-by: Thilo Graf <d...@novatux.de>
diff --git a/tuxbox/neutrino/data/fonts/Makefile.am
b/tuxbox/neutrino/data/fonts/Makefile.am
index be39404..47f888a 100644
--- a/tuxbox/neutrino/data/fonts/Makefile.am
+++ b/tuxbox/neutrino/data/fonts/Makefile.am
@@ -1,10 +1,5 @@
installdir = $(FONTDIR)
install_DATA = \
- micron.ttf micron_bold.ttf micron_italic.ttf \
+ LiberationSans-Regular.ttf micron.ttf micron_bold.ttf \
12.pcf.gz 14B.pcf.gz 15B.pcf.gz
-
-if ENABLE_EPGPLUS
-install_DATA += \
- md_khmurabi_10.ttf
-endif
diff --git a/tuxbox/neutrino/data/locale/deutsch.locale
b/tuxbox/neutrino/data/locale/deutsch.locale
index 71246d0..4a00659 100644
--- a/tuxbox/neutrino/data/locale/deutsch.locale
+++ b/tuxbox/neutrino/data/locale/deutsch.locale
@@ -528,11 +528,12 @@ fontmenu.eventlist Event-Liste
fontmenu.gamelist Spiele-Liste
fontmenu.head Schrift
fontmenu.infobar Infobar
-fontmenu.scaling Schriftgrössenfaktor
+fontmenu.scaling SchriftgröÃenfaktor
fontmenu.scaling_x Horizontal (in %)
fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200
fontmenu.scaling_y Vertikal (in %)
fontmenu.scaling_y_hint2 Vertikal (in %) min 50 / max 200
+fontmenu.sizes SchriftgröÃen
fontsize.channel_num_zap Direktauswahl
fontsize.channellist Kanalliste
fontsize.channellist_descr Beschreibung
@@ -1058,7 +1059,8 @@ options.serial seriell
osdsettings.colormenu.background Hintergrundfarbe
osdsettings.colormenu.background_head Hintergrundfarbe
osdsettings.colormenu.fade Menüs faden
-osdsettings.colormenu.font SchriftgröÃe
+osdsettings.colormenu.font Neutrino Schriftart
+osdsettings.colormenu.fontsize SchriftgröÃe
osdsettings.colormenu.gtx_alpha Transparenz (GTX)
osdsettings.colormenu.head Farben
osdsettings.colormenu.menucolors Menüfarben
diff --git a/tuxbox/neutrino/data/locale/english.locale
b/tuxbox/neutrino/data/locale/english.locale
index 1c5bda4..3c44c03 100644
--- a/tuxbox/neutrino/data/locale/english.locale
+++ b/tuxbox/neutrino/data/locale/english.locale
@@ -533,6 +533,7 @@ fontmenu.scaling_x Horizontal (in %)
fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200
fontmenu.scaling_y Vertical (in %)
fontmenu.scaling_y_hint2 Vertical (in %) min 50 / max 200
+fontmenu.sizes Font sizes
fontsize.channel_num_zap direct selection
fontsize.channellist Channellist
fontsize.channellist_descr Description
@@ -1058,7 +1059,8 @@ options.serial serial
osdsettings.colormenu.background Background
osdsettings.colormenu.background_head Background
osdsettings.colormenu.fade Fade Menus
-osdsettings.colormenu.font Font Size
+osdsettings.colormenu.font Select GUI font
+osdsettings.colormenu.fontsize Font Size
osdsettings.colormenu.gtx_alpha Transparency (GTX)
osdsettings.colormenu.head Colors
osdsettings.colormenu.menucolors Menu Colors
diff --git a/tuxbox/neutrino/src/gui/epgplus.cpp
b/tuxbox/neutrino/src/gui/epgplus.cpp
index ca84297..7954d7d 100644
--- a/tuxbox/neutrino/src/gui/epgplus.cpp
+++ b/tuxbox/neutrino/src/gui/epgplus.cpp
@@ -80,17 +80,16 @@ int EpgPlus::channelsTableWidth = 0;
int EpgPlus::sliderBackColor = 0;
int EpgPlus::sliderKnobColor = 0;
-static EpgPlus::FontSetting fontSettingDefaultTable[] =
-{
- { EpgPlus::EPGPlus_header_font ,
"EPGPlus.header_font" , LOCALE_EPGPLUS_HEADER_FONT
, "md_khmurabi_10.ttf", "Bold" , 20, true},
- { EpgPlus::EPGPlus_timeline_fonttime ,
"EPGPlus.timeline_fonttime" ,
LOCALE_EPGPLUS_TIMELINE_FONTTIME , "micron.ttf", "Bold" , 16,
true},
- { EpgPlus::EPGPlus_timeline_fontdate ,
"EPGPlus.timeline_fontdate" ,
LOCALE_EPGPLUS_TIMELINE_FONTDATE , "micron.ttf", "Bold" , 14,
true},
- { EpgPlus::EPGPlus_channelentry_font ,
"EPGPlus.channelentry_font" ,
LOCALE_EPGPLUS_CHANNELENTRY_FONT , "micron.ttf", "Bold" , 16,
true},
- { EpgPlus::EPGPlus_channelevententry_font ,
"EPGPlus.channelevententry_font" ,
LOCALE_EPGPLUS_CHANNELEVENTENTRY_FONT , "micron.ttf", "Regular", 16,
true},
- { EpgPlus::EPGPlus_footer_fontbouquetchannelname ,
"EPGPlus.footer_fontbouquetchannelname" ,
LOCALE_EPGPLUS_FOOTER_FONTBOUQUETCHANNELNAME , "micron.ttf", "Bold" , 24,
true},
- { EpgPlus::EPGPlus_footer_fonteventdescription ,
"EPGPlus.footer_fonteventdescription" ,
LOCALE_EPGPLUS_FOOTER_FONTEVENTDESCRIPTION , "micron.ttf", "Regular", 16,
true},
- { EpgPlus::EPGPlus_footer_fonteventshortdescription,
"EPGPlus.footer_fonteventshortdescription" ,
LOCALE_EPGPLUS_FOOTER_FONTEVENTSHORTDESCRIPTION , "micron.ttf", "Regular", 16,
true},
- { EpgPlus::EPGPlus_footer_fontbuttons ,
"EPGPlus.footer_fontbuttons" ,
LOCALE_EPGPLUS_FOOTER_FONTBUTTONS , "md_khmurabi_10.ttf",
"Regular", 16, true},
+static EpgPlus::FontSetting fontSettingTable[] = {
+ { EpgPlus::EPGPlus_header_font , "Bold" , 22 },
+ { EpgPlus::EPGPlus_timeline_fonttime , "Bold" , 16 },
+ { EpgPlus::EPGPlus_timeline_fontdate , "Bold" , 14 },
+ { EpgPlus::EPGPlus_channelentry_font , "Bold" , 16 },
+ { EpgPlus::EPGPlus_channelevententry_font , "Regular", 16 },
+ { EpgPlus::EPGPlus_footer_fontbouquetchannelname , "Bold" , 24 },
+ { EpgPlus::EPGPlus_footer_fonteventdescription , "Regular", 16 },
+ { EpgPlus::EPGPlus_footer_fonteventshortdescription, "Regular", 16 },
+ { EpgPlus::EPGPlus_footer_fontbuttons , "Regular", 16 }
};
static EpgPlus::ColorSetting colorSettingDefaultTable[] =
@@ -138,7 +137,7 @@ EpgPlus::Settings::~Settings()
EpgPlus::Settings::Settings(bool doInit)
{
- fontSettings = new FontSetting [sizeof(fontSettingDefaultTable) /
sizeof(FontSetting)];
+ fontSettings = new FontSetting [sizeof(fontSettingTable) /
sizeof(FontSetting)];
colorSettings = new ColorSetting[sizeof(colorSettingDefaultTable)/
sizeof(ColorSetting)];
sizeSettings = new SizeSetting [sizeof(sizeSettingDefaultTable) /
sizeof(SizeSetting)];
@@ -146,9 +145,9 @@ EpgPlus::Settings::Settings(bool doInit)
{
for (size_t i = 0; i < NumberOfFontSettings; ++i)
{
- fontSettings[i] = fontSettingDefaultTable[i];
+ fontSettings[i] = fontSettingTable[i];
if (bigfont && (fontSettings[i].settingID ==
EpgPlus::EPGPlus_channelentry_font || fontSettings[i].settingID ==
EpgPlus::EPGPlus_channelevententry_font))
- fontSettings[i].size =
fontSettingDefaultTable[i].size * 3 / 2;
+ fontSettings[i].size = fontSettingTable[i].size
* 3 / 2;
}
for (size_t i = 0; i < NumberOfColorSettings; ++i)
colorSettings[i] = colorSettingDefaultTable[i];
@@ -766,20 +765,15 @@ void EpgPlus::init()
{
settings = new EpgPlus::Settings(true);
+ std::string FileName = std::string (g_settings.font_file);
for (size_t i = 0; i < NumberOfFontSettings; ++i)
{
FontSetting* fontSetting = &settings->fontSettings[i];
- std::string FileName;
- FileName += std::string(FONTDIR);
- FileName += "/";
- FileName += fontSetting->name;
-
- std::string defaultStyle =
g_fontRenderer->AddFont(FileName.c_str());
- std::string family =
g_fontRenderer->getFamily(FileName.c_str());
- Font* font =
g_fontRenderer->getFont(family.c_str(), fontSetting->name, fontSetting->size);
+ std::string family = g_fontRenderer->getFamily
(FileName.c_str());
+ Font *font = g_fontRenderer->getFont(family.c_str(),
fontSetting->style, fontSetting->size);
if (font == NULL)
- font = g_fontRenderer->getFont(family.c_str(),
defaultStyle.c_str(), fontSetting->size);
+ font = g_fontRenderer->getFont(family.c_str(),
"Regular", fontSetting->size);
fonts[fontSetting->settingID] = font;
}
diff --git a/tuxbox/neutrino/src/gui/epgplus.h
b/tuxbox/neutrino/src/gui/epgplus.h
index d4f325a..f52d890 100644
--- a/tuxbox/neutrino/src/gui/epgplus.h
+++ b/tuxbox/neutrino/src/gui/epgplus.h
@@ -110,12 +110,8 @@ public:
struct FontSetting
{
FontSettingID settingID;
- const char* settingName;
- neutrino_locale_t locale;
- const char* name;
const char* style;
int size;
- bool isConfigurable;
};
struct ColorSetting
diff --git a/tuxbox/neutrino/src/gui/osd_setup.cpp
b/tuxbox/neutrino/src/gui/osd_setup.cpp
index fc7cde1..e2573d7 100644
--- a/tuxbox/neutrino/src/gui/osd_setup.cpp
+++ b/tuxbox/neutrino/src/gui/osd_setup.cpp
@@ -169,6 +169,20 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string
&actionKey)
int res = showOsdChannelListSetup();
return res;
}
+ else if (actionKey=="select_font")
+ {
+ CFileBrowser fileBrowser;
+ CFileFilter fileFilter;
+ fileFilter.addFilter("ttf");
+ fileBrowser.Filter = &fileFilter;
+ if (fileBrowser.exec(FONTDIR))
+ {
+ strcpy(g_settings.font_file,
fileBrowser.getSelectedFile()->Name.c_str());
+ printf("[neutrino] new font file %s\n",
fileBrowser.getSelectedFile()->Name.c_str());
+ CNeutrinoApp::getInstance()->SetupFonts();
+ }
+ return menu_return::RETURN_REPAINT;
+ }
else if (actionKey=="show_fontsize_setup")
{
int res = showOsdFontSizeSetup();
@@ -631,6 +645,12 @@ int COsdSetup::showOsdFontSizeSetup()
CMenuWidget * fontSettings = new CMenuWidget(menue_title, menue_icon,
width);
fontSettings->addIntroItems(LOCALE_FONTMENU_HEAD);
+ // select gui font file
+ CMenuForwarder *mf = new
CMenuForwarder(LOCALE_OSDSETTINGS_COLORMENU_FONT, true, NULL, this,
"select_font", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
+ fontSettings->addItem(mf);
+ fontSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE |
CMenuSeparator::STRING, LOCALE_FONTMENU_SIZES));
+
+ // submenu font scaling
CMenuWidget * fontscale = new CMenuWidget(LOCALE_FONTMENU_HEAD,
menue_icon, width);
fontscale->addIntroItems(LOCALE_FONTMENU_SCALING);
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 4dedf79..59fcc33 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -248,6 +248,8 @@ CNeutrinoApp::CNeutrinoApp()
obeyStartMode = true;
menuGamesIsVisible = true;
menuScriptsIsVisible = true;
+ memset(&font, 0, sizeof(neutrino_font_descr_struct));
+ memset(&lcd_font, 0, sizeof(lcd_font_descr_struct));
}
/*-------------------------------------------------------------------------------------
@@ -731,6 +733,8 @@ int CNeutrinoApp::loadSetup()
strcpy(g_settings.softupdate_proxyusername,
configfile.getString("softupdate_proxyusername", "" ).c_str());
strcpy(g_settings.softupdate_proxypassword,
configfile.getString("softupdate_proxypassword", "" ).c_str());
#endif
+ // GUI font
+ strcpy(g_settings.font_file, configfile.getString( "font_file",
FONTDIR"/LiberationSans-Regular.ttf" ).c_str());
//BouquetHandling
g_settings.bouquetlist_mode = configfile.getInt32( "bouquetlist_mode",
0 );
@@ -1276,6 +1280,8 @@ void CNeutrinoApp::saveSetup()
configfile.setString("softupdate_proxyusername" ,
g_settings.softupdate_proxyusername );
configfile.setString("softupdate_proxypassword" ,
g_settings.softupdate_proxypassword );
#endif
+ // GUI font
+ configfile.setString("font_file", g_settings.font_file);
//BouquetHandling
configfile.setInt32( "bouquetlist_mode", g_settings.bouquetlist_mode );
@@ -1625,7 +1631,9 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
softupdate = false;
fromflash = false;
- font.filename[0] = NULL;
+ font.name = NULL;
+ font.filename = NULL;
+ lcd_font.filename[0] = NULL;
for(int x=1; x<argc; x++)
{
@@ -1639,30 +1647,28 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
dprintf(DEBUG_NORMAL, "enable flash\n");
fromflash = true;
}
- else if (!strcmp(argv[x], "--font"))
+ else if (!strcmp(argv[x], "--lcdfont"))
{
- if ((x + 2) < argc)
+ if ((x + 1) < argc)
{
- font.is_unicode = -1;
- font.size_offset = atoi(argv[x + 1]);
- font.filename[0] = argv[x + 2];
- if ((x + 3) < argc)
+ lcd_font.filename[0] = argv[x + 1];
+ if ((x + 2) < argc)
{
- font.filename[1] = argv[x + 3];
+ lcd_font.filename[1] = argv[x + 2];
x++;
}
else
- font.filename[1] = NULL;
+ lcd_font.filename[1] = NULL;
- if ((x + 3) < argc)
+ if ((x + 2) < argc)
{
- font.filename[2] = argv[x + 3];
+ lcd_font.filename[2] = argv[x + 2];
x++;
}
else
- font.filename[2] = NULL;
+ lcd_font.filename[2] = NULL;
}
- x += 2;
+ x++;
}
else if (((!strcmp(argv[x], "-v")) || (!strcmp(argv[x],
"--verbose"))) && (x+1 < argc))
{
@@ -1673,7 +1679,7 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
}
else
{
- fprintf(stderr, "Usage: neutrino [-u | --enable-update]
[-f | --enable-flash] [-v | --verbose 0..3] [--font sizeoffset /dir/file.ttf
[/dir/bold.ttf [/dir/italic.ttf]]]\n");
+ fprintf(stderr, "Usage: neutrino [-u | --enable-update]
[-f | --enable-flash] [-v | --verbose 0..3] [--lcdfont /dir/menu.ttf
[/dir/time.ttf [/dir/channelname.ttf]]]\n");
exit(0);
}
}
@@ -1706,31 +1712,29 @@ void CNeutrinoApp::SetupFrameBuffer()
*
*
**************************************************************************************/
-const neutrino_font_descr_struct predefined_font[2] =
-{
- { {FONTDIR "/micron.ttf" , FONTDIR "/micron_bold.ttf", FONTDIR
"/micron_italic.ttf"}, 0, 0},
- { {FONTDIR "/md_khmurabi_10.ttf", NULL , NULL
}, 0, 1}
-};
-
-const char* predefined_lcd_font[2][3] =
+const lcd_font_descr_struct predefined_lcd_font[2] =
{
- {FONTDIR "/12.pcf.gz", FONTDIR "/14B.pcf.gz", FONTDIR "/15B.pcf.gz"},
- {FONTDIR "/md_khmurabi_10.ttf", NULL, NULL}
+ { {FONTDIR "/12.pcf.gz", FONTDIR "/14B.pcf.gz", FONTDIR "/15B.pcf.gz"}
},
+ { {FONTDIR "/LiberationSans-Regular.ttf", NULL, NULL} }
};
bool CNeutrinoApp::ChangeFonts(int unicode_locale)
{
- if (font.is_unicode == -1) /* user defined font, don't mess with that */
- return false;
if (unicode_locale == CLocaleManager::NO_SUCH_LOCALE) /* should not
happen, but anyway.. */
return false; /* avoid crash from
negative array index */
- if (font.is_unicode != unicode_locale)
+ if (loadLocale_ret != unicode_locale)
{
- font = predefined_font[unicode_locale];
-
CLCD::getInstance()->reinit(predefined_lcd_font[unicode_locale][0],
-
predefined_lcd_font[unicode_locale][1],
-
predefined_lcd_font[unicode_locale][2]);
- SetupFonts();
+ loadLocale_ret = unicode_locale;
+ if (unicode_locale == CLocaleManager::UNICODE_FONT &&
+ strcmp(g_settings.font_file,
FONTDIR"/LiberationSans-Regular.ttf") != 0)
+ {
+ strcpy(g_settings.font_file,
FONTDIR"/LiberationSans-Regular.ttf");
+ SetupFonts();
+ }
+ if (lcd_font.filename[0] == NULL)
+
CLCD::getInstance()->reinit(predefined_lcd_font[unicode_locale].filename[0],
+
predefined_lcd_font[unicode_locale].filename[1],
+
predefined_lcd_font[unicode_locale].filename[2]);
}
return true;
}
@@ -1738,41 +1742,51 @@ bool CNeutrinoApp::ChangeFonts(int unicode_locale)
void CNeutrinoApp::SetupFonts()
{
const char * style[3];
- char *fontname;
if (g_fontRenderer != NULL)
delete g_fontRenderer;
g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres /
100, 72 * g_settings.screen_yres / 100);
- style[0] = g_fontRenderer->AddFont(font.filename[0]);
+ if(font.filename != NULL)
+ free((void *)font.filename);
- fontname = strdup(g_fontRenderer->getFamily(font.filename[0]).c_str());
- fprintf(stderr, "[neutrino] SetupFonts filename: %s fontname: %s\n",
font.filename[0], fontname);
+ printf("[neutrino] settings font file %s\n", g_settings.font_file);
- if (font.filename[1] == NULL)
- {
- g_fontRenderer->AddFont(font.filename[0], true);
- style[1] = "Bold Regular";
- }
- else
- style[1] = g_fontRenderer->AddFont(font.filename[1]);
+ if(access(g_settings.font_file, F_OK)) {
+ if(!access(FONTDIR"/LiberationSans-Regular.ttf", F_OK)){
+ font.filename =
strdup(FONTDIR"/LiberationSans-Regular.ttf");
+ strcpy(g_settings.font_file, font.filename);
+ }
+ else{
+ fprintf( stderr,"[neutrino] font file [%s] not found\n
neutrino exit\n",FONTDIR"/LiberationSans-Regular.ttf");
+ _exit(0);
+ }
- if (font.filename[2] == NULL)
- {
- g_fontRenderer->AddFont(font.filename[0], true); // make
italics
- style[2] = "Italic";
}
- else
- style[2] = g_fontRenderer->AddFont(font.filename[2]);
+ else{
+ font.filename = strdup(g_settings.font_file);
+ }
+ style[0] = g_fontRenderer->AddFont(font.filename);
+
+ if(font.name != NULL)
+ free((void *)font.name);
+
+ font.name = strdup(g_fontRenderer->getFamily(font.filename).c_str());
+
+ printf("[neutrino] font family %s\n", font.name);
+
+ style[1] = "Bold Regular";
+
+ style[2] = g_fontRenderer->AddFont(font.filename, true); // make
italics
for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++)
{
- g_Font[i] = g_fontRenderer->getFont(fontname,
style[neutrino_font[i].style],
configfile.getInt32(locale_real_names[neutrino_font[i].name],
neutrino_font[i].defaultsize) + neutrino_font[i].size_offset *
font.size_offset);
+ delete g_Font[i];
+ g_Font[i] = g_fontRenderer->getFont(font.name,
style[neutrino_font[i].style],
configfile.getInt32(locale_real_names[neutrino_font[i].name],
neutrino_font[i].defaultsize)/* + neutrino_font[i].size_offset *
font.size_offset*/);
}
- free(fontname);
- /* recalculate infobar, EPGDate and eventlist position */
+ /* recalculate infobar, EPGData and eventlist position */
if (g_InfoViewer)
g_InfoViewer->start();
if (g_EpgData)
@@ -2116,7 +2130,7 @@ int CNeutrinoApp::run(int argc, char **argv)
/* load locales before setting up any fonts to determine whether we
need a true unicode font */
bool display_language_selection;
- CLocaleManager::loadLocale_ret_t loadLocale_ret =
g_Locale->loadLocale(g_settings.language);
+ loadLocale_ret = g_Locale->loadLocale(g_settings.language);
if (loadLocale_ret == CLocaleManager::NO_SUCH_LOCALE)
{
strcpy(g_settings.language, "deutsch"); // Fallback if rest
fails
@@ -2135,18 +2149,18 @@ int CNeutrinoApp::run(int argc, char **argv)
else
display_language_selection = false;
- if (font.filename[0] == NULL) /* no font specified in command line */
+ unsigned int use_true_unicode_font = (loadLocale_ret ==
CLocaleManager::ISO_8859_1_FONT) ? 0 : 1;
+ if (use_true_unicode_font)
+ strcpy(g_settings.font_file,
FONTDIR"/LiberationSans-Regular.ttf");
+ if (lcd_font.filename[0] == NULL) /* no lcd font specified in command
line */
{
- unsigned int use_true_unicode_font = (loadLocale_ret ==
CLocaleManager::ISO_8859_1_FONT) ? 0 : 1;
-
- font = predefined_font[use_true_unicode_font];
-
CLCD::getInstance()->init(predefined_lcd_font[use_true_unicode_font][0],
-
predefined_lcd_font[use_true_unicode_font][1],
-
predefined_lcd_font[use_true_unicode_font][2]);
+
CLCD::getInstance()->init(predefined_lcd_font[use_true_unicode_font].filename[0],
+
predefined_lcd_font[use_true_unicode_font].filename[1],
+
predefined_lcd_font[use_true_unicode_font].filename[2]);
}
else
{
- CLCD::getInstance()->init(font.filename[0]);
+ CLCD::getInstance()->init(lcd_font.filename[0],
lcd_font.filename[1], lcd_font.filename[2]);
}
CLCD::getInstance()->showVolume(g_Controld->getVolume((CControld::volume_type)g_settings.audio_avs_Control));
diff --git a/tuxbox/neutrino/src/neutrino.h b/tuxbox/neutrino/src/neutrino.h
index 82e1e25..6376db7 100644
--- a/tuxbox/neutrino/src/neutrino.h
+++ b/tuxbox/neutrino/src/neutrino.h
@@ -64,9 +64,9 @@
typedef struct neutrino_font_descr
{
- const char *filename[3]; /* name of regular, bold, italics font file */
- int size_offset;
- int is_unicode; /* -1 == don't know (external font), 0 == no, 1
== yes */
+ const char * name;
+ const char * filename; /* name of regular font file */
+ /*int size_offset;*/
} neutrino_font_descr_struct;
typedef struct font_sizes
@@ -77,6 +77,11 @@ typedef struct font_sizes
const unsigned int size_offset;
} font_sizes_struct;
+typedef struct lcd_font_descr
+{
+ const char * filename[3]; /* name of menu, time, channelname lcd font
file */
+} lcd_font_descr_struct;
+
typedef struct font_sizes_groups
{
const neutrino_locale_t groupname;
@@ -160,6 +165,8 @@ class CNeutrinoApp : public CMenuTarget, CChangeObserver
CScanSettings scanSettings;
neutrino_font_descr_struct font;
+ lcd_font_descr_struct lcd_font;
+ int loadLocale_ret;
int mode;
int lastMode;
diff --git a/tuxbox/neutrino/src/system/locals.h
b/tuxbox/neutrino/src/system/locals.h
index 2e09f3e..e3568e6 100644
--- a/tuxbox/neutrino/src/system/locals.h
+++ b/tuxbox/neutrino/src/system/locals.h
@@ -560,6 +560,7 @@ typedef enum
LOCALE_FONTMENU_SCALING_X_HINT2,
LOCALE_FONTMENU_SCALING_Y,
LOCALE_FONTMENU_SCALING_Y_HINT2,
+ LOCALE_FONTMENU_SIZES,
LOCALE_FONTSIZE_CHANNEL_NUM_ZAP,
LOCALE_FONTSIZE_CHANNELLIST,
LOCALE_FONTSIZE_CHANNELLIST_DESCR,
@@ -1086,6 +1087,7 @@ typedef enum
LOCALE_OSDSETTINGS_COLORMENU_BACKGROUND_HEAD,
LOCALE_OSDSETTINGS_COLORMENU_FADE,
LOCALE_OSDSETTINGS_COLORMENU_FONT,
+ LOCALE_OSDSETTINGS_COLORMENU_FONTSIZE,
LOCALE_OSDSETTINGS_COLORMENU_GTX_ALPHA,
LOCALE_OSDSETTINGS_COLORMENU_HEAD,
LOCALE_OSDSETTINGS_COLORMENU_MENUCOLORS,
diff --git a/tuxbox/neutrino/src/system/locals_intern.h
b/tuxbox/neutrino/src/system/locals_intern.h
index 828bb62..48f7703 100644
--- a/tuxbox/neutrino/src/system/locals_intern.h
+++ b/tuxbox/neutrino/src/system/locals_intern.h
@@ -560,6 +560,7 @@ const char * locale_real_names[] =
"fontmenu.scaling_x_hint2",
"fontmenu.scaling_y",
"fontmenu.scaling_y_hint2",
+ "fontmenu.sizes",
"fontsize.channel_num_zap",
"fontsize.channellist",
"fontsize.channellist_descr",
@@ -1086,6 +1087,7 @@ const char * locale_real_names[] =
"osdsettings.colormenu.background_head",
"osdsettings.colormenu.fade",
"osdsettings.colormenu.font",
+ "osdsettings.colormenu.fontsize",
"osdsettings.colormenu.gtx_alpha",
"osdsettings.colormenu.head",
"osdsettings.colormenu.menucolors",
diff --git a/tuxbox/neutrino/src/system/settings.h
b/tuxbox/neutrino/src/system/settings.h
index 1ec81e7..7df17e5 100644
--- a/tuxbox/neutrino/src/system/settings.h
+++ b/tuxbox/neutrino/src/system/settings.h
@@ -479,6 +479,9 @@ struct SNeutrinoSettings
int uboot_lcd_contrast;
int uboot_lcd_bias;
+ //osd
+ char font_file[100];
+
// USERMENU
typedef enum
{
-----------------------------------------------------------------------
Summary of changes:
dvb/zapit/src/zapit.cpp | 14 ++-
.../neutrino/daemons/nhttpd/tuxboxapi/lcdapi.cpp | 1 +
tuxbox/neutrino/data/fonts/Makefile.am | 7 +-
tuxbox/neutrino/data/locale/deutsch.locale | 6 +-
tuxbox/neutrino/data/locale/english.locale | 4 +-
tuxbox/neutrino/src/driver/lcdd.cpp | 9 +-
tuxbox/neutrino/src/gui/bouquetlist.cpp | 2 +-
tuxbox/neutrino/src/gui/bouquetlist.h | 2 +-
tuxbox/neutrino/src/gui/channellist.cpp | 26 ++-
tuxbox/neutrino/src/gui/channellist.h | 5 +-
tuxbox/neutrino/src/gui/epgplus.cpp | 40 ++---
tuxbox/neutrino/src/gui/epgplus.h | 4 -
tuxbox/neutrino/src/gui/imageinfo.cpp | 2 +-
tuxbox/neutrino/src/gui/osd_setup.cpp | 20 +++
tuxbox/neutrino/src/gui/widget/menue.cpp | 107 +++++---------
tuxbox/neutrino/src/gui/widget/menue.h | 3 +-
tuxbox/neutrino/src/neutrino.cpp | 159 +++++++++++---------
tuxbox/neutrino/src/neutrino.h | 13 ++-
tuxbox/neutrino/src/system/locals.h | 2 +
tuxbox/neutrino/src/system/locals_intern.h | 2 +
tuxbox/neutrino/src/system/settings.h | 3 +
21 files changed, 231 insertions(+), 200 deletions(-)
--
Tuxbox-GIT: apps
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Tuxbox-cvs-commits mailing list
Tuxbox-cvs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tuxbox-cvs-commits