def exec_(self):
     """
     raise the dialog
     """
     if not BaseDialog.exec_(self):
         return False
     if self.check_date > localsettings.currentDay():
         QtWidgets.QMessageBox.warning(self, _("Error!"), _("That date is in the future!"))
         return self.exec_()
     if (
         QtWidgets.QMessageBox.question(
             self,
             _("Confirm Action"),
             "%s<hr />%s <b>%s</b><br />%s"
             % (
                 self.pt.name_id,
                 _("Date Checked"),
                 localsettings.readableDate(self.check_date),
                 _("Confirm this date now?"),
             ),
             QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
             QtWidgets.QMessageBox.Yes,
         )
         == QtWidgets.QMessageBox.Yes
     ):
         return True
     else:
         return self.exec_()
     return False
Esempio n. 2
0
 def exec_(self):
     ops = localsettings.operator.split("/")
     if len(ops) == 1 and ops[0] in localsettings.allowed_logins:
         self._user = ops[0]
         if not self.check:
             return True
     return BaseDialog.exec_(self)
Esempio n. 3
0
 def exec_(self):
     ops = localsettings.operator.split("/")
     if len(ops) == 1 and ops[0] in localsettings.allowed_logins:
         self._user = ops[0]
         if not self.check:
             return True
     return BaseDialog.exec_(self)
 def exec_(self):
     if BaseDialog.exec_(self):
         standard_letter.insert_letters(self.updated_letters())
         standard_letter.insert_letters(self.new_letters())
         standard_letter.delete_letters(self.deleted_letters)
         return True
     return False
 def exec_(self):
     if BaseDialog.exec_(self):
         standard_letter.insert_letters(self.updated_letters())
         standard_letter.insert_letters(self.new_letters())
         standard_letter.delete_letters(self.deleted_letters)
         return True
     return False
Esempio n. 6
0
 def exec_(self):
     if BaseDialog.exec_(self):
         referral.update_centres(self.updated_centres())
         referral.insert_centres(self.new_centres())
         referral.delete_centres(self.deleted_centres)
         return True
     return False
 def exec_(self):
     if BaseDialog.exec_(self):
         referral.update_centres(self.updated_centres())
         referral.insert_centres(self.new_centres())
         referral.delete_centres(self.deleted_centres)
         return True
     return False
 def exec_(self):
     if BaseDialog.exec_(self):
         self.update_excluded_days()
         self.update_selection_policies()
         ApptSettingsDialog.ignore_emergency_spaces = \
             self.ignore_emergency_checkbox.isChecked()
         return True
     return False
 def exec_(self):
     if connect.params.has_connection:
         LOGGER.debug("connection established, no need for DCPDialog")
         self.accept()
         return True
     else:
         QtCore.QTimer.singleShot(100, connect.connect)
         return BaseDialog.exec_(self)
 def exec_(self):
     if connect.params.has_connection:
         LOGGER.debug("connection established, no need for DCPDialog")
         self.accept()
         return True
     else:
         QtCore.QTimer.singleShot(100, connect.connect)
         return BaseDialog.exec_(self)
Esempio n. 11
0
 def exec_(self):
     if BaseDialog.exec_(self):
         self.update_excluded_days()
         self.update_selection_policies()
         ApptSettingsDialog.ignore_emergency_spaces = \
             self.ignore_emergency_checkbox.isChecked()
         return True
     return False
    def exec_(self):
        if BaseDialog.exec_(self):
            printer = QtPrintSupport.QPrinter()
            printer.setPaperSize(printer.A4)
            dialog = QtPrintSupport.QPrintDialog(printer, self.parent())
            if not dialog.exec_():
                return False

            self.web_view.print_(printer)
Esempio n. 13
0
    def exec_(self):
        if BaseDialog.exec_(self):
            printer = QtPrintSupport.QPrinter()
            printer.setPaperSize(printer.A4)
            dialog = QtPrintSupport.QPrintDialog(printer, self.parent())
            if not dialog.exec_():
                return False

            self.web_view.print_(printer)
 def exec_(self):
     while BaseDialog.exec_(self):
         result, warnings = self.is_valid_input
         if result:
             self.accept()
             return True
         else:
             QtGui.QMessageBox.warning(self, _("Bad Input"), "<ul><li>%s</li></ul>" % "</li><li>".join(warnings))
     self.reject()
Esempio n. 15
0
    def show_all_prev_receipts(self):
        dl = BaseDialog(self)
        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        layout = QtGui.QVBoxLayout(frame)

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

            layout.addWidget(but)

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

        dl.insertWidget(scroll_area)
        dl.exec_()
    def show_all_prev_receipts(self):
        dl = BaseDialog(self)
        scroll_area = QtGui.QScrollArea()
        frame = QtGui.QFrame()
        layout = QtGui.QVBoxLayout(frame)

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

            layout.addWidget(but)

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

        dl.insertWidget(scroll_area)
        dl.exec_()
Esempio n. 17
0
    def exec_(self):
        result = BaseDialog.exec_(self)
        if result:
            db = connect()
            cursor = db.cursor()
            cursor.execute(DELETE_ALL_QUERY)
            cursor.close()
            db.commit()

        return result
    def exec_(self):
        result = BaseDialog.exec_(self)
        if result:
            db = connect()
            cursor = db.cursor()
            cursor.execute(DELETE_ALL_QUERY)
            cursor.close()
            db.commit()

        return result
Esempio n. 19
0
    def exec_(self):
        QtCore.QTimer.singleShot(100, self.check_pcde)
        QtCore.QTimer.singleShot(500, self.postcode_warning)

        if BaseDialog.exec_(self):
            if self.valid_postcode:
                self.main_ui.pt.pcde = self.pcde
            self.main_ui.addNewNote(
                "CHILDSMILE (postcode '%s'): %s" % (self.pcde, self.result))
            return True
        return False
Esempio n. 20
0
 def exec_(self):
     if not BaseDialog.exec_(self):
         return False
     if self.correct_password:
         localsettings.permissionsRaised = True
         resetExpireTime()
         return True
     else:
         QtGui.QMessageBox.information(self, _("whoops"),
                                       _("incorrect supervisor password"))
     return False
Esempio n. 21
0
 def exec_(self):
     while BaseDialog.exec_(self):
         result, warnings = self.is_valid_input
         if result:
             self.accept()
             return True
         else:
             QtWidgets.QMessageBox.warning(
                 self, _("Bad Input"),
                 "<ul><li>%s</li></ul>" % "</li><li>".join(warnings))
     self.reject()
Esempio n. 22
0
    def exec_(self):
        QtCore.QTimer.singleShot(100, self.check_pcde)
        QtCore.QTimer.singleShot(500, self.postcode_warning)

        if BaseDialog.exec_(self):
            if self.valid_postcode:
                self.main_ui.pt.pcde = self.pcde
            self.main_ui.addNewNote(
                "CHILDSMILE (postcode '%s'): %s" % (self.pcde, self.result))
            return True
        return False
Esempio n. 23
0
 def exec_(self):
     if not BaseDialog.exec_(self):
         return False
     if self.correct_password:
         localsettings.permissionsRaised = True
         resetExpireTime()
         return True
     else:
         QtWidgets.QMessageBox.information(
             self, _("whoops"),
             _("incorrect supervisor password"))
     return False
 def exec_(self):
     '''
     raise the dialog
     '''
     if not BaseDialog.exec_(self):
         return False
     if self.check_date > localsettings.currentDay():
         QtWidgets.QMessageBox.warning(self, _("Error!"),
                                       _("That date is in the future!"))
         return self.exec_()
     if QtWidgets.QMessageBox.question(
             self, _("Confirm Action"), "%s<hr />%s <b>%s</b><br />%s" %
         (self.pt.name_id, _("Date Checked"),
          localsettings.readableDate(
              self.check_date), _("Confirm this date now?")),
             QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
             QtWidgets.QMessageBox.Yes) == QtWidgets.QMessageBox.Yes:
         return True
     else:
         return self.exec_()
     return False
Esempio n. 25
0
    def show_pt_diary(self):
        if self.pt is None:
            QtWidgets.QMessageBox.information(self, _("error"),
                                          _("No patient selected"))
            return

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

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

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

        pt_diary_widget.set_patient(self.pt)

        dl = BaseDialog(self, remove_stretch=True)
        dl.insertWidget(pt_diary_widget)
        dl.cancel_but.setText(_("OK"))
        dl.apply_but.hide()
        dl.setMinimumWidth(800)
        dl.setMaximumWidth(800)
        if not dl.exec_():  # dialog is only accepted by subroutines above
            self.appointment_model.load_from_database(self.pt)
            self.enable_scheduling_buttons()
Esempio n. 26
0
    def show_pt_diary(self):
        if self.pt is None:
            QtWidgets.QMessageBox.information(self, _("error"),
                                              _("No patient selected"))
            return

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

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

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

        pt_diary_widget.set_patient(self.pt)

        dl = BaseDialog(self, remove_stretch=True)
        dl.insertWidget(pt_diary_widget)
        dl.cancel_but.setText(_("OK"))
        dl.apply_but.hide()
        dl.setMinimumWidth(800)
        dl.setMaximumWidth(800)
        if not dl.exec_():  # dialog is only accepted by subroutines above
            self.appointment_model.load_from_database(self.pt)
            self.enable_scheduling_buttons()
Esempio n. 27
0
 def exec_(self):
     if BaseDialog.exec_(self):
         self.ix = feescale_handler.next_insert_id
         shutil.copy(EXAMPLE_XML_PATH, self.filepath)
         return True
     return False
Esempio n. 28
0
 def exec_(self):
     if localsettings.LAST_ADDRESS == localsettings.BLANK_ADDRESS:
         self.om_gui.advise(_("No previous address details found"), 1)
     elif BaseDialog.exec_(self):
         return True
     return False
Esempio n. 29
0
 def exec_(self):
     if BaseDialog.exec_(self):
         return self.apply()
     return False
Esempio n. 30
0
 def exec_(self):
     if localsettings.LAST_ADDRESS == ("",) * 8:
         self.om_gui.advise(_("No previous address details found"), 1)
     elif BaseDialog.exec_(self):
         return True
     return False
Esempio n. 31
0
 def exec_(self):
     if BaseDialog.exec_(self):
         self.apply_changed()
         return True
 def exec_(self):
     if self.files_are_identical():
         return False
     return BaseDialog.exec_(self)
Esempio n. 33
0
 def exec_(self):
     if BaseDialog.exec_(self):
         self.apply_changed()
         return True
Esempio n. 34
0
 def exec_(self):
     if BaseDialog.exec_(self):
         self.apply()
         return True
     return False
Esempio n. 35
0
 def exec_(self):
     if BaseDialog.exec_(self):
         return self.apply()
     return False
 def exec_(self):
     if BaseDialog.exec_(self):
         self.apply()
         return True
     return False
Esempio n. 37
0
 def exec_(self):
     if BaseDialog.exec_(self):
         self.ix = feescale_handler.next_insert_id
         shutil.copy(EXAMPLE_XML_PATH, self.filepath)
         return True
     return False