1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/Common/QtConfigurator/__init__.py Mon Oct 24 15:27:48 2005 +0000
1.3 @@ -0,0 +1,58 @@
1.4 +import QtConfigurator.Forms
1.5 +#import factory
1.6 +import qtui
1.7 +import os
1.8 +
1.9 +class Configurator(QtConfigurator.Forms.Configurator):
1.10 +
1.11 + resource_dir = os.path.join(os.path.split(__file__)[0], "Resources")
1.12 + ui_filename = os.path.join(resource_dir, "config.ui")
1.13 + ui_hard_disks_filename = os.path.join(resource_dir, "config_hard_disks.ui")
1.14 +
1.15 + def __init__(self, *args, **kw):
1.16 + QtConfigurator.Forms.Configurator.__init__(self, *args, **kw)
1.17 + #self.factory = factory.Factory(self.ui_filename)
1.18 +
1.19 + def baseSystemChanged(self):
1.20 + print self.base_system.currentItem()
1.21 +
1.22 + def addHardDisk(self):
1.23 + hard_disks = qtui.QWidgetFactory.create(self.ui_hard_disks_filename)
1.24 + print str(hard_disks.name())
1.25 + #top = qtui.QWidgetFactory.create(self.ui_filename)
1.26 + #print [str(c.name()) for c in top.children()]
1.27 + #hard_disks = top.child("hard_disks")
1.28 + print [str(c.name()) for c in hard_disks.children()]
1.29 + tab_pages = hard_disks.child("tab pages")
1.30 + print [str(c.name()) for c in tab_pages.children()]
1.31 + tab = tab_pages.child("tab")
1.32 + self.hard_disks.addTab(tab, hard_disks.tabLabel(tab))
1.33 +
1.34 + def addMemoryUnit(self):
1.35 + print "configuration.addMemoryUnit(): Not implemented yet"
1.36 +
1.37 + def addStorageUnit(self):
1.38 + print "configuration.addStorageUnit(): Not implemented yet"
1.39 +
1.40 + def removeHardDisk(self):
1.41 + page = self.hard_disks.currentPage()
1.42 + self.hard_disks.removePage(page)
1.43 + del page
1.44 +
1.45 + def removeMemoryUnit(self):
1.46 + page = self.memory_units.currentPage()
1.47 + self.memory_units.removePage(page)
1.48 + del page
1.49 +
1.50 + def removeStorageUnit(self):
1.51 + page = self.storage_units.currentPage()
1.52 + self.storage_units.removePage(page)
1.53 + del page
1.54 +
1.55 + def updateConfig(self):
1.56 + print "configuration.updateConfig(): Not implemented yet"
1.57 +
1.58 + def exportConfig(self):
1.59 + print "configuration.exportConfig(): Not implemented yet"
1.60 +
1.61 +# vim: tabstop=4 expandtab shiftwidth=4