Use checkbox instead of radiobutton in the output page
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 9 Mar 2009 11:33:54 +0000 (11:33 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 9 Mar 2009 11:33:54 +0000 (11:33 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2389 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BOutputPage.py
wizard/bertos_utils.py
wizard/ui/output_select.ui

index 84222fee46cf54ac8416f5d967050853ac8a9aaa..397be470a6684adbde69afb19cca125db5356df2 100644 (file)
@@ -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
index 81ce7bbc9255ce2dad1a90a6e034ae666a5d7368..efc2631c7e3e971c0528dff58aafd1b183e094b6 100644 (file)
@@ -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):
     """
index c866c3ed5cfb0bad56bce4ac75785c8bbf2ea96e..22ac30ee5a0505e6c7cc5205fcf8b9e1f27c1ad4 100644 (file)
      </property>
      <layout class="QVBoxLayout" name="verticalLayout" >
       <item>
-       <widget class="QRadioButton" name="bbsButton" >
+       <widget class="QCheckBox" name="standardCheckBox" >
+        <property name="enabled" >
+         <bool>false</bool>
+        </property>
         <property name="text" >
          <string>BeRTOS build system</string>
         </property>
+        <property name="checkable" >
+         <bool>true</bool>
+        </property>
+        <property name="checked" >
+         <bool>true</bool>
+        </property>
        </widget>
       </item>
       <item>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_2" >
       <item>
-       <widget class="QRadioButton" name="eclipseButton" >
-        <property name="enabled" >
-         <bool>false</bool>
-        </property>
+       <widget class="QCheckBox" name="eclipseCheckBox" >
         <property name="text" >
          <string>Eclipse project</string>
         </property>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_3" >
       <item>
-       <widget class="QRadioButton" name="xcodeButton" >
-        <property name="enabled" >
-         <bool>false</bool>
-        </property>
+       <widget class="QCheckBox" name="xcodeCheckBox" >
         <property name="text" >
          <string>XCode project</string>
         </property>
    <item>
     <widget class="QFrame" name="frame_4" >
      <property name="enabled" >
-      <bool>false</bool>
+      <bool>true</bool>
      </property>
      <property name="frameShape" >
       <enum>QFrame::StyledPanel</enum>
      </property>
      <layout class="QVBoxLayout" name="verticalLayout_4" >
       <item>
-       <widget class="QRadioButton" name="codeliteButton" >
-        <property name="enabled" >
-         <bool>false</bool>
-        </property>
+       <widget class="QCheckBox" name="codeliteCheckBox" >
         <property name="text" >
          <string>CodeLite project</string>
         </property>