def onInit(self): xbmcgui.WindowXMLDialog.onInit(self) self.titleLabel = self.getControl(EditControls.CHANNEL_LABEL) self.titleLabel.setLabel(ACTIONS_EDIT_CHANNEL + "[CR]" + self.display_name) self.programLabel = self.getControl(EditControls.PROGRAM_LABEL) self.programLabel.setLabel(ACTIONS_PROGRAM_LABEL + "[CR]" + self.program_title) self.getControl( EditControls.CHANNEL_HIDE).setLabel(ACTIONS_HIDE_CHANNEL) self.getControl( EditControls.CHANNEL_RENAME).setLabel(ACTIONS_RENAME_CHANNEL) self.getControl(EditControls.QUIT).setLabel(ACTIONS_QUIT_WINDOW) self.getControl( EditControls.CHANNEL_LOGO_UPDATE).setLabel(ACTIONS_LOGO_UPDATE) self.getControl( EditControls.PROGRAM_START).setLabel(ACTIONS_PROGRAM_START) self.getControl( EditControls.PROGRAM_REMINDER).setLabel(ACTIONS_PROGRAM_REMIND) self.setFocus(self.getControl(EditControls.PROGRAM_START)) if not settings.useProgramsReminder(): self.removeControl(self.getControl(EditControls.PROGRAM_REMINDER)) self.getControl(EditControls.PROGRAM_START).controlDown( self.getControl(EditControls.CHANNEL_HIDE)) else: database, cursor = connectEpgDB() epgDb = EpgDb(database, cursor) program_start = epgDb.getProgramStartDate(self.program_id) if program_start < datetime.now() + settings.getRemindersTime(): self.getControl( EditControls.PROGRAM_REMINDER).setVisible(False) remind = epgDb.hasReminder(self.program_id) if remind: self.getControl(EditControls.PROGRAM_REMINDER).setLabel( ACTIONS_PROGRAM_FORGET_REMIND) epgDb.close() del database del cursor del epgDb self.win_logo = LogoEditWindowXML('logo-edit-window.xml', settings.getAddonPath()) self.win_sf = SuperFavouritesXMLDialog('superfavourites-window.xml', settings.getAddonPath())
def onInit(self): if self.epgDb is None: database, cursor = connectEpgDB() self.epgView = EPGGridView(self) loading = SplashScreen(self, self.epgView.width, self.epgView.bottom) loading.start() self.epgDb = EPGXML.EpgDb(database, cursor) self.epgView.setGlobalDataGrid(self.epgDb.getEpgGrid()) self.epgView.displayChannels() self.epgView.setFocus(0, 0) self.editWindow = EditWindow('epg-menu-edit.xml', settings.getAddonPath()) loading.stop() else: self.refresh()
database, cursor = connectEpgDB() epgDb = EPGXML.EpgDb(database, cursor) # Populate and create tables in case of first start if epgDb.firstTimeRuning(): xbmcgui.Dialog().ok(strings.DIALOG_TITLE, strings.SFX_FIRST_START_DETECTED) epgXml = EPGXML.EpgXml(database, cursor, progress_bar=True) if epgXml.getXMLTV(): epgDb.setFirstTimeRuning(0) epgDb.setUpdateDate() xbmc.sleep(1000) # Super favourites folder init. sf_folder = superfavourites.SuperFavouritesIptvFolder() sf_folder.createSubFolders() # All is done, restart required xbmcgui.Dialog().ok(strings.DIALOG_TITLE, strings.SFX_INIT_OK) sf_folder.close() epgDb.close() epgXml.close() del epgDb del epgXml # Else, update epg in a thread else: # Starting GUI EPGgui = XMLWindowEPG('epg.xml', settings.getAddonPath()) EPGgui.doModal() del EPGgui