From: duplo Date: Mon, 9 Mar 2009 11:33:54 +0000 (+0000) Subject: Use checkbox instead of radiobutton in the output page X-Git-Tag: 2.1.0~293 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=a692e320af6d934a7e935e6b2b83bfd3f0de1cab;p=bertos.git Use checkbox instead of radiobutton in the output page git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2389 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BOutputPage.py b/wizard/BOutputPage.py index 84222fee..397be470 100644 --- a/wizard/BOutputPage.py +++ b/wizard/BOutputPage.py @@ -22,32 +22,19 @@ class BOutputPage(BWizardPage): def __init__(self): BWizardPage.__init__(self, UI_LOCATION + "/output_select.ui") self.setTitle(self.tr("Choose the project output")) - self._setupButtonGroup() self._connectSignals() + self._projectInfoStore("OUTPUT", []) def _connectSignals(self): - self.connect(self._buttonGroup, SIGNAL("buttonClicked(int)"), self._buttonClicked) + self.connect(self.pageContent.eclipseCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self._modeChecked(checked, "eclipse")) + self.connect(self.pageContent.xcodeCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self._modeChecked(checked, "xcode")) + self.connect(self.pageContent.codeliteCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self._modeChecked(checked, "codelite")) - 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 _buttonClicked(self): - self.emit(SIGNAL("completeChanged()")) - - def isComplete(self): - for button in self._buttonGroup.buttons(): - if button.isChecked(): - if button is self.pageContent.bbsButton: - self._projectInfoStore("OUTPUT", "makefile") - elif button is self.pageContent.eclipseButton: - self._projectInfoStore("OUTPUT", "eclipse") - elif button is self.pageContent.codeliteButton: - self._projectInfoStore("OUTPUT", "codelite") - elif button is self.pageContent.xcodeButton: - self._projectInfoStore("OUTPUT", "xcode") - return True - return False \ No newline at end of file + def _modeChecked(self, checked, value): + outputList = self._projectInfoRetrieve("OUTPUT") + if checked == Qt.Checked: + outputList.append(value) + else: + outputList.remove(value) + self._projectInfoStore("OUTPUT", outputList) + \ No newline at end of file diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 81ce7bbc..efc2631c 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -68,10 +68,11 @@ def createBertosProject(projectInfo): makefile = open("mktemplates/template.mk", "r").read() makefile = mkGenerator(projectInfo, makefile) open(prjdir + "/" + os.path.basename(prjdir) + ".mk", "w").write(makefile) - workspace = codeliteWorkspaceGenerator(projectInfo) - open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace) - project = codeliteProjectGenerator(projectInfo) - open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project) + if "codelite" in projectInfo.info("OUTPUT"): + workspace = codeliteWorkspaceGenerator(projectInfo) + open(directory + "/" + os.path.basename(prjdir) + ".workspace", "w").write(workspace) + project = codeliteProjectGenerator(projectInfo) + open(directory + "/" + os.path.basename(prjdir) + ".project", "w").write(project) def mkGenerator(projectInfo, makefile): """ diff --git a/wizard/ui/output_select.ui b/wizard/ui/output_select.ui index c866c3ed..22ac30ee 100644 --- a/wizard/ui/output_select.ui +++ b/wizard/ui/output_select.ui @@ -29,10 +29,19 @@ - + + + false + BeRTOS build system + + true + + + true + @@ -75,10 +84,7 @@ - - - false - + Eclipse project @@ -127,10 +133,7 @@ - - - false - + XCode project @@ -169,7 +172,7 @@ - false + true QFrame::StyledPanel @@ -179,10 +182,7 @@ - - - false - + CodeLite project