Ejemplo n.º 1
0
def show_font_face_rule_for_font_file(file_data, added_name, parent=None):
    rule = rule_for_font(BytesIO(file_data), added_name)
    QApplication.clipboard().setText(rule)
    QMessageBox.information(
        parent, _('Font file added'),
        _('The font file <b>{}</b> has been added. The text for the CSS @font-face rule for this file has been copied'
          ' to the clipboard. You should paste it into whichever CSS file you want to add this font to.'
          ).format(added_name))
Ejemplo n.º 2
0
def step_dialog(parent, title, msg, det_msg=''):
    d = QMessageBox(parent)
    d.setWindowTitle(title)
    d.setText(msg)
    d.setStandardButtons(QMessageBox.StandardButton.Ok
                         | QMessageBox.StandardButton.Cancel)
    return d.exec() & QMessageBox.StandardButton.Cancel
Ejemplo n.º 3
0
def show_font_face_rule_for_font_files(container, added_names, parent=None):
    rules = []
    for name in sorted(added_names):
        rule = rule_for_font(container.open(name), name)
        if rule:
            rules.append(rule)
    if rules:
        QApplication.clipboard().setText('\n\n'.join(rules))
        QMessageBox.information(parent, _('Font files added'), _(
        'The specified font files have been added. The text for the CSS @font-face rules for these files has been copied'
        ' to the clipboard. You should paste it into whichever CSS file you want to add these fonts to.'))
Ejemplo n.º 4
0
 def show_dialog(self):
     QMessageBox.information(self, 'A test dialog', 'While this dialog is shown, the global menu should be hidden')