Add the module qvariant_converter.py that abstracts the user from the qvariant_conver...
[bertos.git] / wizard / BWizardPage.py
index 699dd9dcbbc71c3e667910d59a4777b1769e3f67..b4fc6217025419c244c07c57af0743e68ca89319 100644 (file)
@@ -13,14 +13,52 @@ from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 from PyQt4 import uic
 
+import qvariant_converter
+
 class BWizardPage(QWizardPage):
     
     def __init__(self, wizardGui, parent = None):
         QWizardPage.__init__(self, parent)
-        # TODO: see why this function call is needed for display the
-        # application icons...
-        uic.loadUiType(wizardGui)
         self.pageContent = uic.loadUi(wizardGui, None)
         layout = QVBoxLayout()
         layout.addWidget(self.pageContent)
-        self.setLayout(layout)
\ No newline at end of file
+        self.setLayout(layout)
+    
+    def _settingsStore(self, key, value):
+        QApplication.instance().settings.setValue(QString(key), value)
+    
+    def _settingsRetrieve(self, key):
+        return QApplication.instance().settings.value(QString(key), QVariant())
+    
+    def _projectInfoStore(self, key, value):
+        QApplication.instance().project.setInfo(key, value)
+    
+    def _projectInfoRetrieve(self, key):
+        return QApplication.instance().project.info(key)
+
+    def versions(self):
+        return qvariant_converter.getStringList(self._settingsRetrieve("versions"))
+    
+    def setVersions(self, versions):
+        self._settingsStore("versions", qvariant_converter.convertStringList(versions))
+        
+    def searchDirList(self):
+        return qvariant_converter.getStringList(self._settingsRetrieve("search_dir_list"))
+    
+    def setSearchDirList(self, search_dir_list):
+        self._settingsStore("search_dir_list", qvariant_converter.convertStringList(search_dir_list))
+    
+    def pathSearch(self):
+        return qvariant_converter.getBool(self._settingsRetrieve("path_search"))
+    
+    def setPathSearch(self, path_search):
+        self._settingsStore("path_search", qvariant_converter.convertBool(path_search))
+    
+    def toolchains(self):
+        return qvariant_converter.getBoolDict(self._settingsRetrieve("toolchains"))
+
+    def setToolchains(self, toolchains):
+        self._settingsStore("toolchains", qvariant_converter.convertBoolDict(toolchains))
+    
+    def reloadData(self):
+        pass
\ No newline at end of file