Ejemplo n.º 1
0
    def __init__(self, cfg, cfgname=None):
        """
        A dialog for editing config options.  If you specify "cfgname",
        all changes will be saved out to the specified file
        as they happen.
        """
        dname = os.path.dirname(vwidget.__file__)
        fname = os.path.join(dname, "config.glade")
        vw_windows.VWindow.__init__(self, fname, (0,0,500,300))

        self.setGeometry((0,0,500,300))

        self.cfg = cfg
        self.cfgname = cfgname

        tree = self.getWidget("ConfigTree")
        tree.append_column(vw_util.makeColumn("Section",1))
        tree.append_column(vw_util.makeColumn("Option",2))
        tree.append_column(vw_util.makeColumn("Value", 3, self.OptionEdited))

        model = gtk.TreeStore(str,str,str,str)
        tree.set_model(model)

        secs = cfg.sections()
        secs.sort()
        for sec in secs:
            i = model.append(None, (None, sec, None, None))
            opts = cfg.options(sec)
            opts.sort()
            for opt in opts:
                model.append(i, ("%s|%s" % (sec,opt), None, opt, cfg.get(sec, opt)))
Ejemplo n.º 2
0
    def __init__(self, cfg, cfgname=None):
        """
        A dialog for editing config options.  If you specify "cfgname",
        all changes will be saved out to the specified file
        as they happen.
        """
        dname = os.path.dirname(vwidget.__file__)
        fname = os.path.join(dname, "config.glade")
        vw_windows.VWindow.__init__(self, fname, (0, 0, 500, 300))

        self.setGeometry((0, 0, 500, 300))

        self.cfg = cfg
        self.cfgname = cfgname

        tree = self.getWidget("ConfigTree")
        tree.append_column(vw_util.makeColumn("Section", 1))
        tree.append_column(vw_util.makeColumn("Option", 2))
        tree.append_column(vw_util.makeColumn("Value", 3, self.OptionEdited))

        model = gtk.TreeStore(str, str, str, str)
        tree.set_model(model)

        secs = cfg.sections()
        secs.sort()
        for sec in secs:
            i = model.append(None, (None, sec, None, None))
            opts = cfg.options(sec)
            opts.sort()
            for opt in opts:
                model.append(i, ("%s|%s" %
                                 (sec, opt), None, opt, cfg.get(sec, opt)))
Ejemplo n.º 3
0
 def setupHeapTree(self):
     tree = self.getWidget("Win32HeapTree")
     tree.modify_font(self.font)
     col1 = vw_util.makeColumn("Heap", 1)
     col2 = vw_util.makeColumn("Segment", 2)
     tree.append_column(col1)
     tree.append_column(col2)
     store =  gtk.TreeStore(object,str,str)
     tree.set_model(store)
     self.updateHeapTree(tree)
Ejemplo n.º 4
0
 def setupHeapTree(self):
     tree = self.getWidget("Win32HeapTree")
     tree.modify_font(self.font)
     col1 = vw_util.makeColumn("Heap", 1)
     col2 = vw_util.makeColumn("Segment", 2)
     tree.append_column(col1)
     tree.append_column(col2)
     store = gtk.TreeStore(object, str, str)
     tree.set_model(store)
     self.updateHeapTree(tree)
Ejemplo n.º 5
0
 def setupChunkList(self):
     tree = self.getWidget("Win32ChunkList")
     tree.modify_font(self.font)
     col1 = vw_util.makeColumn("Chunkaddr", 1)
     col2 = vw_util.makeColumn("Size", 2)
     col3 = vw_util.makeColumn("Busy", 3)  # FIXME make a picture?
     col4 = vw_util.makeColumn("Bytes", 4)
     tree.append_column(col1)
     tree.append_column(col2)
     tree.append_column(col3)
     tree.append_column(col4)
     store = gtk.ListStore(object, str, str, str, str)
     tree.set_model(store)
Ejemplo n.º 6
0
 def __init__(self):
     vw_views.VTreeView.__init__(self)
     # Hook all the GUI callbacks in the server.
     #FIXME make this a callback object in the server
     self.id_iter = {}
     # Setup a progress bar renderer
     self.treeview.remove_column(self.treeview.get_column(3))
     col = vw_util.makeColumn("Percent",
                              3,
                              cell=gtk.CellRendererProgress(),
                              links={"value": 3})
     self.treeview.append_column(col)
Ejemplo n.º 7
0
    def vwInitModel(self, cols, modelclass):
        # Remove any old columns
        for col in self.treeview.get_columns():
            self.treeview.remove_column(col)

        ftypes = []
        for name, index, ctype in cols:
            ftypes.append(ctype)
            if name == None:
                continue

            onedit = None
            emeth_name = self.__editors__.get(name)
            if emeth_name != None:
                onedit = getattr(self, emeth_name, None)
            col = vw_util.makeColumn(name, index, onedit=onedit)
            self.treeview.append_column(col)

        self.model = modelclass(*ftypes)
        self.treeview.set_model(self.model)