def __init__(self):
        bus_name = dbus.service.BusName('es.atareao.TouchpadIndicator',
                                        bus=dbus.SessionBus())
        dbus.service.Object.__init__(self, bus_name,
                                     '/es/atareao/TouchpadIndicator')
        self.about_dialog = None
        self.the_watchdog = None
        self.icon = comun.ICON
        self.active_icon = None
        self.attention_icon = None
        self.synclient = Synclient()
        self.syndaemon = Syndaemon()
        self.read_preferences()
        self.notification = Notify.Notification.new('', '', None)

        self.indicator = appindicator.Indicator.new ('Touchpad-Indicator',\
         self.active_icon, appindicator.IndicatorCategory.HARDWARE)
        self.indicator.set_attention_icon(self.attention_icon)

        if not self.start_hidden:
            self.indicator.set_status(appindicator.IndicatorStatus.ACTIVE)

        self.touchpad = Touchpad()

        menu = self.get_menu()
        self.indicator.set_menu(menu)
        self.indicator.connect('scroll-event', self.on_scroll)
        if self.touchpad.are_all_touchpad_enabled():
            self.change_state_item.set_label(_('Disable Touchpad'))
        else:
            self.change_state_item.set_label(_('Enable Touchpad'))
            if self.indicator.get_status(
            ) != appindicator.IndicatorStatus.PASSIVE:
                self.indicator.set_status(
                    appindicator.IndicatorStatus.ATTENTION)
        self.on_mouse_plugged_change(self.on_mouse_plugged)
        if self.touchpad.are_all_touchpad_enabled(
        ) and self.disable_touchpad_on_start_indicator:
            self.set_touch_enabled(False)
        configuration = Configuration()
        configuration.set('is_working', True)
        configuration.save()
Exemplo n.º 2
0
 def __init__(self):
     self.synclient = Synclient()