Beispiel #1
0
  def __init__(self, parent):
    ViewerWithDetailsBase.__init__(self, parent, WorkitemViewForm[0])
    
    self.tables = [self.ui.tblCurrent, self.ui.tblItems]
    self.table_contents = {w:[] for w in self.tables}
    self.session = None

    # fill the filter lists
    layouts = [self.ui.grpType.layout(),
               self.ui.grpPrio.layout(),
               self.ui.grpStatus.layout()]
    elements = [model.PlaneableItem.getItemTypeNames(),
                model.PRIORITIES.itervalues(),
                model.REQUIREMENTS_STATES.itervalues()]
    for layout, texts in zip(layouts, elements):
      for txt in texts:
        btn = QtGui.QRadioButton(txt, parent=self)
        layout.addWidget(btn)
        btn.clicked.connect(self.onFilterChange)
    # Also hook the existing 'all' buttons
    self.ui.btnAllPrios.clicked.connect(self.onFilterChange)
    self.ui.btnAllTypes.clicked.connect(self.onFilterChange)
    self.ui.btnAllStates.clicked.connect(self.onFilterChange)
    
    # Hook the items table, for when the user selects a row.
    for tbl in self.tables:
      tbl.cellDoubleClicked.connect(partial(self.onCellDoubleClicked, widget=tbl))
    
    # Hook the Assign button
    self.ui.btnAssign.clicked.connect(self.onAssign)

    # Hook the worker selection combo box
    self.ui.cmbWorker.currentIndexChanged.connect(self.onWorkerChange)
Beispiel #2
0
 def open(self, session):
   self.session = session
   ViewerWithDetailsBase.open(self, session)
   # fill the combo boxes
   users = session.query(model.Worker.Name).order_by(model.Worker.Name).all()
   self.ui.cmbWorker.addItems([str(u[0]) for u in users])
   # Show the items with the default filter
   self.onFilterChange(None)
   self.onWorkerChange()