Пример #1
0
 def __init__(self, event):  ## FIXME
     common.WidgetClass.__init__(self, event)
     ################
     hbox = gtk.HBox()
     pack(hbox, gtk.Label(_("Month")))
     self.monthCombo = MonthComboBox()
     self.monthCombo.build(event.mode)
     pack(hbox, self.monthCombo)
     pack(hbox, gtk.Label(""), 1, 1)
     #pack(self, hbox)
     ###
     #hbox = gtk.HBox()
     pack(hbox, gtk.Label(_("Day")))
     self.daySpin = DaySpinButton()
     pack(hbox, self.daySpin)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(self, hbox)
     ###
     hbox = gtk.HBox()
     self.startYearCheck = gtk.CheckButton(_("Start Year"))
     pack(hbox, self.startYearCheck)
     self.startYearSpin = YearSpinButton()
     pack(hbox, self.startYearSpin)
     pack(hbox, gtk.Label(""), 1, 1)
     pack(self, hbox)
     self.startYearCheck.connect("clicked", self.startYearCheckClicked)
     ####
     self.notificationBox = common.NotificationBox(event)
     pack(self, self.notificationBox)
Пример #2
0
 def __init__(self, event, autoCheck=True):
     common.WidgetClass.__init__(self, event)
     ################
     self.autoCheck = autoCheck
     ######
     self.ruleAddBox = gtk.HBox()
     self.warnLabel = gtk.Label()
     self.warnLabel.modify_fg(gtk.StateType.NORMAL, gdk.Color(65535, 0, 0))
     self.warnLabel.set_alignment(0, 0.5)
     #self.warnLabel.set_visible(False)## FIXME
     ###########
     self.rulesFrame = gtk.Frame()
     self.rulesFrame.set_label(_("Rules"))
     self.rulesFrame.set_border_width(1)
     self.rulesSwin = gtk.ScrolledWindow()
     self.rulesBox = gtk.VBox()
     self.rulesBox.set_border_width(5)
     self.rulesSwin.add(self.rulesBox)
     self.rulesFrame.add(self.rulesSwin)
     pack(self, self.rulesFrame, expand=True, fill=True)
     ###
     pack(self, self.ruleAddBox)
     pack(self, self.warnLabel)
     ###
     self.notificationBox = common.NotificationBox(event)
     pack(self, self.notificationBox)
     ###########
     self.addRuleModel = gtk.ListStore(str, str)
     self.addRuleCombo = gtk.ComboBox()
     self.addRuleCombo.set_model(self.addRuleModel)
     ###
     cell = gtk.CellRendererText()
     pack(self.addRuleCombo, cell, True)
     self.addRuleCombo.add_attribute(cell, "text", 1)
     ###
     pack(self.ruleAddBox, gtk.Label(_("Add Rule") + ":"))
     pack(self.ruleAddBox, self.addRuleCombo)
     pack(self.ruleAddBox, gtk.Label(""), 1, 1)
     self.ruleAddButton = gtk.Button(stock=gtk.STOCK_ADD)
     if ui.autoLocale:
         self.ruleAddButton.set_label(_("_Add"))
         self.ruleAddButton.set_image(
             gtk.Image.new_from_stock(
                 gtk.STOCK_ADD,
                 gtk.IconSize.BUTTON,
             ))
     pack(self.ruleAddBox, self.ruleAddButton)
     #############
     #self.filesBox = common.FilesBox(self.event)
     #pack(self, self.filesBox)
     #############
     self.addRuleCombo.connect("changed", self.addRuleComboChanged)
     self.ruleAddButton.connect("clicked", self.addClicked)
Пример #3
0
 def __init__(self, event, autoCheck=True):
     common.WidgetClass.__init__(self, event)
     ################
     self.autoCheck = autoCheck
     ######
     self.ruleAddBox = gtk.HBox()
     self.warnLabel = gtk.Label()
     self.warnLabel.modify_fg(gtk.StateType.NORMAL, gdk.Color(65535, 0, 0))
     self.warnLabel.set_alignment(0, 0.5)
     #self.warnLabel.set_visible(False)## FIXME
     ###########
     self.rulesExp = gtk.Expander()
     self.rulesExp.set_label(_('Rules'))
     self.rulesExp.set_expanded(True)
     self.rulesBox = gtk.VBox()
     self.rulesExp.add(self.rulesBox)
     pack(self, self.rulesExp)
     ###
     pack(self, self.ruleAddBox)
     pack(self, self.warnLabel)
     ###
     self.notificationBox = common.NotificationBox(event)
     pack(self, self.notificationBox)
     ###########
     self.addRuleModel = gtk.ListStore(str, str)
     self.addRuleCombo = gtk.ComboBox()
     self.addRuleCombo.set_model(self.addRuleModel)
     ###
     cell = gtk.CellRendererText()
     pack(self.addRuleCombo, cell, True)
     self.addRuleCombo.add_attribute(cell, 'text', 1)
     ###
     pack(self.ruleAddBox, gtk.Label(_('Add Rule') + ':'))
     pack(self.ruleAddBox, self.addRuleCombo)
     pack(self.ruleAddBox, gtk.Label(''), 1, 1)
     self.ruleAddButton = gtk.Button(stock=gtk.STOCK_ADD)
     if ui.autoLocale:
         self.ruleAddButton.set_label(_('_Add'))
         self.ruleAddButton.set_image(
             gtk.Image.new_from_stock(gtk.STOCK_ADD, gtk.IconSize.BUTTON))
     pack(self.ruleAddBox, self.ruleAddButton)
     #############
     #self.filesBox = common.FilesBox(self.event)
     #pack(self, self.filesBox)
     #############
     self.addRuleCombo.connect('changed', self.addRuleComboChanged)
     self.ruleAddButton.connect('clicked', self.addClicked)
Пример #4
0
 def __init__(self, event):  ## FIXME
     common.WidgetClass.__init__(self, event)
     ######
     sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
     ######
     hbox = gtk.HBox()
     label = gtk.Label(_('Start'))
     label.set_alignment(0, 0.5)
     sizeGroup.add_widget(label)
     pack(hbox, label)
     self.startDateInput = DateButton()
     pack(hbox, self.startDateInput)
     ##
     pack(hbox, gtk.Label(' ' + _('Time')))
     self.startTimeInput = TimeButton()
     pack(hbox, self.startTimeInput)
     ##
     pack(self, hbox)
     ######
     hbox = gtk.HBox()
     self.endTypeCombo = gtk.ComboBoxText()
     for item in ('Duration', 'End'):
         self.endTypeCombo.append_text(_(item))
     self.endTypeCombo.connect('changed', self.endTypeComboChanged)
     sizeGroup.add_widget(self.endTypeCombo)
     pack(hbox, self.endTypeCombo)
     ####
     self.durationBox = common.DurationInputBox()
     pack(hbox, self.durationBox, 1, 1)
     ####
     self.endDateHbox = gtk.HBox()
     self.endDateInput = DateButton()
     pack(self.endDateHbox, self.endDateInput)
     ##
     pack(self.endDateHbox, gtk.Label(' ' + _('Time')))
     self.endTimeInput = TimeButton()
     pack(self.endDateHbox, self.endTimeInput)
     ##
     pack(hbox, self.endDateHbox, 1, 1)
     ####
     pack(hbox, gtk.Label(''), 1, 1)
     pack(self, hbox)
     #############
     self.notificationBox = common.NotificationBox(event)
     pack(self, self.notificationBox)
Пример #5
0
 def __init__(self, event):  ## FIXME
     common.WidgetClass.__init__(self, event)
     ######
     sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
     ######
     hbox = gtk.HBox()
     label = gtk.Label(_("Start"))
     label.set_alignment(0, 0.5)
     sizeGroup.add_widget(label)
     pack(hbox, label)
     self.startDateInput = DateButton()
     pack(hbox, self.startDateInput)
     ##
     pack(self, hbox)
     ######
     hbox = gtk.HBox()
     self.endTypeCombo = gtk.ComboBoxText()
     for item in ("Duration", "End"):
         self.endTypeCombo.append_text(_(item))
     self.endTypeCombo.connect("changed", self.endTypeComboChanged)
     sizeGroup.add_widget(self.endTypeCombo)
     pack(hbox, self.endTypeCombo)
     ####
     self.durationBox = gtk.HBox()
     self.durationSpin = IntSpinButton(1, 999)
     pack(self.durationBox, self.durationSpin)
     pack(self.durationBox, gtk.Label(_(" days")))
     pack(hbox, self.durationBox)
     ####
     self.endDateInput = DateButton()
     pack(hbox, self.endDateInput)
     ####
     pack(hbox, gtk.Label(""), 1, 1)
     pack(self, hbox)
     #############
     self.notificationBox = common.NotificationBox(event)
     pack(self, self.notificationBox)
Пример #6
0
 def __init__(self, event):  ## FIXME
     gtk.VBox.__init__(self)
     self.event = event
     assert event.parent.name == "universityTerm"  ## FIXME
     sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
     #####
     if not event.parent.courses:
         showError(event.parent.noCourseError, ui.eventManDialog)
         raise RuntimeError("No courses added")
     self.courseIds = []
     self.courseNames = []
     combo = gtk.ComboBoxText()
     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.TextDirection.LTR)
     #self.dayTimeEndCombo.get_child().set_direction(gtk.TextDirection.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)
Пример #7
0
 def __init__(self, event):  ## FIXME
     gtk.VBox.__init__(self)
     self.event = event
     assert event.parent.name == 'universityTerm'  ## FIXME
     sizeGroup = gtk.SizeGroup(gtk.SizeGroupMode.HORIZONTAL)
     #####
     if not event.parent.courses:
         showError(event.parent.noCourseError, ui.eventManDialog)
         raise RuntimeError('No courses added')
     self.courseIds = []
     self.courseNames = []
     combo = gtk.ComboBoxText()
     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.TextDirection.LTR)
     #self.dayTimeEndCombo.get_child().set_direction(gtk.TextDirection.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)