Exemplo n.º 1
0
    def __init__(self, parent=None):
        '''
        when a :doc:`TreatmentItem` is added,
        this dialog attempts to validate it.
        (ie.. is the item aware who prescribed it?
        if applicable - which tooth it relates to? etc. )
        '''
        ExtendableDialog.__init__(self, parent, remove_stretch=False)
        self.setWindowTitle(_("Additional Information is Required"))

        self.top_label = QtGui.QLabel(_("Additional Information is Required"))
        self.top_label.setAlignment(QtCore.Qt.AlignCenter)

        ## chart
        self.chart_frame = QtGui.QFrame()
        self.chart = ChartWidgetBase()
        #self.chart.setStyle(self.chart.CHART_STYLE_ROOTS)
        self.chart.setStyle(self.chart.CHART_STYLE_MIXED)

        teeth_needed_label = QtGui.QLabel()
        teeth_needed_label.setMinimumWidth(120)
        teeth_needed_label.setText(_("Which tooth is being treated?"))
        teeth_needed_label.setWordWrap(True)

        self.chosen_teeth_label = QtGui.QLabel("-")
        self.chosen_teeth_label.setAlignment(QtCore.Qt.AlignCenter)

        layout = QtGui.QGridLayout(self.chart_frame)
        layout.setMargin(0)
        layout.addWidget(teeth_needed_label)
        layout.addWidget(self.chosen_teeth_label, 1, 0)
        layout.addWidget(self.chart, 0, 1, 2, 1)

        ## tooth for selecting chosen surfaces

        self.surfaces_frame = QtGui.QFrame()
        self.tooth = ToothWidget()
        surfs_needed_label = QtGui.QLabel(_("Select surfaces"))
        self.chosen_surfaces_label = QtGui.QLabel("-")
        self.chosen_surfaces_label.setAlignment(QtCore.Qt.AlignCenter)

        layout = QtGui.QGridLayout(self.surfaces_frame)
        layout.setMargin(0)
        layout.addWidget(surfs_needed_label)
        layout.addWidget(self.chosen_surfaces_label, 1, 0)
        layout.addWidget(self.tooth, 0, 1, 2, 1)

        ## pontics chart
        self.pontics_frame = QtGui.QFrame()
        self.pontics_chart = ChartWidgetBase()
        #self.chart.setStyle(self.chart.CHART_STYLE_ROOTS)
        self.pontics_chart.setStyle(self.pontics_chart.CHART_STYLE_MIXED)

        teeth_needed_label = QtGui.QLabel()
        teeth_needed_label.setMinimumWidth(120)
        teeth_needed_label.setText(_("Replacing which Teeth?"))
        teeth_needed_label.setWordWrap(True)

        self.chosen_pontics_label = QtGui.QLabel("-")
        self.chosen_pontics_label.setAlignment(QtCore.Qt.AlignCenter)

        layout = QtGui.QGridLayout(self.pontics_frame)
        layout.setMargin(0)
        layout.addWidget(teeth_needed_label)
        layout.addWidget(self.chosen_pontics_label, 1, 0)
        layout.addWidget(self.pontics_chart, 0, 1, 2, 1)

        ## a combo box for prescribing clinician
        self.px_clinician_frame = ChooseClinicianFrame(completing=False)
        self.tx_clinician_frame = ChooseClinicianFrame(completing=True)

        ## a line edit for description
        self.description_frame = QtGui.QFrame()
        description_label = QtGui.QLabel(_("Description of item"))
        self.comment_line_edit = QtGui.QLineEdit()

        layout = QtGui.QHBoxLayout(self.description_frame)
        layout.setMargin(0)
        layout.addWidget(description_label)
        layout.addWidget(self.comment_line_edit)

        self.plan_completed_frame = QtGui.QFrame()
        layout = QtGui.QGridLayout(self.plan_completed_frame)
        self.completed_radiobutton = QtGui.QRadioButton(_("Completed Today"))
        self.planning_radiobutton = QtGui.QRadioButton(_("Planned Treatment"))
        self.planning_radiobutton.setChecked(True)
        layout.addWidget(self.planning_radiobutton, 0, 0)
        layout.addWidget(self.completed_radiobutton, 0, 1)
        layout.addWidget(self.tx_clinician_frame, 1, 0, 1, 2)

        self.insertWidget(self.top_label)
        self.insertWidget(self.px_clinician_frame)
        self.insertWidget(self.chart_frame)
        self.insertWidget(self.pontics_frame)
        self.insertWidget(self.surfaces_frame)
        self.insertWidget(self.description_frame)
        self.insertWidget(self.plan_completed_frame)

        self.changes_list_widget = QtGui.QListWidget()
        self.add_advanced_widget(self.changes_list_widget)

        self.dent_key = 281474976645120  #adult only
        self.connect_signals()