def updateVars(self): ## FIXME courseIndex = self.courseCombo.get_active() if courseIndex is None: showError(_("No course is selected"), self) raise RuntimeError("No courses is selected") else: self.event.courseId = self.courseIds[courseIndex] ## self.event.setDate(*tuple(self.dateInput.get_value())) ## self.event["dayTimeRange"].setRange(self.dayTimeStartCombo.get_value(), self.dayTimeEndCombo.get_value()) #### # self.event.summary = self.summaryEntry.get_text() self.event.description = self.descriptionInput.get_text() self.event.icon = self.iconSelect.get_filename() #### self.notificationBox.updateVars() self.event.updateSummary()
def fetchClicked(self, obj=None): combo = self.combo account = combo.account if not account: self.msgLabel.set_label(_('No account selected')) return self.msgLabel.set_label(_('Fatching')) while gtk.events_pending(): gtk.main_iteration_do(False) try: account.fetchGroups() except Exception as e: self.msgLabel.set_label(_('Error')) showError(_('Error in fetching remote groups') + '\n' + str(e)) return else: self.msgLabel.set_label('') account.save() self.combo.updateList()
def updateVars(self):## FIXME courseIndex = self.courseCombo.get_active() if courseIndex is None: showError(_('No course is selected'), self) raise RuntimeError('No courses is selected') else: self.event.courseId = self.courseIds[courseIndex] ## self.event.setDate(*tuple(self.dateInput.get_value())) ## self.event['dayTimeRange'].setRange( self.dayTimeStartCombo.get_value(), self.dayTimeEndCombo.get_value(), ) #### #self.event.summary = self.summaryEntry.get_text() self.event.description = self.descriptionInput.get_text() self.event.icon = self.iconSelect.get_filename() #### self.notificationBox.updateVars() self.event.updateSummary()
def fetchClicked(self, obj=None): combo = self.combo account = combo.account if not account: self.msgLabel.set_label(_('No account selected')) return self.msgLabel.set_label(_('Fatching')) while gtk.events_pending(): gtk.main_iteration_do(False) try: account.fetchGroups() except Exception as e: self.msgLabel.set_label(_('Error')) showError( _('Error in fetching remote groups') + '\n' + str(e) ) return else: self.msgLabel.set_label('') account.save() self.combo.updateList()
def updateVars(self):## FIXME courseIndex = self.courseCombo.get_active() if courseIndex is None: showError(_('No course is selected'), self) raise RuntimeError('No courses is selected') else: self.event.courseId = self.courseIds[courseIndex] ## self.weekNumModeCombo.updateVars() self.event['weekDay'].weekDayList = [self.weekDayCombo.getValue()]## FIXME ## self.event['dayTimeRange'].setRange( self.dayTimeStartCombo.get_value(), self.dayTimeEndCombo.get_value(), ) #### #self.event.summary = self.summaryEntry.get_text() self.event.description = self.descriptionInput.get_text() self.event.icon = self.iconSelect.get_filename() #### self.notificationBox.updateVars() self.event.updateSummary()
def __init__(self, event):## FIXME gtk.VBox.__init__(self) self.event = event assert event.parent.name == 'universityTerm' ## FIXME sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) ##### if not event.parent.courses: showError(event.parent.noCourseError) raise RuntimeError('No courses added') self.courseIds = [] self.courseNames = [] combo = gtk.combo_box_new_text() for course in event.parent.courses: self.courseIds.append(course[0]) self.courseNames.append(course[1]) combo.append_text(course[1]) #combo.connect('changed', self.updateSummary) self.courseCombo = combo ## hbox = gtk.HBox() label = gtk.Label(_('Course')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) hbox.pack_start(label, 0, 0) hbox.pack_start(combo, 0, 0) ## self.pack_start(hbox, 0, 0) ##### hbox = gtk.HBox() label = gtk.Label(_('Week')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) hbox.pack_start(label, 0, 0) self.weekNumModeCombo = WeekNumModeRuleWidget(event['weekNumMode']) hbox.pack_start(self.weekNumModeCombo, 0, 0) self.pack_start(hbox, 0, 0) ##### hbox = gtk.HBox() label = gtk.Label(_('Week Day')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) hbox.pack_start(label, 0, 0) self.weekDayCombo = WeekDayComboBox() #self.weekDayCombo.connect('changed', self.updateSummary) hbox.pack_start(self.weekDayCombo, 0, 0) self.pack_start(hbox, 0, 0) ##### hbox = gtk.HBox() label = gtk.Label(_('Time')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) hbox.pack_start(label, 0, 0) ## self.dayTimeStartCombo = HourMinuteButtonOption() self.dayTimeEndCombo = HourMinuteButtonOption() ## #self.dayTimeStartCombo.child.set_direction(gtk.TEXT_DIR_LTR) #self.dayTimeEndCombo.child.set_direction(gtk.TEXT_DIR_LTR) ## hbox.pack_start(self.dayTimeStartCombo, 0, 0) hbox.pack_start(gtk.Label(' ' + _('to') + ' '), 0, 0) hbox.pack_start(self.dayTimeEndCombo, 0, 0) self.pack_start(hbox, 0, 0) ########### #hbox = gtk.HBox() #label = gtk.Label(_('Summary')) #label.set_alignment(0, 0.5) #sizeGroup.add_widget(label) #hbox.pack_start(label, 0, 0) #self.summaryEntry = gtk.Entry() #hbox.pack_start(self.summaryEntry, 1, 1) #self.pack_start(hbox, 0, 0) ##### hbox = gtk.HBox() label = gtk.Label(_('Description')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) hbox.pack_start(label, 0, 0) self.descriptionInput = TextFrame() hbox.pack_start(self.descriptionInput, 1, 1) self.pack_start(hbox, 0, 0) ##### hbox = gtk.HBox() label = gtk.Label(_('Icon')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) hbox.pack_start(label, 0, 0) self.iconSelect = common.IconSelectButton() #print join(pixDir, self.icon) hbox.pack_start(self.iconSelect, 0, 0) hbox.pack_start(gtk.Label(''), 1, 1) self.pack_start(hbox, 0, 0) ###### self.notificationBox = common.NotificationBox(event) self.pack_start(self.notificationBox, 0, 0) ###### #self.filesBox = common.FilesBox(self.event) #self.pack_start(self.filesBox, 0, 0) ###### self.courseCombo.set_active(0)
def __init__(self, event):## FIXME gtk.VBox.__init__(self) self.event = event assert event.parent.name == 'universityTerm' ## FIXME sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) ##### if not event.parent.courses: showError(event.parent.noCourseError) raise RuntimeError('No courses added') self.courseIds = [] self.courseNames = [] combo = gtk.combo_box_new_text() for course in event.parent.courses: self.courseIds.append(course[0]) self.courseNames.append(course[1]) combo.append_text(course[1]) #combo.connect('changed', self.updateSummary) self.courseCombo = combo ## hbox = gtk.HBox() label = gtk.Label(_('Course')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) pack(hbox, combo) ## pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Date')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.dateInput = DateButton() pack(hbox, self.dateInput) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Time')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) ## self.dayTimeStartCombo = HourMinuteButton() self.dayTimeEndCombo = HourMinuteButton() ## #self.dayTimeStartCombo.get_child().set_direction(gtk.TEXT_DIR_LTR) #self.dayTimeEndCombo.get_child().set_direction(gtk.TEXT_DIR_LTR) ## pack(hbox, self.dayTimeStartCombo) pack(hbox, gtk.Label(' ' + _('to') + ' ')) pack(hbox, self.dayTimeEndCombo) pack(self, hbox) ########### #hbox = gtk.HBox() #label = gtk.Label(_('Summary')) #label.set_alignment(0, 0.5) #sizeGroup.add_widget(label) #pack(hbox, label) #self.summaryEntry = gtk.Entry() #pack(hbox, self.summaryEntry, 1, 1) #pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Description')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.descriptionInput = TextFrame() pack(hbox, self.descriptionInput, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Icon')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.iconSelect = IconSelectButton() #print(join(pixDir, self.icon)) pack(hbox, self.iconSelect) pack(hbox, gtk.Label(''), 1, 1) pack(self, hbox) ###### self.notificationBox = common.NotificationBox(event) pack(self, self.notificationBox) ###### #self.filesBox = common.FilesBox(self.event) #pack(self, self.filesBox) ###### self.courseCombo.set_active(0)
def checkEventToAdd(self, group, event): if not group.checkEventToAdd(event): showError(_('Group type "%s" can not contain event type "%s"')%(group.desc, event.desc), self) raise RuntimeError('Invalid event type for this group')
def __init__(self, event): ## FIXME gtk.VBox.__init__(self) self.event = event assert event.parent.name == "universityTerm" ## FIXME sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) ##### if not event.parent.courses: showError(event.parent.noCourseError) raise RuntimeError("No courses added") self.courseIds = [] self.courseNames = [] combo = gtk.combo_box_new_text() for course in event.parent.courses: self.courseIds.append(course[0]) self.courseNames.append(course[1]) combo.append_text(course[1]) # combo.connect('changed', self.updateSummary) self.courseCombo = combo ## hbox = gtk.HBox() label = gtk.Label(_("Course")) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) pack(hbox, combo) ## pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Date")) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.dateInput = DateButton() pack(hbox, self.dateInput) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Time")) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) ## self.dayTimeStartCombo = HourMinuteButton() self.dayTimeEndCombo = HourMinuteButton() ## # self.dayTimeStartCombo.get_child().set_direction(gtk.TEXT_DIR_LTR) # self.dayTimeEndCombo.get_child().set_direction(gtk.TEXT_DIR_LTR) ## pack(hbox, self.dayTimeStartCombo) pack(hbox, gtk.Label(" " + _("to") + " ")) pack(hbox, self.dayTimeEndCombo) pack(self, hbox) ########### # hbox = gtk.HBox() # label = gtk.Label(_('Summary')) # label.set_alignment(0, 0.5) # sizeGroup.add_widget(label) # pack(hbox, label) # self.summaryEntry = gtk.Entry() # pack(hbox, self.summaryEntry, 1, 1) # pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Description")) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.descriptionInput = TextFrame() pack(hbox, self.descriptionInput, 1, 1) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_("Icon")) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.iconSelect = IconSelectButton() # print(join(pixDir, self.icon)) pack(hbox, self.iconSelect) pack(hbox, gtk.Label(""), 1, 1) pack(self, hbox) ###### self.notificationBox = common.NotificationBox(event) pack(self, self.notificationBox) ###### # self.filesBox = common.FilesBox(self.event) # pack(self, self.filesBox) ###### self.courseCombo.set_active(0)