Example #1
0
 def addProjectTab(self):
     """
     Display a welcome tab if nothing is opened
     """
     pm = get_applet(identifier='ProjectManager')
     if pm:
         actions = [pm.actionNewProj, pm.actionOpenProj]
         welcomePage = WelcomePage(actions=actions, parent=self.parent())
         self.addTab(welcomePage, "Welcome")
Example #2
0
 def on_package_manager_focus_change(self, item):
     pkg_id, factory_id, mimetype = NodeFactoryView.get_item_info(item)
     if len(pkg_id) and len(factory_id) and mimetype in [NodeFactory.mimetype,
                                                         CompositeNodeFactory.mimetype]:
         factory = package_manager[pkg_id][factory_id]
         factoryDoc = factory.get_documentation()
         txt = factory.get_tip(asRst=True) + "\n\n"
         if factoryDoc is not None:
             txt += "**Docstring:**\n" + factoryDoc
         applet = get_applet(identifier='HelpWidget')
         if applet:
             applet.setText(txt)
Example #3
0
    def mouseDoubleClickEvent(self, event):

        item = self.currentIndex()
        obj = item.internalPointer()

        if isinstance(obj, CompositeNodeFactory):
            applet = get_applet(identifier="EditorManager")
            if applet:
                model = ModelFactory(dtype="Workflow", mimetype="text/x-visualea", code=obj)
                cat, data = applet.add(
                    applet.project(), obj.name + ".wpy", code=model.repr_code(), category="model", dtype="Workflow"
                )
                applet.open_data(data)
        elif not isinstance(obj, Package):
            self.open_node()
Example #4
0
if __name__ == '__main__':
    instance = QtGui.QApplication.instance()
    if instance is None:
        app = QtGui.QApplication([])
    else:
        app = instance

    session = Session()
    mainwin = MainWindow(session)
    for plugin in plugins('oalab.applet'):
        if plugin.name in ('ProjectManager', 'EditorManager'):
            mainwin.add_plugin(plugin())

    pm = session.project_manager
    pm.cproject = pm.default()
    pmw = get_applet(identifier='ProjectManager', class_args=dict(mainwindow=mainwin))
    pcw = get_applet(identifier='EditorManager', class_args=dict(mainwindow=mainwin))

    interp = interpreter()
    interp.locals['pmw'] = pmw
    interp.locals['pcw'] = pcw

    mainwin.show()
    mainwin.raise_()

    if instance is None:
        app.exec_()

"""
from openalea.core.control.manager import ControlManager
from openalea.core.control import Control