本文整理汇总了Python中lib.db.DB.setTaskPriority方法的典型用法代码示例。如果您正苦于以下问题:Python DB.setTaskPriority方法的具体用法?Python DB.setTaskPriority怎么用?Python DB.setTaskPriority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.db.DB
的用法示例。
在下文中一共展示了DB.setTaskPriority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Workload
# 需要导入模块: from lib.db import DB [as 别名]
# 或者: from lib.db.DB import setTaskPriority [as 别名]
#.........这里部分代码省略.........
msgWindow=QtGui.QMessageBox()
if parent is not None: self=parent
msgWindow.information(self, windowtitle, text, buttons=QtGui.QMessageBox.Ok )
def loadTasksList(self, archived=False,init=False):
self.ui.taskList.clear()
for i in self.db.getTasks(self.currentContext):
self.createTaskItem(i[1], i[0],i[2])
def deleteSelectedTasks(self, force=False):
selectedItems = self.ui.taskList.selectedItems()
if len(selectedItems)>0:
tasks = []
for item in selectedItems:
tasks.append(item)
windowtitle=QtGui.QApplication.translate("ui","Delete task")
text=QtGui.QApplication.translate("ui","Do you really want to delete selected task(s) ?")
if force:
self.deleteTasks(tasks)
windowtitle=QtGui.QApplication.translate("ui","Delete task")
text=QtGui.QApplication.translate("ui","Do you really want to delete selected task(s) ?")
elif self.questionPopup(windowtitle,text):
self.deleteTasks(tasks)
self.adjustHeight(downSize=True)
def deleteTasks(self, tasks):
for item in tasks:
self.db.deleteTask(item.data(0, 32))
index = self.ui.taskList.indexOfTopLevelItem(item)
self.ui.taskList.takeTopLevelItem(index)
self.ui.statusbar.showMessage(QtGui.QApplication.translate("ui","Task removed."),3300)
def setTaskPriority(self,priority):
selectedItems = self.ui.taskList.selectedItems()
for item in selectedItems:
self.db.setTaskPriority(item.data(0, 32),priority)
self.setPriorityColor(item, priority)
item.setText(0,str(priority))
self.ui.taskList.sortItems(0,QtCore.Qt.AscendingOrder)
self.ui.statusbar.showMessage(QtGui.QApplication.translate("ui","Priority updated."),3300)
def setPriorityColor(self,item,priority):
icon=QtGui.QIcon(':res/status/'+str(priority)+'.png')
item.setIcon(1,icon)
def openTask(self,taskname=None):
if not self.taskOpened:
item = self.getSelectedItem()
if item:
Task(self,item.data(0, 32))
def getSelectedItem(self):
selectedItems = self.ui.taskList.selectedItems()
if len(selectedItems) == 1:
item = self.ui.taskList.selectedItems()[0]
return item
else:
return False
# SHORTCUTS AND KEYBOARD EVENTS RELATED ACTIONS
def getKeysOnList(self, e):
if e.key() == 16777223: # delete
if (QtCore.Qt.ShiftModifier & e.modifiers()):