Ejemplo n.º 1
0
    def __init__(self, path):

        # the instantiated items
        self.__children = []

        # getter, setter, and caller for getting and settings values and
        # calling callbacks
        self.__getter = None
        self.__setter = None
        self.__caller = None

        self.__close_callback = None

        # a banner
        self.__banner = None

        self.__path = path

        HIGDialog.__init__(self, buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE),
                           self_destroy = False)

#        self.__tooltip = gtk.Tooltip()
#        self.__tooltip.enable()


        def destroy(*args):
            if (self.__close_callback): self.__close_callback()
            
            self.hide()
            return True  # return True so that the window doesn't get destroyed

        self.connect("response", destroy)
        self.connect("delete-event", destroy)  # catch the close button as well
Ejemplo n.º 2
0
    def __init__(self, ctrlclass):

        HIGDialog.__init__(self, buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
        name = ctrlclass.__name__
        self.set_property("title", _("%s Control") % name)

        align = gtk.Alignment(0.0, 0.0, 0.0, 0.0)
        align.set_property("border-width", 6)
        frame = gtk.Frame()
        self.__scrollw = gtk.ScrolledWindow()
        frame.add(self.__scrollw)
        align.add(frame)

        self.__label = gtk.Label()
        self.__label.set_property("selectable", True)

        self.vbox.pack_start(align, False, False, 0)
        self.vbox.pack_start(self.__label, False, False, 0)

        # list the interfaces and their descriptions
        texts = Interface.gui_describe(ctrlclass)

        # create the listview now, with the content
        self.__create_listview(texts)

        def f(*args): self.destroy()
        self.connect("response", f)

        self.vbox.show_all()
Ejemplo n.º 3
0
    def __init__(self, sensorconfigurators):

        HIGDialog.__init__(self, buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
        self.set_property("title", _("Configuration"))

        def destroy(*args): self.destroy()

        self.connect("response", destroy)

        # close functions
        pages = []
        for c in sensorconfigurators:
            if (c):
                lbl = gtk.Label(c.get_name())
                lbl.show()
                pages.append((c, lbl))

        # use a special page when there are no config options
        if (not pages):
            lbl = gtk.Label(_("This desklet is not configurable."))
            lbl.show()
            pages.append((lbl, None))

        # only use the notebook when there are more than one pages
        if (len(pages) == 1):
            self.vbox.add(pages[0][0])
        else:
            align = gtk.Alignment(0.0, 0.0, 0.0, 0.0)
            align.show()
            notebook = gtk.Notebook()
            notebook.set_property("border-width", 6)
            notebook.show()
            align.add(notebook)
            self.vbox.pack_start(align, False, False, 0)
            for page, tab in pages:
                notebook.append_page(page, tab)

        self.show()