Exemplo n.º 1
0
 def populate(self):
     self.clear()
     doc = self.parentWidget().currentDocument()
     if doc:
         import resultfiles
         files = resultfiles.results(doc).files()
         first = True
         for group in util.group_files(files,
                 ('pdf', 'mid midi', 'svg svgz', 'png', '!ly ily lyi')):
             if group:
                 if not first:
                     self.addSeparator()
                 first = False
                 for f in group:
                     name = os.path.split(f)[1]
                     a = self.addAction(name)
                     a.setIcon(icons.file_type(f))
                     a.filename = f
         if not self.actions():
             a = self.addAction(_("No files available"))
             a.setEnabled(False)
         else:
             util.addAccelerators(self.actions())
Exemplo n.º 2
0
 def populate(self):
     self.clear()
     doc = self.parentWidget().currentDocument()
     if doc:
         import resultfiles
         files = resultfiles.results(doc).files()
         first = True
         for group in util.group_files(
                 files,
             ('pdf', 'mid midi', 'svg svgz', 'png', '!ly ily lyi')):
             if group:
                 if not first:
                     self.addSeparator()
                 first = False
                 for f in group:
                     name = os.path.split(f)[1]
                     a = self.addAction(name)
                     a.setIcon(icons.file_type(f))
                     a.filename = f
         if not self.actions():
             a = self.addAction(_("No files available"))
             a.setEnabled(False)
         else:
             qutil.addAccelerators(self.actions())
Exemplo n.º 3
0
    def __init__(self, mainwindow):
        super(Dialog, self).__init__(mainwindow)
        self._document = None

        layout = QGridLayout()
        self.setLayout(layout)

        self.versionLabel = QLabel()
        self.lilyChooser = lilychooser.LilyChooser()

        self.outputLabel = QLabel()
        self.outputCombo = QComboBox()

        self.resolutionLabel = QLabel()
        self.resolutionCombo = QComboBox(editable=True)

        self.antialiasLabel = QLabel()
        self.antialiasSpin = QSpinBox(minimum=1, maximum=128, value=1)

        self.modeLabel = QLabel()
        self.modeCombo = QComboBox()

        self.deleteCheck = QCheckBox()
        self.embedSourceCodeCheck = QCheckBox()
        self.englishCheck = QCheckBox()

        self.commandLineLabel = QLabel()
        self.commandLine = QTextEdit(acceptRichText=False)

        self.buttons = QDialogButtonBox(QDialogButtonBox.Ok
                                        | QDialogButtonBox.Cancel)
        self.buttons.button(QDialogButtonBox.Ok).setIcon(
            icons.get("lilypond-run"))
        userguide.addButton(self.buttons, "engrave_custom")

        self.resolutionCombo.addItems(['100', '200', '300', '600', '1200'])
        self.resolutionCombo.setCurrentIndex(2)

        self.modeCombo.addItems(['preview', 'publish', 'debug'])
        layout.addWidget(self.versionLabel, 0, 0)
        layout.addWidget(self.lilyChooser, 0, 1, 1, 3)
        layout.addWidget(self.outputLabel, 1, 0)
        layout.addWidget(self.outputCombo, 1, 1, 1, 3)
        layout.addWidget(self.resolutionLabel, 2, 0)
        layout.addWidget(self.resolutionCombo, 2, 1)
        layout.addWidget(self.antialiasLabel, 2, 2, Qt.AlignRight)
        layout.addWidget(self.antialiasSpin, 2, 3)
        layout.addWidget(self.modeLabel, 3, 0)
        layout.addWidget(self.modeCombo, 3, 1, 1, 3)
        layout.addWidget(self.deleteCheck, 4, 0, 1, 4)
        layout.addWidget(self.embedSourceCodeCheck, 5, 0, 1, 4)
        layout.addWidget(self.englishCheck, 6, 0, 1, 4)
        layout.addWidget(self.commandLineLabel, 7, 0, 1, 4)
        layout.addWidget(self.commandLine, 8, 0, 1, 4)
        layout.addWidget(widgets.Separator(), 9, 0, 1, 4)
        layout.addWidget(self.buttons, 10, 0, 1, 4)

        app.translateUI(self)
        qutil.saveDialogSize(self, "engrave/custom/dialog/size",
                             QSize(480, 260))
        self.buttons.accepted.connect(self.accept)
        self.buttons.rejected.connect(self.reject)

        model = listmodel.ListModel(formats,
                                    display=lambda f: f.title(),
                                    icon=lambda f: icons.file_type(f.type))
        self.outputCombo.setModel(model)

        s = QSettings()
        s.beginGroup("lilypond_settings")
        self.englishCheck.setChecked(s.value("no_translation", False, bool))
        self.deleteCheck.setChecked(
            s.value("delete_intermediate_files", True, bool))

        if s.value("default_output_target", "pdf", str) == "svg":
            self.outputCombo.setCurrentIndex(3)

        app.jobFinished.connect(self.slotJobFinished)
        self.outputCombo.currentIndexChanged.connect(self.makeCommandLine)
        self.modeCombo.currentIndexChanged.connect(self.makeCommandLine)
        self.deleteCheck.toggled.connect(self.makeCommandLine)
        self.embedSourceCodeCheck.toggled.connect(self.makeCommandLine)
        self.resolutionCombo.editTextChanged.connect(self.makeCommandLine)
        self.antialiasSpin.valueChanged.connect(self.makeCommandLine)
        self.makeCommandLine()
        panelmanager.manager(
            mainwindow).layoutcontrol.widget().optionsChanged.connect(
                self.makeCommandLine)
Exemplo n.º 4
0
 def __init__(self, mainwindow):
     super(Dialog, self).__init__(mainwindow)
     self._document = None
     
     layout = QGridLayout()
     self.setLayout(layout)
     
     self.versionLabel = QLabel()
     self.lilyChooser = lilychooser.LilyChooser()
     
     self.outputLabel = QLabel()
     self.outputCombo = QComboBox()
     
     self.resolutionLabel = QLabel()
     self.resolutionCombo = QComboBox(editable=True)
     
     self.antialiasLabel = QLabel()
     self.antialiasSpin = QSpinBox(minimum=1, maximum=128, value=1)
     
     self.modeLabel = QLabel()
     self.modeCombo = QComboBox()
     
     self.englishCheck = QCheckBox()
     self.deleteCheck = QCheckBox()
     
     self.commandLineLabel = QLabel()
     self.commandLine = QTextEdit(acceptRichText=False)
     
     self.buttons = QDialogButtonBox(
         QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
     self.buttons.button(QDialogButtonBox.Ok).setIcon(icons.get("lilypond-run"))
     userguide.addButton(self.buttons, "engrave_custom")
     
     self.resolutionCombo.addItems(['100', '200', '300', '600', '1200'])
     self.resolutionCombo.setCurrentIndex(2)
     
     self.modeCombo.addItems(['preview', 'publish', 'debug'])
     layout.addWidget(self.versionLabel, 0, 0)
     layout.addWidget(self.lilyChooser, 0, 1, 1, 3)
     layout.addWidget(self.outputLabel, 1, 0)
     layout.addWidget(self.outputCombo, 1, 1, 1, 3)
     layout.addWidget(self.resolutionLabel, 2, 0)
     layout.addWidget(self.resolutionCombo, 2, 1)
     layout.addWidget(self.antialiasLabel, 2, 2, Qt.AlignRight)
     layout.addWidget(self.antialiasSpin, 2, 3)
     layout.addWidget(self.modeLabel, 3, 0)
     layout.addWidget(self.modeCombo, 3, 1, 1, 3)
     layout.addWidget(self.englishCheck, 4, 0, 1, 4)
     layout.addWidget(self.deleteCheck, 5, 0, 1, 4)
     layout.addWidget(self.commandLineLabel, 6, 0, 1, 4)
     layout.addWidget(self.commandLine, 7, 0, 1, 4)
     layout.addWidget(widgets.Separator(), 8, 0, 1, 4)
     layout.addWidget(self.buttons, 9, 0, 1, 4)
     
     app.translateUI(self)
     qutil.saveDialogSize(self, "engrave/custom/dialog/size", QSize(480, 260))
     self.buttons.accepted.connect(self.accept)
     self.buttons.rejected.connect(self.reject)
     
     model = listmodel.ListModel(formats, display=lambda f: f.title(),
         icon=lambda f: icons.file_type(f.type))
     self.outputCombo.setModel(model)
     
     s = QSettings()
     s.beginGroup("lilypond_settings")
     self.englishCheck.setChecked(
         s.value("no_translation", False, bool))
     self.deleteCheck.setChecked(
         s.value("delete_intermediate_files", True, bool))
     
     if s.value("default_output_target", "pdf", type("")) == "svg":
         self.outputCombo.setCurrentIndex(3)
     
     app.jobFinished.connect(self.slotJobFinished)
     self.outputCombo.currentIndexChanged.connect(self.makeCommandLine)
     self.modeCombo.currentIndexChanged.connect(self.makeCommandLine)
     self.deleteCheck.toggled.connect(self.makeCommandLine)
     self.resolutionCombo.editTextChanged.connect(self.makeCommandLine)
     self.antialiasSpin.valueChanged.connect(self.makeCommandLine)
     self.makeCommandLine()
     panelmanager.manager(mainwindow).layoutcontrol.widget().optionsChanged.connect(self.makeCommandLine)
Exemplo n.º 5
0
 def __init__(self, parent=None):
     super(Dialog, self).__init__(parent)
     self._document = None
     
     layout = QGridLayout()
     self.setLayout(layout)
     
     self.versionLabel = QLabel()
     self.versionCombo = QComboBox()
     
     self.outputLabel = QLabel()
     self.outputCombo = QComboBox()
     
     self.resolutionLabel = QLabel()
     self.resolutionCombo = QComboBox(editable=True)
     
     self.previewCheck = QCheckBox()
     self.verboseCheck = QCheckBox()
     self.englishCheck = QCheckBox()
     self.deleteCheck = QCheckBox()
     
     self.commandLineLabel = QLabel()
     self.commandLine = QTextEdit(acceptRichText=False)
     
     self.buttons = QDialogButtonBox(
         QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
     self.buttons.button(QDialogButtonBox.Ok).setIcon(icons.get("lilypond-run"))
     help.addButton(self.buttons, help_engrave_custom)
     
     self.resolutionCombo.addItems(['100', '200', '300', '600', '1200'])
     self.resolutionCombo.setCurrentIndex(2)
     
     layout.addWidget(self.versionLabel, 0, 0)
     layout.addWidget(self.versionCombo, 0, 1)
     layout.addWidget(self.outputLabel, 1, 0)
     layout.addWidget(self.outputCombo, 1, 1)
     layout.addWidget(self.resolutionLabel, 2, 0)
     layout.addWidget(self.resolutionCombo, 2, 1)
     layout.addWidget(self.previewCheck, 3, 0, 1, 2)
     layout.addWidget(self.verboseCheck, 4, 0, 1, 2)
     layout.addWidget(self.englishCheck, 5, 0, 1, 2)
     layout.addWidget(self.deleteCheck, 6, 0, 1, 2)
     layout.addWidget(self.commandLineLabel, 7, 0, 1, 2)
     layout.addWidget(self.commandLine, 8, 0, 1, 2)
     layout.addWidget(widgets.Separator(), 9, 0, 1, 2)
     layout.addWidget(self.buttons, 10, 0, 1, 2)
     
     app.translateUI(self)
     util.saveDialogSize(self, "engrave/custom/dialog/size", QSize(480, 260))
     self.buttons.accepted.connect(self.accept)
     self.buttons.rejected.connect(self.reject)
     
     model = listmodel.ListModel(formats, display=lambda f: f.title(),
         icon=lambda f: icons.file_type(f.type))
     self.outputCombo.setModel(model)
     
     s = QSettings()
     s.beginGroup("lilypond_settings")
     self.englishCheck.setChecked(
         s.value("no_translation", False) in (True, "true"))
     self.deleteCheck.setChecked(
         s.value("delete_intermediate_files", True) not in (False, "false"))
     
     self.loadLilyPondVersions()
     self.selectLilyPondInfo(lilypondinfo.preferred())
     app.settingsChanged.connect(self.loadLilyPondVersions)
     app.jobFinished.connect(self.slotJobFinished)
     self.outputCombo.currentIndexChanged.connect(self.makeCommandLine)
     self.previewCheck.toggled.connect(self.makeCommandLine)
     self.verboseCheck.toggled.connect(self.makeCommandLine)
     self.deleteCheck.toggled.connect(self.makeCommandLine)
     self.resolutionCombo.editTextChanged.connect(self.makeCommandLine)
     self.makeCommandLine()