Add the _project() method that return the BProject instance
[bertos.git] / wizard / BWizardPage.py
1 #!/usr/bin/env python
2 # encoding: utf-8
3 #
4 # Copyright 2008 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 from PyQt4.QtCore import *
13 from PyQt4.QtGui import *
14 from PyQt4 import uic
15
16 import qvariant_converter
17
18 class BWizardPage(QWizardPage):
19     
20     def __init__(self, wizardGui, parent = None):
21         QWizardPage.__init__(self, parent)
22         self.pageContent = uic.loadUi(wizardGui, None)
23         layout = QVBoxLayout()
24         layout.addWidget(self.pageContent)
25         self.setLayout(layout)
26     
27     def _exceptionOccurred(self, message):
28         QMessageBox.critical(self, self.tr("Error occurred"), message, QMessageBox.Ok, QMessageBox.NoButton)
29     
30     def _settingsStore(self, key, value):
31         QApplication.instance().settings.setValue(QString(key), value)
32     
33     def _settingsRetrieve(self, key):
34         return QApplication.instance().settings.value(QString(key), QVariant())
35     
36     def _projectInfoStore(self, key, value):
37         QApplication.instance().project.setInfo(key, value)
38     
39     def _projectInfoRetrieve(self, key):
40         return QApplication.instance().project.info(key)
41     
42     def _project(self):
43         return QApplication.instance().project
44
45     def versions(self):
46         return qvariant_converter.getStringList(self._settingsRetrieve("versions"))
47     
48     def setVersions(self, versions):
49         self._settingsStore("versions", qvariant_converter.convertStringList(versions))
50         
51     def searchDirList(self):
52         return qvariant_converter.getStringList(self._settingsRetrieve("search_dir_list"))
53     
54     def setSearchDirList(self, search_dir_list):
55         self._settingsStore("search_dir_list", qvariant_converter.convertStringList(search_dir_list))
56     
57     def pathSearch(self):
58         return qvariant_converter.getBool(self._settingsRetrieve("path_search"))
59     
60     def setPathSearch(self, path_search):
61         self._settingsStore("path_search", qvariant_converter.convertBool(path_search))
62     
63     def toolchains(self):
64         return qvariant_converter.getBoolDict(self._settingsRetrieve("toolchains"))
65
66     def setToolchains(self, toolchains):
67         self._settingsStore("toolchains", qvariant_converter.convertBoolDict(toolchains))
68     
69     def reloadData(self):
70         pass
71     
72     def saveData(self):
73         pass