def ok(self): mode = self.comboMode.currentIndex() if mode==None: return get = self.get() if get==None: return y0, m0, d0 = get if mode==core.primaryMode: y, m, d = (y0, m0, d0) else: y, m, d = convert(y0, m0, d0, mode, core.primaryMode) if not core.validDate(mode, y, m, d): print 'bad date: %s'%dateStr(mode, y, m, d) return self.emit(qc.SIGNAL('response-date'), y, m, d) self.hide()
def ok(self, widget): mode = self.comboMode.get_active() if mode==None: return get = self.get() if get==None: return y0, m0, d0 = get if mode==calTypes.primary: y, m, d = (y0, m0, d0) else: y, m, d = convert(y0, m0, d0, mode, calTypes.primary) if not core.validDate(mode, y, m, d): print('bad date: %s'%dateStr(mode, y, m, d)) return self.emit('response-date', y, m, d) self.hide() self.dateInput.set_value((y0, m0, d0)) self.dateInput.add_history()