Exemplo n.º 1
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)

        self.app = app
        self.dir = os.path.dirname(__file__)
        self.status = STATUS_STOP

        fname = os.path.join(self.dir, 'vehicle.glade')
        self._glade = glade.XML(fname, 'vehicle_info_box')
        main_vbox = self._glade.get_widget('vehicle_info_box')
        self.pack_start(main_vbox)
        main_vbox.show_all()

        self._vehicle_name = self._glade.get_widget('vehicle_name_data')
        self._vehicle_plate = self._glade.get_widget('vehicle_plate_data')
        self._vehicle_make = self._glade.get_widget('vehicle_make_data')
        self._vehicle_model = self._glade.get_widget('vehicle_model_data')
        self._vehicle_year = self._glade.get_widget('vehicle_year_data')
        self._vehicle_vin = self._glade.get_widget('vehicle_vin_data')
        self._vehicle_engine = self._glade.get_widget('vehicle_engine_data')
        self._vehicle_fuel = self._glade.get_widget('vehicle_fuel_data')
        self._vehicle_obd = self._glade.get_widget('vehicle_obd_data')
        self._vehicle_last_connect = self._glade.get_widget(
            'vehicle_last_connect_data')

        alignment = gtk.Alignment(0, 0, 0, 0)
        self.layout = gtk.Layout()
        alignment.add(self.layout)
        self.pack_start(alignment, True, True)
        self.show_all()

        self._reset_cbid = app.connect("reset", self._on_reset)
        self._switch_cbid = app.notebook.connect('switch-page',
                                                 self._notebook_page_change_cb)
Exemplo n.º 2
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)

        self.app = app
        self.dir = os.path.dirname(__file__)
        self.status = STATUS_STOP

        fname = os.path.join(self.dir, 'dtc_lookup.glade')
        self._glade = glade.XML(fname, 'hpaned')

        self._dtc_info = DTCInfo(self._glade)

        button = self._glade.get_widget('re-read-button')
        button.connect('clicked', self._reread_button_clicked)

        button = self._glade.get_widget('dtc-lookup-button')
        button.connect('clicked', self._dtclookup_button_clicked)

        hpaned = self._glade.get_widget('hpaned')
        self.pack_start(hpaned, True, True)
        hpaned.set_border_width(5)

        self.dtc_enter = self._glade.get_widget('dtc_entry')
        self.dtc_enter.connect('activate', self._dtclookup_button_clicked)

        self.show_all()

        self._reset_cbid = app.connect("reset", self._on_reset)
        self._switch_cbid = app.notebook.connect('switch-page',
                                                 self._notebook_page_change_cb)
Exemplo n.º 3
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)
        
        self.app = app
        self.dir = os.path.dirname(__file__)
        self.status = STATUS_STOP
        
        fname = os.path.join(self.dir, 'dtc_lookup.glade')
        self._glade = glade.XML(fname, 'hpaned')

        self._dtc_info = DTCInfo(self._glade)
        
        button = self._glade.get_widget('re-read-button')
        button.connect('clicked', self._reread_button_clicked)
        
        button = self._glade.get_widget('dtc-lookup-button')
        button.connect('clicked', self._dtclookup_button_clicked)
        
        hpaned = self._glade.get_widget('hpaned')
        self.pack_start(hpaned, True, True)
        hpaned.set_border_width(5)

        self.dtc_enter = self._glade.get_widget('dtc_entry')
        self.dtc_enter.connect('activate',self._dtclookup_button_clicked)

        self.show_all()
        
        self._reset_cbid = app.connect("reset", self._on_reset)
        self._switch_cbid = app.notebook.connect('switch-page', 
                                              self._notebook_page_change_cb)
Exemplo n.º 4
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)
        
        self.app = app
        self.dir = os.path.dirname(__file__)
        self.status = STATUS_STOP
        
        fname = os.path.join(self.dir, 'vehicle.glade')
        self._glade = glade.XML(fname, 'vehicle_info_box')
        main_vbox = self._glade.get_widget('vehicle_info_box')
        self.pack_start(main_vbox)
        main_vbox.show_all()

        self._vehicle_name = self._glade.get_widget('vehicle_name_data')
        self._vehicle_plate = self._glade.get_widget('vehicle_plate_data')
        self._vehicle_make = self._glade.get_widget('vehicle_make_data')
        self._vehicle_model = self._glade.get_widget('vehicle_model_data')
        self._vehicle_year = self._glade.get_widget('vehicle_year_data')
        self._vehicle_vin = self._glade.get_widget('vehicle_vin_data')
        self._vehicle_engine = self._glade.get_widget('vehicle_engine_data')
        self._vehicle_fuel = self._glade.get_widget('vehicle_fuel_data')
        self._vehicle_obd = self._glade.get_widget('vehicle_obd_data')
        self._vehicle_last_connect = self._glade.get_widget('vehicle_last_connect_data')

        alignment = gtk.Alignment(0, 0, 0, 0)
        self.layout = gtk.Layout()
        alignment.add(self.layout)
        self.pack_start(alignment, True, True)
        self.show_all()
        
        self._reset_cbid = app.connect("reset", self._on_reset)
        self._switch_cbid = app.notebook.connect('switch-page', 
                                              self._notebook_page_change_cb)
Exemplo n.º 5
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)

        self.app = app
        self.dir = os.path.dirname(__file__)
        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._scheduler_cbs = []
        self._obd_cbs = []

        app.prefs.register('dashboard.needle-color', '#F20D1B')
        app.prefs.register('dashboard.background', '#2F2323')

        fname = os.path.join(self.dir, 'dashboard.glade')
        xml = gtk.glade.XML(fname, 'prefs-vbox', 'garmon')
        app.prefs.add_dialog_page(xml, 'prefs-vbox', _('Dashboard'))

        self._needle_color = app.prefs.get('dashboard.needle-color')
        self._background = app.prefs.get('dashboard.background')
        cb_id = app.prefs.add_watch('dashboard.needle-color',
                                    self._prefs_notify_color_cb)
        self._pref_cbs.append(('dashboard.needle-color', cb_id))
        cb_id = app.prefs.add_watch('dashboard.background',
                                    self._prefs_notify_color_cb)
        self._pref_cbs.append(('dashboard.background', cb_id))

        if app.prefs.get('imperial'):
            self._unit_standard = 'Imperial'
        else:
            self._unit_standard = 'Metric'

        cb_id = app.prefs.add_watch('imperial', self._notify_units_cb)
        self._pref_cbs.append(('imperial', cb_id))

        self.status = STATUS_STOP

        self._setup_gui()
        self._setup_gauges()
        self._set_gauges_background()

        self._obd_cbs.append(
            app.device.connect('connected', self._obd_connected_cb))
        self._notebook_cbs.append(
            app.notebook.connect('switch-page', self._notebook_page_change_cb))

        self._scheduler_cbs.append(
            self.app.scheduler.connect('notify::working',
                                       self._scheduler_notify_working_cb))

        self._obd_connected_cb(app.device)
Exemplo n.º 6
0
    def __init__(self, app) :
        gtk.VBox.__init__(self)
        Plugin.__init__(self)
        
        self.app = app
        self.dir = os.path.dirname(__file__)
        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._scheduler_cbs = []
        self._obd_cbs = []
                
        app.prefs.register('dashboard.needle-color', '#F20D1B')
        app.prefs.register('dashboard.background', '#2F2323')

        fname = os.path.join(self.dir, 'dashboard.glade')
        xml = gtk.glade.XML(fname, 'prefs-vbox', 'garmon')
        app.prefs.add_dialog_page(xml, 'prefs-vbox', _('Dashboard'))
        
        self._needle_color = app.prefs.get('dashboard.needle-color')
        self._background = app.prefs.get('dashboard.background')
        cb_id = app.prefs.add_watch('dashboard.needle-color', 
                                                self._prefs_notify_color_cb)
        self._pref_cbs.append(('dashboard.needle-color', cb_id))
        cb_id = app.prefs.add_watch('dashboard.background', 
                                                self._prefs_notify_color_cb)
        self._pref_cbs.append(('dashboard.background', cb_id))

        if app.prefs.get('imperial'):
            self._unit_standard = 'Imperial'
        else:
            self._unit_standard = 'Metric'
            
        cb_id = app.prefs.add_watch('imperial', 
                                    self._notify_units_cb)
        self._pref_cbs.append(('imperial', cb_id))

        self.status = STATUS_STOP
        
        self._setup_gui()
        self._setup_gauges()
        self._set_gauges_background()
        
        self._obd_cbs.append(app.device.connect('connected', self._obd_connected_cb))
        self._notebook_cbs.append(app.notebook.connect('switch-page', 
                                                self._notebook_page_change_cb))

        self._scheduler_cbs.append(self.app.scheduler.connect('notify::working', 
                                             self._scheduler_notify_working_cb))        

        self._obd_connected_cb(app.device)
Exemplo n.º 7
0
    def __init__(self, app):
        Plugin.__init__(self)

        self.app = app
                
        self.ui_info = '''<ui>
                                <toolbar  name='ToolBar'>
                                    <placeholder name='DeviceToolItems'>
                                    <separator/>
                                        <toolitem action='ConnectedDTC'/>
                                    </placeholder>
                                </toolbar>
                            </ui>'''
                            
        self._create_action_group()
Exemplo n.º 8
0
    def __init__(self, app):
        Plugin.__init__(self)

        self.app = app

        self.ui_info = '''<ui>
                                <toolbar  name='ToolBar'>
                                    <placeholder name='DeviceToolItems'>
                                    <separator/>
                                        <toolitem action='ConnectedDTC'/>
                                    </placeholder>
                                </toolbar>
                            </ui>'''

        self._create_action_group()
Exemplo n.º 9
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)
        
        self.app = app
        self.dir = os.path.dirname(__file__)
        self.status = STATUS_STOP
        
        fname = os.path.join(self.dir, 'dtc_reader.ui')
        self._builder = gtk.Builder()
        self._builder.set_translation_domain('garmon')
        self._builder.add_from_file(fname)

        self._dtc_info = DTCInfo(self._builder)
        
        button = self._builder.get_object('re-read-button')
        button.connect('clicked', self._reread_button_clicked)
        
        hpaned = self._builder.get_object('hpaned')
        self.pack_start(hpaned, True, True)
        hpaned.set_border_width(5)

        dtc_frame = self._builder.get_object('dtc_frame')


        self.treemodel = gtk.ListStore(gobject.TYPE_STRING,
                                                        gobject.TYPE_STRING,
                                                        gobject.TYPE_STRING)
        treeview = gtk.TreeView(self.treemodel)
        treeview.set_rules_hint(True)
        #column = gtk.TreeViewColumn(_('Bits'), gtk.CellRendererText(),
        #                            text=COLUMN_CODE)
        #treeview.append_column(column)
        column = gtk.TreeViewColumn(_('DTC'), gtk.CellRendererText(),
                                    text=COLUMN_DTC)
        treeview.append_column(column)
        
        selection = treeview.get_selection()
        selection.set_mode(gtk.SELECTION_SINGLE)
        selection.connect("changed", self._on_selection_changed)

        dtc_frame.add(treeview)
        
        self.show_all()
        
        self._reset_cbid = app.connect("reset", self._on_reset)
        self._switch_cbid = app.notebook.connect('switch-page', 
                                              self._notebook_page_change_cb)
Exemplo n.º 10
0
    def __init__(self, app):
        Plugin.__init__(self)
        PropertyObject.__init__(self)

        self.app = app
	
        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._queue_cbs = []
        self._obd_cbs = []

        self.status = STATUS_STOP

        self._frames = []

        self._setup_gui()
Exemplo n.º 11
0
    def __init__ (self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)

        self.app = app
        
        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._scheduler_cbs = []
        self._obd_cbs = []
        
        if app.prefs.get('imperial', False):
            self._unit_standard = 'Imperial'
        else:
            self._unit_standard = 'Metric'
            
        cb_id = app.prefs.add_watch('imperial', 
                                    self._notify_units_cb)
        self._pref_cbs.append(('imperial', cb_id))

        self.status = STATUS_STOP

        self.views = []
        self.os_views = []

        self._setup_gui()
        self._setup_sensors()

        self._obd_cbs.append(app.device.connect('connected', 
                                             self._device_connected_cb))
        self._notebook_cbs.append(app.notebook.connect('switch-page', 
                                                  self._notebook_page_change_cb))
        
        self._scheduler_cbs.append(self.app.scheduler.connect('notify::working',
                                             self._scheduler_notify_working_cb))
        
        self._device_connected_cb(app.device)
Exemplo n.º 12
0
    def __init__(self, app):
        gtk.VBox.__init__(self)
        Plugin.__init__(self)

        self.app = app

        self._pref_cbs = []
        self._app_cbs = []
        self._notebook_cbs = []
        self._scheduler_cbs = []
        self._obd_cbs = []

        if app.prefs.get('imperial', False):
            self._unit_standard = 'Imperial'
        else:
            self._unit_standard = 'Metric'

        cb_id = app.prefs.add_watch('imperial', self._notify_units_cb)
        self._pref_cbs.append(('imperial', cb_id))

        self.status = STATUS_STOP

        self.views = []
        self.os_views = []

        self._setup_gui()
        self._setup_sensors()

        self._obd_cbs.append(
            app.device.connect('connected', self._device_connected_cb))
        self._notebook_cbs.append(
            app.notebook.connect('switch-page', self._notebook_page_change_cb))

        self._scheduler_cbs.append(
            self.app.scheduler.connect('notify::working',
                                       self._scheduler_notify_working_cb))

        self._device_connected_cb(app.device)