예제 #1
0
    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()
예제 #2
0
    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()
예제 #3
0
    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()
예제 #4
0
    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()