def __init__(self, patient, chartimage, parent): BaseDialog.__init__(self, parent) self.pt = patient self.chartimage = chartimage patient_label = QtWidgets.QLabel( "%s<br /><b>%s</b>" % (_("Print the record of"), patient.name_id)) patient_label.setAlignment(QtCore.Qt.AlignCenter) self.web_view = OMWebView(self) self.web_view.loadStarted.connect(self.print_start) self.web_view.loadFinished.connect(self.print_load_result) self.insertWidget(patient_label) self.insertWidget(self.web_view) self.apply_but.setText("Print") self.enableApply() html = patientDetails.header(self.pt).replace("center", "left") html += '''<hr /> <div align="center"> <img src="%s" width="80%%" /> </div> <hr />''' % self.chartimage html += formatted_notes.notes(self.pt.notes_dict) self.web_view.setHtml(html)
def __init__(self, pt=None, parent=None): BaseDialog.__init__(self, parent) self.pt = pt self.setWindowTitle(_("MH Form Print Dialog")) self.radio_button_a = QtGui.QRadioButton(_("Leave fields empty")) self.radio_button_b = QtGui.QRadioButton(_("Populate with current MH")) if self.has_no_patient: message = _("No Patient Selected, A blank form will be produced") else: message = "%s<br /><b>%s</b>" % (_("Medical History form for"), pt.name_id) date_gb = QtGui.QGroupBox(_("Use this date for the form")) self.date_edit = QtGui.QDateEdit() self.date_edit.setDate(self.chosen_date) self.date_edit.setCalendarPopup(True) layout = QtGui.QVBoxLayout(date_gb) layout.addWidget(self.date_edit) label = QtGui.QLabel(message) label.setAlignment(QtCore.Qt.AlignCenter) self.insertWidget(label) self.insertWidget(self.radio_button_a) self.insertWidget(self.radio_button_b) self.insertWidget(date_gb) self.radio_button_a.setVisible(not self.has_no_patient) self.radio_button_b.setVisible(not self.has_no_patient) self.radio_button_a.setChecked(True) self.radio_button_b.setChecked(bool(self.pt and self.pt.mh_chkdate)) self.enableApply()
def __init__(self, parent=None): BaseDialog.__init__(self, parent, remove_stretch=True) title = _("Confgure Feescales Dialog") self.setWindowTitle(title) label = WarningLabel( "%s<hr />%s" % ( _("This dialog enables you to modify the metadata which " "determines the order feescales are loaded."), _("You can also archive a feescale by unchecking 'in use'."))) self.insertWidget(label) self.configurer = FeescaleConfigurer() LOGGER.debug("Feescales to config\n%s", "\n".join( [" %s" % f for f in self.configurer.feescales])) frame = QtWidgets.QFrame() self.fs_layout = QtWidgets.QVBoxLayout(frame) self.fs_layout.setContentsMargins(0, 0, 0, 0) self.fs_layout.setSpacing(0) for feescale in self.configurer.feescales: widg = FeescaleWidget(feescale) widg.promote_signal.connect(self.promote_widget) widg.demote_signal.connect(self.demote_widget) widg.check_required_signal.connect(self.check_enable) self.fs_layout.addWidget(widg) scroll_area = QtWidgets.QScrollArea(self) scroll_area.setWidget(frame) scroll_area.setWidgetResizable(True) self.insertWidget(scroll_area) self.enable_buttons()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Edit Practice Address Dialog")) self.top_label = WarningLabel("%s<hr />%s" % ( _('Edit the Practice Name and/or address.'), _("This information is used on receipts and appointment slips."), )) self.practice_line_edit = QtGui.QLineEdit() self.practice_line_edit.setText(localsettings.PRACTICE_NAME) frame = QtGui.QFrame(self) layout = QtGui.QFormLayout(frame) layout.addRow(_("Practice Name"), self.practice_line_edit) self.addr_line_edits = [] for i in range(7): le = QtGui.QLineEdit() self.addr_line_edits.append(le) layout.addRow("%s %d" % (_("Address Line"), i + 1), le) try: le.setText(localsettings.PRACTICE_ADDRESS[i + 1]) except IndexError: pass self.insertWidget(self.top_label) self.insertWidget(frame) self.enableApply()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Confirm")) label = WarningLabel(_("Clear ALL Patient Locations?")) self.insertWidget(label) self.enableApply()
def __init__(self, om_gui=None): BaseDialog.__init__(self, om_gui) self.om_gui = om_gui message = _("Denture Treatment Dialog") self.setWindowTitle(message) self.header_label = QtGui.QLabel(message) self.header_label.setAlignment(QtCore.Qt.AlignCenter) frame = QtGui.QFrame() layout = QtGui.QHBoxLayout(frame) new_but = QtGui.QPushButton(_("Plan New Denture(s)")) new_but.setMinimumSize(QtCore.QSize(150, 150)) alt_but = QtGui.QPushButton(_("Alter an Existing Denture")) alt_but.setMinimumSize(QtCore.QSize(150, 150)) layout.addWidget(new_but) layout.addWidget(alt_but) self.insertWidget(self.header_label) self.insertWidget(frame) self.apply_but.hide() new_but.clicked.connect(self.new_denture) alt_but.clicked.connect(self.alt_denture)
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("User choice")) label = WarningLabel(_("Set the Appointment Viewing Mode")) self.insertWidget(label) for mode, description, value in ( (_("Browsing"), "", self.VIEW_MODE), (_("Scheduling"), _("make appointments for a patient"), self.SCHEDULING_MODE), (_("Blocking"), _("block time periods. eg. lunch times etc."), self.BLOCKING_MODE), (_("Note Checking"), _("check notes for today's patients"), self.NOTES_MODE)): but = QtWidgets.QPushButton(mode) but.setToolTip(description) but.appt_mode = value but.clicked.connect(self.but_clicked) self.insertWidget(but) self.apply_but.hide()
def __init__(self, parent=None): BaseDialog.__init__(self, parent, remove_stretch=True) title = _("Confgure Feescales Dialog") self.setWindowTitle(title) label = WarningLabel( "%s<hr />%s" % (_("This dialog enables you to modify the metadata which " "determines the order feescales are loaded."), _("You can also archive a feescale by unchecking 'in use'."))) self.insertWidget(label) self.configurer = FeescaleConfigurer() LOGGER.debug( "Feescales to config\n%s", "\n".join([" %s" % f for f in self.configurer.feescales])) frame = QtWidgets.QFrame() self.fs_layout = QtWidgets.QVBoxLayout(frame) self.fs_layout.setContentsMargins(0, 0, 0, 0) self.fs_layout.setSpacing(0) for feescale in self.configurer.feescales: widg = FeescaleWidget(feescale) widg.promote_signal.connect(self.promote_widget) widg.demote_signal.connect(self.demote_widget) widg.check_required_signal.connect(self.check_enable) self.fs_layout.addWidget(widg) scroll_area = QtWidgets.QScrollArea(self) scroll_area.setWidget(frame) scroll_area.setWidgetResizable(True) self.insertWidget(scroll_area) self.enable_buttons()
def __init__(self, addresses, parent=None): BaseDialog.__init__(self, parent) self.addresses = list(addresses) label = QtGui.QLabel(_("Which address should be used?")) self.table_widget = QtGui.QTableWidget() self.table_widget.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows) self.table_widget.setAlternatingRowColors(True) self.table_widget.setRowCount(len(addresses)) self.table_widget.setColumnCount(len(HEADERS)) self.table_widget.setHorizontalHeaderLabels(HEADERS) self.table_widget.horizontalHeader().setStretchLastSection(True) for row, fields in enumerate(addresses): for col, field in enumerate(fields): if field is None: continue item = QtGui.QTableWidgetItem(field) self.table_widget.setItem(row, col, item) self.insertWidget(label) self.insertWidget(self.table_widget) self.table_widget.resizeColumnsToContents() self.table_widget.itemSelectionChanged.connect(self.enableApply)
def __init__(self, serialno, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Medical Form Date Entry Dialog")) self.pt = BriefPatient(serialno) self.patient_label = QtGui.QLabel(self.pt.name_id) self.patient_label.setAlignment(QtCore.Qt.AlignCenter) f = self.patient_label.font() f.setBold(True) self.patient_label.setFont(f) year_button = QtGui.QPushButton(_("Change Year")) last_check = localsettings.formatDate(self.pt.mh_form_date) if not last_check: last_check = _("NEVER") self.date_checked_label = WarningLabel( "%s<hr />(%s %s)" % ( _('Please enter the date that this patient has completed ' 'a medical history form.'), _('Last recorded check was'), last_check) ) self.date_checked_label.setMaximumHeight(120) self.calendar = yearCalendar(self) self.insertWidget(self.patient_label) self.insertWidget(self.date_checked_label) self.insertWidget(year_button) self.insertWidget(self.calendar) year_button.clicked.connect(self.select_year) self.calendar.selected_date_signal.connect(self.accept) self.enableApply()
def __init__(self, pt=None, parent=None): BaseDialog.__init__(self, parent) self.pt = pt self.setWindowTitle(_("MH Form Print Dialog")) self.radio_button_a = QtWidgets.QRadioButton(_("Leave fields empty")) self.radio_button_b = QtWidgets.QRadioButton( _("Populate with current MH")) if self.has_no_patient: message = _("No Patient Selected, A blank form will be produced") else: message = "%s<br /><b>%s</b>" % ( _("Medical History form for"), pt.name_id) date_gb = QtWidgets.QGroupBox(_("Use this date for the form")) self.date_edit = QtWidgets.QDateEdit() self.date_edit.setDate(self.chosen_date) self.date_edit.setCalendarPopup(True) layout = QtWidgets.QVBoxLayout(date_gb) layout.addWidget(self.date_edit) label = QtWidgets.QLabel(message) label.setAlignment(QtCore.Qt.AlignCenter) self.insertWidget(label) self.insertWidget(self.radio_button_a) self.insertWidget(self.radio_button_b) self.insertWidget(date_gb) self.radio_button_a.setVisible(not self.has_no_patient) self.radio_button_b.setVisible(not self.has_no_patient) self.radio_button_a.setChecked(True) self.radio_button_b.setChecked(bool(self.pt and self.pt.mh_chkdate)) self.enableApply()
def __init__(self, parent): BaseDialog.__init__(self, parent) self.main_ui = parent self.header_label = QtGui.QLabel() self.header_label.setAlignment(QtCore.Qt.AlignCenter) self.pcde_le = UpperCaseLineEdit() self.pcde_le.setText(self.main_ui.pt.pcde) self.simd_label = QtGui.QLabel() self.simd_label.setAlignment(QtCore.Qt.AlignCenter) self.tbi_checkbox = QtGui.QCheckBox( _("ToothBrushing Instruction Given")) self.tbi_checkbox.setChecked(True) self.di_checkbox = QtGui.QCheckBox(_("Dietary Advice Given")) self.di_checkbox.setChecked(True) self.fl_checkbox = QtGui.QCheckBox(_("Fluoride Varnish Applied")) self.fl_checkbox.setToolTip( _("Fee claimable for patients betwen 2 and 5")) self.fl_checkbox.setChecked(2 <= self.main_ui.pt.ageYears <= 5) self.insertWidget(self.header_label) self.insertWidget(self.pcde_le) self.insertWidget(self.simd_label) self.insertWidget(self.tbi_checkbox) self.insertWidget(self.di_checkbox) self.insertWidget(self.fl_checkbox) self.pcde_le.textEdited.connect(self.check_pcde) self._simd = None
def __init__(self, serialno, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Medical Form Date Entry Dialog")) self.pt = BriefPatient(serialno) self.patient_label = QtWidgets.QLabel(self.pt.name_id) self.patient_label.setAlignment(QtCore.Qt.AlignCenter) f = self.patient_label.font() f.setBold(True) self.patient_label.setFont(f) year_button = QtWidgets.QPushButton(_("Change Year")) last_check = localsettings.formatDate(self.pt.mh_form_date) if not last_check: last_check = _("NEVER") self.date_checked_label = WarningLabel( "%s<hr />(%s %s)" % (_('Please enter the date that this patient has completed ' 'a medical history form.'), _('Last recorded check was'), last_check)) self.date_checked_label.setMaximumHeight(120) self.calendar = yearCalendar(self) self.insertWidget(self.patient_label) self.insertWidget(self.date_checked_label) self.insertWidget(year_button) self.insertWidget(self.calendar) year_button.clicked.connect(self.select_year) self.calendar.selected_date_signal.connect(self.accept) self.enableApply()
def __init__(self, pt, parent): BaseDialog.__init__(self, parent, remove_stretch=True) self.pt = pt self.om_gui = parent widget = QtGui.QWidget(self) self.ui = Ui_record_tools.Ui_Form() self.ui.setupUi(widget) self.insertWidget(widget) self.ui.tabWidget.setCurrentIndex(0) self.initialMoney() self.initialDates() self.initialHidden_notes() self.signals() self.setMinimumSize(self.sizeHint()) self.DATE_ATTRIBUTES = ( self.pt.pd5, self.pt.pd6, self.pt.pd7, self.pt.pd8, self.pt.pd9, self.pt.pd10, self.pt.billdate) self.ui.money0_spinBox.setEnabled(False) self.ui.money1_spinBox.setEnabled(False) self.check_before_reject_if_dirty = True
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("User choice")) label = QtGui.QLabel(_("Set the Appointment Viewing Mode")) self.insertWidget(label) for mode, description, value in ( (_("Browsing"), "", self.VIEW_MODE), (_("Scheduling"), _("make appointments for a patient"), self.SCHEDULING_MODE), (_("Blocking"), _("block time periods. eg. lunch times etc."), self.BLOCKING_MODE), (_("Note Checking"), _("check notes for today's patients"), self.NOTES_MODE), ): but = QtGui.QPushButton(mode) but.setToolTip(description) but.appt_mode = value but.clicked.connect(self.but_clicked) self.insertWidget(but) self.apply_but.hide()
def __init__(self, pt, parent): BaseDialog.__init__(self, parent, remove_stretch=True) self.pt = pt self.om_gui = parent widget = QtWidgets.QWidget(self) self.ui = Ui_record_tools.Ui_Form() self.ui.setupUi(widget) self.insertWidget(widget) self.ui.tabWidget.setCurrentIndex(0) self.initialMoney() self.initialDates() self.initialHidden_notes() self.signals() self.setMinimumSize(self.sizeHint()) self.DATE_ATTRIBUTES = (self.pt.pd5, self.pt.pd6, self.pt.pd7, self.pt.pd8, self.pt.pd9, self.pt.pd10, self.pt.billdate) self.ui.money0_spinBox.setEnabled(False) self.ui.money1_spinBox.setEnabled(False) self.check_before_reject_if_dirty = True
def __init__(self, check=False, parent=None): BaseDialog.__init__(self, parent) self.check = check self.enableApply() label = WarningLabel(_("Who is Browsing the Forum?")) self.insertWidget(label) other_ops = localsettings.allowed_logins[:] logged_in_ops = localsettings.operator.split("/") for op in logged_in_ops: if op in localsettings.allowed_logins: other_ops.remove(op) but = QtWidgets.QPushButton(op) but.clicked.connect(self.but_clicked) self.insertWidget(but) label2 = QtWidgets.QLabel(_("Or choose another user")) self.cb = QtWidgets.QComboBox() self.cb.addItem("--") self.cb.addItems(sorted(other_ops)) self.cb.currentTextChanged.connect(self.cb_interaction) self.insertWidget(label2) self.insertWidget(self.cb)
def __init__(self, om_gui=None): BaseDialog.__init__(self, om_gui) self.chosen_treatments = [] self.om_gui = om_gui message = _("Bridge Treatment Dialog") self.setWindowTitle(message) self.header_label = QtGui.QLabel(message) self.header_label.setAlignment(QtCore.Qt.AlignCenter) frame = QtGui.QFrame() layout = QtGui.QHBoxLayout(frame) new_but = QtGui.QPushButton(_("Plan a New Bridge")) new_but.setMinimumSize(QtCore.QSize(150, 150)) alt_but = QtGui.QPushButton(_("Recement/Repairs")) alt_but.setMinimumSize(QtCore.QSize(150, 150)) layout.addWidget(new_but) layout.addWidget(alt_but) self.insertWidget(self.header_label) self.insertWidget(frame) self.apply_but.hide() new_but.clicked.connect(self.new_bridge) alt_but.clicked.connect(self.recement_bridge) if om_gui.ui.toothPropsWidget.is_Static: self.hide() QtCore.QTimer.singleShot(10, self.new_bridge)
def __init__(self, patient, parent): BaseDialog.__init__(self, parent) self.pt = patient self.main_ui = parent patient_label = QtGui.QLabel("%s<br /><b>%s</b>" % ( _("Appointment Card for"), patient.name_id)) patient_label.setAlignment(QtCore.Qt.AlignCenter) self.appointments_label = QtGui.QLabel() self.check_box = QtGui.QCheckBox(_("Include Today's appointments?")) self.check_box.setChecked(True) icon = QtGui.QIcon(":/ps.png") self.apply_but.setText(_("Print")) self.apply_but.setIcon(icon) self.remove_spacer() self.insertWidget(patient_label) self.insertWidget(self.appointments_label) self.layout().insertStretch(2) self.insertWidget(self.check_box) self.check_box.toggled.connect(self.today_check_box_toggled) QtCore.QTimer.singleShot(100, self.get_data)
def __init__(self, patient, parent): BaseDialog.__init__(self, parent) self.pt = patient self.main_ui = parent patient_label = QtGui.QLabel( "%s<br /><b>%s</b>" % (_("Appointment Card for"), patient.name_id)) patient_label.setAlignment(QtCore.Qt.AlignCenter) self.appointments_label = QtGui.QLabel() self.check_box = QtGui.QCheckBox(_("Include Today's appointments?")) self.check_box.setChecked(True) icon = QtGui.QIcon(":/ps.png") self.apply_but.setText(_("Print")) self.apply_but.setIcon(icon) self.remove_spacer() self.insertWidget(patient_label) self.insertWidget(self.appointments_label) self.layout().insertStretch(2) self.insertWidget(self.check_box) self.check_box.toggled.connect(self.today_check_box_toggled) QtCore.QTimer.singleShot(100, self.get_data)
def __init__(self, pt, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Recall Prompt Dialog")) pt_details = "<b>%s %s %s</b>" % (pt.title, pt.fname, pt.sname) self.patient_label = QtWidgets.QLabel(pt_details) self.patient_label.setAlignment(QtCore.Qt.AlignCenter) message = _("There is a problem with the recall date of this patient.") action = _("Would you like to fix this now?") self.warning_label = WarningLabel("%s<hr />%s" % (message, action)) self.apply_but.setText(_("Fix")) self.ignore_but = self.button_box.addButton( QtWidgets.QDialogButtonBox.Discard) self.ignore_but.setText(_("Ignore Recall Date")) self.ignore_but.setToolTip(_("Ignore this for now.")) self.cancel_but.setToolTip(_("Cancel and Continue Editing")) self.insertWidget(self.patient_label) self.insertWidget(self.warning_label) self.enableApply()
def accept(self): card = apptcardPrint.Card() card.setProps(self.pt, self.appts) card.print_() self.pt.addHiddenNote("printed", "appt card") BaseDialog.accept(self)
def __init__(self, parent): BaseDialog.__init__(self, parent) self.main_ui = parent self.header_label = QtWidgets.QLabel() self.header_label.setAlignment(QtCore.Qt.AlignCenter) self.pcde_le = UpperCaseLineEdit() self.pcde_le.setText(self.main_ui.pt.pcde) self.simd_label = QtWidgets.QLabel() self.simd_label.setAlignment(QtCore.Qt.AlignCenter) self.tbi_checkbox = QtWidgets.QCheckBox( _("ToothBrushing Instruction Given")) self.tbi_checkbox.setChecked(True) self.di_checkbox = QtWidgets.QCheckBox(_("Dietary Advice Given")) self.di_checkbox.setChecked(True) self.fl_checkbox = QtWidgets.QCheckBox(_("Fluoride Varnish Applied")) self.fl_checkbox.setToolTip( _("Fee claimable for patients betwen 2 and 5")) self.fl_checkbox.setChecked(2 <= self.main_ui.pt.ageYears <= 5) self.insertWidget(self.header_label) self.insertWidget(self.pcde_le) self.insertWidget(self.simd_label) self.insertWidget(self.tbi_checkbox) self.insertWidget(self.di_checkbox) self.insertWidget(self.fl_checkbox) self.pcde_le.textEdited.connect(self.check_pcde) self._simd = None
def reject(self): self.get_new_mh(rejecting=True) if self.has_edits: if QtWidgets.QMessageBox.question( self, _("Confirm"), _("Abandon your changes?"), QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No: return BaseDialog.reject(self)
def _clicked(self, but): ''' "private" function called when button box is clicked ''' if but == self.next_but: next(self) elif but == self.back_but: self.back() else: BaseDialog._clicked(self, but)
def _clicked(self, but): ''' "private" function called when button box is clicked ''' if but == self.next_but: self.next() elif but == self.back_but: self.back() else: BaseDialog._clicked(self, but)
def __init__(self, serialno, parent=None): BaseDialog.__init__(self, parent) self.browser = QtWidgets.QTextBrowser() label = QtWidgets.QLabel("%s %s %s" % (_("Add Record"), serialno, _("to this family group?"))) self.insertWidget(label) self.insertWidget(self.browser) self.load(serialno) self.enableApply()
def reject(self): self.get_new_mh(rejecting=True) if self.has_edits: if QtGui.QMessageBox.question( self, _("Confirm"), _("Abandon your changes?"), QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No) == QtGui.QMessageBox.No: return BaseDialog.reject(self)
def __init__(self, text1, text2, parent=None): BaseDialog.__init__(self, parent, remove_stretch=True) self.text1 = text1 self.text2 = text2 self.window_title = _("Diff Dialog") self.setWindowTitle(self.window_title) self.main_toolbar = QtWidgets.QToolBar() self.main_toolbar.setObjectName("Main Toolbar") self.main_toolbar.toggleViewAction().setText(_("Toolbar")) self.xml_editor1 = XMLEditor() self.xml_editor1.editor_settings() self.xml_editor1.setFolding(self.xml_editor1.BoxedFoldStyle) self.xml_editor1.setMarkerBackgroundColor( QtGui.QColor("#44ee44"), self.xml_editor1.MARKER_COLUMN) self.xml_editor1.setIndicatorForegroundColor( QtGui.QColor("#55ff55"), self.xml_editor1.highlight_index) self.xml_editor2 = XMLEditor() self.xml_editor2.editor_settings() self.xml_editor2.setFolding(self.xml_editor2.BoxedFoldStyle) self.xml_editor2.setIndicatorForegroundColor( QtGui.QColor("#ff5555"), self.xml_editor1.highlight_index) self.xml_editor1.verticalScrollBar().hide() self.xml_editor2.verticalScrollBar().valueChanged.connect( self.xml_editor1.verticalScrollBar().setValue) action_show_min_diffs = QtWidgets.QAction(_("Show Standard Diffs"), self) action_show_full_diffs = QtWidgets.QAction(_("Show Full Diffs"), self) icon = QtGui.QIcon.fromTheme("application-exit") action_quit = QtWidgets.QAction(icon, _("Quit"), self) self.main_toolbar.addAction(action_show_min_diffs) self.main_toolbar.addAction(action_show_full_diffs) self.main_toolbar.addAction(action_quit) splitter = QtWidgets.QSplitter() splitter.addWidget(self.xml_editor1) splitter.addWidget(self.xml_editor2) # splitter.setSizes([150, 650]) self.insertWidget(self.main_toolbar) self.insertWidget(splitter) action_show_min_diffs.triggered.connect(self.load_diffs) action_show_full_diffs.triggered.connect(self.load_full_diffs) action_quit.triggered.connect(self.reject) self.load_diffs()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.ix = None self.setWindowTitle(_("New Feescale Dialog")) self.insertWidget(WarningLabel( _('Click Apply to create a new local feescale file' ' which can be modified and then inserted into the database') )) self.enableApply()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.ix = None self.setWindowTitle(_("New Feescale Dialog")) self.insertWidget( WarningLabel( _('Click Apply to create a new local feescale file' ' which can be modified and then inserted into the database') )) self.enableApply()
def accept(self): if self.appts == []: QtGui.QMessageBox.information(self, "warning", _("No appointments to print!")) self.reject() card = apptcardPrint.Card() card.setProps(self.pt, self.appts) card.print_() self.pt.addHiddenNote("printed", "appt card") BaseDialog.accept(self)
def __init__(self, text1, text2, parent=None): BaseDialog.__init__(self, parent, remove_stretch=True) self.text1 = text1 self.text2 = text2 self.window_title = _("Diff Dialog") self.setWindowTitle(self.window_title) self.main_toolbar = QtGui.QToolBar() self.main_toolbar.setObjectName("Main Toolbar") self.main_toolbar.toggleViewAction().setText(_("Toolbar")) self.xml_editor1 = XMLEditor() self.xml_editor1.editor_settings() self.xml_editor1.setFolding(self.xml_editor1.BoxedFoldStyle) self.xml_editor1.setMarkerBackgroundColor( QtGui.QColor("#44ee44"), self.xml_editor1.MARKER_COLUMN) self.xml_editor1.setIndicatorForegroundColor( QtGui.QColor("#55ff55"), self.xml_editor1.highlight_index) self.xml_editor2 = XMLEditor() self.xml_editor2.editor_settings() self.xml_editor2.setFolding(self.xml_editor2.BoxedFoldStyle) self.xml_editor2.setIndicatorForegroundColor( QtGui.QColor("#ff5555"), self.xml_editor1.highlight_index) self.xml_editor1.verticalScrollBar().hide() self.xml_editor2.verticalScrollBar().valueChanged.connect( self.xml_editor1.verticalScrollBar().setValue) action_show_min_diffs = QtGui.QAction(_("Show Standard Diffs"), self) action_show_full_diffs = QtGui.QAction(_("Show Full Diffs"), self) icon = QtGui.QIcon.fromTheme("application-exit") action_quit = QtGui.QAction(icon, _("Quit"), self) self.main_toolbar.addAction(action_show_min_diffs) self.main_toolbar.addAction(action_show_full_diffs) self.main_toolbar.addAction(action_quit) splitter = QtGui.QSplitter() splitter.addWidget(self.xml_editor1) splitter.addWidget(self.xml_editor2) # splitter.setSizes([150, 650]) self.insertWidget(self.main_toolbar) self.insertWidget(splitter) action_show_min_diffs.triggered.connect(self.load_diffs) action_show_full_diffs.triggered.connect(self.load_full_diffs) action_quit.triggered.connect(self.reject) self.load_diffs()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Connection Progress Dialog")) self.top_label = WarningLabel( _("Establishing a database connection... please wait!")) wait_widget = WaitWidget(self) self.insertWidget(self.top_label) self.insertWidget(wait_widget) self.apply_but.hide() self.cancel_but.setText(_("Quit OpenMolar")) connect.params.signaller.connection_signal.connect(self.is_connected)
def __init__(self, serialno, parent=None): BaseDialog.__init__(self, parent) self.browser = QtGui.QTextBrowser() label = QtGui.QLabel( u"%s %s %s" % (_("Add Record"), serialno, _("to this family group?"))) self.insertWidget(label) self.insertWidget(self.browser) self.load(serialno) self.enableApply()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Bookend Dialog")) label = WarningLabel( _("Change the last date where appointments are searched for?")) self.date_edit = QtWidgets.QDateEdit() self.date_edit.setDate(localsettings.BOOKEND) self.date_edit.setCalendarPopup(True) self.insertWidget(label) self.insertWidget(self.date_edit) self.date_edit.dateChanged.connect(self.check_enable)
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Restore Default Settings")) label = WarningLabel("%s<hr />%s" % ( _("Appointment search does not have default settings"), _("Would You like to reset these now?"))) self.insertWidget(label) self.show_dialog_but = self.button_box.addButton( QtGui.QDialogButtonBox.Apply) self.show_dialog_but.setText(_("Show Settings Dialog")) self.cancel_but.setText(_("Keep Custom Settings")) self.apply_but.setText(_("Yes")) self.enableApply() self.apply_but.setFocus(True)
def __init__(self, om_gui): BaseDialog.__init__(self, om_gui, remove_stretch=True) self.om_gui = om_gui title = _("Address Matches") self.setWindowTitle(title) self.table_widget = QtGui.QTableWidget() self.table_widget.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows) self.table_widget.setAlternatingRowColors(True) self.table_widget.setSortingEnabled(True) if self.om_gui.pt.serialno == 0: self.address = localsettings.LAST_ADDRESS[1:] else: self.address = (self.om_gui.pt.addr1, self.om_gui.pt.addr2, self.om_gui.pt.addr3, self.om_gui.pt.town, self.om_gui.pt.county, self.om_gui.pt.pcde, ) addr = "%s, %s, %s, %s, %s, %s" % ( self.address[0], self.address[1], self.address[2], self.address[3], self.address[4], self.address[5], ) while re.search(", *,", addr): addr = re.sub(", *,", ", ", addr) message = "<b>%s<b><hr />%s" % ( _("Top 12 address matches for"), addr) label = QtGui.QLabel() label.setText(message) self.insertWidget(label) self.insertWidget(self.table_widget) self.load_values() self.table_widget.itemSelectionChanged.connect(self.enableApply)
def __init__(self, patient, parent): BaseDialog.__init__(self, parent) self.pt = patient self.main_ui = parent patient_label = QtGui.QLabel("%s<br /><b>%s</b>"% ( _("Duplicate receipts for Patient"), patient.name_id)) patient_label.setAlignment(QtCore.Qt.AlignCenter) self.no_receipts_found_label = QtGui.QLabel( _("No previous receipts found!")) self.prev_receipts_groupbox = QtGui.QGroupBox( _("Reprint an existing receipt")) self.prev_buts_layout = QtGui.QVBoxLayout(self.prev_receipts_groupbox) self.prev_receipts_groupbox.hide() new_dup_receipt_groupbox = QtGui.QGroupBox( _("Generate a Duplicate receipt")) self.dup_date_edit = QtGui.QDateEdit() self.dup_date_edit.setDate(QtCore.QDate.currentDate()) self.amount_spinbox = QtGui.QDoubleSpinBox() self.amount_spinbox.setMaximum(10000) icon = QtGui.QIcon(localsettings.printer_png) print_dup_button = QtGui.QPushButton(icon, "Print") print_dup_button.clicked.connect(self.print_duplicate) layout = QtGui.QFormLayout(new_dup_receipt_groupbox) layout.addRow(_("Date"), self.dup_date_edit) layout.addRow(_("Amount"), self.amount_spinbox) layout.addRow(print_dup_button) self.insertWidget(patient_label) self.insertWidget(self.no_receipts_found_label) self.insertWidget(self.prev_receipts_groupbox) self.insertWidget(new_dup_receipt_groupbox) self.apply_but.hide() self.prev_receipts = {} QtCore.QTimer.singleShot(0, self.get_previous_receipts)
def __init__(self, om_gui): BaseDialog.__init__(self, om_gui, remove_stretch=True) self.om_gui = om_gui title = _("Address Matches") self.setWindowTitle(title) self.table_widget = QtWidgets.QTableWidget() self.table_widget.setSelectionBehavior( QtWidgets.QAbstractItemView.SelectRows) self.table_widget.setAlternatingRowColors(True) self.table_widget.setSortingEnabled(True) if self.om_gui.pt.serialno == 0: self.address = localsettings.LAST_ADDRESS[1:] else: self.address = ( self.om_gui.pt.addr1, self.om_gui.pt.addr2, self.om_gui.pt.addr3, self.om_gui.pt.town, self.om_gui.pt.county, self.om_gui.pt.pcde, ) addr = "%s, %s, %s, %s, %s, %s" % ( self.address[0], self.address[1], self.address[2], self.address[3], self.address[4], self.address[5], ) while re.search(", *,", addr): addr = re.sub(", *,", ", ", addr) message = "<b>%s<b><hr />%s" % (_("Top 12 address matches for"), addr) label = QtWidgets.QLabel() label.setText(message) self.insertWidget(label) self.insertWidget(self.table_widget) self.load_values() self.table_widget.itemSelectionChanged.connect(self.enableApply)
def reject(self): LOGGER.info("Forced quit - no database connection") try: connect.params.signaller.connection_signal.disconnect( self.is_connected) except TypeError: pass app = QtWidgets.QApplication.instance() connect.params.connection_abandoned = True QtCore.QTimer.singleShot(4000, app.closeAllWindows) QtWidgets.QMessageBox.warning( self, _("Closing"), _("No Database Connection - Closing OpenMolar")) BaseDialog.reject(self) app.closeAllWindows()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Advanced Names Dialog")) label = WarningLabel(_("Previous Surnames, Nicknames, and alternate " "spelling can help when searching for patients")) self.browser = OMWebView(self) self.browser.linkClicked.connect(self.link_clicked) self.insertWidget(label) self.insertWidget(self.browser) self.cancel_but.hide() self.enableApply()
def __init__(self, parent=None): BaseDialog.__init__(self, parent) self.setWindowTitle(_("Update Account Letter Settings")) label = WarningLabel(_("The following fields can be edited.")) self.debt_collector_lineedit = QtWidgets.QLineEdit() self.footer_textedit = QtWidgets.QTextEdit() frame = QtWidgets.QFrame() layout = QtWidgets.QFormLayout(frame) layout.addRow(_("Debt Collector"), self.debt_collector_lineedit) layout.addRow(_("Footer"), self.footer_textedit) self.insertWidget(label) self.insertWidget(frame)
def __init__(self, patient, parent): BaseDialog.__init__(self, parent) self.pt = patient self.main_ui = parent patient_label = QtGui.QLabel( "%s<br /><b>%s</b>" % (_("Duplicate receipts for Patient"), patient.name_id)) patient_label.setAlignment(QtCore.Qt.AlignCenter) self.no_receipts_found_label = QtGui.QLabel( _("No previous receipts found!")) self.prev_receipts_groupbox = QtGui.QGroupBox( _("Reprint an existing receipt")) self.prev_buts_layout = QtGui.QVBoxLayout(self.prev_receipts_groupbox) self.prev_receipts_groupbox.hide() new_dup_receipt_groupbox = QtGui.QGroupBox( _("Generate a Duplicate receipt")) self.dup_date_edit = QtGui.QDateEdit() self.dup_date_edit.setDate(QtCore.QDate.currentDate()) self.amount_spinbox = QtGui.QDoubleSpinBox() self.amount_spinbox.setMaximum(10000) icon = QtGui.QIcon(localsettings.printer_png) print_dup_button = QtGui.QPushButton(icon, "Print") print_dup_button.clicked.connect(self.print_duplicate) layout = QtGui.QFormLayout(new_dup_receipt_groupbox) layout.addRow(_("Date"), self.dup_date_edit) layout.addRow(_("Amount"), self.amount_spinbox) layout.addRow(print_dup_button) self.insertWidget(patient_label) self.insertWidget(self.no_receipts_found_label) self.insertWidget(self.prev_receipts_groupbox) self.insertWidget(new_dup_receipt_groupbox) self.apply_but.hide() self.prev_receipts = {} QtCore.QTimer.singleShot(0, self.get_previous_receipts)
def exec_(self): if BaseDialog.exec_(self): standard_letter.insert_letters(self.updated_letters()) standard_letter.insert_letters(self.new_letters()) standard_letter.delete_letters(self.deleted_letters) return True return False