def projectChange_(self, sender): """Project changed event""" if self.pbtnProject.titleOfSelectedItem(): self.cbxInput.removeAllItems() self.cbxInput.addItemsWithObjectValues_(Projects.getAutocomleteList( self.pbtnProject.titleOfSelectedItem(), SlackingAutocompletes.get())) if sender: userPrefs.selectedProject = unicode( self.pbtnProject.titleOfSelectedItem()) userPrefs.save()
def projectChange_(self, sender): """Project changed event""" if self.pbtnProject.titleOfSelectedItem(): self.cbxInput.removeAllItems() self.cbxInput.addItemsWithObjectValues_( Projects.getAutocomleteList( self.pbtnProject.titleOfSelectedItem(), SlackingAutocompletes.get())) if sender: userPrefs.selectedProject = unicode( self.pbtnProject.titleOfSelectedItem()) userPrefs.save()
def showStartHelpMessage(self): """Show alert with help message""" alert = NSAlert.alloc().init() alert.addButtonWithTitle_('OK') alert.setMessageText_("Congrats, you started your working day!") alert.setInformativeText_("Now start doing your working activity " "(e.g reading mail). When you finish with your activity " "go back to MacTimeLog and type it in. If your activity is " "slacking, use 2 asterisks (**) at the end of the activity's " "name.") alert.setShowsSuppressionButton_(True) alert.runModal() if alert.suppressionButton().state() == NSOnState: userPrefs.showHelpMessageOnStart = False userPrefs.save()
def showStartHelpMessage(self): """Show alert with help message""" alert = NSAlert.alloc().init() alert.addButtonWithTitle_('OK') alert.setMessageText_("Congrats, you started your working day!") alert.setInformativeText_( "Now start doing your working activity " "(e.g reading mail). When you finish with your activity " "go back to MacTimeLog and type it in. If your activity is " "slacking, use 2 asterisks (**) at the end of the activity's " "name.") alert.setShowsSuppressionButton_(True) alert.runModal() if alert.suppressionButton().state() == NSOnState: userPrefs.showHelpMessageOnStart = False userPrefs.save()
def saveSettings(self): userPrefs.workDayLength = fh.hoursToSeconds( self.stprWorkHours.intValue()) userPrefs.workEndTime = fh.nsDateToDatetime( self.dpkrWorkStarts.dateValue()).strftime("%H:%M") userPrefs.logEditComman = self.edtLogEditCommand.stringValue() userPrefs.logDateTimeFormat = self.edtDateTimeFormat.stringValue() userPrefs.notificationTime = self.stprNotificationTime.intValue() userPrefs.notificationRepeatTime = ( self.stprNotificationRepeatTime.intValue()) userPrefs.save()
def saveSettings(self): userPrefs.workDayLength = fh.hoursToSeconds( self.stprWorkHours.intValue()) userPrefs.workEndTime = fh.nsDateToDatetime( self.dpkrWorkStarts.dateValue()).strftime("%H:%M") userPrefs.logEditComman = self.edtLogEditCommand.stringValue() userPrefs.logDateTimeFormat = self.edtDateTimeFormat.stringValue() userPrefs.notificationTime = self.stprNotificationTime.intValue() userPrefs.notificationRepeatTime = (self. stprNotificationRepeatTime.intValue()) userPrefs.save()