def __init__(self, category, parent=None): WelcomePage.__init__(self, parent=parent) self._actions = {} self._sorted_actions = [] for plugin_class in plugins(category): action = QtGui.QAction(obj_icon(plugin_class), alias(plugin_class), self) action.triggered.connect(self._on_action_triggered) self._actions[action] = plugin_class self._sorted_actions.append(action) self.set_actions(self._sorted_actions)
def __init__(self, category, parent=None): WelcomePage.__init__(self, parent=parent) self._actions = {} self._sorted_actions = [] for plugin_class in plugins(category): action = QtGui.QAction(obj_icon(plugin_class), alias(plugin_class), self) action.triggered.connect(self._on_action_triggered) self._actions[action] = plugin_class self._sorted_actions.append(action) self.set_actions(self._sorted_actions)
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")
def addCreateFileTab(self): """ Display a tab to select type of file that you can create """ if self.paradigms_actions: page = WelcomePage(actions=self.paradigms_actions) self.addTab(page, "Create File") else: self.addProjectTab() self.rmTab("Welcome")
def resize(self, *args, **kwargs): WelcomePage.resize(self, *args, **kwargs) self.set_actions(self._sorted_actions)
def resize(self, *args, **kwargs): WelcomePage.resize(self, *args, **kwargs) self.set_actions(self._sorted_actions)