def printEpisodeList(self): # Reset text if necessary for i in range( len( self.refEpisodeList ) ): # Remove click areas karamba.removeClickArea(Applet.widget, self.refEpisodeUrls[i]) # Remove text karamba.deleteText(Applet.widget, self.refEpisodeList[i]) karamba.deleteText(Applet.widget, self.refEpisodeListWhen[i]) self.refEpisodeUrls = [] self.refEpisodeList = [] self.refEpisodeListWhen = [] # Write episode list for i in range( len( self.episodeList ) ): color = self._processColor( self.episodeList[i]['delta'] ) posTitleY = self.themeHeaderWH[1] + ( self.themeBodyWH[1] * i ) + self.themeBodyTitleXY[1] posWhenY = self.themeHeaderWH[1] + ( self.themeBodyWH[1] * i ) + self.themeBodyWhenXY[1] episodeText = tools.formatEpisode( self.episodeList[i], self.episodeFormatString ) refT = karamba.createText(Applet.widget, self.themeBodyTitleXY[0], posTitleY, self.themeBodyTitleWH[0], self.themeBodyTitleWH[1], episodeText) karamba.changeTextColor(Applet.widget, refT, color[0], color[1], color[2]) self.refEpisodeList.append( refT ) cmd = self.browser.replace( "$url$", self.episodeList[i]['url'] ) refUrl = karamba.createClickArea(Applet.widget, self.themeBodyTitleXY[0], posTitleY, self.themeBodyTitleWH[0], self.themeBodyTitleWH[1], cmd) self.refEpisodeUrls.append( refUrl ) whenText = self._formatWhen( self.episodeList[i]['airdate'], self.episodeList[i]['delta'] ) refW = karamba.createText(Applet.widget, self.themeBodyWhenXY[0], posWhenY, self.themeBodyWhenWH[0], self.themeBodyWhenWH[1], whenText) karamba.changeTextColor(Applet.widget, refW, color[0], color[1], color[2]) karamba.setTextAlign(Applet.widget, refW, "CENTER") karamba.attachClickArea(Applet.widget, refW) self.refEpisodeListWhen.append( refW )
def printEpisodeList(self): # Reset text if necessary for i in range(len(self.refEpisodeList)): # Remove click areas karamba.removeClickArea(Applet.widget, self.refEpisodeUrls[i]) # Remove text karamba.deleteText(Applet.widget, self.refEpisodeList[i]) karamba.deleteText(Applet.widget, self.refEpisodeListWhen[i]) self.refEpisodeUrls = [] self.refEpisodeList = [] self.refEpisodeListWhen = [] # Write episode list for i in range(len(self.episodeList)): color = self._processColor(self.episodeList[i]['delta']) posTitleY = self.themeHeaderWH[1] + (self.themeBodyWH[1] * i) + self.themeBodyTitleXY[1] posWhenY = self.themeHeaderWH[1] + (self.themeBodyWH[1] * i) + self.themeBodyWhenXY[1] episodeText = tools.formatEpisode(self.episodeList[i], self.episodeFormatString) refT = karamba.createText(Applet.widget, self.themeBodyTitleXY[0], posTitleY, self.themeBodyTitleWH[0], self.themeBodyTitleWH[1], episodeText) karamba.changeTextColor(Applet.widget, refT, color[0], color[1], color[2]) self.refEpisodeList.append(refT) cmd = self.browser.replace("$url$", self.episodeList[i]['url']) refUrl = karamba.createClickArea(Applet.widget, self.themeBodyTitleXY[0], posTitleY, self.themeBodyTitleWH[0], self.themeBodyTitleWH[1], cmd) self.refEpisodeUrls.append(refUrl) whenText = self._formatWhen(self.episodeList[i]['airdate'], self.episodeList[i]['delta']) refW = karamba.createText(Applet.widget, self.themeBodyWhenXY[0], posWhenY, self.themeBodyWhenWH[0], self.themeBodyWhenWH[1], whenText) karamba.changeTextColor(Applet.widget, refW, color[0], color[1], color[2]) karamba.setTextAlign(Applet.widget, refW, "CENTER") karamba.attachClickArea(Applet.widget, refW) self.refEpisodeListWhen.append(refW)
def refreshFormatPreview(self, text): testFormat = tools.formatEpisode(Globals().sampleEpisode, text) self.ui.lblFormatPreview.setText(u"<u><b>Preview:</b></u> %s" % testFormat)
def refreshFormatPreview(self, text): testFormat = tools.formatEpisode( Globals().sampleEpisode, text ) self.ui.lblFormatPreview.setText( u"<u><b>Preview:</b></u> %s" % testFormat )