def onButtonClick(self, event): if self.recBtn['text'] == 'Record': if self.scName.get() != "": Recorder.RecorderFileName = self.scName.get() log.writeEvent('Record') Recorder.RecorderState = 'recording' self.recBtn['text'] = 'Save' else: messagebox.showerror( "No Scenario Name", " You Should Specify a Name for your Scenario" + " before starting to record") return else: if self.scName.get() == "": messagebox.showerror( "No Scenario Name", " You Should Specify a Name for your Scenario") return log.writeEvent('Save') self.recBtn['text'] = 'Record' log.saveRecordedScenario(self.scName.get()) self.updateList() scenarioEvents = log.getScenarioEvents(self.scName.get()) scc = ScenarioCenter(self, scenarioEvents, self.scName.get()) scc.mainloop()
def onDoubleClick(self, event): itemName = event.widget.master.name log.writeEvent('DoubleClick on ' + itemName + ' Folder') top = Explorer(self) self.root.topwindows.add(top) self.explorerList.add(top) top.mainloop()
def onClick(self, event): log.writeEvent('Click on Desktop') for item in self.selected: if type(item).__name__ == 'Folder': icon = ImageTk.PhotoImage(Image.open('Images/folder.png')) item.img.configure(image=icon) item.img.image = icon item.lbl.configure(fg='#000') if type(item).__name__ == 'File': icon = ImageTk.PhotoImage(Image.open('Images/file.png')) item.img.configure(image=icon) item.img.image = icon item.lbl.configure(fg='#000')
def onClick(self, event): itemName = event.widget.master.name log.writeEvent('Click on ' + itemName + ' File') for item in self.root.master.selected: if type(item).__name__ == 'Folder': icon = ImageTk.PhotoImage(Image.open('Images/folder.png')) item.img.configure(image=icon) item.img.image = icon item.lbl.configure(fg='#000') if type(item).__name__ == 'File': icon = ImageTk.PhotoImage(Image.open('Images/file.png')) item.img.configure(image=icon) item.img.image = icon item.lbl.configure(fg='#000') icon_sel = ImageTk.PhotoImage(Image.open('Images/fileselected.png')) self.img.configure(image=icon_sel) self.img.image = icon_sel self.lbl.configure(fg='#103c74') self.root.master.selected.add(event.widget.master)
def onImageClicked(self, event): index = int(event.widget.cget('text')) if index != self.slidesNumber: log.writeEvent('Click on preview image' + str(index)) self.show.configure(image=self.slides[index].original) self.show.image = self.slides[index].original else: self.slides = self.slides[:-1] log.writeEvent('Click on add new Image') dir = self.checkLogFileForScenarioPPT() if dir and self.automate == True: self.automatePPTScenario(dir) return self.ppt.attributes('-topmost', 'false') filename = filedialog.askopenfilename(initialdir='./OS', title='Select File to Add') self.ppt.attributes('-topmost', 'true') if filename != "": log.writeEvent('Insert new image:' + filename.split('OS')[1]) self.slides.append(PPTImage(filename)) self.populate() self.show.configure(image=self.slides[index].original) self.show.image = self.slides[index].original
def onClose(self): log.writeEvent('Close PPT') self.destroy()
def onNAClick(self, event): log.writeEvent('Cancel Automate') self.parent.automate = False self.parent.slides.append(self.parent.blank) self.destroy()
def openPowerPoint(self, event): log.writeEvent('Open PPT') ppt = PPT(self.parent) ppt.mainloop()