paulb@332 | 1 | import QtConfigurator.Forms |
paulb@332 | 2 | #import factory |
paulb@332 | 3 | import qtui |
paulb@332 | 4 | import os |
paulb@332 | 5 | |
paulb@332 | 6 | class Configurator(QtConfigurator.Forms.Configurator): |
paulb@332 | 7 | |
paulb@332 | 8 | resource_dir = os.path.join(os.path.split(__file__)[0], "Resources") |
paulb@332 | 9 | ui_filename = os.path.join(resource_dir, "config.ui") |
paulb@332 | 10 | ui_hard_disks_filename = os.path.join(resource_dir, "config_hard_disks.ui") |
paulb@332 | 11 | |
paulb@332 | 12 | def __init__(self, *args, **kw): |
paulb@332 | 13 | QtConfigurator.Forms.Configurator.__init__(self, *args, **kw) |
paulb@332 | 14 | #self.factory = factory.Factory(self.ui_filename) |
paulb@332 | 15 | |
paulb@332 | 16 | def baseSystemChanged(self): |
paulb@332 | 17 | print self.base_system.currentItem() |
paulb@332 | 18 | |
paulb@332 | 19 | def addHardDisk(self): |
paulb@332 | 20 | hard_disks = qtui.QWidgetFactory.create(self.ui_hard_disks_filename) |
paulb@332 | 21 | print str(hard_disks.name()) |
paulb@332 | 22 | #top = qtui.QWidgetFactory.create(self.ui_filename) |
paulb@332 | 23 | #print [str(c.name()) for c in top.children()] |
paulb@332 | 24 | #hard_disks = top.child("hard_disks") |
paulb@332 | 25 | print [str(c.name()) for c in hard_disks.children()] |
paulb@332 | 26 | tab_pages = hard_disks.child("tab pages") |
paulb@332 | 27 | print [str(c.name()) for c in tab_pages.children()] |
paulb@332 | 28 | tab = tab_pages.child("tab") |
paulb@332 | 29 | self.hard_disks.addTab(tab, hard_disks.tabLabel(tab)) |
paulb@332 | 30 | |
paulb@332 | 31 | def addMemoryUnit(self): |
paulb@332 | 32 | print "configuration.addMemoryUnit(): Not implemented yet" |
paulb@332 | 33 | |
paulb@332 | 34 | def addStorageUnit(self): |
paulb@332 | 35 | print "configuration.addStorageUnit(): Not implemented yet" |
paulb@332 | 36 | |
paulb@332 | 37 | def removeHardDisk(self): |
paulb@332 | 38 | page = self.hard_disks.currentPage() |
paulb@332 | 39 | self.hard_disks.removePage(page) |
paulb@332 | 40 | del page |
paulb@332 | 41 | |
paulb@332 | 42 | def removeMemoryUnit(self): |
paulb@332 | 43 | page = self.memory_units.currentPage() |
paulb@332 | 44 | self.memory_units.removePage(page) |
paulb@332 | 45 | del page |
paulb@332 | 46 | |
paulb@332 | 47 | def removeStorageUnit(self): |
paulb@332 | 48 | page = self.storage_units.currentPage() |
paulb@332 | 49 | self.storage_units.removePage(page) |
paulb@332 | 50 | del page |
paulb@332 | 51 | |
paulb@332 | 52 | def updateConfig(self): |
paulb@332 | 53 | print "configuration.updateConfig(): Not implemented yet" |
paulb@332 | 54 | |
paulb@332 | 55 | def exportConfig(self): |
paulb@332 | 56 | print "configuration.exportConfig(): Not implemented yet" |
paulb@332 | 57 | |
paulb@332 | 58 | # vim: tabstop=4 expandtab shiftwidth=4 |