X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=wizard%2FBFinalPage.py;h=aad5fec0344d8cb547586ec4c6530434861b213b;hb=b184b8dae2e3dffa463932855a77f7566788620e;hp=b8901d4eeaa60d2ef78d4a6e03eb8c85a0d65cc2;hpb=8d22a2e350167e155a798ae50844e49e8597eb96;p=bertos.git diff --git a/wizard/BFinalPage.py b/wizard/BFinalPage.py index b8901d4e..aad5fec0 100644 --- a/wizard/BFinalPage.py +++ b/wizard/BFinalPage.py @@ -40,20 +40,27 @@ class BFinalPage(BWizardPage): output = self.projectInfo("OUTPUT") import winreg_importer command_lines = winreg_importer.getCommandLines() + self.setProjectInfo("COMMAND_LINES", command_lines) layout = QVBoxLayout() self._plugin_dict = {} for plugin in output: if plugin in command_lines: module = bertos_utils.loadPlugin(plugin) - checked = len(output) == 1 - group, check = self.createNewOutput(self, module.PLUGIN_NAME, module.PLUGIN_DESCRIPTION, checked) - layout.addWidget(group) + check = QCheckBox(self.tr("Open project in %s" %module.PLUGIN_NAME)) + if len(output) == 1: + check.setCheckState(Qt.Checked) + else: + check.setCheckState(Qt.Unchecked) + layout.addWidget(check) self._plugin_dict[check] = plugin widget = QWidget() widget.setLayout(layout) if len(self._plugin_dict) > 0: self.pageContent.scrollArea.setVisible(True) self.pageContent.scrollArea.setWidget(widget) + for plugin in self._plugin_dict: + self.connect(plugin, SIGNAL("stateChanged(int)"), self.modeChecked) + self.modeChecked() def setupUi(self): """ @@ -62,21 +69,14 @@ class BFinalPage(BWizardPage): self.pageContent.scrollArea.setVisible(False) #### + + ## Slots ## + + def modeChecked(self): + to_be_opened = [] + for check, plugin in self._plugin_dict.items(): + if check.checkState() == Qt.Checked: + to_be_opened.append(plugin) + self.setProjectInfo("TO_BE_OPENED", to_be_opened) - def createNewOutput(self, name, description, checked=True, enabled=True): - """ - Create a groupBox for the given pieces of information. Returns the - groupBox and the checkBox - """ - check = QCheckBox(description) - if checked: - check.setCheckState(Qt.Checked) - else: - check.setCheckState(Qt.Unchecked) - groupLayout = QVBoxLayout() - groupLayout.addWidget(check) - group = QGroupBox(name) - group.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum) - group.setLayout(groupLayout) - group.setEnabled(enabled) - return group, check \ No newline at end of file + #### \ No newline at end of file