4 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
9 # Author: Lorenzo Berni <duplo@develer.com>
14 from PyQt4.QtGui import *
16 from BWizardPage import *
21 class BFinalPage(BWizardPage):
23 Last page of the wizard. It creates the project and show a success message.
27 BWizardPage.__init__(self, UI_LOCATION + "/final_page.ui")
28 self.setTitle(self.tr("Project created successfully"))
30 ## Overloaded BWizardPage methods ##
34 Overload of the BWizardPage reloadData method.
36 QApplication.instance().setOverrideCursor(Qt.WaitCursor)
37 bertos_utils.createBertosProject(self.project())
38 QApplication.instance().restoreOverrideCursor()
40 output = self.projectInfo("OUTPUT")
41 import winreg_importer
42 command_lines = winreg_importer.getCommandLines()
43 self.setProjectInfo("COMMAND_LINES", command_lines)
44 layout = QVBoxLayout()
45 self._plugin_dict = {}
47 if plugin in command_lines:
48 module = bertos_utils.loadPlugin(plugin)
49 check = QCheckBox(self.tr("Open project in %s" %module.PLUGIN_NAME))
51 check.setCheckState(Qt.Checked)
53 check.setCheckState(Qt.Unchecked)
54 layout.addWidget(check)
55 self._plugin_dict[check] = plugin
57 widget.setLayout(layout)
58 if len(self._plugin_dict) > 0:
59 self.pageContent.scrollArea.setVisible(True)
60 self.pageContent.scrollArea.setWidget(widget)
61 for plugin in self._plugin_dict:
62 self.connect(plugin, SIGNAL("stateChanged(int)"), self.modeChecked)
67 Overload of the BWizardPage setupUi method.
69 self.pageContent.scrollArea.setVisible(False)
75 def modeChecked(self):
77 for check, plugin in self._plugin_dict.items():
78 if check.checkState() == Qt.Checked:
79 to_be_opened.append(plugin)
80 self.setProjectInfo("TO_BE_OPENED", to_be_opened)