def __init__(self, session, allowOveride=True): try: log("", self, "Menu Opened succesfull..") #check if enigmalight is pointed to good OE Version, if not then make the link checkSymbolic() Screen.__init__(self, session) self.session = session #Set screen self.currentScreen = self #Set controller and session self.controller = CONTROLLER_INSTANCE self.controller.setSession(self.session) self.controller.setMainScreen(True) #Timer class self.timer_class = TIMER_INSTANCE TIMER_INSTANCE.setController(CONTROLLER_INSTANCE) #Set horizontal menu items self.setHorMenuElements(depth=2) self.translateNames() # Menu self["menu"] = List(enableWrapAround=True) # Buttons self["txt_green"] = Label() self["btn_green"] = Pixmap() self["txt_red"] = Label() self["btn_red"] = Pixmap() self["txt_blue"] = Label() self["btn_blue"] = Pixmap() self["txt_yellow"] = Label() self["btn_yellow"] = Pixmap() self["txt_check"] = Label() self["statusbar"] = Pixmap() self["txt_statusbar"] = Label() self["txt_statusbar_info"] = Label() self["actions"] = HelpableActionMap( self, "EL_MainMenuActions", { "ok": (self.okbuttonClick, ""), "left": (self.left, ""), "right": (self.right, ""), "up": (self.up, ""), "down": (self.down, ""), "cancel": (self.cancel, ""), "green": (self.keyGreen, ""), "red": (self.keyRed, ""), "blue": (self.keyBlue, ""), "yellow": (self.keyYellow, ""), "key_0": (self.key0, ""), }, -2) self.onLayoutFinish.append(self.finishLayout) except: from traceback import format_exc log("Error:", format_exc()) try: open(getCrashFilePath(), "w").write(format_exc()) except: pass
m_session = None ## Start timer thread timer = ELightTimer() timer.start() ## Start controller thread controller = Controller() controller.start() #remove old files rmFile(getCrashFilePath()) rmFile("/tmp/enigmalight_gui.log") #check if enigmalight is pointed to good OE Version, if not then make the link checkSymbolic() #=============================================================================== # main # Actions to take place when starting the plugin over extensions #=============================================================================== #noinspection PyUnusedLocal def main(session, **kwargs): log("",None,"plugin::sessionstart()") session.open(EnigmaLight_MainMenu) def sessionstart(reason, **kwargs): try: if reason == 0: timer.setSession(kwargs["session"])