Пример #1
0
  def __init__(self, parent):
    ViewerWithTreeBase.__init__(self, parent, ArchitectureViewForm[0])

    self.current_stereotype = ''

    # Create the tree model viewers
    tree_models = {self.ui.wdgBlocks:model.ArchitectureBlock,
                   self.ui.wdgViews:model.View,
                   self.ui.wdgRequirements:model.Requirement,
                   self.ui.wdgBugs:model.Bug,
                   self.ui.wdgActions:model.FunctionPoint}
    self.tree_models = tree_models
    self.createTreeViewers()
    # Let a view be shown when double clicked in the tree viewer.
    self.ui.wdgViews.ui.tree.itemDoubleClicked.connect(self.onView)

    self.ui.tabGraphicViews.tabCloseRequested.connect(self.onTabCloseRequested)
    self.ui.tabGraphicViews.currentChanged.connect(self.onTabChanged)

    self.ui.cmbRole.activated.connect(self.onRoleChanged)
    
    self.ui.btnShowStyles.clicked.connect(self.onShowStyles)
    self.stateWindow = StyleEditor()
    self.stateWindow.hide()

    self.ui.chkFunctionFP.stateChanged.connect(lambda i: theController.setFpAsCall(bool(i)))
    
        
    # Add database hooks to properly update when items are added.
    for cls in [model.ArchitectureBlock, model.View, model.Requirement, model.Bug,
                model.FunctionPoint]:
      event.listen(cls, 'after_update', self.onDetailUpdate)
      event.listen(cls, 'after_insert', self.onDetailInsert)
      #FIXME: also handle deletes.
    self.hasEvents = True
Пример #2
0
  def __init__(self, parent):
    ViewerWithTreeBase.__init__(self, parent, ProjectViewForm[0])
    
    tree_models = {self.ui.wdgProjects:model.Project}
    self.tree_models = tree_models
    self.createTreeViewers()
      
    # Add a context menu to the workers viewer
    actions = [('Add', self.onAddWorker), ('Delete', self.onDeleteWorker)]
    mkMenu(actions, self, self.ui.lstWorkers)

    # Add a context menu to the projects viewer
    self.ui.wdgProjects.ui.tree.item_actions.append(('Planning Details', self.onEstimateDetails))

    # If a project is double-clicked, the planning overview is shown.
    self.ui.wdgProjects.ui.tree.itemDoubleClicked.connect(self.onViewPlanning)
    # If a worker is double-clicked, the worker overview is shown.
    self.ui.lstWorkers.itemDoubleClicked.connect(self.onViewWorker)
    # If a worker is selected, his/her details are shown.
    self.ui.lstWorkers.itemClicked.connect(lambda item: self.openDetailsViewer(item.details))