Ejemplo n.º 1
0
    def __init__(self, manager, group='default', parent=None, style=None):
        """
        items: function returning items for a given group
        """
        self.manager = manager
        if style is None:
            style = WelcomePage.STYLE_MEDIUM
        WelcomePage.__init__(self, parent=parent, style=style)

        self._actions = {}
        items = sorted(self.manager.items(group), key=lambda item: item.label)
        self._sorted_actions = []
        for item in items:
            action = QtGui.QAction(obj_icon(item), item.label, self)
            action.triggered.connect(self._on_action_triggered)
            self._actions[action] = item
            self._sorted_actions.append(action)

        self.set_actions(self._sorted_actions)
Ejemplo n.º 2
0
 def add_welcome_tab(self, actions):
     self.remove_tab("Welcome")
     welcomePage = WelcomePage(actions=actions,
                               parent=self.parent(),
                               style=WelcomePage.STYLE_MEDIUM)
     self.addTab(welcomePage, "Welcome")
Ejemplo n.º 3
0
 def resize(self, *args, **kwargs):
     WelcomePage.resize(self, *args, **kwargs)
     self.set_actions(self._sorted_actions)