Exemplo n.º 1
0
    def addProject_(self, sender):
        projectName = self.edtAddProject.stringValue()
        if projectName not in Projects.get() and not re.match("^\s*$", projectName):
                Projects.add(self.edtAddProject.stringValue())
        else:
            # show alert with reason for failure
            alert = NSAlert.alloc().init()
            alert.addButtonWithTitle_('OK')
            alert.setMessageText_('Failed to add new project')
            alert.setInformativeText_('Please ensure the project does not '
                    'already exist and that it contains characters.')
            alert.runModal()

        self.loadProjectsLists()
        self.edtAddProject.setStringValue_('')
    def addProject_(self, sender):
        projectName = self.edtAddProject.stringValue()
        if projectName not in Projects.get() and not re.match(
                "^\s*$", projectName):
            Projects.add(self.edtAddProject.stringValue())
        else:
            # show alert with reason for failure
            alert = NSAlert.alloc().init()
            alert.addButtonWithTitle_('OK')
            alert.setMessageText_('Failed to add new project')
            alert.setInformativeText_(
                'Please ensure the project does not '
                'already exist and that it contains characters.')
            alert.runModal()

        self.loadProjectsLists()
        self.edtAddProject.setStringValue_('')
Exemplo n.º 3
0
    def initControls(self):
        """Init basic controls"""
        self.outputArea.setString_("")

        self.tasks = Tasks()

        if userPrefs.showWorkTill:
            self.workTillBox.setHidden_(False)
        else:
            self.workTillBox.setHidden_(True)

        self.pbtnProject.removeAllItems()
        self.pbtnProject.addItemsWithTitles_(Projects.get())
        self.pbtnProject.selectItemWithTitle_(userPrefs.selectedProject)

        self.projectChange_(None)

        self.initDoneButton()

        self.fillTasks()
        self.scrollToEnd()
Exemplo n.º 4
0
    def initControls(self):
        """Init basic controls"""
        self.outputArea.setString_("")

        self.tasks = Tasks()

        if userPrefs.showWorkTill:
            self.workTillBox.setHidden_(False)
        else:
            self.workTillBox.setHidden_(True)

        self.pbtnProject.removeAllItems()
        self.pbtnProject.addItemsWithTitles_(Projects.get())
        self.pbtnProject.selectItemWithTitle_(userPrefs.selectedProject)

        self.projectChange_(None)

        self.initDoneButton()

        self.fillTasks()
        self.scrollToEnd()
 def loadProjectsLists(self):
     self.pbtnRemoveProject.removeAllItems()
     self.pbtnRemoveProject.addItemsWithTitles_(Projects.get())
Exemplo n.º 6
0
 def loadProjectsLists(self):
     self.pbtnRemoveProject.removeAllItems()
     self.pbtnRemoveProject.addItemsWithTitles_(Projects.get())