X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBOutputPage.py;h=55418d664de7f98dfd2f4bdfd57a45773c2ac905;hb=81f2387d160fee072af03291b5682a06f5b807cd;hp=cd1290eea7cf124883f435b2a77d1de32ed98be8;hpb=e00a0e97d2ec8ef378448598be142f4647b74756;p=bertos.git diff --git a/wizard/BOutputPage.py b/wizard/BOutputPage.py index cd1290ee..55418d66 100644 --- a/wizard/BOutputPage.py +++ b/wizard/BOutputPage.py @@ -4,7 +4,7 @@ # Copyright 2009 Develer S.r.l. (http://www.develer.com/) # All rights reserved. # -# $Id:$ +# $Id$ # # Author: Lorenzo Berni # @@ -15,30 +15,50 @@ from PyQt4.QtGui import * from BWizardPage import * import bertos_utils +from const import * class BOutputPage(BWizardPage): + """ + Page of the wizard that show a little summary of the previous decisions. + """ def __init__(self): - BWizardPage.__init__(self, "output_select.ui") + BWizardPage.__init__(self, UI_LOCATION + "/output_select.ui") self.setTitle(self.tr("Choose the project output")) - self._setupButtonGroup() - self._connectSignals() - def _connectSignals(self): - self.connect(self._buttonGroup, SIGNAL("buttonClicked(int)"), self._buttonClicked) + ## Overloaded BWizardPage methods. ## - def _setupButtonGroup(self): - self._buttonGroup = QButtonGroup() - self._buttonGroup.addButton(self.pageContent.bbsButton) - self._buttonGroup.addButton(self.pageContent.eclipseButton) - self._buttonGroup.addButton(self.pageContent.codeliteButton) - self._buttonGroup.addButton(self.pageContent.xcodeButton) + def connectSignals(self): + """ + Connects the signals with the related slots. + """ + self.connect(self.pageContent.codeliteCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self.modeChecked(checked, "codelite")) - def _buttonClicked(self): - self.emit(SIGNAL("completeChanged()")) + def reloadData(self): + """ + Overload of the BWizardPage reloadData method. + """ + output = [] + if self.pageContent.codeliteCheckBox.isChecked(): + output.append("codelite") + else: + if "codelite" in output: + output.remove("codelite") + self.setProjectInfo("OUTPUT", output) - def isComplete(self): - for button in self._buttonGroup.buttons(): - if button.isChecked(): - return True - return False \ No newline at end of file + #### + + ## Slots ## + + def modeChecked(self, checked, value): + """ + Slot called when one of the mode checkbox is checked. It stores it. + """ + output_list = self.projectInfo("OUTPUT") + if checked == Qt.Checked: + output_list.append(value) + else: + output_list.remove(value) + self.setProjectInfo("OUTPUT", output_list) + + #### \ No newline at end of file