コード例 #1
0
    def initVlaues(self):
        self.stprWorkHours.setIntValue_(fh.secToHours(userPrefs.workDayLength))
        self.edtWorkHours.setIntValue_(self.stprWorkHours.intValue())

        self.stprNotificationTime.setIntValue_(userPrefs.notificationTime)
        self.edtNotificationTime.setIntValue_(
            self.stprNotificationTime.intValue())

        self.stprNotificationRepeatTime.setIntValue_(
            userPrefs.notificationRepeatTime)
        self.edtNotificationRepeatTime.setIntValue_(
            self.stprNotificationRepeatTime.intValue())

        workEndTime = datetime.datetime.strptime(userPrefs.workEndTime,
                                                 "%H:%M").time()
        someDate = datetime.datetime.combine(datetime.datetime.now(),
                                             workEndTime)

        self.dpkrWorkStarts.setDateValue_(fh.datetimeToNSDate(someDate))

        self.edtLogEditCommand.setStringValue_(userPrefs.logEditCommand)

        self.chbShowWorkTill.setState_(1 if userPrefs.showWorkTill else 0)
        self.chbShowDateTime.setState_(1 if userPrefs.showDateTime else 0)
        self.chbShowNotification.setState_(
            1 if userPrefs.showNotification else 0)
        self.chbSoundOnNotification.setState_(
            1 if userPrefs.soundOnNotification else 0)

        self.edtDateTimeFormat.setStringValue_(userPrefs.logDateTimeFormat)
        self.edtDateTimeFormat.setEnabled_(self.chbShowDateTime.state())
        self.showNotification_(self)
コード例 #2
0
    def initVlaues(self):
        self.stprWorkHours.setIntValue_(fh.secToHours(userPrefs.workDayLength))
        self.edtWorkHours.setIntValue_(self.stprWorkHours.intValue())

        self.stprNotificationTime.setIntValue_(userPrefs.notificationTime)
        self.edtNotificationTime.setIntValue_(self.stprNotificationTime.intValue())

        self.stprNotificationRepeatTime.setIntValue_(userPrefs.notificationRepeatTime)
        self.edtNotificationRepeatTime.setIntValue_(self.stprNotificationRepeatTime.intValue())

        workEndTime = datetime.datetime.strptime(userPrefs.workEndTime, "%H:%M").time()
        someDate = datetime.datetime.combine(datetime.datetime.now(), workEndTime)

        self.dpkrWorkStarts.setDateValue_(fh.datetimeToNSDate(someDate))

        self.edtLogEditCommand.setStringValue_(userPrefs.logEditCommand)

        self.chbShowWorkTill.setState_(1 if userPrefs.showWorkTill else 0)
        self.chbShowDateTime.setState_(1 if userPrefs.showDateTime else 0)
        self.chbShowNotification.setState_(1 if userPrefs.showNotification else 0)
        self.chbSoundOnNotification.setState_(1 if userPrefs.soundOnNotification else 0)

        self.edtDateTimeFormat.setStringValue_(userPrefs.logDateTimeFormat)
        self.edtDateTimeFormat.setEnabled_(self.chbShowDateTime.state())
        self.showNotification_(self)
コード例 #3
0
 def updateCustomDatePicker(self):
     self.dpkrTo.setDateValue_(datetimeToNSDate(self.endDate))
     self.dpkrFrom.setDateValue_(datetimeToNSDate(self.startDate))