def __init__(self, rule): self.rule = rule ##### gtk.HBox.__init__(self) ### combo = gtk.combo_box_new_text() for item in rule.wmIndexNames: combo.append_text(item) pack(self, combo) self.nthCombo = combo ### combo = WeekDayComboBox() pack(self, combo) self.weekDayCombo = combo ### pack(self, gtk.Label(_(' of '))) ### combo = MonthComboBox(True) combo.build(rule.getMode()) pack(self, combo) self.monthCombo = combo
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(_('Week')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.weekNumModeCombo = WeekNumModeWidgetClass(event['weekNumMode']) pack(hbox, self.weekNumModeCombo) pack(self, hbox) ##### hbox = gtk.HBox() label = gtk.Label(_('Week Day')) label.set_alignment(0, 0.5) sizeGroup.add_widget(label) pack(hbox, label) self.weekDayCombo = WeekDayComboBox() #self.weekDayCombo.connect('changed', self.updateSummary) pack(hbox, self.weekDayCombo) 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 = HourMinuteButtonOption() self.dayTimeEndCombo = HourMinuteButtonOption() ## #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)