def calibration_dialog(self, window):
    d = WindowModalDialog(window, _('Revealer - Printer calibration settings'))
    d.setMinimumSize(100, 200)
    vbox = QVBoxLayout(d)
    vbox.addWidget(QLabel(''.join(['<br/>', _('If you have an old printer, or want optimal precision'), '<br/>', _('print the calibration pdf and follow the instructions '), '<br/>', '<br/>'])))
    self.calibration_h = self.config.get('calibration_h')
    self.calibration_v = self.config.get('calibration_v')
    cprint = QPushButton(_('Open calibration pdf'))
    cprint.clicked.connect(self.calibration)
    vbox.addWidget(cprint)
    vbox.addWidget(QLabel(_('Calibration values:')))
    grid = QGridLayout()
    vbox.addLayout(grid)
    grid.addWidget(QLabel(_('Right side')), 0, 0)
    horizontal = QLineEdit()
    horizontal.setText(str(self.calibration_h))
    grid.addWidget(horizontal, 0, 1)
    grid.addWidget(QLabel(_('Bottom')), 1, 0)
    vertical = QLineEdit()
    vertical.setText(str(self.calibration_v))
    grid.addWidget(vertical, 1, 1)
    vbox.addStretch()
    vbox.addSpacing(13)
    vbox.addLayout(Buttons(CloseButton(d), OkButton(d)))
    if (not d.exec_()):
        return
    self.calibration_h = int(Decimal(horizontal.text()))
    self.config.set_key('calibration_h', self.calibration_h)
    self.calibration_v = int(Decimal(vertical.text()))
    self.config.set_key('calibration_v', self.calibration_v)
def calibration_dialog(self, window):
    d = WindowModalDialog(window, _('Revealer - Printer calibration settings'))
    d.setMinimumSize(100, 200)
    vbox = QVBoxLayout(d)
    vbox.addWidget(QLabel(.join(['<br/>', _('If you have an old printer, or want optimal precision'), '<br/>', _('print the calibration pdf and follow the instructions '), '<br/>', '<br/>'])))
    self.calibration_h = self.config.get('calibration_h')
    self.calibration_v = self.config.get('calibration_v')
    cprint = QPushButton(_('Open calibration pdf'))
    cprint.clicked.connect(self.calibration)
    vbox.addWidget(cprint)
    vbox.addWidget(QLabel(_('Calibration values:')))
    grid = QGridLayout()
    vbox.addLayout(grid)
    grid.addWidget(QLabel(_('Right side')), 0, 0)
    horizontal = QLineEdit()
    horizontal.setText(str(self.calibration_h))
    grid.addWidget(horizontal, 0, 1)
    grid.addWidget(QLabel(_('Bottom')), 1, 0)
    vertical = QLineEdit()
    vertical.setText(str(self.calibration_v))
    grid.addWidget(vertical, 1, 1)
    vbox.addStretch()
    vbox.addSpacing(13)
    vbox.addLayout(Buttons(CloseButton(d), OkButton(d)))
    if (not d.exec_()):
        return
    self.calibration_h = int(Decimal(horizontal.text()))
    self.config.set_key('calibration_h', self.calibration_h)
    self.calibration_v = int(Decimal(vertical.text()))
    self.config.set_key('calibration_v', self.calibration_v)