コード例 #1
0
ファイル: resultfiles.py プロジェクト: ryanakca/frescobaldi
 def forgetDocumentInfo(self):
     """Called when the user saves a Document.
     
     'Forgets' the basenames and job filename if set, but only if no job is currently running.
     
     """
     if not jobmanager.isRunning(self.document()):
         self._jobfile = None
         self._basenames = None
コード例 #2
0
ファイル: resultfiles.py プロジェクト: WedgeLeft/frescobaldi
 def forgetDocumentInfo(self):
     """Called when the user saves a Document.
     
     'Forgets' the basenames and job filename if set, but only if no job is currently running.
     
     """
     if not jobmanager.isRunning(self.document()):
         self._jobfile = None
         self._basenames = None
コード例 #3
0
ファイル: widget.py プロジェクト: mbsrz1972/frescobaldi
 def setDocumentStatus(self, doc):
     i = self._items[doc]
     # set properties according to document
     i.setText(0, doc.documentName())
     if jobmanager.isRunning(doc):
         icon = 'lilypond-run'
     elif doc.isModified():
         icon = 'document-save'
     else:
         icon = 'text-plain'
     i.setIcon(0, icons.get(icon))
     i.setToolTip(0, path(doc.url()))
     # handle ordering in groups if desired
     if self._group:
         self.groupDocument(doc)
     else:
         self.sortItems(0, Qt.AscendingOrder)
コード例 #4
0
ファイル: tabbar.py プロジェクト: WedgeLeft/frescobaldi
 def setDocumentStatus(self, doc):
     if doc in self.docs:
         index = self.docs.index(doc)
         self.setTabText(index, doc.documentName())
         if doc.url().toLocalFile():
             tooltip = util.homify(doc.url().toLocalFile())
         elif not doc.url().isEmpty():
             tooltip = doc.url().toString(QUrl.RemoveUserInfo)
         else:
             tooltip = None
         self.setTabToolTip(index, tooltip)
         # icon
         if jobmanager.isRunning(doc):
             icon = 'lilypond-run'
         elif doc.isModified():
             icon = 'document-save'
         else:
             icon = 'text-plain'
         self.setTabIcon(index, icons.get(icon))
コード例 #5
0
ファイル: documentmenu.py プロジェクト: WedgeLeft/frescobaldi
 def setDocumentStatus(self, doc):
     # create accels
     accels = [self._accels[d] for d in self._accels if d is not doc]
     name = doc.documentName().replace('&', '&&')
     for index, char in enumerate(name):
         if char.isalnum() and char.lower() not in accels:
             name = name[:index] + '&' + name[index:]
             self._accels[doc] = char.lower()
             break
     else:
         self._accels[doc] = ''
     # add [sticky] mark if necessary
     if doc == engrave.engraver(self.mainwindow()).stickyDocument():
         # L10N: 'always engraved': the document is marked as 'Always Engrave' in the LilyPond menu
         name += " " + _("[always engraved]")
     self._acts[doc].setText(name)
     # set the icon
     if jobmanager.isRunning(doc):
         icon = icons.get('lilypond-run')
     elif doc.isModified():
         icon = icons.get('document-save')
     else:
         icon = QIcon()
     self._acts[doc].setIcon(icon)
コード例 #6
0
 def setDocumentStatus(self, doc):
     # create accels
     accels = [self._accels[d] for d in self._accels if d is not doc]
     name = doc.documentName().replace('&', '&&')
     for index, char in enumerate(name):
         if char.isalnum() and char.lower() not in accels:
             name = name[:index] + '&' + name[index:]
             self._accels[doc] = char.lower()
             break
     else:
         self._accels[doc] = ''
     # add [sticky] mark if necessary
     if doc == engrave.engraver(self.mainwindow()).stickyDocument():
         # L10N: 'always engraved': the document is marked as 'Always Engrave' in the LilyPond menu
         name += " " + _("[always engraved]")
     self._acts[doc].setText(name)
     # set the icon
     if jobmanager.isRunning(doc):
         icon = icons.get('lilypond-run')
     elif doc.isModified():
         icon = icons.get('document-save')
     else:
         icon = QIcon()
     self._acts[doc].setIcon(icon)
コード例 #7
0
ファイル: custom.py プロジェクト: marnen/frescobaldi
 def setDocument(self, doc):
     self.selectLilyPondInfo(command.info(doc))
     if jobmanager.isRunning(doc):
         self._document = doc
         self.buttons.button(QDialogButtonBox.Ok).setEnabled(False)
コード例 #8
0
ファイル: custom.py プロジェクト: ryanakca/frescobaldi
 def setDocument(self, doc):
     self.lilyChooser.setLilyPondInfo(command.info(doc))
     if jobmanager.isRunning(doc):
         self._document = doc
         self.buttons.button(QDialogButtonBox.Ok).setEnabled(False)