Add the _loadModuleData() method, a method that load the modules, the define lists...
[bertos.git] / wizard / BModulePage.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
19 class BModulePage(BWizardPage):
20     
21     def __init__(self):
22         BWizardPage.__init__(self, "module_select.ui")
23         self.setTitle(self.tr("Configure the BeRTOS modules"))
24         self._setupUi()
25         self._connectSignals()
26     
27     def reloadData(self):
28         self._loadModuleData()
29     
30     def _loadModuleData(self):
31         modules = bertos_utils.loadModuleInfosDict(self._projectInfoRetrieve("SOURCES_PATH"))
32         lists = bertos_utils.loadDefineListsDict(self._projectInfoRetrieve("SOURCES_PATH"))
33         configurations = {}
34         for module, informations in modules.items():
35             configurations.update(bertos_utils.loadConfigurationInfos(self._projectInfoRetrieve("SOURCES_PATH") + "/" + informations["configuration"]))
36         print "modules", modules
37         print "lists", lists
38         print "configurations", configurations
39     
40     def _setupUi(self):
41         self.pageContent.moduleList.setSortingEnabled(True)
42         self.pageContent.propertyTable.horizontalHeader().setResizeMode(QHeaderView.ResizeToContents)
43         self.pageContent.propertyTable.horizontalHeader().setVisible(False)
44         self.pageContent.propertyTable.verticalHeader().setResizeMode(QHeaderView.ResizeToContents)
45         self.pageContent.propertyTable.verticalHeader().setVisible(False)
46         self.pageContent.propertyTable.setColumnCount(2)
47         self.pageContent.propertyTable.setRowCount(0)
48     
49     def _connectSignals(self):
50         pass