def set_applet(self, applet):
     self._applet = weakref.ref(applet)
     self._layout.insertWidget(1, applet)
     _plugin_class = plugin_class('oalab.applet', applet.name)
     self._l_title.setText(_plugin_class.alias)
     p = QtGui.QSizePolicy
     applet.setSizePolicy(p(p.MinimumExpanding, p.MinimumExpanding))
Beispiel #2
0
 def set_applet(self, applet):
     self._applet = weakref.ref(applet)
     self._layout.insertWidget(1, applet)
     _plugin_class = plugin_class('oalab.applet', applet.name)
     self._l_title.setText(_plugin_class.alias)
     p = QtGui.QSizePolicy
     applet.setSizePolicy(p(p.MinimumExpanding, p.MinimumExpanding))
Beispiel #3
0
    def add_plugin(self, plugin=None, name=None):
        if name and plugin is None:
            _plugin_class = plugin_class('oalab.applet', name)
            if _plugin_class is None:
                return
            plugin = _plugin_class()

        def plug():
            applet = plugin_instance('oalab.applet', plugin.name)
            plugin.graft(applet=applet, oa_mainwin=self)
            self.session.applet['plugin_%s' % plugin.name] = plugin
            self.session.applet[applet.__class__.__name__] = applet

        # Use plugin manager call to handle debug mode automatically
        debug_plugin('oalab.applet', func=plug)
Beispiel #4
0
    def add_plugin(self, plugin=None, name=None):
        if name and plugin is None:
            _plugin_class = plugin_class('oalab.applet', name)
            if _plugin_class is None:
                return
            plugin = _plugin_class()

        def plug():
            applet = plugin_instance('oalab.applet', plugin.name)
            plugin.graft(applet=applet, oa_mainwin=self)
            self.session.applet['plugin_%s' % plugin.name] = plugin
            self.session.applet[applet.__class__.__name__] = applet

        # Use plugin manager call to handle debug mode automatically
        debug_plugin('oalab.applet', func=plug)
    def _redraw_tab(self, idx):
        """
        """
        if idx not in self._name:
            return

        name = self._name[idx]
        _plugin_class = plugin_class('oalab.applet', name)
        applet = self._applets[idx][name]
        # self.setTabText(idx, _plugin_class.alias)
        if self.tabPosition() == QtGui.QTabWidget.East:
            rotation = -90
        elif self.tabPosition() == QtGui.QTabWidget.West:
            rotation = 90
        else:
            rotation = 0

        self.setTabIcon(idx, obj_icon(_plugin_class, applet=applet, rotation=rotation))
        self.setTabToolTip(idx, _plugin_class.alias)
        self.widget(idx).set_edit_mode(self._edit_mode)
Beispiel #6
0
    def _redraw_tab(self, idx):
        """
        """
        if idx not in self._name:
            return

        name = self._name[idx]
        _plugin_class = plugin_class('oalab.applet', name)
        applet = self._applets[idx][name]
        # self.setTabText(idx, _plugin_class.alias)
        if self.tabPosition() == QtGui.QTabWidget.East:
            rotation = -90
        elif self.tabPosition() == QtGui.QTabWidget.West:
            rotation = 90
        else:
            rotation = 0

        self.setTabIcon(idx, obj_icon(_plugin_class, applet=applet, rotation=rotation))
        self.setTabToolTip(idx, _plugin_class.alias)
        self.widget(idx).set_edit_mode(self._edit_mode)