Пример #1
0
    def show_all_prev_receipts(self):
        dl = BaseDialog(self)
        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        layout = QtGui.QVBoxLayout(frame)

        for ix in sorted(self.prev_receipts.keys())[3:]:
            printdate = self.prev_receipts[ix]
            but = QtGui.QPushButton(localsettings.readableDate(printdate))
            but.ix = ix
            but.clicked.connect(self.print_existing)

            layout.addWidget(but)

        scroll_area.setWidgetResizable(True)
        scroll_area.setWidget(frame)

        dl.insertWidget(scroll_area)
        dl.exec_()
Пример #2
0
    def show_pt_diary(self):
        if self.pt is None:
            QtWidgets.QMessageBox.information(self, _("error"),
                                              _("No patient selected"))
            return

        def _find_appt(appt):
            dl.accept()
            self.find_appt.emit(appt)

        def _start_scheduling(custom):
            '''
            if custom, the dialog will be raised giving day of week options etc
            '''
            dl.accept()
            self.get_data()
            self.appointment_model.selection_model.reset()
            appts = pt_diary_widget.selected_appointments
            self.update_appt_selection(appts)
            QtCore.QTimer.singleShot(
                100, partial(self.schedule_signal.emit, custom))

        pt_diary_widget = PtDiaryWidget()
        pt_diary_widget.find_appt.connect(_find_appt)
        pt_diary_widget.start_scheduling_signal.connect(_start_scheduling)

        pt_diary_widget.set_patient(self.pt)

        dl = BaseDialog(self, remove_stretch=True)
        dl.insertWidget(pt_diary_widget)
        dl.cancel_but.setText(_("OK"))
        dl.apply_but.hide()
        dl.setMinimumWidth(800)
        dl.setMaximumWidth(800)
        if not dl.exec_():  # dialog is only accepted by subroutines above
            self.appointment_model.load_from_database(self.pt)
            self.enable_scheduling_buttons()