Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/7.3-dev' into 7.3-dev-sigc3
Browse files Browse the repository at this point in the history
  • Loading branch information
henrylicious committed Apr 21, 2024
2 parents 9cfc1bc + ba4c74d commit 37e390d
Show file tree
Hide file tree
Showing 44 changed files with 950 additions and 289 deletions.
2 changes: 1 addition & 1 deletion data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<item level="2" text="Hide zap errors" description="When enabled, error messages related to zapping will not be shown.">config.usage.hide_zap_errors</item>
<!-- <item level="2" text="Hide CI messages" description="When enabled, error messages related to the Common Interface module will not be shown.">config.usage.hide_ci_messages</item> -->
<item level="0" text="Consider CI assignment" description="Use CI assignment for detection of available services.">config.misc.use_ci_assignment</item>
<item level="2" text="Show crypto info in infobar" description="When enabled, encryption info will be shown in the infobar (when supported by the skin).">config.usage.show_cryptoinfo</item>
<item level="2" text="Show crypto info in infobar" conditional="parameters.get('hasInfobarCryptoInfo', True)" description="When enabled, encryption info will be shown in the infobar (when supported by the skin).">config.usage.show_cryptoinfo</item>
<item level="2" text="Show picons in display" description="Configure if service picons will be shown in display (when supported by the skin)." requires="HasFrontDisplayPicon">config.usage.show_picon_in_display</item>
<item level="2" text="Infobar frontend data source" description="Configure the source of the frontend data as shown on the infobars. 'Settings' is as stored on the settings. 'Tuner' is as reported by the tuner.">config.usage.infobar_frontend_source</item>
<item level="2" text="Show SNR percentage instead of dB value" description="By default, SNR will be shown in dB (when supported by the tuner). This setting forces SNR to be shown as a percentage instead.">config.usage.swap_snr_on_osd</item>
Expand Down
5 changes: 4 additions & 1 deletion data/unicable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ bootuptime: integer, delay to allow the device to boot up, in milliseconds (opti
lofl: integer, alternative LOF/L value (optional, default value is 9750)
lofh: integer, alternative LOF/H value (optional, defaultvalue is 10600)
-->
<unicable version="20230506">
<unicable version="20240410">
<lnb>
<manufacturer name="Dura-Sat(DUR-line)">
<product name="Unicable LNB" scrs="1210,1420,1680,2040"/>
<product name="MB6-UK Mono" positions="2" format="jess" bootuptime="2500" scrs= "1210,1420,1680,2040,1005,1050,1095,1140,1260,1305,1350,1475,1520,1565,1610,1725,1770,1815,1860,1905,1950,1995,2085,2130"/>
<product name="UK101" scrs="1210,1420,1680,2040" bootuptime="2500"/>
<product name="UK102" scrs="1210,1420,1680,2040"/>
<product name="UK104" scrs="1210,1420,1680,2040"/>
Expand All @@ -32,6 +33,7 @@ lofh: integer, alternative LOF/H value (optional, defaultvalue is 10600)
<product name="SCR-1" scrs="1210,1420,1680,2040"/>
</manufacturer>
<manufacturer name="Fuba">
<product name="DEK 124" format="jess" scrs="975,1025,1075,1125,1175,1225,1275,1325,1375,1425,1475,1525,1575,1625,1675,1730,1775,1825,1875,1925,1975,2025,2075,2125"/>
<product name="DEK 342" scrs="1210,1420,1680,2040"/>
</manufacturer>
<manufacturer name="Fte maximal">
Expand All @@ -48,6 +50,7 @@ lofh: integer, alternative LOF/H value (optional, defaultvalue is 10600)
<product name="GT-S1-2-3SCR4" scrs="1210,1420,1680,2040"/>
<product name="dLNB dHello" format="jess" bootuptime="2700" scrs="0975,1025,1075,1125,1175,1225,1275,1325,1375,1425,1475,1525,1575,1625,1675,1725,1775,1825,1875,1925,1975,2025,2075,2125"/>
<product name="GT-dLNB1-T" format="jess" bootuptime="2700" scrs="0975,1025,1075,1125,1175,1225,1275,1325,1375,1425,1475,1525,1575,1625,1675,1725,1775,1825,1875,1925,1975,2025,2075,2125"/>
<product name="GT-dLNB1-T - Poland" format="jess" bootuptime="2500" scrs="1210,1420,1680,2040,978,1028,1072,1116,1160,1271,1315,1359,1484,1528,1572,1616,2084,2128,1816,1860,1904,1948,1992,1728"/>
<product name="GT-dLNB1-DY" format="jess" bootuptime="2700" scrs="0975,1025,1075,1125,1175,1225,1275,1325,1375,1425,1475,1525,1575,1625,1675,1725,1775,1825,1875,1925,1975,2025,2075,2125"/>
<product name="GT-S1dCSS24" bootuptime="2500" format="jess" scrs="0975,1025,1075,1125,1175,1225,1275,1325,1375,1425,1475,1525,1575,1625,1675,1725,1775,1825,1875,1925,1975,2025,2075,2125"/>
<product name="GT-S2dCSS24" bootuptime="2500" format="jess" scrs="0975,1025,1075,1125,1175,1225,1275,1325,1375,1425,1475,1525,1575,1625,1675,1725,1775,1825,1875,1925,1975,2025,2075,2125"/>
Expand Down
3 changes: 2 additions & 1 deletion lib/dvb/metaparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ int eDVBMetaParser::parseMeta(const std::string &tsname)
}
break;
case 9:
m_scrambled = atoi(line);
// This is not nice but the fastest way to 'fix' the 'records not playable'-bug
//m_scrambled = atoi(line);
break;
default:
break;
Expand Down
16 changes: 10 additions & 6 deletions lib/gui/elistboxcontent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,6 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
eListboxStyle *local_style = 0;
eRect sel_clip(m_selection_clip);
bool cursorValid = this->cursorValid();
gRGB border_color;
int border_size = 0;
bool isverticallb = true;

if (sel_clip.valid())
Expand All @@ -1046,8 +1044,6 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
if (m_listbox)
{
local_style = m_listbox->getLocalStyle();
border_size = local_style->m_border_size;
border_color = local_style->m_border_color;
isverticallb = m_listbox->getOrientation() == 1;
}

Expand Down Expand Up @@ -1179,7 +1175,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
pfnt = PyTuple_GET_ITEM(item, 5),
pflags = PyTuple_GET_ITEM(item, 6),
pstring = PyTuple_GET_ITEM(item, 7),
pforeColor, pforeColorSelected, pbackColor, pbackColorSelected, pborderWidth, pborderColor, pCornerRadius, pCornerEdges;
pforeColor, pforeColorSelected, pbackColor, pbackColorSelected, pborderWidth, pborderColor, pCornerRadius, pCornerEdges, pTextBorderWidth, pTextBorderColor;

if (!(px && py && pwidth && pheight && pfnt && pflags && pstring))
{
Expand Down Expand Up @@ -1214,6 +1210,12 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
if (size > 15)
pCornerEdges = PyTuple_GET_ITEM(item, 15);

if (size > 16)
pTextBorderWidth = PyTuple_GET_ITEM(item, 16);

if (size > 17)
pTextBorderColor = lookupColor(PyTuple_GET_ITEM(item, 17), data);

if (PyLong_Check(pstring) && data) /* if the string is in fact a number, it refers to the 'data' list. */
pstring = PyTuple_GetItem(data, PyLong_AsLong(pstring));

Expand All @@ -1229,6 +1231,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
int flags = PyLong_AsLong(pflags);
int fnt = PyLong_AsLong(pfnt);
int bwidth = pborderWidth ? PyLong_AsLong(pborderWidth) : 0;
int btwidth = pTextBorderWidth ? PyLong_AsLong(pTextBorderWidth) : 0;

int cornerRadius = pCornerRadius ? PyLong_AsLong(pCornerRadius) : 0;
int cornerEdges = pCornerEdges ? PyLong_AsLong(pCornerEdges) : 0;
Expand Down Expand Up @@ -1262,8 +1265,9 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
}
}

unsigned int textBColor = pTextBorderColor ? PyLong_AsUnsignedLongMask(pTextBorderColor) : 0x000000;
painter.setFont(m_font[fnt]);
painter.renderText(rect, string, flags, border_color, border_size);
painter.renderText(rect, string, flags, gRGB(textBColor), btwidth);
painter.clippop();

// draw border
Expand Down
1 change: 0 additions & 1 deletion lib/python/Components/AVSwitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import os
from boxbranding import getBoxType, getMachineBuild

iAVSwitch = None # will be initialized later, allows to import name 'iAVSwitch' from 'Components.AVSwitch'

class AVSwitch:
def setInput(self, input):
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/Addons/GUIAddon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
class GUIAddon(GUIComponent):
def __init__(self):
GUIComponent.__init__(self)
self.source = None
self.sources = {}
self.relatedScreen = None

Expand Down
163 changes: 163 additions & 0 deletions lib/python/Components/Addons/MainMenu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
from Components.Addons.GUIAddon import GUIAddon

from enigma import eListbox, eListboxPythonMultiContent, gFont, RT_HALIGN_LEFT, RT_VALIGN_CENTER, getDesktop, eSize

from skin import applySkinFactor, parseFont, parseColor, parseScale

from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaBlend
from Components.Label import Label


class MainMenu(GUIAddon):
def __init__(self):
GUIAddon.__init__(self)
self.itemHeight = 36
self.itemWidth = 36
self.l = eListboxPythonMultiContent() # noqa: E741
self.l.setBuildFunc(self.buildEntry)
self.l.setItemHeight(self.itemHeight)
self.l.setItemWidth(self.itemWidth)
self.orientation = eListbox.orVertical
self.font = gFont("Regular", applySkinFactor(22))
self.iconSize = 0
self.foregroundColor = 0xffffff
self.foregroundColorSelected = 0xffffff
self.backgroundColor = 0x000000
self.textRenderer = Label("")
self.longestMenuTextWidth = 0
self.minWidth = 100
self.maxWidth = 700


def onContainerShown(self):
self.textRenderer.GUIcreate(self.relatedScreen.instance)
self.source.onListUpdated.append(self.constructMenu)
self.constructMenu()

GUI_WIDGET = eListbox


def getDesktopWith(self):
return getDesktop(0).size().width()

def _calcTextWidth(self, text, font=None, size=None):
if size:
self.textRenderer.instance.resize(size)
if font:
self.textRenderer.instance.setFont(font)
self.textRenderer.text = text
return self.textRenderer.instance.calculateSize().width()

def buildEntry(self, *args):
item_text = args[0]
menupng = args[5]
xPos = 17
yPos = 5

res = [None]

if self.iconSize > 0:
res.append(MultiContentEntryPixmapAlphaBlend(
pos=(xPos, yPos),
size=(self.iconSize, self.iconSize),
png=menupng))
xPos += self.iconSize + 10
textWidth = self.longestMenuTextWidth if self.maxWidth >= (self.longestMenuTextWidth + self.iconSize + 40 + 10) else self.maxWidth - self.iconSize - 40 - 10
res.append(MultiContentEntryText(
pos=(xPos, 0),
size=(textWidth, self.itemHeight),
font=0, flags=RT_HALIGN_LEFT | RT_VALIGN_CENTER,
text=item_text,
color=self.foregroundColor, color_sel=self.foregroundColorSelected,
backcolor=None, backcolor_sel=None))

return res

def moveSelection(self, index):
if self.instance is not None:
self.instance.moveSelectionTo(index)

def selectionChanged(self):
if self.instance and hasattr(self, "source"):
self.source.setConnectedGuiElement(self)

def setFont(self, value):
self.font = parseFont(value, ((1, 1), (1, 1)))
self.l.setFont(0, self.font)

def setMinWidth(self, value):
self.minWidth = parseScale(value)

def setMaxWidth(self, value):
self.maxWidth = parseScale(value)

def setIconSize(self, value):
self.iconSize = parseScale(value)

def setForegroundColor(self, value):
self.foregroundColor = parseColor(value).argb()

def setForegroundColorSelected(self, value):
self.foregroundColorSelected = parseColor(value).argb()

def setBackgroundColor(self, value):
self.backgroundColor = parseColor(value).argb()

def setItemWidth(self, value):
self.itemWidth = parseScale(value)
self.l.setItemWidth(self.itemWidth)

def setItemHeight(self, value):
self.itemHeight = parseScale(value)
self.l.setItemHeight(self.itemHeight)

def postWidgetCreate(self, instance):
instance.selectionChanged.get().append(self.selectionChanged)
instance.setSelectionEnable(True)
instance.setContent(self.l)
instance.allowNativeKeys(True)

def constructMenu(self):
for x in self.source.list:
textWidth = self._calcTextWidth(x[0], font=self.font, size=eSize(self.getDesktopWith() // 3, 0))
if textWidth > self.longestMenuTextWidth:
self.longestMenuTextWidth = textWidth
curSize = self.instance.size()
dest_width = self.iconSize + 20*2 + 10
dest_width += self.longestMenuTextWidth
if dest_width > self.maxWidth:
dest_width = self.maxWidth
if dest_width > self.minWidth:
self.instance.resize(eSize(dest_width, curSize.height()))
self.relatedScreen.screenContentChanged()
self.l.setList(self.source.list)

def applySkin(self, desktop, parent):
attribs = []
for (attrib, value) in self.skinAttributes[:]:
if attrib == "font":
self.font = parseFont(value, ((1, 1), (1, 1)))
elif attrib == "foregroundColor":
self.foregroundColor = parseColor(value).argb()
elif attrib == "foregroundColorSelected":
self.foregroundColorSelected = parseColor(value).argb()
elif attrib == "backgroundColor":
self.backgroundColor = parseColor(value).argb()
elif attrib == "iconSize":
self.iconSize = parseScale(value)
elif attrib == "minWidth":
self.minWidth = parseScale(value)
elif attrib == "maxWidth":
self.maxWidth = parseScale(value)
elif attrib == "itemWidth":
self.itemWidth = parseScale(value)
elif attrib == "itemHeight":
self.itemHeight = parseScale(value)
else:
attribs.append((attrib, value))
self.skinAttributes = attribs
self.l.setFont(0, self.font)
self.l.setItemHeight(self.itemHeight)
self.l.setItemWidth(self.itemWidth)

return GUIAddon.applySkin(self, desktop, parent)
1 change: 1 addition & 0 deletions lib/python/Components/Addons/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ installdir = $(pkglibdir)/python/Components/Addons

install_PYTHON = \
GUIAddon.py \
MainMenu.py \
Pager.py \
ButtonSequence.py \
ColorButtonsSequence.py \
Expand Down
6 changes: 3 additions & 3 deletions lib/python/Components/Addons/Pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def postWidgetCreate(self, instance):

def getSourceOrientation(self):
if isinstance(self.source, List): # Components.Sources.List
orig_source = self.source.master.master
orig_source = self.source.connectedGuiElement or self.source.master.master
else:
orig_source = self.source
if hasattr(orig_source, "instance") and hasattr(orig_source.instance, "getOrientation"):
Expand All @@ -166,7 +166,7 @@ def getCurrentIndex(self):

def getSourceSize(self):
if isinstance(self.source, List): # Components.Sources.List
return self.source.master.master.instance.size()
return self.source.connectedGuiElement and self.source.connectedGuiElement.instance.size() or self.source.master.master.instance.size()
return self.source.instance.size()

def getListCount(self):
Expand All @@ -180,7 +180,7 @@ def getListCount(self):

def getListItemSize(self):
if isinstance(self.source, List): # Components.Sources.List
orig_source = self.source.master.master
orig_source = self.source.connectedGuiElement or self.source.master.master
else:
orig_source = self.source
if hasattr(orig_source, 'content'):
Expand Down
Loading

0 comments on commit 37e390d

Please sign in to comment.