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 btnDonePress_(self, sender): """On done button press""" if self.tasks.dayStarted(): if self.cbxInput.stringValue().strip(): taskName = self.cbxInput.stringValue() self.appendTask(*fh.formatTaskString(*self.tasks.add( taskName, self.pbtnProject.titleOfSelectedItem()))) self.readCounters() self.cbxInput.setStringValue_("") self.scrollToEnd() if Tasks.taskType(taskName) == "work": Projects.addAutocomplete( self.pbtnProject.titleOfSelectedItem(), taskName) else: SlackingAutocompletes.add(taskName) self.cbxInput.addItemWithObjectValue_(taskName) else: if userPrefs.showHelpMessageOnStart: self.showStartHelpMessage() taskName = userPrefs.startPlaceholder self.appendTask(*fh.formatTaskString(*self.tasks.add(taskName))) self.initDoneButton()
def btnDonePress_(self, sender): """On done button press""" if self.tasks.dayStarted(): if self.cbxInput.stringValue().strip(): taskName = self.cbxInput.stringValue() self.appendTask(*fh.formatTaskString( *self.tasks.add(taskName, self.pbtnProject.titleOfSelectedItem()))) self.readCounters() self.cbxInput.setStringValue_("") self.scrollToEnd() if Tasks.taskType(taskName) == "work": Projects.addAutocomplete( self.pbtnProject.titleOfSelectedItem(), taskName) else: SlackingAutocompletes.add(taskName) self.cbxInput.addItemWithObjectValue_(taskName) else: if userPrefs.showHelpMessageOnStart: self.showStartHelpMessage() taskName = userPrefs.startPlaceholder self.appendTask(*fh.formatTaskString(*self.tasks.add(taskName))) self.initDoneButton()