Skip to content

Commit

Permalink
Merge OpenViX
Browse files Browse the repository at this point in the history
  • Loading branch information
Ev0-BH committed Dec 5, 2021
2 parents 55ca07e + 650eea2 commit 5982310
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 15 deletions.
6 changes: 4 additions & 2 deletions data/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ self.session.open(SABnzbdSetupScreen)
<item entryID="logs_setup" level="2" text="Settings"><setup id="logs" /></item>
<item entryID="logs_man" level="2" text="Log Manager"><screen module="LogManager" screen="LogManager" /></item>
</menu>

<!-- Menu / Setup / System / Software Update -->
<menu weight="3" level="0" text="Software update" entryID="software_update">
<id val="softwareupdatemenu"/>
<item weight="1" level="0" text="Settings" entryID="onlineupdate_setup"><setup id="softwareupdate"/></item>
<item weight="2" level="0" text="Online update" entryID="software_update"><screen module="SoftwareUpdate" screen="UpdatePlugin"/></item>
<item entryID="onlineupdate_setup" level="0" text="Settings" weight="1"><setup id="softwareupdate"/></item>
<item entryID="software_update" level="0" text="Online update" weight="2"><screen module="SoftwareUpdate" screen="UpdatePlugin"/></item>
</menu>
<item entryID="input_device_setup" level="1" text="Input Devices" weight="4"><screen module="InputDeviceSetup" screen="InputDeviceSelection" /></item>
<item entryID="keyboard_setup" level="0" text="Keyboard" weight="5"><setup id="keyboard" /></item>
Expand Down
2 changes: 1 addition & 1 deletion data/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
<item level="1" text="Allow unstable (experimental) updates" description="When enabled the online checker will also check for experimental versions">config.softwareupdate.updatebeta</item>
<item level="1" text="Automatic settings backup" description="Perform a settings backup before updating.">config.softwareupdate.autosettingsbackup</item>
<item level="1" text="Automatic image backup" description="Perform a complete image backup before updating.">config.softwareupdate.autoimagebackup</item>
<item level="1" text="Show Software Update in Extensions" description="Show Software Update in Extensions Menu (Blue button long). 'yes' adds it permanently. 'only when available' only shows it when updates are known to be available based on update polling.">config.softwareupdate.showinextensions</item>
</setup>
<setup key="softcamsetup" title="Softcam settings">
<item level="2" text="Show CCcam Info in extensions?" description="Allows you to show/hide CCcam Info in extensions -blue button." requires="CCcamInstalled">config.cccaminfo.showInExtensions</item>
Expand Down Expand Up @@ -472,7 +473,6 @@
<setup key="pluginbrowsersetup" title="Plugin browser settings">
<item level="2" text="Show translation packages" description="If set to 'yes' it will show the 'PO' packages in browser.">config.pluginbrowser.po</item>
<item level="2" text="Show source packages" description="If set to 'yes' it will show the 'SRC' packages in browser.">config.pluginbrowser.src</item>
<item level="1" text="Allow unstable (experimental) feeds" description="When enabled the feeds and software updates may contain unstable experimental versions. Enable this at your own risk.">config.softwareupdate.updatebeta</item>
</setup>
<setup key="wizardoptions" title="Common options">
<item level="0" text="Picons: Show in channel list" description="Configure if service picons will be shown in the channel selection list.">config.usage.service_icon_enable</item>
Expand Down
4 changes: 3 additions & 1 deletion lib/python/Components/ChoiceList.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def row_delta_y():
return (int(font[2]) - int(font[1])) / 2


def ChoiceEntryComponent(key=None, text=["--"]):
def ChoiceEntryComponent(key=None, text=None):
if text is None:
text = ["--"]
res = [text]
if text[0] == "--":
x, y, w, h = parameters.get("ChoicelistDash", applySkinFactor(0, 2, 800, 25))
Expand Down
1 change: 1 addition & 0 deletions lib/python/Components/UsageConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ def set12VOutput(configElement):
config.softwareupdate.updatefound = NoSave(ConfigBoolean(default=False))
config.softwareupdate.updatebeta = ConfigYesNo(default=False)
config.softwareupdate.updateisunstable = ConfigInteger(default=0)
config.softwareupdate.showinextensions = ConfigSelection(default="no", choices=[("no", _("no")), ("yes", _("yes")), ("available", _("only when available"))])

config.timeshift = ConfigSubsection()
choicelist = [("0", "Disabled")]
Expand Down
14 changes: 14 additions & 0 deletions lib/python/Screens/InfoBarGenerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2699,11 +2699,21 @@ def __init__(self):
for p in plugins.getPlugins(PluginDescriptor.WHERE_EXTENSIONSINGLE):
p(self)

self.addExtension(extension=self.getSoftwareUpdate, type=InfoBarExtensions.EXTENSION_LIST)
self.addExtension(extension=self.getLogManager, type=InfoBarExtensions.EXTENSION_LIST)
self.addExtension(extension=self.getOsd3DSetup, type=InfoBarExtensions.EXTENSION_LIST)
self.addExtension(extension=self.getCCcamInfo, type=InfoBarExtensions.EXTENSION_LIST)
self.addExtension(extension=self.getOScamInfo, type=InfoBarExtensions.EXTENSION_LIST)

def getSUname(self):
return _("Software Update")

def getSoftwareUpdate(self):
if config.softwareupdate.showinextensions.value == "yes" or config.softwareupdate.showinextensions.value == "available" and config.softwareupdate.updatefound.value:
return [((boundFunction(self.getSUname), boundFunction(self.openSoftwareUpdate), lambda: True), None)]
else:
return []

def getLMname(self):
return _("Log Manager")

Expand Down Expand Up @@ -2816,6 +2826,10 @@ def openOScamInfo(self):
def showTimerList(self):
self.session.open(TimerEditList)

def openSoftwareUpdate(self):
from Screens.SoftwareUpdate import UpdatePlugin
self.session.open(UpdatePlugin)

def openLogManager(self):
from Screens.LogManager import LogManager
self.session.open(LogManager)
Expand Down
2 changes: 1 addition & 1 deletion lib/python/Screens/PluginBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def startRun(self):
self["text"].setText(_("WARNING: feeds may be unstable.") + '\n' + _("Downloading plugin information. Please wait..."))
self.container.execute(self.ipkg + " update")
elif config.softwareupdate.updateisunstable.value == '1' and not config.softwareupdate.updatebeta.value:
self["text"].setText(_("UNSTABLE: The feeds currently contain unstable experimental items. If you wish to use these, enable 'Allow unstable (experimental) updates' in the Plugin Browser settings menu."))
self["text"].setText(_("Sorry feeds seem be in an unstable state, if you wish to use them please enable 'Allow unstable (experimental) updates' in \"Software update settings\"."))
else:
self.container.execute(self.ipkg + " update")
elif self.type == self.REMOVE:
Expand Down
10 changes: 1 addition & 9 deletions lib/python/Screens/SoftwareUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ def __init__(self, session, title="", list=None, keys=None, selection=0, skin_na
self['tl_yellow'] = Pixmap()
self['tl_green'] = Pixmap()

self["menuActions"] = NumberActionMap(["MenuActions"],
{
"menu": self.opensettings
}, prio=-3) # Override ChoiceBox "menu" action
self.onShown.append(self.onshow)

def onshow(self):
Expand All @@ -92,10 +88,6 @@ def onshow(self):
else:
self['tl_off'].show()

def opensettings(self):
from Screens.Setup import Setup
self.session.open(Setup, "softwareupdate")

def cancelClick(self, dummy=False):
self.close()

Expand Down Expand Up @@ -179,7 +171,7 @@ def checkNetworkState(self):
else:
self.startCheck()
else:
self.session.openWithCallback(self.statusMessageCallback, MessageBox, _("UNSTABLE: The feeds currently contain unstable experimental updates. You can continue at your own risk but doing so may render your %s %s unusable and in need of a complete reflash.\n\nAre you sure you want to continue?") % (getMachineBrand(), getMachineName()), type=MessageBox.TYPE_YESNO, default=False)
self.session.openWithCallback(self.close, MessageBox, _("Sorry the feeds seem to be in an unstable state, if you wish to use them please enable 'Allow unstable (experimental) updates' in \"Software update settings\"."), type=MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True)

def statusMessageCallback(self, answer):
if answer:
Expand Down
51 changes: 50 additions & 1 deletion lib/python/skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import errno
import xml.etree.cElementTree

from enigma import addFont, eLabel, ePixmap, ePoint, eRect, eSize, eWindow, eWindowStyleManager, eWindowStyleSkinned, getDesktop, gFont, getFontFaces, gMainDC, gRGB, BT_ALPHATEST, BT_ALPHABLEND
from enigma import addFont, eLabel, ePixmap, ePoint, eRect, eSize, eWindow, eWindowStyleManager, eWindowStyleSkinned, getDesktop, gFont, getFontFaces, gMainDC, gRGB, BT_ALPHATEST, BT_ALPHABLEND, BT_HALIGN_CENTER, BT_HALIGN_LEFT, BT_HALIGN_RIGHT, BT_KEEP_ASPECT_RATIO, BT_SCALE, BT_VALIGN_BOTTOM, BT_VALIGN_CENTER, BT_VALIGN_TOP
from os.path import basename, dirname, isfile

from Components.config import ConfigSubsection, ConfigText, config
Expand Down Expand Up @@ -553,6 +553,55 @@ def scale(self, value):
value = 1 if value.lower() in ("1", "enabled", "on", "scale", "true", "yes") else 0
self.guiObject.setScale(value)

def scaleFlags(self, value):
base = BT_SCALE | BT_KEEP_ASPECT_RATIO
try:
self.guiObject.setPixmapScaleFlags({
"none": 0,
"scale": BT_SCALE,
"scaleKeepAspect": base,
"scaleLeftTop": base | BT_HALIGN_LEFT | BT_VALIGN_TOP,
"scaleLeftCenter": base | BT_HALIGN_LEFT | BT_VALIGN_CENTER,
"scaleLeftCentre": base | BT_HALIGN_LEFT | BT_VALIGN_CENTER,
"scaleLeftMiddle": base | BT_HALIGN_LEFT | BT_VALIGN_CENTER,
"scaleLeftBotton": base | BT_HALIGN_LEFT | BT_VALIGN_BOTTOM,
"scaleCenterTop": base | BT_HALIGN_CENTER | BT_VALIGN_TOP,
"scaleCentreTop": base | BT_HALIGN_CENTER | BT_VALIGN_TOP,
"scaleMiddleTop": base | BT_HALIGN_CENTER | BT_VALIGN_TOP,
"scaleCenter": base | BT_HALIGN_CENTER | BT_VALIGN_CENTER,
"scaleCentre": base | BT_HALIGN_CENTER | BT_VALIGN_CENTER,
"scaleMiddle": base | BT_HALIGN_CENTER | BT_VALIGN_CENTER,
"scaleCenterBotton": base | BT_HALIGN_CENTER | BT_VALIGN_BOTTOM,
"scaleCentreBottom": base | BT_HALIGN_CENTER | BT_VALIGN_BOTTOM,
"scaleMiddleBotton": base | BT_HALIGN_CENTER | BT_VALIGN_BOTTOM,
"scaleRightTop": base | BT_HALIGN_RIGHT | BT_VALIGN_TOP,
"scaleRightCenter": base | BT_HALIGN_RIGHT | BT_VALIGN_CENTER,
"scaleRightCentre": base | BT_HALIGN_RIGHT | BT_VALIGN_CENTER,
"scaleRightMiddle": base | BT_HALIGN_RIGHT | BT_VALIGN_CENTER,
"scaleRightBottom": base | BT_HALIGN_RIGHT | BT_VALIGN_BOTTOM,
"moveLeftTop": BT_HALIGN_LEFT | BT_VALIGN_TOP,
"moveLeftCenter": BT_HALIGN_LEFT | BT_VALIGN_CENTER,
"moveLeftCentre": BT_HALIGN_LEFT | BT_VALIGN_CENTER,
"moveLeftMiddle": BT_HALIGN_LEFT | BT_VALIGN_CENTER,
"moveLeftBotton": BT_HALIGN_LEFT | BT_VALIGN_BOTTOM,
"moveCenterTop": BT_HALIGN_CENTER | BT_VALIGN_TOP,
"moveCentreTop": BT_HALIGN_CENTER | BT_VALIGN_TOP,
"moveMiddleTop": BT_HALIGN_CENTER | BT_VALIGN_TOP,
"moveCenter": BT_HALIGN_CENTER | BT_VALIGN_CENTER,
"moveCentre": BT_HALIGN_CENTER | BT_VALIGN_CENTER,
"moveMiddle": BT_HALIGN_CENTER | BT_VALIGN_CENTER,
"moveCenterBotton": BT_HALIGN_CENTER | BT_VALIGN_BOTTOM,
"moveCentreBottom": BT_HALIGN_CENTER | BT_VALIGN_BOTTOM,
"moveMiddleBotton": BT_HALIGN_CENTER | BT_VALIGN_BOTTOM,
"moveRightTop": BT_HALIGN_RIGHT | BT_VALIGN_TOP,
"moveRightCenter": BT_HALIGN_RIGHT | BT_VALIGN_CENTER,
"moveRightCentre": BT_HALIGN_RIGHT | BT_VALIGN_CENTER,
"moveRightMiddle": BT_HALIGN_RIGHT | BT_VALIGN_CENTER,
"moveRightBottom": BT_HALIGN_RIGHT | BT_VALIGN_BOTTOM
}[value])
except KeyError:
raise AttribValueError("'none', 'scale', 'scaleKeepAspect', 'scaleLeftTop', 'scaleLeftCenter', 'scaleLeftBotton', 'scaleCenterTop', 'scaleCenter', 'scaleCenterBotton', 'scaleRightTop', 'scaleRightCenter', 'scaleRightBottom', 'moveLeftTop', 'moveLeftCenter', 'moveLeftBotton', 'moveCenterTop', 'moveCenter', 'moveCenterBotton', 'moveRightTop', 'moveRightCenter', 'moveRightBottom' ('Center'/'Centre'/'Middle' are equivalent)")

def orientation(self, value): # Used by eSlider.
try:
self.guiObject.setOrientation(*{
Expand Down

0 comments on commit 5982310

Please sign in to comment.