Beispiel #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)
Beispiel #2
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)
Beispiel #3
0
 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
Beispiel #4
0
class WidgetClass(common.WidgetClass):
    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)
        ####
        #self.filesBox = common.FilesBox(self.event)
        #pack(self, self.filesBox)
    startYearCheckClicked = lambda self, obj=None: self.startYearSpin.set_sensitive(self.startYearCheck.get_active())
    def updateWidget(self):## FIXME
        common.WidgetClass.updateWidget(self)
        self.monthCombo.setValue(self.event.getMonth())
        self.daySpin.set_value(self.event.getDay())
        try:
            startRule = self.event['start']
        except:
            self.startYearCheck.set_active(False)
            self.startYearSpin.set_value(self.event.getSuggestedStartYear())
        else:
            self.startYearCheck.set_active(True)
            self.startYearSpin.set_value(startRule.date[0])
        self.startYearCheckClicked()
    def updateVars(self):## FIXME
        common.WidgetClass.updateVars(self)
        self.event.setMonth(self.monthCombo.getValue())
        self.event.setDay(int(self.daySpin.get_value()))
        if self.startYearCheck.get_active():
            startRule = self.event.getAddRule('start')
            startRule.date = (self.startYearSpin.get_value(), 1, 1)
        else:
            try:
                del self.event['start']
            except KeyError:
                pass
    def modeComboChanged(self, obj=None):## overwrite method from common.WidgetClass
        newMode = self.modeCombo.get_active()
        module = calTypes[newMode]
        monthCombo = self.monthCombo
        month = monthCombo.getValue()
        monthCombo.build(newMode)
        y2, m2, d2 = convert(
            int(self.startYearSpin.get_value()),
            month,
            int(self.daySpin.get_value()),
            self.event.mode,
            newMode,
        )
        self.startYearSpin.set_value(y2)
        monthCombo.setValue(m2)
        self.daySpin.set_value(d2)
        self.event.mode = newMode
Beispiel #5
0
class WidgetClass(common.WidgetClass):
    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)
        ####
        #self.filesBox = common.FilesBox(self.event)
        #pack(self, self.filesBox)

    startYearCheckClicked = lambda self, obj=None: self.startYearSpin.set_sensitive(
        self.startYearCheck.get_active())

    def updateWidget(self):  ## FIXME
        common.WidgetClass.updateWidget(self)
        self.monthCombo.setValue(self.event.getMonth())
        self.daySpin.set_value(self.event.getDay())
        try:
            startRule = self.event['start']
        except:
            self.startYearCheck.set_active(False)
            self.startYearSpin.set_value(self.event.getSuggestedStartYear())
        else:
            self.startYearCheck.set_active(True)
            self.startYearSpin.set_value(startRule.date[0])
        self.startYearCheckClicked()

    def updateVars(self):  ## FIXME
        common.WidgetClass.updateVars(self)
        self.event.setMonth(self.monthCombo.getValue())
        self.event.setDay(int(self.daySpin.get_value()))
        if self.startYearCheck.get_active():
            startRule = self.event.getAddRule('start')
            startRule.date = (self.startYearSpin.get_value(), 1, 1)
        else:
            try:
                del self.event['start']
            except KeyError:
                pass

    def modeComboChanged(self,
                         obj=None
                         ):  ## overwrite method from common.WidgetClass
        newMode = self.modeCombo.get_active()
        module = calTypes[newMode]
        monthCombo = self.monthCombo
        month = monthCombo.getValue()
        monthCombo.build(newMode)
        y2, m2, d2 = convert(
            int(self.startYearSpin.get_value()),
            month,
            int(self.daySpin.get_value()),
            self.event.mode,
            newMode,
        )
        self.startYearSpin.set_value(y2)
        monthCombo.setValue(m2)
        self.daySpin.set_value(d2)
        self.event.mode = newMode