document — Opened file representation

class enki.core.document.Document(parentObject, filePath, createNew=False)

Bases: QWidget

Document is a opened file representation.

It contains file management methods and uses Qutepart as an editor widget. Qutepart is available as qutepart attribute.

documentDataChanged

documentDataChanged()

Signal emitted, when document icon or toolTip has changed (i.e. document has been modified externally)

del_()

Explicytly called destructor

isExternallyModified()

Check if document’s file has been modified externally.

This method does not do any file system access, but only returns cached info

isExternallyRemoved()

Check if document’s file has been deleted externally.

This method does not do any file system access, but only returns cached info

isNeverSaved()

Check if document has been created, but never has been saved on disk

filePath()

Return the document file absolute path.

None if not set (new document)

fileName()

Document file name without a path.

None if not set (new document)

setFilePath(newPath)

Change document file path.

Used when saving first time, or on Save As action

saveFile()

Save the file to file system.

Show QFileDialog if file name is not known. Return False, if user cancelled QFileDialog, True otherwise

saveFileAs()

Ask for new file name with dialog. Save file

reload()

Reload the file from the disk

If child class reimplemented this method, it MUST call method of the parent class for update internal bookkeeping

modelToolTip()

Tool tip for the opened files model

modelIcon()

Icon for the opened files model

invokeGoTo()

Show GUI dialog, go to line, if user accepted it

printFile()

Print file