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 layout = QVBoxLayout()
44 self._plugin_dict = {}
46 if plugin in command_lines:
47 module = bertos_utils.loadPlugin(plugin)
48 checked = len(output) == 1
49 group, check = self.createNewOutput(self, module.PLUGIN_NAME, module.PLUGIN_DESCRIPTION, checked)
50 layout.addWidget(group)
51 self._plugin_dict[check] = plugin
53 widget.setLayout(layout)
54 if len(self._plugin_dict) > 0:
55 self.pageContent.scrollArea.setVisible(True)
56 self.pageContent.scrollArea.setWidget(widget)
60 Overload of the BWizardPage setupUi method.
62 self.pageContent.scrollArea.setVisible(False)
66 def createNewOutput(self, name, description, checked=True, enabled=True):
68 Create a groupBox for the given pieces of information. Returns the
69 groupBox and the checkBox
71 check = QCheckBox(description)
73 check.setCheckState(Qt.Checked)
75 check.setCheckState(Qt.Unchecked)
76 groupLayout = QVBoxLayout()
77 groupLayout.addWidget(check)
78 group = QGroupBox(name)
79 group.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum)
80 group.setLayout(groupLayout)
81 group.setEnabled(enabled)