def updateDetailScreen(self): self.textBrowser.clear() self.currentTreeWidget = self.treeWidget.currentItem() try: scriptName = self.currentTreeWidget.text(0) scriptNo = scriptName.replace("script", "") indexSelectedScript = videoscriptcore.getScripts().index( int(scriptNo)) selectedScript = videoscriptcore.video_scripts[indexSelectedScript] self.currentScriptSelected = selectedScript.scriptno self.textBrowser.append("Category: %s\n" % selectedScript.sub_reddit) self.textBrowser.append("Title: %s\n" % selectedScript.title) self.textBrowser.append("Upvotes: %s" % selectedScript.upvotes) self.textBrowser.append("Author: %s" % selectedScript.author) self.textBrowser.append("Vid Number: %s" % selectedScript.vidNo) self.textBrowser.append("Status: %s" % selectedScript.status) self.textBrowser.append("Script ID: %s" % selectedScript.scriptno) self.textBrowser.append("Being Edited by: %s" % selectedScript.editedby) self.editedby.setText(selectedScript.editedby) self.currentTreeWidget.setForeground( 0, QtGui.QBrush(QtGui.QColor("blue"))) except AttributeError: pass self.updateColors()
def updateColors(self): try: children = self.count_tems() for i in range(len(children)): scriptName = children[i].text(0) scriptNo = scriptName.replace("script", "") indexSelectedScript = videoscriptcore.getScripts().index( int(scriptNo)) status = videoscriptcore.video_scripts[ indexSelectedScript].status if hasattr(self, "currentTreeWidget"): if status == "RAW": children[i].setForeground( 0, QtGui.QBrush(QtGui.QColor("black"))) elif status == "EDITING": children[i].setForeground( 0, QtGui.QBrush(QtGui.QColor("yellow"))) elif status == "COMPLETE": children[i].setForeground( 0, QtGui.QBrush(QtGui.QColor("green"))) elif status == "MANUALCOMPLETE": children[i].setForeground( 0, QtGui.QBrush(QtGui.QColor("darkgreen"))) except: print("error occured recolouring scripts")
def startVideoEditor(self): if hasattr(self, "currentTreeWidget"): scriptName = self.currentTreeWidget.text(0) scriptNo = scriptName.replace("script", "") indexSelectedScript = videoscriptcore.getScripts().index( int(scriptNo)) selectedScript = videoscriptcore.video_scripts[indexSelectedScript] client.editScript(selectedScript.scriptno) self.videoEditorWindow = videoeditor.VideoEditor( selectedScript, self) self.videoEditorWindow.show() self.isEditing = True
def changeSelected(self): try: if not self.treeWidget.currentItem().text( 0) in videoscriptcore.getCategories(): scriptName = self.treeWidget.currentItem().text(0) scriptNo = scriptName.replace("script", "") indexSelectedScript = videoscriptcore.getScripts().index( int(scriptNo)) status = videoscriptcore.video_scripts[ indexSelectedScript].status if hasattr(self, "currentTreeWidget"): if status == "RAW": self.currentTreeWidget.setForeground( 0, QtGui.QBrush(QtGui.QColor("black"))) self.startEditing.setEnabled(True) self.flagComplete.setEnabled(True) self.flagscriptquality.setEnabled(True) elif status == "EDITING": self.currentTreeWidget.setForeground( 0, QtGui.QBrush(QtGui.QColor("yellow"))) self.startEditing.setEnabled(False) self.flagComplete.setEnabled(False) self.flagscriptquality.setEnabled(False) elif status == "COMPLETE": self.currentTreeWidget.setForeground( 0, QtGui.QBrush(QtGui.QColor("green"))) self.startEditing.setEnabled(False) self.flagComplete.setEnabled(False) self.flagscriptquality.setEnabled(False) elif status == "MANUALCOMPLETE": self.currentTreeWidget.setForeground( 0, QtGui.QBrush(QtGui.QColor("darkgreen"))) self.startEditing.setEnabled(False) self.flagComplete.setEnabled(False) self.flagscriptquality.setEnabled(False) if self.isEditing: self.startEditing.setEnabled(False) self.updateDetailScreen() except AttributeError: self.updateDetailScreen()