def _setSheet(self, sheet): self.sheet = sheet self.sheetName = self.sheet.sheetName() self._listener = KSpread.createListener(self.sheetName, self.config.sheetRange) if not self._listener: raise Exception, T.i18n("Failed to create listener") def cellChanged(column, row): text = self.sheet.text(column, row) if text: # if self.myorca.isSpeaking(): # self.myorca.stop() self.myorca.speak(text) self._listener.connect("cellChanged(int,int)", cellChanged) def sheetNameChanged(*args): self.myorca.speak(T.i18n("Sheet name changed")) self.sheet.connect("nameChanged()", sheetNameChanged) def sheetShowChanged(*args): self.myorca.speak(T.i18n("Show sheet %1", [self.sheetName])) self.sheet.connect("showChanged()", sheetShowChanged) def sheetHideChanged(*args): self.myorca.speak(T.i18n("Hide sheet %1"), [self.sheetName]) self.sheet.connect("hideChanged()", sheetHideChanged)
def _setSheet(self, sheet): self.sheet = sheet self.sheetName = self.sheet.sheetName() self._listener = KSpread.createListener(self.sheetName, self.config.sheetRange) if not self._listener: raise Exception, T.i18n("Failed to create listener") def cellChanged(column, row): text = self.sheet.text(column, row) if text: #if self.myorca.isSpeaking(): # self.myorca.stop() self.myorca.speak(text) self._listener.connect("cellChanged(int,int)", cellChanged) def sheetNameChanged(*args): self.myorca.speak(T.i18n("Sheet name changed")) self.sheet.connect("nameChanged()", sheetNameChanged) def sheetShowChanged(*args): self.myorca.speak(T.i18n("Show sheet %1", [self.sheetName])) self.sheet.connect("showChanged()", sheetShowChanged) def sheetHideChanged(*args): self.myorca.speak(T.i18n("Hide sheet %1"), [self.sheetName]) self.sheet.connect("hideChanged()", sheetHideChanged)
def startLogging(self, sheetname, cellrange = ""): self.sheet = KSpread.sheetByName(sheetname) self.listener = KSpread.createListener(sheetname, cellrange) if not self.listener: raise "Failed to create listener for sheetname '%s' and range '%s'" % (sheetname,cellrange) self.addLog( "Start logging sheet='%s' range='%s'" % (sheetname,cellrange) ) self.listener.connect("regionChanged(QVariantList)", self.regionChanged) self.listener.connect("cellChanged(int,int)", self.cellChanged)
def startLogging(self, sheetname, cellrange=""): self.sheet = KSpread.sheetByName(sheetname) self.listener = KSpread.createListener(sheetname, cellrange) if not self.listener: raise Exception, T.i18n( "Failed to create listener for sheetname '%1' and range '%2'", [sheetname], [cellrange]) self.addLog("Start logging sheet='%s' range='%s'" % (sheetname, cellrange)) self.listener.connect("regionChanged(QVariantList)", self.regionChanged) self.listener.connect("cellChanged(int,int)", self.cellChanged)