Example #1
0
    def __init__(self, parent, readOnly=True):
        super(cFeatureDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cFeatureModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 3, 0)
        layout.addWidget(QtGui.QLabel(lbl("risk")), 3, 2)
        layout.addWidget(QtGui.QLabel(lbl("status")), 3, 4)
        lblDescription = self.makeEditLinkLabel("description", readOnly)
        lblDescription.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblDescription, 4, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True) # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)
        cbxKeywords = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxKeywords.setModel(self.mapper.model().getHistoryModel('keywords_view'))
        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))
        cbxStatus = QtGui.QComboBox(self, enabled=not readOnly)
        cbxStatus.setModel(self.mapper.model().getLookupModel('statusLUT'))
        cbxRisk = QtGui.QComboBox(self, enabled=not readOnly)
        cbxRisk.setModel(self.mapper.model().getLookupModel('riskLUT'))
        tedDescription = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedDescription.setImageProvider(nafdb.getImageForId)

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId,          0, 1, 1, 5)
        layout.addWidget(ledTitle,       1, 1, 1, 5)
        layout.addWidget(cbxKeywords,    2, 1, 1, 5)
        layout.addWidget(cbxPriority,    3, 1, 1, 1)
        layout.addWidget(cbxRisk,        3, 3, 1, 1)
        layout.addWidget(cbxStatus,      3, 5, 1, 1)
        layout.addWidget(tedDescription, 4, 1, 1, 5)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)
        layout.setColumnStretch(5, 1)
        layout.setRowStretch(4, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))
        self.mapper.addMapping(cbxStatus, columns.index('status'))
        self.mapper.addMapping(cbxRisk, columns.index('risk'))
        self.mapper.addMapping(tedDescription, columns.index('description'))
Example #2
0
    def __init__(self, parent, isEditable=False):
        super(cSimplesectionView, self).__init__(parent)
        self.defaultTitle = self.tr("New Text Section")
        self.editTitle = self.tr("Edit text section")
        self.detailsView = self
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cSimplesectionModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)
        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)

        lblContent = self.makeEditLinkLabel("content", not isEditable)
        lblContent.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblContent, 3, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True)  # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=not isEditable)
        cbxKeywords = QtGui.QComboBox(self, enabled=isEditable, editable=True)
        cbxKeywords.setModel(
            self.mapper.model().getHistoryModel('keywords_view'))
        tedContent = _naf_textviewer.cTextEditor(self, readOnly=not isEditable)
        tedContent.setImageProvider(nafdb.getImageForId)

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId, 0, 1, 1, 3)
        layout.addWidget(ledTitle, 1, 1, 1, 3)
        layout.addWidget(cbxKeywords, 2, 1, 1, 3)
        layout.addWidget(tedContent, 3, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(tedContent, columns.index('content'))
Example #3
0
    def __init__(self, parent, isEditable=False):
        super(cSimplesectionView, self).__init__(parent)
        self.defaultTitle = self.tr("New Text Section")
        self.editTitle = self.tr("Edit text section")
        self.detailsView = self
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cSimplesectionModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)
        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)

        lblContent = self.makeEditLinkLabel("content", not isEditable)
        lblContent.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblContent, 3, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True) # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=not isEditable)
        cbxKeywords = QtGui.QComboBox(self, enabled=isEditable, editable=True)
        cbxKeywords.setModel(self.mapper.model().getHistoryModel('keywords_view'))
        tedContent = _naf_textviewer.cTextEditor(self, readOnly=not isEditable)
        tedContent.setImageProvider(nafdb.getImageForId)

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId,          0, 1, 1, 3)
        layout.addWidget(ledTitle,       1, 1, 1, 3)
        layout.addWidget(cbxKeywords,    2, 1, 1, 3)
        layout.addWidget(tedContent,     3, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(tedContent, columns.index('content'))
Example #4
0
    def __init__(self, parent, readOnly=True):
        super(cRequirementDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cRequirementModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 3, 0)
        layout.addWidget(QtGui.QLabel(lbl("status")), 3, 2)
        layout.addWidget(QtGui.QLabel(lbl("complexity")), 5, 0)
        layout.addWidget(QtGui.QLabel(lbl("assigned")), 5, 2)
        layout.addWidget(QtGui.QLabel(lbl("effort")), 6, 0)
        layout.addWidget(QtGui.QLabel(lbl("category")), 4, 2)
        layout.addWidget(QtGui.QLabel(lbl("origin")), 9, 0)
        layout.addWidget(QtGui.QLabel(lbl("risk")), 4, 0)
        layout.addWidget(QtGui.QLabel(lbl("baseline")), 6, 2)
        layout.addWidget(QtGui.QLabel(lbl("testability")), 8, 0)

        lblRationale = self.makeEditLinkLabel("rationale", readOnly)
        lblRationale.linkActivated.connect(self.sendEditSignal)

        lblDescription = self.makeEditLinkLabel("description", readOnly)
        lblDescription.linkActivated.connect(self.sendEditSignal)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True) # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)

        cbxKeywords = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxKeywords.setModel(self.mapper.model().getHistoryModel('keywords_view'))

        tedDescription = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        cbxAssigned = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxAssigned.setModel(self.mapper.model().getHistoryModel('assigned_view'))

        tedRationale = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedRationale.setImageProvider(nafdb.getImageForId)
        self.mapper.addMapping(tedRationale, columns.index('rationale'))

        cbxOrigin = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxOrigin.setModel(self.mapper.model().getHistoryModel('origin_view'))

        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))

        cbxStatus = QtGui.QComboBox(self, enabled=not readOnly)
        cbxStatus.setModel(self.mapper.model().getLookupModel('statusLUT'))

        cbxComplexity = QtGui.QComboBox(self, enabled=not readOnly)
        cbxComplexity.setModel(self.mapper.model().getLookupModel('complexityLUT'))

        cbxEffort = QtGui.QComboBox(self, enabled=not readOnly)
        cbxEffort.setModel(self.mapper.model().getLookupModel('effortLUT'))

        cbxCategory = QtGui.QComboBox(self, enabled=not readOnly)
        cbxCategory.setModel(self.mapper.model().getLookupModel('categoryLUT'))

        tedDescription.setImageProvider(nafdb.getImageForId)
        
        cbxRisk = QtGui.QComboBox(self, enabled=not readOnly)
        cbxRisk.setModel(self.mapper.model().getLookupModel('riskLUT'))
        
        cbxBaseline =  QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxBaseline.setModel(self.mapper.model().getHistoryModel('baseline_view'))
        
        cbxTestability =  QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxTestability.setModel(self.mapper.model().getHistoryModel('testability_view'))

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId,          0, 1, 1, 3)
        layout.addWidget(ledTitle,       1, 1, 1, 3)
        layout.addWidget(cbxKeywords,    2, 1, 1, 3)
        layout.addWidget(cbxPriority,    3, 1, 1, 1)
        layout.addWidget(cbxRisk,        4, 1, 1, 1)
        layout.addWidget(cbxComplexity,  5, 1, 1, 1)
        layout.addWidget(cbxEffort,      6, 1, 1, 1)
        
        layout.addWidget(cbxStatus,      3, 3, 1, 1)
        layout.addWidget(cbxCategory,    4, 3, 1, 1)
        layout.addWidget(cbxAssigned,    5, 3, 1, 1)
        layout.addWidget(cbxBaseline,    6, 3, 1, 1)
        
        layout.addWidget(lblDescription, 7, 0)
        layout.addWidget(tedDescription, 7, 1, 1, 3)
        layout.addWidget(cbxTestability, 8, 1, 1, 3)
        layout.addWidget(cbxOrigin,      9, 1, 1, 3)
        layout.addWidget(lblRationale,   10, 0)
        layout.addWidget(tedRationale,   10, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)
        layout.setRowStretch(7, 5)
        layout.setRowStretch(10, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(tedDescription, columns.index('description'))
        self.mapper.addMapping(cbxAssigned, columns.index('assigned'))

        self.mapper.addMapping(cbxOrigin, columns.index('origin'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))
        self.mapper.addMapping(cbxStatus, columns.index('status'))
        self.mapper.addMapping(cbxComplexity, columns.index('complexity'))
        self.mapper.addMapping(cbxEffort, columns.index('effort'))
        self.mapper.addMapping(cbxCategory, columns.index('category'))
        
        self.mapper.addMapping(cbxRisk, columns.index('risk'))
        self.mapper.addMapping(cbxBaseline, columns.index('baseline'))
        self.mapper.addMapping(cbxTestability, columns.index('testability'))
Example #5
0
    def __init__(self, parent, readOnly=True):
        super(cRequirementDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cRequirementModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 3, 0)
        layout.addWidget(QtGui.QLabel(lbl("status")), 3, 2)
        layout.addWidget(QtGui.QLabel(lbl("complexity")), 5, 0)
        layout.addWidget(QtGui.QLabel(lbl("assigned")), 5, 2)
        layout.addWidget(QtGui.QLabel(lbl("effort")), 6, 0)
        layout.addWidget(QtGui.QLabel(lbl("category")), 4, 2)
        layout.addWidget(QtGui.QLabel(lbl("origin")), 9, 0)
        layout.addWidget(QtGui.QLabel(lbl("risk")), 4, 0)
        layout.addWidget(QtGui.QLabel(lbl("baseline")), 6, 2)
        layout.addWidget(QtGui.QLabel(lbl("testability")), 8, 0)

        lblRationale = self.makeEditLinkLabel("rationale", readOnly)
        lblRationale.linkActivated.connect(self.sendEditSignal)

        lblDescription = self.makeEditLinkLabel("description", readOnly)
        lblDescription.linkActivated.connect(self.sendEditSignal)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True)  # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)

        cbxKeywords = QtGui.QComboBox(self,
                                      enabled=not readOnly,
                                      editable=True)
        cbxKeywords.setModel(
            self.mapper.model().getHistoryModel('keywords_view'))

        tedDescription = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        cbxAssigned = QtGui.QComboBox(self,
                                      enabled=not readOnly,
                                      editable=True)
        cbxAssigned.setModel(
            self.mapper.model().getHistoryModel('assigned_view'))

        tedRationale = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedRationale.setImageProvider(nafdb.getImageForId)
        self.mapper.addMapping(tedRationale, columns.index('rationale'))

        cbxOrigin = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxOrigin.setModel(self.mapper.model().getHistoryModel('origin_view'))

        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))

        cbxStatus = QtGui.QComboBox(self, enabled=not readOnly)
        cbxStatus.setModel(self.mapper.model().getLookupModel('statusLUT'))

        cbxComplexity = QtGui.QComboBox(self, enabled=not readOnly)
        cbxComplexity.setModel(
            self.mapper.model().getLookupModel('complexityLUT'))

        cbxEffort = QtGui.QComboBox(self, enabled=not readOnly)
        cbxEffort.setModel(self.mapper.model().getLookupModel('effortLUT'))

        cbxCategory = QtGui.QComboBox(self, enabled=not readOnly)
        cbxCategory.setModel(self.mapper.model().getLookupModel('categoryLUT'))

        tedDescription.setImageProvider(nafdb.getImageForId)

        cbxRisk = QtGui.QComboBox(self, enabled=not readOnly)
        cbxRisk.setModel(self.mapper.model().getLookupModel('riskLUT'))

        cbxBaseline = QtGui.QComboBox(self,
                                      enabled=not readOnly,
                                      editable=True)
        cbxBaseline.setModel(
            self.mapper.model().getHistoryModel('baseline_view'))

        cbxTestability = QtGui.QComboBox(self,
                                         enabled=not readOnly,
                                         editable=True)
        cbxTestability.setModel(
            self.mapper.model().getHistoryModel('testability_view'))

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId, 0, 1, 1, 3)
        layout.addWidget(ledTitle, 1, 1, 1, 3)
        layout.addWidget(cbxKeywords, 2, 1, 1, 3)
        layout.addWidget(cbxPriority, 3, 1, 1, 1)
        layout.addWidget(cbxRisk, 4, 1, 1, 1)
        layout.addWidget(cbxComplexity, 5, 1, 1, 1)
        layout.addWidget(cbxEffort, 6, 1, 1, 1)

        layout.addWidget(cbxStatus, 3, 3, 1, 1)
        layout.addWidget(cbxCategory, 4, 3, 1, 1)
        layout.addWidget(cbxAssigned, 5, 3, 1, 1)
        layout.addWidget(cbxBaseline, 6, 3, 1, 1)

        layout.addWidget(lblDescription, 7, 0)
        layout.addWidget(tedDescription, 7, 1, 1, 3)
        layout.addWidget(cbxTestability, 8, 1, 1, 3)
        layout.addWidget(cbxOrigin, 9, 1, 1, 3)
        layout.addWidget(lblRationale, 10, 0)
        layout.addWidget(tedRationale, 10, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)
        layout.setRowStretch(7, 5)
        layout.setRowStretch(10, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(tedDescription, columns.index('description'))
        self.mapper.addMapping(cbxAssigned, columns.index('assigned'))

        self.mapper.addMapping(cbxOrigin, columns.index('origin'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))
        self.mapper.addMapping(cbxStatus, columns.index('status'))
        self.mapper.addMapping(cbxComplexity, columns.index('complexity'))
        self.mapper.addMapping(cbxEffort, columns.index('effort'))
        self.mapper.addMapping(cbxCategory, columns.index('category'))

        self.mapper.addMapping(cbxRisk, columns.index('risk'))
        self.mapper.addMapping(cbxBaseline, columns.index('baseline'))
        self.mapper.addMapping(cbxTestability, columns.index('testability'))
Example #6
0
    def __init__(self, parent, readOnly=True):
        super(cTestcaseDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cTestcaseModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 2, 2)

        lblPurpose = self.makeEditLinkLabel("purpose", readOnly)
        lblPurpose.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblPurpose, 3, 0)

        lblPrerequisite = self.makeEditLinkLabel("prerequisite", readOnly)
        lblPrerequisite.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblPrerequisite, 4, 0)

        lblTestdata = self.makeEditLinkLabel("testdata", readOnly)
        lblTestdata.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblTestdata, 5, 0)

        lblSteps = self.makeEditLinkLabel("steps", readOnly)
        lblSteps.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblSteps, 6, 0)

        lblNotes = self.makeEditLinkLabel("notes", readOnly)
        lblNotes.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblNotes, 7, 0)

        layout.addWidget(QtGui.QLabel(lbl("scripturl")), 8, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True) # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)
        cbxKeywords = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxKeywords.setModel(self.mapper.model().getHistoryModel('keywords_view'))
        tedPurpose = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedPurpose.setImageProvider(nafdb.getImageForId)
        tedPrerequisite = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedPrerequisite.setImageProvider(nafdb.getImageForId)
        tedTestdata = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedTestdata.setImageProvider(nafdb.getImageForId)
        tedSteps = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedSteps.setImageProvider(nafdb.getImageForId)
        tedNotes = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedNotes.setImageProvider(nafdb.getImageForId)
        ledScripturl = QtGui.QLineEdit(self, readOnly=readOnly)
        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId,           0, 1, 1, 3)
        layout.addWidget(ledTitle,        1, 1, 1, 3)
        layout.addWidget(cbxPriority,     2, 3, 1, 1)
        layout.addWidget(cbxKeywords,     2, 1, 1, 1)
        layout.addWidget(tedPurpose,      3, 1, 1, 3)
        layout.addWidget(tedPrerequisite, 4, 1, 1, 3)
        layout.addWidget(tedTestdata,     5, 1, 1, 3)
        layout.addWidget(tedSteps,        6, 1, 1, 3)
        layout.addWidget(tedNotes,        7, 1, 1, 3)
        layout.addWidget(ledScripturl,    8, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setRowStretch(3, 2)
        layout.setRowStretch(4, 2)
        layout.setRowStretch(5, 2)
        layout.setRowStretch(6, 5)
        layout.setRowStretch(7, 2)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(tedPurpose, columns.index('purpose'))
        self.mapper.addMapping(tedPrerequisite, columns.index('prerequisite'))
        self.mapper.addMapping(tedTestdata, columns.index('testdata'))
        self.mapper.addMapping(tedSteps, columns.index('steps'))
        self.mapper.addMapping(tedNotes, columns.index('notes'))
        self.mapper.addMapping(ledScripturl, columns.index('scripturl'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))
Example #7
0
    def __init__(self, parent, readOnly=True):
        super(cUsecaseDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cUsecaseModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)

        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 3, 0)
        layout.addWidget(QtGui.QLabel(lbl("usefrequency")), 3, 2)
        layout.addWidget(QtGui.QLabel(lbl("actors")), 4, 0)
        layout.addWidget(QtGui.QLabel(lbl("stakeholders")), 5, 0)

        lblPrerequisites = self.makeEditLinkLabel("prerequisites", readOnly)
        lblPrerequisites.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblPrerequisites, 6, 0)

        lblMainscenario = self.makeEditLinkLabel("mainscenario", readOnly)
        lblMainscenario.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblMainscenario, 7, 0)

        lblAltscenario = self.makeEditLinkLabel("altscenario", readOnly)
        lblAltscenario.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblAltscenario, 8, 0)

        lblNotes = self.makeEditLinkLabel("notes", readOnly)
        lblNotes.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblNotes, 9, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True) # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)

        cbxKeywords = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxKeywords.setModel(self.mapper.model().getHistoryModel('keywords_view'))

        tedPrerequisites = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedMainscenario = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedAltscenario = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedNotes = _naf_textviewer.cTextEditor(self, readOnly=readOnly)

        #cbxPriority = QtGui.QLineEdit(self, readOnly=True)
        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))

        #cbxUsefrequency = QtGui.QLineEdit(self, readOnly=True)
        cbxUsefrequency = QtGui.QComboBox(self, enabled=not readOnly)
        cbxUsefrequency.setModel(self.mapper.model().getLookupModel('usefrequencyLUT'))

        cbxActors = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxActors.setModel(self.mapper.model().getHistoryModel('actors_view'))
        cbxStakeholders = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxStakeholders.setModel(self.mapper.model().getHistoryModel('stakeholders_view'))

        tedPrerequisites.setImageProvider(nafdb.getImageForId)
        tedMainscenario.setImageProvider(nafdb.getImageForId)
        tedAltscenario.setImageProvider(nafdb.getImageForId)
        tedNotes.setImageProvider(nafdb.getImageForId)

        layout.addWidget(ledId,            0, 1, 1, 3)
        layout.addWidget(ledTitle,         1, 1, 1, 3)
        layout.addWidget(cbxKeywords,      2, 1, 1, 3)
        layout.addWidget(cbxPriority,      3, 1, 1, 1)
        layout.addWidget(cbxUsefrequency,  3, 3, 1, 1)
        layout.addWidget(cbxActors,        4, 1, 1, 3)
        layout.addWidget(cbxStakeholders,  5, 1, 1, 3)
        layout.addWidget(tedPrerequisites, 6, 1, 1, 3)
        layout.addWidget(tedMainscenario,  7, 1, 1, 3)
        layout.addWidget(tedAltscenario,   8, 1, 1, 3)
        layout.addWidget(tedNotes,         9, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)
        layout.setRowStretch(6, 1)
        layout.setRowStretch(7, 3)
        layout.setRowStretch(8, 2)
        layout.setRowStretch(9, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))
        self.mapper.addMapping(cbxUsefrequency, columns.index('usefrequency'))
        self.mapper.addMapping(cbxActors, columns.index('actors'))
        self.mapper.addMapping(cbxStakeholders, columns.index('stakeholders'))
        self.mapper.addMapping(tedPrerequisites, columns.index('prerequisites'))
        self.mapper.addMapping(tedMainscenario, columns.index('mainscenario'))
        self.mapper.addMapping(tedAltscenario, columns.index('altscenario'))
        self.mapper.addMapping(tedNotes, columns.index('notes'))
Example #8
0
    def __init__(self, parent, readOnly=True):
        super(cUsecaseDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cUsecaseModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)

        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 3, 0)
        layout.addWidget(QtGui.QLabel(lbl("usefrequency")), 3, 2)
        layout.addWidget(QtGui.QLabel(lbl("actors")), 4, 0)
        layout.addWidget(QtGui.QLabel(lbl("stakeholders")), 5, 0)

        lblPrerequisites = self.makeEditLinkLabel("prerequisites", readOnly)
        lblPrerequisites.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblPrerequisites, 6, 0)

        lblMainscenario = self.makeEditLinkLabel("mainscenario", readOnly)
        lblMainscenario.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblMainscenario, 7, 0)

        lblAltscenario = self.makeEditLinkLabel("altscenario", readOnly)
        lblAltscenario.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblAltscenario, 8, 0)

        lblNotes = self.makeEditLinkLabel("notes", readOnly)
        lblNotes.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblNotes, 9, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True)  # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)

        cbxKeywords = QtGui.QComboBox(self,
                                      enabled=not readOnly,
                                      editable=True)
        cbxKeywords.setModel(
            self.mapper.model().getHistoryModel('keywords_view'))

        tedPrerequisites = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedMainscenario = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedAltscenario = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedNotes = _naf_textviewer.cTextEditor(self, readOnly=readOnly)

        #cbxPriority = QtGui.QLineEdit(self, readOnly=True)
        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))

        #cbxUsefrequency = QtGui.QLineEdit(self, readOnly=True)
        cbxUsefrequency = QtGui.QComboBox(self, enabled=not readOnly)
        cbxUsefrequency.setModel(
            self.mapper.model().getLookupModel('usefrequencyLUT'))

        cbxActors = QtGui.QComboBox(self, enabled=not readOnly, editable=True)
        cbxActors.setModel(self.mapper.model().getHistoryModel('actors_view'))
        cbxStakeholders = QtGui.QComboBox(self,
                                          enabled=not readOnly,
                                          editable=True)
        cbxStakeholders.setModel(
            self.mapper.model().getHistoryModel('stakeholders_view'))

        tedPrerequisites.setImageProvider(nafdb.getImageForId)
        tedMainscenario.setImageProvider(nafdb.getImageForId)
        tedAltscenario.setImageProvider(nafdb.getImageForId)
        tedNotes.setImageProvider(nafdb.getImageForId)

        layout.addWidget(ledId, 0, 1, 1, 3)
        layout.addWidget(ledTitle, 1, 1, 1, 3)
        layout.addWidget(cbxKeywords, 2, 1, 1, 3)
        layout.addWidget(cbxPriority, 3, 1, 1, 1)
        layout.addWidget(cbxUsefrequency, 3, 3, 1, 1)
        layout.addWidget(cbxActors, 4, 1, 1, 3)
        layout.addWidget(cbxStakeholders, 5, 1, 1, 3)
        layout.addWidget(tedPrerequisites, 6, 1, 1, 3)
        layout.addWidget(tedMainscenario, 7, 1, 1, 3)
        layout.addWidget(tedAltscenario, 8, 1, 1, 3)
        layout.addWidget(tedNotes, 9, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setColumnStretch(3, 1)
        layout.setRowStretch(6, 1)
        layout.setRowStretch(7, 3)
        layout.setRowStretch(8, 2)
        layout.setRowStretch(9, 1)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))
        self.mapper.addMapping(cbxUsefrequency, columns.index('usefrequency'))
        self.mapper.addMapping(cbxActors, columns.index('actors'))
        self.mapper.addMapping(cbxStakeholders, columns.index('stakeholders'))
        self.mapper.addMapping(tedPrerequisites,
                               columns.index('prerequisites'))
        self.mapper.addMapping(tedMainscenario, columns.index('mainscenario'))
        self.mapper.addMapping(tedAltscenario, columns.index('altscenario'))
        self.mapper.addMapping(tedNotes, columns.index('notes'))
Example #9
0
    def __init__(self, parent, readOnly=True):
        super(cTestcaseDetailsView, self).__init__(parent)
        self.mapper = QtGui.QDataWidgetMapper()
        self.mapper.setItemDelegate(_naf_itemmodel.cItemDelegate(self))
        self.mapper.setModel(cTestcaseModel())
        self.mapper.setSubmitPolicy(QtGui.QDataWidgetMapper.ManualSubmit)

        columns = self.mapper.model().getColumns()
        lbl = self.mapper.model().getLabel
        layout = QtGui.QGridLayout()
        self.setLayout(layout)
        layout.addWidget(QtGui.QLabel(lbl("id")), 0, 0)
        layout.addWidget(QtGui.QLabel(lbl("title")), 1, 0)
        layout.addWidget(QtGui.QLabel(lbl("keywords")), 2, 0)
        layout.addWidget(QtGui.QLabel(lbl("priority")), 2, 2)

        lblPurpose = self.makeEditLinkLabel("purpose", readOnly)
        lblPurpose.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblPurpose, 3, 0)

        lblPrerequisite = self.makeEditLinkLabel("prerequisite", readOnly)
        lblPrerequisite.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblPrerequisite, 4, 0)

        lblTestdata = self.makeEditLinkLabel("testdata", readOnly)
        lblTestdata.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblTestdata, 5, 0)

        lblSteps = self.makeEditLinkLabel("steps", readOnly)
        lblSteps.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblSteps, 6, 0)

        lblNotes = self.makeEditLinkLabel("notes", readOnly)
        lblNotes.linkActivated.connect(self.sendEditSignal)
        layout.addWidget(lblNotes, 7, 0)

        layout.addWidget(QtGui.QLabel(lbl("scripturl")), 8, 0)

        ledId = QtGui.QSpinBox(self, maximum=sys.maxint)
        ledId.setReadOnly(True)  # id is always read only
        ledTitle = QtGui.QLineEdit(self, readOnly=readOnly)
        cbxKeywords = QtGui.QComboBox(self,
                                      enabled=not readOnly,
                                      editable=True)
        cbxKeywords.setModel(
            self.mapper.model().getHistoryModel('keywords_view'))
        tedPurpose = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedPurpose.setImageProvider(nafdb.getImageForId)
        tedPrerequisite = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedPrerequisite.setImageProvider(nafdb.getImageForId)
        tedTestdata = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedTestdata.setImageProvider(nafdb.getImageForId)
        tedSteps = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedSteps.setImageProvider(nafdb.getImageForId)
        tedNotes = _naf_textviewer.cTextEditor(self, readOnly=readOnly)
        tedNotes.setImageProvider(nafdb.getImageForId)
        ledScripturl = QtGui.QLineEdit(self, readOnly=readOnly)
        cbxPriority = QtGui.QComboBox(self, enabled=not readOnly)
        cbxPriority.setModel(self.mapper.model().getLookupModel('priorityLUT'))

        # addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, alignment)
        layout.addWidget(ledId, 0, 1, 1, 3)
        layout.addWidget(ledTitle, 1, 1, 1, 3)
        layout.addWidget(cbxPriority, 2, 3, 1, 1)
        layout.addWidget(cbxKeywords, 2, 1, 1, 1)
        layout.addWidget(tedPurpose, 3, 1, 1, 3)
        layout.addWidget(tedPrerequisite, 4, 1, 1, 3)
        layout.addWidget(tedTestdata, 5, 1, 1, 3)
        layout.addWidget(tedSteps, 6, 1, 1, 3)
        layout.addWidget(tedNotes, 7, 1, 1, 3)
        layout.addWidget(ledScripturl, 8, 1, 1, 3)

        layout.setColumnStretch(1, 1)
        layout.setRowStretch(3, 2)
        layout.setRowStretch(4, 2)
        layout.setRowStretch(5, 2)
        layout.setRowStretch(6, 5)
        layout.setRowStretch(7, 2)

        self.mapper.addMapping(ledId, columns.index('id'))
        self.mapper.addMapping(ledTitle, columns.index('title'))
        self.mapper.addMapping(cbxKeywords, columns.index('keywords'))
        self.mapper.addMapping(tedPurpose, columns.index('purpose'))
        self.mapper.addMapping(tedPrerequisite, columns.index('prerequisite'))
        self.mapper.addMapping(tedTestdata, columns.index('testdata'))
        self.mapper.addMapping(tedSteps, columns.index('steps'))
        self.mapper.addMapping(tedNotes, columns.index('notes'))
        self.mapper.addMapping(ledScripturl, columns.index('scripturl'))
        self.mapper.addMapping(cbxPriority, columns.index('priority'))