def on_editItem1(self): """ Command launched when 'Edit' QPushButton is clicked Launch Group editing dialog """ super(Groups, self).on_editItem1() selItems = self.tw_tree.selectedItems() or [] if selItems: #--- Get Prompts ---# grades = [] itemObj = selItems[0].itemObj for n in range(max(self._groups.grades) + 1): grades.append(str(n)) prompts = [dict(promptType='line', promptLabel='grpCode', promptValue=itemObj.grpCode, readOnly=True), dict(promptType='line', promptLabel='grpName', promptValue=itemObj.grpName), dict(promptType='combo', promptLabel='grpGrade', promptValue=grades, defaultValue=itemObj.grpGrade), dict(promptType='color', promptLabel='grpColor', promptValue=itemObj.grpColor)] #--- Launch Dialog ---# self.dial_groups = promptMultiUi.PromptMulti(title="Edit Group", prompts=prompts, parent=self, acceptCmd=partial(self.on_dialogAccept, dialogMode='edit', selItem=selItems[0])) self.dial_groups.exec_() else: message = "!!! Select at least one group item !!!" pQt.errorDialog(message, self)
def on_addItem(self): """ Command launched when 'Add' QPushButton is clicked Create new user """ super(Users, self).on_addItem() #--- Get Prompts ---# prompts = [ dict(promptType='line', promptLabel='userName'), dict(promptType='combo', promptLabel='userGroup', promptValue=self._groups.codes, defaultValue=self._groups.codes[-1]), dict(promptType='line', promptLabel='userFirstName'), dict(promptType='line', promptLabel='userLastName') ] #--- Launch Dialog ---# self.dial_user = promptMultiUi.PromptMulti(title="New User", prompts=prompts, parent=self, acceptCmd=partial( self.on_dialogAccept, dialogMode='add', selItem=None)) self.dial_user.exec_()
def on_miNewProject(self): """ Command launched when 'New Project' QMenuItem is triggered Launch NewProject dialog """ self.log.detail(">>> Launch 'New Project' ...") #--- Get Prompts ---# prompts = [ dict(promptType='line', promptLabel='projectName'), dict(promptType='line', promptLabel='projectCode') ] #--- Launch Dialog ---# self.dial_newProject = promptMultiUi.PromptMulti( title="New Project", prompts=prompts, parent=self, acceptCmd=self.on_dialNewProject) self.dial_newProject.exec_()
def on_addItem(self): """ Command launched when 'Add' QPushButton is clicked Add new group to tree """ super(Entities, self).on_addItem() #--- Get Prompts ---# prompts = [ dict(promptType='line', promptLabel='ctxtCode'), dict(promptType='line', promptLabel='ctxtName'), dict(promptType='line', promptLabel='ctxtFolder') ] #--- Launch Dialog ---# self.dial_CtxtEntity = promptMultiUi.PromptMulti( title="New Entity", prompts=prompts, parent=self, acceptCmd=self.on_dialogAccept) self.dial_CtxtEntity.exec_()
def on_addItem(self): """ Command launched when 'Add' QPushButton is clicked Add new group to tree """ super(Groups, self).on_addItem() #--- Get Prompts ---# grades = [] for n in range(max(self._groups.grades) + 1): grades.append(str(n)) prompts = [dict(promptType='line', promptLabel='grpCode'), dict(promptType='line', promptLabel='grpName'), dict(promptType='combo', promptLabel='grpGrade', promptValue=grades, defaultValue='9'), dict(promptType='color', promptLabel='grpColor', promptValue=(0, 0, 0))] #--- Launch Dialog ---# self.dial_groups = promptMultiUi.PromptMulti(title="New Group", prompts=prompts, parent=self, acceptCmd=partial(self.on_dialogAccept, dialogMode='add', selItem=None)) self.dial_groups.exec_()
def on_editItem1(self): """ Command launched when 'Edit' QPushButton is clicked Launch User editing dialog """ super(Users, self).on_editItem1() selItems = self.tw_tree.selectedItems() or [] if selItems: #--- Get Prompts ---# itemObj = selItems[0].itemObj prompts = [ dict(promptType='line', promptLabel='userName', promptValue=itemObj.userName, readOnly=True), dict(promptType='combo', promptLabel='userGroup', promptValue=self._groups.codes, defaultValue=itemObj.userGroup), dict(promptType='line', promptLabel='userFirstName', promptValue=itemObj.userFirstName), dict(promptType='line', promptLabel='userLastName', promptValue=itemObj.userLastName) ] #--- Launch Dialog ---# self.dial_user = promptMultiUi.PromptMulti( title="Edit User", prompts=prompts, parent=self, acceptCmd=partial(self.on_dialogAccept, dialogMode='edit', selItem=selItems[0])) self.dial_user.exec_() else: message = "!!! Select at least one user item !!!" pQt.errorDialog(message, self)
def on_addItem(self): """ Command launched when 'Add' QPushButton is clicked Add new group to tree """ super(Tasks, self).on_addItem() #--- Get Prompts ---# prompts = [ dict(promptType='line', promptLabel='pipeCode'), dict(promptType='line', promptLabel='pipeName') ] #--- Launch Dialog ---# selItems = self.tw_tree.selectedItems() or [] if selItems: title = "New Task" else: title = "New Step" self.dial_pipeLine = promptMultiUi.PromptMulti( title=title, prompts=prompts, parent=self, acceptCmd=self.on_dialogAccept) self.dial_pipeLine.exec_()