Beispiel #1
0
    def editCategory(self):
        selectedCategory = self.ui.treeWidget.currentItem()

        if (selectedCategory != None):

            #just edit categories
            if (not isinstance(selectedCategory, TICategoryWidget)):
                return

            selectedCategoryText = selectedCategory.categoryText()

            categoryInput = TICategoryDialog(self)
            categoryInput.setCategoryText(selectedCategoryText)
            categoryInput.exec_()

            if (categoryInput.result() == TICategoryDialog.Accepted):
                #this returns QString so str() it
                selectedCategoryId = selectedCategory.categoryId()
                updatedCategoryText = str(categoryInput.categoryText())

                dbHandler = self.dbHandler
                dbHandler.editCategory(selectedCategoryId, updatedCategoryText)

                selectedCategory.setCategoryText(updatedCategoryText)
                self.tasklistModification(True)
Beispiel #2
0
 def editCategory(self):
     selectedCategory = self.ui.treeWidget.currentItem()
     
     if(selectedCategory != None):
         
         #just edit categories
         if(not isinstance(selectedCategory, TICategoryWidget)):
             return
         
         selectedCategoryText = selectedCategory.categoryText()
                     
         categoryInput = TICategoryDialog(self)
         categoryInput.setCategoryText(selectedCategoryText)
         categoryInput.exec_()
         
         if(categoryInput.result() == TICategoryDialog.Accepted):
             #this returns QString so str() it
             selectedCategoryId = selectedCategory.categoryId()
             updatedCategoryText = str(categoryInput.categoryText())
             
             dbHandler = self.dbHandler
             dbHandler.editCategory(selectedCategoryId, updatedCategoryText)
             
             selectedCategory.setCategoryText(updatedCategoryText)
             self.tasklistModification(True)