Advertisement
SharkyEXE

Untitled

Aug 25th, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. from enigma import getDesktop, eTimer
  2. from Components.ActionMap import ActionMap
  3. from Components.ConfigList import ConfigListScreen
  4. from Screens.Screen import Screen
  5. from Tools import Notifications
  6. from Screens.MessageBox import MessageBox
  7. from Plugins.Plugin import PluginDescriptor
  8.  
  9. screenWidth = getDesktop(0).size().width()
  10.  
  11. skin_hd = """
  12. <screen position="40,40" size="72,72" zPosition="-6" flags="wfNoBorder">
  13. <ePixmap position="0,0" size="72,72" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/BlockButton2/block_hd.png" />
  14. </screen>"""
  15.  
  16. skin_fhd = """
  17. <screen position="60,60" size="108,108" zPosition="-6" flags="wfNoBorder">
  18. <ePixmap position="0,0" size="108,108" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/BlockButton2/block_fhd.png" />
  19. </screen>"""
  20.  
  21. class BlockButton2(Screen):
  22. def __init__(self, session):
  23. Screen.__init__(self, session)
  24. if screenWidth and screenWidth == 1280:
  25. self.skin = skin_hd
  26. if screenWidth and screenWidth == 1920:
  27. self.skin = skin_fhd
  28. self["actions"] = ActionMap(["WizardActions", "ColorActions", "OkCancelActions", "DirectionActions", "ChannelSelectEPGActions", "ButtonSetupActions", "GlobalActions", "SetupActions"],
  29. {
  30. "power": self.close,
  31. "text": self.close,
  32. "subtitle": self.close,
  33. "1": self.close,
  34. "2": self.close,
  35. "3": self.close,
  36. "4": self.close,
  37. "5": self.close,
  38. "6": self.close,
  39. "7": self.close,
  40. "8": self.close,
  41. "9": self.close,
  42. "previous": self.close,
  43. "0": self.close,
  44. "next": self.close,
  45. "back": self.close,
  46. "red": self.close,
  47. "green": self.close,
  48. "yellow": self.close,
  49. "blue": self.close,
  50. "left": self.close,
  51. "up": self.close,
  52. "right": self.close,
  53. "down": self.close,
  54. "ok": self.close,
  55. "channelup": self.close,
  56. "channeldown": self.close,
  57. "cancel": self.close,
  58. "epg": self.close,
  59. "volumeUp": self.close,
  60. "volumeDown": self.close,
  61. "menu": self.close,
  62. "list": self.close,
  63. "audio": self.close,
  64. "info": self.close,
  65. "rewind": self.close,
  66. "play": self.close,
  67. "playpause": self.close,
  68. "fastforward": self.close,
  69. "showTv": self.close,
  70. "rec": self.close,
  71. "stop": self.close,
  72. "radio": self.close,
  73. }, -2)
  74. self.hide_time = eTimer()
  75. self.hide_time.callback.append(self.setHide)
  76. self.hide_time.startLongTimer(2) # Pause in seconds
  77.  
  78. def setHide(self):
  79. self.hide_time.stop()
  80. self.close()
  81.  
  82. def sessionstart(reason, **kwargs):
  83. if reason == 0:
  84. #Notifications.AddPopup(text=_('AutoStart Work 100%'), type=MessageBox.TYPE_INFO, timeout=10, id='BlockButton2')
  85. #Notifications.AddPopup(text=_('AutoStart Work 100%'), type=MessageBox.TYPE_INFO, timeout=1, id='BlockButton2')
  86. #Notifications.AddPopup(text=_('AutoStart Work 100%'), type=MessageBox.TYPE_INFO, timeout=0, id='BlockButton2') # Pri "timeout=0" - okno pokazyvaetsya postoyanno
  87. #self.close()
  88. print 'BlockButton'
  89. return
  90.  
  91. def main(session, **kwargs):
  92. session.open(BlockButton2)
  93.  
  94. def Plugins(**kwargs):
  95. list = [PluginDescriptor(where=[PluginDescriptor.WHERE_SESSIONSTART], fnc=sessionstart)]
  96. list.append(PluginDescriptor(name=_('BlockButton2'), description=_("Do Not Show the 'BlockButton2' on the screen"), where=PluginDescriptor.WHERE_PLUGINMENU, icon='plugin.png', fnc=main))
  97. return list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement