8 """Interface for all VispaPlugins""" 11 QObject.__init__(self, application)
18 """ Returns application object. 23 """ Registers Filetype object for given extension with description. 25 Description will be shown in open and save dialogs. 27 self._filetypes.append(
Filetype(ext,description))
30 """ Returns local list of Filetype objects. 35 """Adds supported file types from TabControllerClass. 37 Evaluates the static function staticSupportedFileTypes() of class TabControllerClass.""" 38 for (ext, description)
in TabControllerClass.staticSupportedFileTypes():
42 """This function has to be implemented by each plugin which can open files. 44 On success it should return True 46 logging.warning(
'VispaPlugin: openFile() method not implemented by '+ self.__class__.__name__ +
'.')
47 self.
application().statusBar().showMessage(
'Opening of desired file type not implemented.', 10000)
51 """Creates a new file action with label and optionally with a callable slot set and appends it to local new file actions list. """ 52 self._createNewFileActions.append(self._application.createAction(label, slot,image=
'filenew'))
55 """ Returns local list of new file actions. 60 """ Cleanup actions for the plugins def getNewFileActions(self)
def addNewFileAction(self, label, slot=None)
def registerFiletype(self, ext, description)
def registerFiletypesFromTabController(self, TabControllerClass)
def __init__(self, application=None)
def openFile(self, filename)