예제 #1
0
    def populate(self):
        def _end_populate():
            self.unset_loading()

        @queue_cb(callback=_end_populate, gtk=True)
        def _do_populate(devices):
            if not devices:
                logger.info("No devices")
                GObject.idle_add(self.set_no_devices_nearby)

            for idx, device in enumerate(devices):
                logger.info("Adding device {}".format(device))
                GObject.idle_add(self.add_device, device, idx)

        if not is_bluetooth_available():
            logger.info("No adapter")
            self.set_no_adapter_available()
            return

        self.set_loading()
        device_scan(_do_populate)
예제 #2
0
    def populate(self):
        def _end_populate():
            self.unset_loading()

        @queue_cb(callback=_end_populate, gtk=True)
        def _do_populate(devices):
            if not devices:
                logger.info("No devices")
                GObject.idle_add(self.set_no_devices_nearby)

            for idx, device in enumerate(devices):
                logger.info("Adding device {}".format(device))
                GObject.idle_add(self.add_device, device, idx)

        if not is_bluetooth_available():
            logger.info("No adapter")
            self.set_no_adapter_available()
            return

        self.set_loading()
        device_scan(_do_populate)
예제 #3
0
        for screen in self.itervalues():
            if screen.on_home_screen:
                displayed_screens.append(screen)

        return displayed_screens


SCREENS = ScreenCollection([
    Screen('keyboard', N_("Keyboard"), choose_keyboard_screen, screen_no=0,
           setting_param='Keyboard-country-human'),
    Screen('mouse', N_("Mouse"), SetMouse, screen_no=1, setting_param='Mouse'),
    Screen('audio', N_("Audio"), SetAudio, screen_no=2, setting_param='Audio'),
    Screen('display', N_("Display"), SetDisplay, screen_no=3),
    Screen('wifi', N_("WiFi"), SetWifi, screen_no=4),
    Screen('bluetooth', N_("Bluetooth"), BluetoothConfig,
           on_home_screen=is_bluetooth_available()),
    Screen('overclocking', N_("Overclocking"), SetOverclock, screen_no=5,
           setting_param='Overclocking'),
    Screen('account', N_("Account"), SetAccount, screen_no=6),
    Screen('appearance', N_("Style"), SetStyle, screen_no=7,
           on_home_screen=os.environ.get('DESKTOP_MODE'),
           setting_param='Wallpaper'),
    Screen('font', N_("Font"), SetFont, screen_no=8, setting_param='Font'),
    Screen('advanced', N_("Advanced"), SetAdvanced, screen_no=9),
    Screen('about', N_("About"), SetAbout, screen_no=10),
    Screen('notifications', N_("Notifications"), SetNotifications, screen_no=11),
    Screen('no-internet', N_("No-internet"), NoInternet, screen_no=12,
           on_home_screen=False),
    Screen('proxy', 'proxy', SetProxy, screen_no=13, on_home_screen=False),
    Screen('first-boot-set-wallpaper', 'first-boot-set-wallpaper',
           FirstBootSetWallpaper, screen_no=14, on_home_screen=False),
예제 #4
0
        for screen in self.itervalues():
            if screen.on_home_screen:
                displayed_screens.append(screen)

        return displayed_screens


SCREENS = ScreenCollection([
    Screen('keyboard', N_("Keyboard"), choose_keyboard_screen, screen_no=0,
           setting_param='Keyboard-country-human'),
    Screen('mouse', N_("Mouse"), SetMouse, screen_no=1, setting_param='Mouse'),
    Screen('audio', N_("Audio"), SetAudio, screen_no=2, setting_param='Audio'),
    Screen('display', N_("Display"), SetDisplay, screen_no=3),
    Screen('wifi', N_("WiFi"), SetWifi, screen_no=4),
    Screen('bluetooth', N_("Bluetooth"), BluetoothConfig,
           on_home_screen=is_bluetooth_available()),
    Screen('overclocking', N_("Overclocking"), SetOverclock, screen_no=5,
           setting_param='Overclocking'),
    Screen('account', N_("Account"), SetAccount, screen_no=6),
    Screen('appearance', N_("Style"), SetStyle, screen_no=7,
           on_home_screen=os.environ.get('DESKTOP_MODE'),
           setting_param='Wallpaper'),
    Screen('font', N_("Font"), SetFont, screen_no=8, setting_param='Font'),
    Screen('advanced', N_("Advanced"), SetAdvanced, screen_no=9),
    Screen('about', N_("About"), SetAbout, screen_no=10),
    Screen('notifications', N_("Notifications"), SetNotifications, screen_no=11),
    Screen('no-internet', N_("No-internet"), NoInternet, screen_no=12,
           on_home_screen=False),
    Screen('proxy', 'proxy', SetProxy, screen_no=13, on_home_screen=False),
    Screen('first-boot-set-wallpaper', 'first-boot-set-wallpaper',
           FirstBootSetWallpaper, screen_no=14, on_home_screen=False),