Use checkbox instead of radiobutton in the output page
[bertos.git] / wizard / BOutputPage.py
1 #!/usr/bin/env python
2 # encoding: utf-8
3 #
4 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
5 # All rights reserved.
6 #
7 # $Id:$
8 #
9 # Author: Lorenzo Berni <duplo@develer.com>
10 #
11
12 import os
13
14 from PyQt4.QtGui import *
15 from BWizardPage import *
16 import bertos_utils
17
18 from const import *
19
20 class BOutputPage(BWizardPage):
21     
22     def __init__(self):
23         BWizardPage.__init__(self, UI_LOCATION + "/output_select.ui")
24         self.setTitle(self.tr("Choose the project output"))
25         self._connectSignals()
26         self._projectInfoStore("OUTPUT", [])
27     
28     def _connectSignals(self):
29         self.connect(self.pageContent.eclipseCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self._modeChecked(checked, "eclipse"))
30         self.connect(self.pageContent.xcodeCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self._modeChecked(checked, "xcode"))
31         self.connect(self.pageContent.codeliteCheckBox, SIGNAL("stateChanged(int)"), lambda checked: self._modeChecked(checked, "codelite"))
32     
33     def _modeChecked(self, checked, value):
34         outputList = self._projectInfoRetrieve("OUTPUT")
35         if checked == Qt.Checked:
36             outputList.append(value)
37         else:
38             outputList.remove(value)
39         self._projectInfoStore("OUTPUT", outputList)
40