コード例 #1
0
ファイル: view.py プロジェクト: wbsoft/frescobaldi
 def document(self, filename, load=False):
     """Get the document with the specified filename.
     
     If load is True, the document is loaded if it wasn't already.
     Also takes scratchdir into account for unnamed or non-local documents.
     
     """
     doc = scratchdir.findDocument(filename)
     if not doc and load:
         doc = app.openUrl(QUrl.fromLocalFile(filename))
     return doc
コード例 #2
0
ファイル: view.py プロジェクト: zaffnet/frescobaldi
    def document(self, filename, load=False):
        """Get the document with the specified filename.

        If load is True, the document is loaded if it wasn't already.
        Also takes scratchdir into account for unnamed or non-local documents.

        """
        doc = scratchdir.findDocument(filename)
        if not doc and load:
            doc = app.openUrl(QUrl.fromLocalFile(filename))
        return doc
コード例 #3
0
ファイル: pointandclick.py プロジェクト: 19joho66/frescobaldi
    def finish(self):
        """Call this when you are done with adding links.

        This method tries to bind() already loaded documents and starts
        monitoring document open/close events.

        You can also use the links as a context manager and then add links.
        On exit, finish() is automatically called.

        """
        for filename in self._links:
            d = scratchdir.findDocument(filename)
            if d:
                self.bind(filename, d)
        app.documentLoaded.connect(self.slotDocumentLoaded)
        app.documentClosed.connect(self.slotDocumentClosed)
コード例 #4
0
ファイル: pointandclick.py プロジェクト: stweil/frescobaldi
 def finish(self):
     """Call this when you are done with adding links.
     
     This method tries to bind() already loaded documents and starts
     monitoring document open/close events.
     
     You can also use the links as a context manager and then add links.
     On exit, finish() is automatically called.
     
     """
     for filename in self._links:
         d = scratchdir.findDocument(filename)
         if d:
             self.bind(filename, d)
     app.documentLoaded.connect(self.slotDocumentLoaded)
     app.documentClosed.connect(self.slotDocumentClosed)
コード例 #5
0
ファイル: errors.py プロジェクト: wbsoft/frescobaldi
    def __init__(self, filename, line, column):
        """Creates the reference to filename, line and column.

        lines start numbering with 1, columns with 0 (LilyPond convention).

        If a document with the given filename is already loaded (or the filename
        refers to the scratchdir for a document) a QTextCursor is created immediately.

        Otherwise, when a Document is loaded later with our filename, a QTextCursor
        is created then (by the bind() method).

        """
        self._filename = filename
        self._line = line
        self._column = column
        self._cursor = None

        app.documentLoaded.connect(self.trybind)
        d = scratchdir.findDocument(filename)
        if d:
            self.bind(d)
コード例 #6
0
ファイル: errors.py プロジェクト: zmole945/frescobaldi
    def __init__(self, filename, line, column):
        """Creates the reference to filename, line and column.

        lines start numbering with 1, columns with 0 (LilyPond convention).

        If a document with the given filename is already loaded (or the filename
        refers to the scratchdir for a document) a QTextCursor is created immediately.

        Otherwise, when a Document is loaded later with our filename, a QTextCursor
        is created then (by the bind() method).

        """
        self._filename = filename
        self._line = line
        self._column = column
        self._cursor = None

        app.documentLoaded.connect(self.trybind)
        d = scratchdir.findDocument(filename)
        if d:
            self.bind(d)