Exemplo n.º 1
0
    def __init__(self):
        gtk.gdk.threads_init()
        call_signal(self.status_changed)

        self.pcid = {}
        self.lock = False
        self.testing = False
        self.has_tap = None

        self.mainbox = gtk.VBox()
        self.framebox = gtk.VBox()
        '''test'''
        hbox = gtk.HBox()
        l_line = self.draw_line()
        hbox.pack_start(l_line, False)

        hbox.pack_start(self.framebox)

        r_line = self.draw_line()
        hbox.pack_start(r_line, False)
        '''test'''

        # Init gtk window
        self.window = InitWindow()

        # Create toolbar
        self.toolbar = ToolBar(self)
        self.mainbox.pack_start(self.toolbar, False)

        # content box
        #self.mainbox.pack_start(self.framebox)
        self.mainbox.pack_start(hbox)

        # statusbar
        self.status_bar = StatusBar()
        self.mainbox.pack_start(self.status_bar, False)

        # device change
        if has_udev:
            self.device_changed()

        self.align = self.define_align(self.mainbox, xc=1.0, yc=1.0)
        #self.align = self.define_align(hbox, xc=1.0, yc=1.0)
        self.align.set_padding(2 * S, 2 * S, 2 * S, 2 * S)

        self.window.add(self.align)
        self.window.show_all()

        self.device_thread = DeviceThread(self)
        self.device_thread.start()

        self.driver_thread = DriverThread(self)
        self.driver_thread.start()

        if os.path.isfile(HW_XML) and os.path.getsize(HW_XML):
            self.device_thread.join()

        self.test_thread = TestThread(self)
        self.test_thread.start()

        gtk.gdk.threads_enter()
        try:
            gtk.main()
        finally:
            gtk.gdk.threads_leave()