Beispiel #1
0
 def _clicked(self, but):
     if but == self.postpone_but:
         self.postpone_appointment()
     elif but == self.apply_but:
         self.confirm_cancel_all()
     else:
         ExtendableDialog._clicked(self, but)
Beispiel #2
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)
Beispiel #3
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 = QtGui.QLabel(message)
        label.setAlignment(QtCore.Qt.AlignCenter)
        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
Beispiel #4
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()
    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
    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()
        settings_fetcher = db_settings.SettingsFetcher()
        self.existing_logins = settings_fetcher.existing_logins()

        list_widget = QtWidgets.QListWidget()
        list_widget.addItems(sorted(self.existing_logins))
        self.add_advanced_widget(list_widget)
        self.set_advanced_but_text(_("view existing users"))
    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()
    def __init__(self, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)

        title = _("Confgure Feescales Dialog")
        self.setWindowTitle(title)
        label = QtGui.QLabel("%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'.")))
        label.setWordWrap(True)
        self.insertWidget(label)
        self.configurer = FeescaleConfigurer()
        LOGGER.debug("Feescales to config\n%s", "\n".join(
            ["  %s" % f for f in self.configurer.feescales]))

        frame = QtGui.QFrame()
        self.fs_layout = QtGui.QVBoxLayout(frame)
        self.fs_layout.setSpacing(1)
        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 = QtGui.QScrollArea(self)
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.insertWidget(scroll_area)

        self.enable_buttons()
    def __init__(self, candidates, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.table_widget = QtWidgets.QTableWidget()
        self.table_widget.setAlternatingRowColors(True)
        self.table_widget.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.insertWidget(self.table_widget)

        self.headers = (_('Serialno'),
                        _('Status'),
                        _('Title'),
                        _('Forename'),
                        _('Surname'),
                        _('Birth Date'),
                        _('Address Line 1'),
                        _('Address Line 2'),
                        _('Town'),
                        _('POSTCODE'),
                        _('Tel1'),
                        _('Tel2'),
                        _('Mobile')
                        )
        self._candidates = candidates
        self.hidden_count = 0
        self.load_candidates()
        self.table_widget.itemDoubleClicked.connect(self.accept)
        self.enableApply(True)
        self.apply_but.setText(_("Load the Selected Patient"))
        self.setMinimumWidth(
            QtWidgets.QApplication.desktop().screenGeometry().width() - 20)
Beispiel #10
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"))
    def __init__(self, static, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Crown Choice Dialog"))
        self.om_gui = parent
        self.chosen_shortcut = None

        scroll_area = QtWidgets.QScrollArea()
        frame = QtWidgets.QFrame()
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.but_layout = QtWidgets.QGridLayout(frame)
        self.insertWidget(scroll_area)

        self.apply_but.hide()

        if static:
            self.more_but.hide()
            self.add_buttons(STATIC_LIST)
        else:
            all_crowns_but = QtWidgets.QPushButton(
                _("Show Crowns types from all feescales"))
            all_crowns_but.clicked.connect(self._show_all_crowns)
            self.add_advanced_widget(all_crowns_but)

            self.add_buttons(
                self.om_gui.pt.fee_table.ui_lists["crown_buttons"])
    def __init__(self, om_gui):
        ExtendableDialog.__init__(self, om_gui, remove_stretch=True)

        self.om_gui = om_gui

        title = _("Manage Family Group")
        self.setWindowTitle(title)
        label = QtGui.QLabel(u"<b>%s</b>" % title)
        label.setAlignment(QtCore.Qt.AlignCenter)

        frame = QtGui.QFrame()
        self.frame_layout = QtGui.QGridLayout(frame)

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

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

        self.member_dict = {}
        self.widgets = []
        self.apply_but.hide()
        self.cancel_but.setText(_("Close"))

        self.advanced_widg = _AdvancedWidget(self)
        self.advanced_widg.sync_address_signal.connect(self.sync_addresses)
        self.advanced_widg.add_member_signal.connect(self.record_search)
        self.advanced_widg.find_others_signal.connect(self.address_search)
        self.advanced_widg.delete_group_signal.connect(self.delete_group)
        self.advanced_widg.setEnabled(False)
        self.add_advanced_widget(self.advanced_widg)

        self.load_values()
Beispiel #13
0
    def __init__(self, om_gui):
        ExtendableDialog.__init__(self, om_gui, remove_stretch=True)

        self.om_gui = om_gui

        title = _("Manage Family Group")
        self.setWindowTitle(title)
        label = QtGui.QLabel(u"<b>%s</b>" % title)
        label.setAlignment(QtCore.Qt.AlignCenter)

        frame = QtGui.QFrame()
        self.frame_layout = QtGui.QGridLayout(frame)

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

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

        self.member_dict = {}
        self.widgets = []
        self.apply_but.hide()
        self.cancel_but.setText(_("Close"))

        self.advanced_widg = _AdvancedWidget(self)
        self.advanced_widg.sync_address_signal.connect(self.sync_addresses)
        self.advanced_widg.add_member_signal.connect(self.record_search)
        self.advanced_widg.find_others_signal.connect(self.address_search)
        self.advanced_widg.delete_group_signal.connect(self.delete_group)
        self.advanced_widg.setEnabled(False)
        self.add_advanced_widget(self.advanced_widg)

        self.load_values()
    def __init__(self, static, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Crown Choice Dialog"))
        self.om_gui = parent
        self.chosen_shortcut = None

        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.but_layout = QtGui.QGridLayout(frame)
        self.insertWidget(scroll_area)

        self.apply_but.hide()

        if static:
            self.more_but.hide()
            self.add_buttons(STATIC_LIST)
        else:
            all_crowns_but = QtGui.QPushButton(
                _("Show Crowns types from all feescales"))
            all_crowns_but.clicked.connect(self._show_all_crowns)
            self.add_advanced_widget(all_crowns_but)

            self.add_buttons(
                self.om_gui.pt.fee_table.ui_lists["crown_buttons"])
Beispiel #15
0
    def __init__(self, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)

        title = _("Confgure Feescales Dialog")
        self.setWindowTitle(title)
        label = QtGui.QLabel("%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'.")))
        label.setWordWrap(True)
        self.insertWidget(label)
        self.configurer = FeescaleConfigurer()
        LOGGER.debug(
            "Feescales to config\n%s",
            "\n".join(["  %s" % f for f in self.configurer.feescales]))

        frame = QtGui.QFrame()
        self.fs_layout = QtGui.QVBoxLayout(frame)
        self.fs_layout.setSpacing(1)
        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 = QtGui.QScrollArea(self)
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.insertWidget(scroll_area)

        self.enable_buttons()
Beispiel #16
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)
    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 = QtGui.QComboBox()
        but = QtGui.QPushButton(_("Add New Login"))

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

        row1 = QtGui.QWidget()
        layout = QtGui.QHBoxLayout(row1)
        layout.setMargin(0)
        layout.addWidget(self.user_id_comboBox)
        layout.addWidget(but)

        frame = QtGui.QFrame(self)
        layout = QtGui.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 = QtGui.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)
Beispiel #18
0
    def __init__(self, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)

        title = _("Openmolar Documents Dialog")
        self.setWindowTitle(title)
        label = QtWidgets.QLabel(
            "<b>%s</b>" %
            _("Please choose a document to open"))
        label.setAlignment(QtCore.Qt.AlignCenter)

        self.chosen_document = None

        message = '<p>%s<br /><a href="%s">%s</a></p>' % (
            _("For help configuring this feature, see"),
            urls.DOCUMENT_HELP, urls.DOCUMENT_HELP)

        advanced_label = QtWidgets.QLabel(message)
        advanced_label.setOpenExternalLinks(True)
        self.add_advanced_widget(advanced_label)

        files = os.listdir(localsettings.DOCS_DIRECTORY)

        if files == []:
            widg = QtWidgets.QLabel("<p>%s %s</p><hr />%s" % (
                                _("You have no documents stored in"),
                                localsettings.DOCS_DIRECTORY, message))
            widg.setAlignment(QtCore.Qt.AlignCenter)
            widg.setOpenExternalLinks(True)
            widg.selected_file = _null_func

        elif "docs.xml" in files:
            dom = None
            try:
                control_f = os.path.join(
                    localsettings.DOCS_DIRECTORY, "docs.xml")
                dom = minidom.parse(control_f)
                doc_node = dom.getElementsByTagName("documents")[0]
                widg = QtWidgets.QTabWidget()
                for group in doc_node.getElementsByTagName("group"):
                    docs = group.getElementsByTagName("document")
                    group_widg = _LabelledFileListWidget(docs)
                    tab = widg.addTab(group_widg,
                                      group.getAttribute("heading"))
                    group_widg.radio_buts[0].setChecked(True)
                widg.selected_file = widg.currentWidget().selected_file
            except:
                LOGGER.exception("unable to parse '%s'", control_f)
                widg = QtWidgets.QLabel(_("docs.xml is not parseable"))

        else:
            # self.remove_spacer()
            widg = _FileListWidget(files)

        self.apply_but.setText(_("Open &File"))
        self.enableApply(bool(widg.selected_file()))
        self.insertWidget(label)
        self.insertWidget(widg)
        self._widg = widg
 def _clicked(self, but):
     '''
     "private" function called when button box is clicked
     '''
     role = self.button_box.buttonRole(but)
     if role == self.button_box.ActionRole:
         self.next_widget()
     else:
         ExtendableDialog._clicked(self, but)
 def _clicked(self, but):
     '''
     overwrite :doc:`ExtendableDialog` _clicked
     '''
     if but == self.more_but:
         FinalChoiceDialog.FILTER = not self.FILTER
         self.load_candidates()
         return
     ExtendableDialog._clicked(self, but)
 def _clicked(self, but):
     '''
     overwrite :doc:`ExtendableDialog` _clicked
     '''
     if but == self.more_but:
         FinalChoiceDialog.FILTER = not self.FILTER
         self.load_candidates()
         return
     ExtendableDialog._clicked(self, but)
 def _clicked(self, but):
     """
     "private" function called when button box is clicked
     """
     role = self.button_box.buttonRole(but)
     if role == self.button_box.ActionRole:
         self.next_widget()
     else:
         ExtendableDialog._clicked(self, but)
 def _clicked(self, but):
     '''
     overwrite BaseDialog method
     '''
     if but == self.apply_but and QtWidgets.QMessageBox.question(
             self, _("Confirm"), _("Apply Changes?"),
             QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel,
             QtWidgets.QMessageBox.Cancel) == QtWidgets.QMessageBox.Cancel:
         return
     ExtendableDialog._clicked(self, but)
    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 = QtGui.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 = QtGui.QLineEdit()

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

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

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

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

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

        self.public_holiday_le = QtGui.QLineEdit()
        public_holiday_widget = QtGui.QFrame()
        form_layout = QtGui.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)
Beispiel #25
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)
Beispiel #26
0
    def __init__(self, patient, parent=None):
        ExtendableDialog.__init__(self, parent)

        self.pt = patient
        self.data = Gp17Data(patient)

        title = _("GP17 Dialog")
        self.setWindowTitle(title)
        label = QtGui.QLabel(u"<b>%s</b>"% title)
        label.setAlignment(QtCore.Qt.AlignCenter)


        self.dentist_combobox = QtGui.QComboBox()
        self.dentist_combobox.addItems(localsettings.activedents)

        frame = QtGui.QFrame()
        layout = QtGui.QFormLayout(frame)
        layout.addRow(_("Use this dentists stamp?"), self.dentist_combobox)

        self.chart_cb = QtGui.QCheckBox(_("Chart"))
        self.bpe_cb = QtGui.QCheckBox(_("BPE"))

        self.accd_cb = QtGui.QCheckBox(_("Acceptance Date"))
        self.cmpd_cb = QtGui.QCheckBox(_("Completion Date"))
        self.tx_cb = QtGui.QCheckBox(_("Treatments"))

        self.charting_gb = QtGui.QGroupBox(_("Include Chart Details"))
        self.charting_gb.setCheckable(True)
        layout = QtGui.QVBoxLayout(self.charting_gb)
        layout.addWidget(self.chart_cb)
        layout.addWidget(self.bpe_cb)

        self.course_gb = QtGui.QGroupBox(_("Include Course Details"))
        self.course_gb.setCheckable(True)
        layout = QtGui.QVBoxLayout(self.course_gb)
        layout.addWidget(self.accd_cb)
        layout.addWidget(self.cmpd_cb)
        layout.addWidget(self.tx_cb)

        self.insertWidget(label)
        self.insertWidget(frame)
        self.insertWidget(self.charting_gb)
        self.insertWidget(self.course_gb)

        self.set_dentist()
        self.set_default_values()
        self.enableApply()

        self.choose_form_widget = ChooseFormWidget(self)
        self.set_advanced_but_text(_("select form(s) to print"))
        self.add_advanced_widget(self.choose_form_widget)

        self.course_gb.toggled.connect(self.toggle_cbs)
        self.charting_gb.toggled.connect(self.toggle_cbs)
    def __init__(self, serialno, courseno, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Edit Treatment Dialog"))

        self.serialno = serialno
        self.courseno = courseno

        planning = QtGui.QMessageBox.question(self, _("Option"),
            "%s<hr /><em>%s</em>" %(
                _("Edit Completed items?"),
                _("Choosing 'NO' will offer edit of planned items")
                ),
            QtGui.QMessageBox.Yes|QtGui.QMessageBox.No,
            QtGui.QMessageBox.Yes) == QtGui.QMessageBox.No


        if planning:
            header = _("Planned Items")
            self.suffix = "pl"
        else:
            header = _("Completed Items")
            self.suffix = "cmp"

        self._treatment_course = None
        self.widgets = {}
        self.orig_values = {}

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

        header_label = QtGui.QLabel(header)
        header_label.setAlignment(QtCore.Qt.AlignCenter)

        tooth_atts = []

        for att in treatment_course.CURRTRT_ROOT_ATTS:
            widg = UpperCaseLineEdit()
            self.widgets[att] = widg
            if re.match("[ul][lr][1-8]", att):
                tooth_atts.append(att)
            else:
                form_layout.addRow(att, widg)
        for att in sorted(tooth_atts):
            form_layout.addRow(att.upper(), self.widgets[att])

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

        self.insertWidget(header_label)
        self.insertWidget(scroll_area)

        self.add_advanced_widget(QtGui.QLabel(_("No Advanced Options")))
        QtCore.QTimer.singleShot(100, self.load_values)
Beispiel #28
0
 def _clicked(self, but):
     '''
     overwrite BaseDialog method
     '''
     role = self.button_box.buttonRole(but)
     if role == QtGui.QDialogButtonBox.ApplyRole and QtGui.QMessageBox.question(
             self, _("Confirm"), _("Apply Changes?"),
             QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel,
             QtGui.QMessageBox.Cancel) == QtGui.QMessageBox.Cancel:
         return
     ExtendableDialog._clicked(self, but)
 def _clicked(self, but):
     '''
     overwrite BaseDialog method
     '''
     if but == self.apply_but and QtWidgets.QMessageBox.question(
             self,
             _("Confirm"),
             _("Apply Changes?"),
             QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel,
             QtWidgets.QMessageBox.Cancel) == QtWidgets.QMessageBox.Cancel:
         return
     ExtendableDialog._clicked(self, but)
 def _clicked(self, but):
     '''
     overwrite BaseDialog method
     '''
     role = self.button_box.buttonRole(but)
     if role == QtGui.QDialogButtonBox.ApplyRole and QtGui.QMessageBox.question(
         self, _("Confirm"), _("Apply Changes?"),
         QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel,
         QtGui.QMessageBox.Cancel
     ) == QtGui.QMessageBox.Cancel:
         return
     ExtendableDialog._clicked(self, but)
    def __init__(self, om_gui=None):
        ExtendableDialog.__init__(self, om_gui)

        self.om_gui = om_gui
        message = (_("Alterations to an existing Denture"))
        self.setWindowTitle(message)
        self.header_label = QtGui.QLabel(message)
        self.header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.odu_le = UpperCaseLineEdit()
        self.odl_le = UpperCaseLineEdit()

        self.set_default_lineedit(self.odl_le)

        self.wizard_widget = QtGui.QStackedWidget()

        page0 = PageZero(self)
        page1 = PageOne(self)
        page2 = PageTwo(self)
        page3 = PageThree(self)
        page4 = PageFour(self)
        page5 = PageFive(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(page5)
        self.wizard_widget.addWidget(accept_page)

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

        frame = QtGui.QFrame()
        layout = QtGui.QFormLayout(frame)
        layout.addRow(_("Upper Denture"), self.odu_le)
        layout.addRow(_("Lower Denture"), self.odl_le)

        self.add_advanced_widget(frame)

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

        self.apply_but.hide()

        self.odu_le.textChanged.connect(self.enable_apply)
        self.odl_le.textChanged.connect(self.enable_apply)

        self.odu_le.editingFinished.connect(self.advanced_apply)
        self.odl_le.editingFinished.connect(self.advanced_apply)
    def __init__(self, om_gui=None):
        ExtendableDialog.__init__(self, om_gui)

        self.om_gui = om_gui
        message = (_("Alterations to an existing Denture"))
        self.setWindowTitle(message)
        self.header_label = QtWidgets.QLabel(message)
        self.header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.odu_le = UpperCaseLineEdit()
        self.odl_le = UpperCaseLineEdit()

        self.set_default_lineedit(self.odl_le)

        self.wizard_widget = QtWidgets.QStackedWidget()

        page0 = PageZero(self)
        page1 = PageOne(self)
        page2 = PageTwo(self)
        page3 = PageThree(self)
        page4 = PageFour(self)
        page5 = PageFive(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(page5)
        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.odu_le)
        layout.addRow(_("Lower Denture"), self.odl_le)

        self.add_advanced_widget(frame)

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

        self.apply_but.hide()

        self.odu_le.textChanged.connect(self.enable_apply)
        self.odl_le.textChanged.connect(self.enable_apply)

        self.odu_le.editingFinished.connect(self.advanced_apply)
        self.odl_le.editingFinished.connect(self.advanced_apply)
Beispiel #33
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)
    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)
    def exec_(self):
        if ExtendableDialog.exec_(self):

            self.deleted_plan_items = list(self._deleted_plan_items)
            self.new_cmp_items = list(self._new_cmp_items)
            for item in self.completed_items:
                try:
                    self.deleted_plan_items.remove(item)
                except ValueError:
                    pass
                try:
                    self.new_cmp_items.remove(item)
                except ValueError:
                    pass

            self.deleted_cmp_items = list(self._deleted_cmp_items)
            self.new_plan_items = list(self._new_plan_items)
            for item in self.reversed_items:
                try:
                    self.deleted_cmp_items.remove(item)
                except ValueError:
                    pass
                try:
                    self.new_plan_items.remove(item)
                except ValueError:
                    pass

            return True

        return False
    def exec_(self):
        if ExtendableDialog.exec_(self):

            self.deleted_plan_items = list(self._deleted_plan_items)
            self.new_cmp_items = list(self._new_cmp_items)
            for item in self.completed_items:
                try:
                    self.deleted_plan_items.remove(item)
                except ValueError:
                    pass
                try:
                    self.new_cmp_items.remove(item)
                except ValueError:
                    pass

            self.deleted_cmp_items = list(self._deleted_cmp_items)
            self.new_plan_items = list(self._new_plan_items)
            for item in self.reversed_items:
                try:
                    self.deleted_cmp_items.remove(item)
                except ValueError:
                    pass
                try:
                    self.new_plan_items.remove(item)
                except ValueError:
                    pass

            return True

        return False
    def __init__(self, ix, parent=None):
        ExtendableDialog.__init__(self, parent)

        self.ix = ix
        title = _("Alter Cashbook Entry")
        self.setWindowTitle(title)
        label = QtGui.QLabel(u"<b>%s</b>"% title)
        label.setAlignment(QtCore.Qt.AlignCenter)

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

        self.serialno_le = QtGui.QLineEdit()
        self.patient_le = QtGui.QLineEdit()
        self.date_edit = QtGui.QDateEdit()
        self.dentist_cb = QtGui.QComboBox()
        self.dentist_cb.addItems(localsettings.activedents)

        self.code_cb = QtGui.QComboBox()
        self.amount_sb = QtGui.QDoubleSpinBox()
        self.amount_sb.setRange(0,10000)

        self.codestrings = cashbookCodesDict.values()
        self.code_cb.addItems(self.codestrings)

        form_layout.addRow(_("Patient Number"), self.serialno_le)
        form_layout.addRow(_("Patient Name"), self.patient_le)
        form_layout.addRow(_("Date"), self.date_edit)
        form_layout.addRow(_("Dentist"), self.dentist_cb)
        form_layout.addRow(_("Payment Type"), self.code_cb)
        form_layout.addRow(_("Amount"), self.amount_sb)

        self.serialno_le.setEnabled(False)
        self.patient_le.setEnabled(False)
        self.date_edit.setEnabled(False)
        self.dentist_cb.setEnabled(False)
        self.amount_sb.setEnabled(False)


        self.insertWidget(label)
        self.insertWidget(frame)

        self.load_values()

        adv_button = QtGui.QPushButton(_("Enable Full Edit"))
        self.add_advanced_widget(adv_button)
        adv_button.clicked.connect(self.enable_all)
 def exec_(self):
     if self.worth_executing:
         if ExtendableDialog.exec_(self):
             self.config.user_chosen_option = \
                 self.options_widget.chosen_option
             self.config.write_config()
         return True
     return False
Beispiel #39
0
 def exec_(self):
     if self.worth_executing:
         if ExtendableDialog.exec_(self):
             self.config.user_chosen_option = \
                 self.options_widget.chosen_option
             self.config.write_config()
         return True
     return False
Beispiel #40
0
    def __init__(self, ix, parent=None):
        ExtendableDialog.__init__(self, parent)

        self.ix = ix
        title = _("Alter Cashbook Entry")
        self.setWindowTitle(title)
        label = QtGui.QLabel(u"<b>%s</b>" % title)
        label.setAlignment(QtCore.Qt.AlignCenter)

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

        self.serialno_le = QtGui.QLineEdit()
        self.patient_le = QtGui.QLineEdit()
        self.date_edit = QtGui.QDateEdit()
        self.dentist_cb = QtGui.QComboBox()
        self.dentist_cb.addItems(localsettings.activedents)

        self.code_cb = QtGui.QComboBox()
        self.amount_sb = QtGui.QDoubleSpinBox()
        self.amount_sb.setRange(0, 10000)

        self.codestrings = localsettings.cashbookCodesDict.values()
        self.code_cb.addItems(self.codestrings)

        form_layout.addRow(_("Patient Number"), self.serialno_le)
        form_layout.addRow(_("Patient Name"), self.patient_le)
        form_layout.addRow(_("Date"), self.date_edit)
        form_layout.addRow(_("Dentist"), self.dentist_cb)
        form_layout.addRow(_("Payment Type"), self.code_cb)
        form_layout.addRow(_("Amount"), self.amount_sb)

        self.serialno_le.setEnabled(False)
        self.patient_le.setEnabled(False)
        self.date_edit.setEnabled(False)
        self.dentist_cb.setEnabled(False)
        self.amount_sb.setEnabled(False)

        self.insertWidget(label)
        self.insertWidget(frame)

        self.load_values()

        adv_button = QtGui.QPushButton(_("Enable Full Edit"))
        self.add_advanced_widget(adv_button)
        adv_button.clicked.connect(self.enable_all)
    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()
    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 = QtGui.QFrame(self)
        self.form_layout = QtGui.QFormLayout(frame)

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

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

        self.apply_but.setText(_("Proceed"))
        self.cancel_but.hide()
    def __init__(self, static, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Implant Choice Dialog"))
        self.om_gui = parent
        self.chosen_shortcut = None

        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.but_layout = QtGui.QVBoxLayout(frame)
        self.insertWidget(scroll_area)

        self.apply_but.hide()
        self.more_but.hide()
        if static:
            self.add_buttons(STATIC_LIST)
        else:
            self.add_buttons(localsettings.FEETABLES.ui_implant_chart_buttons)
Beispiel #44
0
    def __init__(self, static, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Implant Choice Dialog"))
        self.om_gui = parent
        self.chosen_shortcut = None

        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.but_layout = QtGui.QVBoxLayout(frame)
        self.insertWidget(scroll_area)

        self.apply_but.hide()
        self.more_but.hide()
        if static:
            self.add_buttons(STATIC_LIST)
        else:
            self.add_buttons(localsettings.FEETABLES.ui_implant_chart_buttons)
    def __init__(self, serialno, courseno, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.serialno = serialno
        self.courseno = courseno

        header_label = QtWidgets.QLabel("<b>%s %s</b>" % (_("Course Daybook Estimate Checker"), self.courseno))
        header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.polling_label = QtWidgets.QLabel(_("Polling Database"))

        self.trt_widget = QtWidgets.QTextBrowser()
        self.day_trt_widget = QtWidgets.QTextBrowser()

        self.insertWidget(header_label)
        self.insertWidget(self.polling_label)

        self.adv_widget = QtWidgets.QLabel(_("No advanced options available"))
        self.add_advanced_widget(self.adv_widget)

        QtCore.QTimer.singleShot(100, self.get_data)
    def __init__(self, candidates, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.table_widget = QtGui.QTableWidget()
        self.table_widget.setAlternatingRowColors(True)
        self.table_widget.setSelectionBehavior(
            QtGui.QAbstractItemView.SelectRows)
        self.insertWidget(self.table_widget)

        self.headers = (_('Serialno'), _('Status'), _('Title'), _('Forename'),
                        _('Surname'), _('Birth Date'), _('Address Line 1'),
                        _('Address Line 2'), _('Town'), _('POSTCODE'),
                        _('Tel1'), _('Tel2'), _('Mobile'))
        self._candidates = candidates
        self.hidden_count = 0
        self.load_candidates()
        self.table_widget.itemDoubleClicked.connect(self.accept)
        self.enableApply(True)
        self.apply_but.setText(_("Load the Selected Patient"))
        self.setMinimumWidth(
            QtGui.QApplication.desktop().screenGeometry().width() - 20)
    def __init__(self, serialno, courseno, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.serialno = serialno
        self.courseno = courseno

        header_label = QtWidgets.QLabel("<b>%s %s</b>" % (
            _("Course Daybook Estimate Checker"), self.courseno))
        header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.polling_label = QtWidgets.QLabel(_("Polling Database"))

        self.trt_widget = QtWidgets.QTextBrowser()
        self.day_trt_widget = QtWidgets.QTextBrowser()

        self.insertWidget(header_label)
        self.insertWidget(self.polling_label)

        self.adv_widget = QtWidgets.QLabel(_("No advanced options available"))
        self.add_advanced_widget(self.adv_widget)

        QtCore.QTimer.singleShot(100, self.get_data)
    def __init__(self, serialno, courseno, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.patient = _Patient(serialno, courseno)

        header_label = QtWidgets.QLabel("<b>%s %s</b>" % (
            _("Inspecting estimate for Course Number"), courseno))
        header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.est_widget = OldEstimateWidget(self)

        self.insertWidget(header_label)
        self.insertWidget(self.est_widget)

        self.adv_widget = QtWidgets.QLabel(_("No advanced options available"))
        self.add_advanced_widget(self.adv_widget)
        # self.remove_spacer()

        self.est_widget.delete_estimate_item.connect(self.delete_item)
        self.est_widget.edited_signal.connect(self._enable_apply)

        QtCore.QTimer.singleShot(100, self.get_data)
Beispiel #49
0
    def __init__(self, appt, parent=None):
        ExtendableDialog.__init__(self, parent)
        # self.set_advanced_but_text(_("What's changed?"))
        self.button_box.removeButton(self.more_but)
        self.apply_but.setText(_("&Yes"))
        self.apply_but.setToolTip(_("Cancel the appointment"))
        self.enableApply()

        self.postpone_but = self.button_box.addButton(
            QtWidgets.QDialogButtonBox.Discard)
        self.postpone_but.setText(_("Yes, but &Keep for re-scheduling"))
        # self.postpone_but.setToolTip(_("Discard All Changes"))

        pt = BriefPatient(appt.serialno)

        if appt.date is None:
            message = "%s<hr />%s<br />%s" % (
                _("Delete unscheduled appointment?"),
                pt.name_id,
                " ".join((appt.trt1, appt.trt2, appt.trt3))
            )
            self.postpone_but.hide()
        else:
            message = "%s<hr />%s - %s <b>%s</b><br />%s<hr />%s %s %s" % (
                _("Delete this appointment?"),
                pt.name_id,
                _("with"),
                appt.dent_inits,
                " ".join((appt.trt1, appt.trt2, appt.trt3)),
                localsettings.readableDate(appt.date),
                _("at"),
                "%d:%02d" % (appt.atime // 100, appt.atime % 100)
            )
        label = WarningLabel(message)
        self.insertWidget(label)

        self.cancel_but.setText(_("&No"))
        self.cancel_but.setToolTip(_("Close this dialog, making no changes"))
        self.appt = appt
        LOGGER.debug("appt type = %s", type(appt))
    def __init__(self, static, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Chart Treatment Choice Dialog"))
        self.om_gui = parent
        self.chosen_shortcut = None

        scroll_area = QtWidgets.QScrollArea()
        frame = QtWidgets.QFrame()
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.but_layout = QtWidgets.QVBoxLayout(frame)
        self.insertWidget(scroll_area)

        self.apply_but.hide()
        self.all_tx_buttons = []
        if static:
            self.more_but.hide()
        else:
            all_tx_but = QtWidgets.QPushButton(
                _("Show Treatments from all feescales"))
            all_tx_but.clicked.connect(self._show_all_txs)
            self.add_advanced_widget(all_tx_but)
    def __init__(self, static, parent=None):
        ExtendableDialog.__init__(self, parent, remove_stretch=True)
        self.setWindowTitle(_("Chart Treatment Choice Dialog"))
        self.om_gui = parent
        self.chosen_shortcut = None

        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        scroll_area.setWidget(frame)
        scroll_area.setWidgetResizable(True)
        self.but_layout = QtGui.QVBoxLayout(frame)
        self.insertWidget(scroll_area)

        self.apply_but.hide()
        self.all_tx_buttons = []
        if static:
            self.more_but.hide()
        else:
            all_tx_but = QtGui.QPushButton(
                _("Show Treatments from all feescales"))
            all_tx_but.clicked.connect(self._show_all_txs)
            self.add_advanced_widget(all_tx_but)
    def __init__(self, parent):
        ExtendableDialog.__init__(self, parent)
        self.setWindowTitle(_("Medical Form Checked Dialog"))

        self.pt = parent.pt
        self.patient_label = QtGui.QLabel(self.pt.name)
        self.patient_label.setAlignment(QtCore.Qt.AlignCenter)
        f = self.patient_label.font()
        f.setBold(True)
        self.patient_label.setFont(f)

        self.date_checked_label = WarningLabel(
            _('You are about to confirm that the patient has completed '
              'a medical history form.'))
        self.date_checked_label.setMaximumHeight(120)

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

        frame = QtGui.QFrame(self)
        layout = QtGui.QFormLayout(frame)
        layout.addRow(_("Date Checked"), self.date_edit)

        question_label = QtGui.QLabel(
            "<b>%s</b>" %
            _("Confirm this date now?"))
        question_label.setAlignment(QtCore.Qt.AlignCenter)

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

        self.correction_widget = CorrectionWidget(self.pt, self)
        self.add_advanced_widget(self.correction_widget)

        self.enableApply()
Beispiel #53
0
    def __init__(self, serialno, courseno, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.patient = _Patient(serialno, courseno)

        header_label = QtGui.QLabel(
            "<b>%s %s</b>" %
            (_("Inspecting estimate for Course Number"), courseno))
        header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.est_widget = OldEstimateWidget(self)

        self.insertWidget(header_label)
        self.insertWidget(self.est_widget)

        self.adv_widget = QtGui.QLabel(_("No advanced options available"))
        self.add_advanced_widget(self.adv_widget)
        # self.remove_spacer()

        self.est_widget.delete_estimate_item.connect(self.delete_item)
        self.est_widget.edited_signal.connect(self._enable_apply)

        QtCore.QTimer.singleShot(100, self.get_data)
Beispiel #54
0
    def __init__(self, daybook_id, feesa=None, feesb=None, parent=None):
        ExtendableDialog.__init__(self, parent)
        self.daybook_id = daybook_id
        self.feesa = feesa
        self.feesb = feesb

        header_label = QtGui.QLabel(
            "<b>%s %s</b>" % (_("Inspecting daybook row"), self.daybook_id))
        header_label.setAlignment(QtCore.Qt.AlignCenter)

        self.feesa_label = QtGui.QLabel()
        self.feesa_label.setStyleSheet("color:red;")
        self.feesb_label = QtGui.QLabel()
        self.feesb_label.setStyleSheet("color:red;")

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

        self.insertWidget(header_label)
        self.web_view = QtGui.QTextBrowser()
        self.insertWidget(self.web_view)
        self.insertWidget(self.feesa_label)
        self.insertWidget(self.feesb_label)

        self.adv_widget = DaybookItemAdvancedWidget()
        self.add_advanced_widget(self.adv_widget)
        self.remove_spacer()

        self.total_fee = 0
        self.total_ptfee = 0

        self.adv_widget.update_totals_signal.connect(self.update_totals)
        self.adv_widget.update_fee_signal.connect(self.update_fee)
        self.adv_widget.update_ptfee_signal.connect(self.update_ptfee)
        self.adv_widget.delete_row_signal.connect(self.delete_row)

        QtCore.QTimer.singleShot(100, self.get_data)
Beispiel #55
0
    def __init__(self, parent):
        ExtendableDialog.__init__(self, parent)
        self.setWindowTitle(_("Medical Form Checked Dialog"))

        self.pt = parent.pt
        self.patient_label = QtGui.QLabel(self.pt.name)
        self.patient_label.setAlignment(QtCore.Qt.AlignCenter)
        f = self.patient_label.font()
        f.setBold(True)
        self.patient_label.setFont(f)

        self.date_checked_label = WarningLabel(
            _('You are about to confirm that the patient has completed '
              'a medical history form.'))
        self.date_checked_label.setMaximumHeight(120)

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

        frame = QtGui.QFrame(self)
        layout = QtGui.QFormLayout(frame)
        layout.addRow(_("Date Checked"), self.date_edit)

        question_label = QtGui.QLabel("<b>%s</b>" %
                                      _("Confirm this date now?"))
        question_label.setAlignment(QtCore.Qt.AlignCenter)

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

        self.correction_widget = CorrectionWidget(self.pt, self)
        self.add_advanced_widget(self.correction_widget)

        self.enableApply()