コード例 #1
0
ファイル: custom.py プロジェクト: marnen/frescobaldi
 def loadLilyPondVersions(self):
     infos = lilypondinfo.infos() or [lilypondinfo.default()]
     infos.sort(key = lambda i: i.version() or (999,))
     self._infos = infos
     index = self.versionCombo.currentIndex()
     self.versionCombo.clear()
     for i in infos:
         icon = 'lilypond-run' if i.version() else 'dialog-error'
         self.versionCombo.addItem(icons.get(icon), i.prettyName())
     self.versionCombo.setCurrentIndex(index)
コード例 #2
0
ファイル: custom.py プロジェクト: mbsrz1972/frescobaldi
 def loadLilyPondVersions(self):
     infos = lilypondinfo.infos() or [lilypondinfo.default()]
     infos.sort(key = lambda i: i.version() or (999,))
     self._infos = infos
     index = self.versionCombo.currentIndex()
     self.versionCombo.clear()
     for i in infos:
         icon = 'lilypond-run' if i.version() else 'dialog-error'
         text = _("LilyPond {version}").format(version=i.versionString())
         self.versionCombo.addItem(icons.get(icon), text)
     self.versionCombo.setCurrentIndex(index)
コード例 #3
0
ファイル: lilypond.py プロジェクト: stweil/frescobaldi
 def loadSettings(self):
     s = settings()
     default = lilypondinfo.default()
     self._defaultCommand = s.value("default", default.command, str)
     self.auto.setChecked(s.value("autoversion", False, bool))
     infos = sorted(lilypondinfo.infos(), key=lambda i: i.version())
     if not infos:
         infos = [default]
     items = [InfoItem(info) for info in infos]
     self.instances.setItems(items)
     for item in items:
         if item._info.command == self._defaultCommand:
             self.instances.setCurrentItem(item)
             break
コード例 #4
0
 def loadSettings(self):
     s = settings()
     default = lilypondinfo.default()
     self._defaultCommand = s.value("default", default.command, type(""))
     self.auto.setChecked(s.value("autoversion", False, bool))
     infos = sorted(lilypondinfo.infos(), key=lambda i: i.version())
     if not infos:
         infos = [default]
     items = [InfoItem(info) for info in infos]
     self.instances.setItems(items)
     for item in items:
         if item._info.command == self._defaultCommand:
             self.instances.setCurrentItem(item)
             break
コード例 #5
0
 def load(self):
     """Load the available LilyPond infos."""
     infos = lilypondinfo.infos() or [lilypondinfo.default()]
     infos.sort(key = lambda i: i.version() or (999,))
     cur = self._infos[self.currentIndex()] if self._infos else lilypondinfo.preferred()
     self._infos = infos
     block = self.blockSignals(True)
     try:
         self.clear()
         index = 0
         for i, info in enumerate(infos):
             icon = 'lilypond-run' if info.version() else 'dialog-error'
             self.addItem(icons.get(icon), info.prettyName())
             if info.abscommand() == cur.abscommand() or info.command == cur.command:
                 index = i
         self.setCurrentIndex(index)
     finally:
         self.blockSignals(block)