示例#1
0
    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()
示例#2
0
    def __init__(self, parent=None):
        BaseDialog.__init__(self, parent)
        self.setWindowTitle(_("Confirm"))

        label = WarningLabel(_("Clear ALL Patient Locations?"))
        self.insertWidget(label)
        self.enableApply()
示例#3
0
    def __init__(self, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.setWindowTitle(_("Login Dialog"))

        header_label = WarningLabel(_('Login Required'))

        self.password_lineEdit = QtWidgets.QLineEdit()
        self.password_lineEdit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.user1_lineEdit = UpperCaseLineEdit()
        self.user1_lineEdit.setMaximumWidth(50)
        self.user2_lineEdit = UpperCaseLineEdit()
        self.user2_lineEdit.setMaximumWidth(50)

        self.reception_radioButton = QtWidgets.QRadioButton(
            _("Reception Machine"))
        self.surgery_radioButton = QtWidgets.QRadioButton(_("Surgery Machine"))
        self.surgery_radioButton.setChecked(True)

        frame = QtWidgets.QFrame()
        form_layout = QtWidgets.QFormLayout(frame)

        form_layout.addRow(_("System Password"), self.password_lineEdit)

        form_layout.addRow(_("User 1 (Required)"), self.user1_lineEdit)
        form_layout.addRow(_("User 2 (Optional)"), self.user2_lineEdit)

        but_group = QtWidgets.QButtonGroup(self)
        but_group.addButton(self.surgery_radioButton)
        but_group.addButton(self.reception_radioButton)

        self.insertWidget(header_label)
        self.insertWidget(frame)
        self.insertWidget(self.surgery_radioButton)
        self.insertWidget(self.reception_radioButton)
        self.enableApply()

        # grab any stored information
        PASSWORD, USER1, USER2 = localsettings.autologin()
        self.password_lineEdit.setText(PASSWORD)
        self.user1_lineEdit.setText(USER1)
        self.user2_lineEdit.setText(USER2)
        self.autoreception(USER1)
        self.autoreception(USER2)

        self.parse_conf_file()

        self.alternate_servers_widget = AlternateServersWidget(self)
        if self.alternate_servers_widget.has_options:
            self.more_but.setText(_("Database choice"))
            self.add_advanced_widget(self.alternate_servers_widget)
        else:
            self.more_but.hide()

        self.user1_lineEdit.textEdited.connect(self.autoreception)
        self.user2_lineEdit.textEdited.connect(self.autoreception)

        self.dirty = True
        self.set_check_on_cancel(True)

        QtCore.QTimer.singleShot(1000, self._developer_login)
示例#4
0
    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)
示例#5
0
    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()
示例#6
0
    def __init__(self, om_gui=None):
        ExtendableDialog.__init__(self, om_gui)

        self.chosen_properties = {}
        self.om_gui = om_gui
        message = (_("Chart/Plan a Bridge"))
        self.setWindowTitle(message)
        self.header_label = WarningLabel(message)

        self.wizard_widget = QtWidgets.QStackedWidget()

        page0 = PageZero(self)
        page1 = PageOne(self)
        page2 = PageTwo(self)
        page3 = PageThree(self)
        page4 = PageFour(self)
        accept_page = AcceptPage(self)

        self.wizard_widget.addWidget(page0)
        self.wizard_widget.addWidget(page1)
        self.wizard_widget.addWidget(page2)
        self.wizard_widget.addWidget(page3)
        self.wizard_widget.addWidget(page4)
        self.wizard_widget.addWidget(accept_page)

        self.insertWidget(self.header_label)
        self.insertWidget(self.wizard_widget)

        self.advanced_label = QtWidgets.QLabel("self.advanced_label")
        self.add_advanced_widget(self.advanced_label)

        self.next_but = self.button_box.addButton(_("Next"),
                                                  self.button_box.ActionRole)

        self.apply_but.hide()
示例#7
0
    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 __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()
示例#9
0
    def __init__(self, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.setWindowTitle(_("Add User Dialog"))

        self.top_label = WarningLabel("%s<br />%s<hr />%s" % (
            _('Add a new user to the system?'),
            _("This is done using initials or a short nickname."),
            _("Must be unique and Maximum allowed in 5 characters")))

        self.line_edit = UpperCaseLineEdit()

        frame = QtWidgets.QFrame(self)
        layout = QtWidgets.QFormLayout(frame)
        layout.addRow(_("User Initials or nickname"), self.line_edit)

        self.insertWidget(self.top_label)
        self.insertWidget(frame)

        self.line_edit.textChanged.connect(self._check_enable)
        self.line_edit.setFocus()

        list_widget = QtWidgets.QListWidget()
        list_widget.addItems(sorted(localsettings.allowed_logins))
        self.add_advanced_widget(list_widget)
        self.set_advanced_but_text(_("view existing users"))
示例#10
0
    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()
示例#11
0
    def __init__(self, message, changes, parent=None):
        '''
        offers a choiced of save discard cancel, but allows for examination
        of what has changed.
        changes should be a function, which returns a string list
        '''
        ExtendableDialog.__init__(self, parent)
        self.set_advanced_but_text(_("What's changed?"))
        self.apply_but.setText("&Save")
        self.enableApply()
        self.save_on_exit = True

        label = WarningLabel(message)
        self.insertWidget(label)

        self.discard_but = self.button_box.addButton(
            QtGui.QDialogButtonBox.Discard)
        self.discard_but.setToolTip(_("Discard All Changes"))

        self.cancel_but.setToolTip(_("Cancel and Continue Editing"))

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

        self.result = self.SAVE
示例#12
0
    def __init__(self, ftr=False, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.setWindowTitle(_("Add User Dialog"))

        self.top_label = WarningLabel(_('Add a new clinician to the system?'))

        self.user_id_comboBox = QtWidgets.QComboBox()
        but = QtWidgets.QPushButton(_("Add New Login"))

        self.name_lineedit = QtWidgets.QLineEdit()
        self.f_name_lineedit = QtWidgets.QLineEdit()
        self.quals_lineedit = QtWidgets.QLineEdit()
        self.type_comboBox = QtWidgets.QComboBox()
        self.type_comboBox.addItems([
            _("Dentist"),
            _("Hygienist"),
            _("Therapist")
            ])
        self.speciality_lineedit = QtWidgets.QLineEdit()
        self.date_edit = QtWidgets.QDateEdit()
        self.date_edit.setDate(localsettings.currentDay())
        self.data_lineedit = QtWidgets.QLineEdit()
        self.new_diary_checkbox = QtWidgets.QCheckBox(
            _("Create a new diary for this clinician "
              "(uncheck to map to an existing diary)"))
        self.new_diary_checkbox.setChecked(True)

        row1 = QtWidgets.QWidget()
        layout = QtWidgets.QHBoxLayout(row1)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self.user_id_comboBox)
        layout.addWidget(but)

        frame = QtWidgets.QFrame(self)
        layout = QtWidgets.QFormLayout(frame)
        layout.addRow(_("Initials/Nickname (must be an existing Login)"), row1)
        layout.addRow(_("Name eg. Fred Smith"), self.name_lineedit)
        layout.addRow(_("Formal Name eg. Dr.F. Smith"), self.f_name_lineedit)
        layout.addRow(_("Qualifications"), self.quals_lineedit)
        layout.addRow(_("Speciality"), self.speciality_lineedit)
        layout.addRow(_("Clinician Type"), self.type_comboBox)
        layout.addRow(_("Start Date"), self.date_edit)
        layout.addRow(_("Additional Data"), self.data_lineedit)
        layout.addRow(self.new_diary_checkbox)
        self.insertWidget(self.top_label)
        self.insertWidget(frame)

        for le in (self.name_lineedit, self.f_name_lineedit):
            le.textChanged.connect(self._check_enable)
        self.name_lineedit.setFocus()

        list_widget = QtWidgets.QListWidget()
        list_widget.addItems(
            [str(val) for val in sorted(localsettings.dentDict.values())])
        self.add_advanced_widget(list_widget)
        self.set_advanced_but_text(_("view existing dentists"))

        self.load_logins()
        but.clicked.connect(self.add_user)
示例#13
0
    def __init__(self, date_, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.date = date_
        label = WarningLabel(
            "%s %s" % (_("Edit Memos for"), localsettings.longDate(date_)))

        self.bank_hol_label = QtWidgets.QLabel("")
        font = self.font()
        font.setBold(True)
        font.setItalic(True)
        self.bank_hol_label.setFont(font)
        self.bank_hol_label.setAlignment(QtCore.Qt.AlignCenter)
        self.bank_hol_label.hide()

        self.global_lineedit = QtWidgets.QLineEdit()

        frame = QtWidgets.QFrame()
        form_layout = QtWidgets.QFormLayout(frame)
        form_layout.addRow(_("Global Memo"), self.global_lineedit)

        frame2 = QtWidgets.QFrame()
        form_layout = QtWidgets.QFormLayout(frame2)

        self.le_dict = {}
        for apptix in \
                localsettings.activedent_ixs + localsettings.activehyg_ixs:
            le = QtWidgets.QLineEdit()
            form_layout.addRow(localsettings.apptix_reverse.get(apptix), le)
            self.le_dict[apptix] = le

        scroll_area = QtWidgets.QScrollArea()
        scroll_area.setWidget(frame2)
        scroll_area.setWidgetResizable(True)

        clinician_groupbox = QtWidgets.QGroupBox()
        clinician_groupbox.setTitle(_("Clinician Memos"))
        layout = QtWidgets.QVBoxLayout(clinician_groupbox)
        layout.addWidget(scroll_area)

        self.public_holiday_le = QtWidgets.QLineEdit()
        public_holiday_widget = QtWidgets.QFrame()
        form_layout = QtWidgets.QFormLayout(public_holiday_widget)
        form_layout.addRow(_("Public Holiday Text"), self.public_holiday_le)
        self.add_advanced_widget(public_holiday_widget)
        self.set_advanced_but_text(_("Edit Public Holiday Text"))

        self.insertWidget(label)
        self.insertWidget(self.bank_hol_label)
        self.insertWidget(frame)
        self.insertWidget(clinician_groupbox)

        self.setMinimumSize(self.sizeHint())
        self.check_before_reject_if_dirty = True
        QtCore.QTimer.singleShot(100, self.load_values)
示例#14
0
    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.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)
示例#16
0
 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)
示例#17
0
    def __init__(self, om_gui=None):
        ExtendableDialog.__init__(self, om_gui)

        self.om_gui = om_gui
        message = (_("Add A New Denture To The Treatment Plan"))
        self.setWindowTitle(message)
        self.header_label = WarningLabel(message)

        self.ndu_le = UpperCaseLineEdit()
        self.ndl_le = UpperCaseLineEdit()

        self.set_default_lineedit(self.ndl_le)

        self.wizard_widget = QtWidgets.QStackedWidget()

        page0 = PageZero(self)
        page0.finished_signal.connect(self.next_widget)
        page1 = PageOne(self)
        page2 = PageTwo(self)
        page3 = PageThree(self)
        page4 = PageFour(self)
        accept_page = AcceptPage(self)

        self.wizard_widget.addWidget(page0)
        self.wizard_widget.addWidget(page1)
        self.wizard_widget.addWidget(page2)
        self.wizard_widget.addWidget(page3)
        self.wizard_widget.addWidget(page4)
        self.wizard_widget.addWidget(accept_page)

        self.insertWidget(self.header_label)
        self.insertWidget(self.wizard_widget)

        frame = QtWidgets.QFrame()
        layout = QtWidgets.QFormLayout(frame)
        layout.addRow(_("Upper Denture"), self.ndu_le)
        layout.addRow(_("Lower Denture"), self.ndl_le)

        self.add_advanced_widget(frame)

        self.next_but = self.button_box.addButton(
            _("Next"), self.button_box.ActionRole)

        self.apply_but.hide()

        self.ndu_le.textChanged.connect(self.enable_apply)
        self.ndl_le.textChanged.connect(self.enable_apply)

        self.ndu_le.editingFinished.connect(self.advanced_apply)
        self.ndl_le.editingFinished.connect(self.advanced_apply)
示例#18
0
    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)
示例#19
0
    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)
示例#20
0
    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()
示例#21
0
    def __init__(self, parent=None):
        BaseDialog.__init__(self, parent)
        label = WarningLabel(_("Please enter the reason for your alterations"))
        self.insertWidget(label)
        self.rbs = []
        for note in (_("Updated Medical Notes"), _("Corrected Medical Notes"),
                     self.NO_NOTE):
            rb = QtWidgets.QRadioButton(note)
            self.rbs.append(rb)
            self.insertWidget(rb)

        if "REC" in localsettings.operator:
            self.rbs[-1].setChecked(True)
        else:
            self.rbs[0].setChecked(True)
        self.enableApply()
        self.cancel_but.hide()
示例#22
0
    def __init__(self, parent=None):
        BaseDialog.__init__(self, parent)
        self.setWindowTitle(_("Account Dialog"))
        label = WarningLabel(_("Please Choose the tone of this letter"))
        self.radio_button_a = QtWidgets.QRadioButton(
            _("Normal Account - Very Polite"))
        self.radio_button_b = QtWidgets.QRadioButton(
            _("Mildly assertive request"))
        self.radio_button_c = QtWidgets.QRadioButton(
            _("Threaten with Debt Collector"))

        self.insertWidget(label)
        self.insertWidget(self.radio_button_a)
        self.insertWidget(self.radio_button_b)
        self.insertWidget(self.radio_button_c)

        self.radio_button_a.setChecked(True)
        self.enableApply()
示例#23
0
    def __init__(self, parent=None):
        BaseDialog.__init__(self, parent)
        self.setWindowTitle(_("Raise Permissions Dialog"))
        label = WarningLabel(
            "%s<hr />%s" %
            (_("Supervisor privileges required to perform this action"),
             _("Please enter the supervisor password")))

        frame = QtGui.QFrame()
        self.form_layout = QtGui.QFormLayout(frame)
        self.line_edit = QtGui.QLineEdit()
        self.line_edit.setEchoMode(QtGui.QLineEdit.Password)
        self.form_layout.addRow(_("Supervisor Password"), self.line_edit)

        self.insertWidget(label)
        self.insertWidget(frame)
        self.enableApply()
        self.line_edit.setFocus(True)
示例#24
0
    def add_widgets(self):
        self.header_label = WarningLabel(
            _("Checking for updates.... please wait."))
        self.result_label = QtWidgets.QLabel("")
        self.result_label.setAlignment(QtCore.Qt.AlignCenter)
        self.result_label.setOpenExternalLinks(True)

        self.insertWidget(self.header_label)
        self.insertWidget(self.result_label)

        self.cancel_but.hide()
        self.apply_but.setText(_("OK"))
        self.enableApply()

        self.options_widget = OptionsWidget(self)
        self.options_widget.set_chosen_option(self.config.update_option)
        self.set_advanced_but_text(_("Options"))
        self.add_advanced_widget(self.options_widget)
示例#25
0
    def __init__(self, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.setWindowTitle(_("Initial Check Dialog"))

        top_label = WarningLabel(
            _('OpenMolar has found the following issues with your database.'))

        frame = QtWidgets.QFrame(self)
        self.form_layout = QtWidgets.QFormLayout(frame)

        self.add_advanced_widget(QtWidgets.QLabel(_("No Advanced options")))
        self.enableApply(True)

        self.insertWidget(top_label)
        self.insertWidget(frame)

        self.apply_but.setText(_("Proceed"))
        self.cancel_but.hide()
示例#26
0
    def __init__(self, parent=None):
        BaseDialog.__init__(self, parent)
        self.dent_cbs = []

        self.setWindowTitle(_("Load Accounts"))
        label = WarningLabel(
            _("Please select criteria for loading patients in debt or credit"))
        self.debt_rb = QtWidgets.QRadioButton(_("Debt"))
        self.debt_rb.setChecked(True)
        credit_rb = QtWidgets.QRadioButton(_("Credit"))

        self.dent_gb = QtWidgets.QGroupBox(
            _("Dentist choice (leave unchecked for all)"))
        self.dent_gb.setCheckable(True)
        self.dent_gb.setChecked(False)
        layout = QtWidgets.QVBoxLayout(self.dent_gb)

        for i, dent in enumerate(localsettings.activedents):
            cb = QtWidgets.QCheckBox()
            cb.setChecked(True)
            cb.setText(dent)
            cb.dent = localsettings.activedent_ixs[i]
            layout.addWidget(cb)
            self.dent_cbs.append(cb)

        self.amount_spin_box = QtWidgets.QDoubleSpinBox()
        self.bad_debts_cb = QtWidgets.QCheckBox()

        rb_frame = QtWidgets.QFrame()
        radio_but_layout = QtWidgets.QHBoxLayout(rb_frame)
        radio_but_layout.addWidget(self.debt_rb)
        radio_but_layout.addWidget(credit_rb)

        amount_frame = QtWidgets.QFrame()
        amount_layout = QtWidgets.QFormLayout(amount_frame)
        amount_layout.addRow(_("Ignore amounts less than"),
                             self.amount_spin_box)
        amount_layout.addRow(_("Include Bad Debts"), self.bad_debts_cb)

        self.insertWidget(label)
        self.insertWidget(rb_frame)
        self.insertWidget(amount_frame)
        self.insertWidget(self.dent_gb)
        self.enableApply()
示例#27
0
    def __init__(self, sno, parent=None):
        BaseDialog.__init__(self, parent)
        self.setWindowTitle(_("Patient Location Dialog"))
        self.serialno = sno

        label = WarningLabel("%s %s" %
                             (_("Update the location of"), self.name))
        self.insertWidget(label)

        for location in sorted(localsettings.PATIENT_LOCATIONS.values()):
            button = QtWidgets.QPushButton(location)
            button.clicked.connect(self.button_clicked)
            self.insertWidget(button)

        button = QtWidgets.QPushButton(_("Clear Patient Location"))
        button.clicked.connect(self.clear_patient)
        button.setMinimumHeight(80)
        self.insertWidget(button)
        self.apply_but.hide()
示例#28
0
    def __init__(self, parent=None):
        BaseDialog.__init__(self, parent)
        self.setWindowTitle(_("First Run Dialog"))

        self.top_label = WarningLabel("FirstRun")

        self.wizard_widget = QtWidgets.QStackedWidget()

        page0 = PageZero(self)
        self.page1 = PageOne(self)
        self.page2 = PageTwo(self)
        self.page3 = PageThree(self)
        self.page4 = PageFour(self)
        self.page5 = PageFive(self)
        page6 = PageSix(self)
        page7 = PageSeven(self)
        self.page8 = PageEight(self)
        self.page9 = PageNine(self)

        self.wizard_widget.addWidget(page0)
        self.wizard_widget.addWidget(self.page1)
        self.wizard_widget.addWidget(self.page2)
        self.wizard_widget.addWidget(self.page3)
        self.wizard_widget.addWidget(self.page4)
        self.wizard_widget.addWidget(self.page5)
        self.wizard_widget.addWidget(page6)
        self.wizard_widget.addWidget(page7)
        self.wizard_widget.addWidget(self.page8)
        self.wizard_widget.addWidget(self.page9)

        self.insertWidget(self.top_label)
        self.insertWidget(self.wizard_widget)

        self.next_but = self.button_box.addButton(_("Next"),
                                                  self.button_box.ActionRole)
        self.back_but = self.button_box.addButton(_("Back"),
                                                  self.button_box.ActionRole)

        self.apply_but.hide()
        self.back_but.hide()
        self.cancel_but.setText(_("Quit OpenMolar"))

        self.set_labels()
示例#29
0
    def __init__(self, ftr=False, parent=None):
        BaseDialog.__init__(self, parent)
        self.setWindowTitle(_("Close Course Dialog"))

        self.patient_label = QtWidgets.QLabel("")
        self.patient_label.setAlignment(QtCore.Qt.AlignCenter)
        f = self.patient_label.font()
        f.setBold(True)
        self.patient_label.setFont(f)

        self.tx_complete_label = WarningLabel(
            _('You have no further treatment proposed for this patient, '
              'yet they are deemed to be "under treatment".'))
        self.tx_complete_label.setMaximumHeight(120)

        self.date_edit = QtWidgets.QDateEdit()
        self.date_edit.setDate(QtCore.QDate.currentDate())
        self.date_edit.setMaximumDate(QtCore.QDate().currentDate())
        self.date_edit.setCalendarPopup(True)

        frame = QtWidgets.QFrame(self)
        layout = QtWidgets.QFormLayout(frame)
        layout.addRow(_("Suggested Completion Date"), self.date_edit)

        question_label = QtWidgets.QLabel(
            "<b>%s</b>" %
            _("Close this course now?"))
        question_label.setAlignment(QtCore.Qt.AlignCenter)

        self.ftr_checkbox = QtWidgets.QCheckBox(_("Pt failed to return"))
        self.ftr_checkbox.setChecked(ftr)

        self.insertWidget(self.patient_label)
        self.insertWidget(self.tx_complete_label)
        self.insertWidget(frame)
        self.insertWidget(question_label)

        if ftr:
            self.layout().insertStretch(4, 200)
            self.insertWidget(self.ftr_checkbox)

        self.enableApply()
示例#30
0
    def __init__(self, user, parent=None):
        BaseDialog.__init__(self, parent)

        label = WarningLabel(
            "%s %s<hr /> %s" %
            (user, _("is not allowed to post."), _("Who are you?")))
        frame = QtWidgets.QFrame()
        layout = QtWidgets.QVBoxLayout(frame)

        scroll_area = QtWidgets.QScrollArea()
        scroll_area.setWidgetResizable(True)
        scroll_area.setWidget(frame)

        for op in localsettings.allowed_logins:
            if op not in localsettings.disallowed_forum_posters:
                but = QtWidgets.QPushButton(op)
                but.clicked.connect(self.but_clicked)
                layout.addWidget(but)

        self.insertWidget(label)
        self.insertWidget(scroll_area)