def _you_are_connected_via_ethernet(self):
            self.remove_main_widget()
            title = _("You are already connected via ethernet.")
            description = _("Do you still want to connect with WiFi?")

            # Decide which callback to use depending on if wifi dongle is
            # plugged in
            buttons = [
                {
                    'label': _("NO"),
                    'color': 'red',
                    'callback': Gtk.main_quit,
                    'type': 'KanoButton'
                },
                {
                    'label': _("YES"),
                    'color': 'green',
                    'callback': self._ethernet_next_step,
                    'type': 'KanoButton',
                    'focus': True
                }
            ]

            img_path = os.path.join(img_dir, "ethernet-2.png")

            screen = Template(
                title,
                description,
                buttons,
                self.is_plug(),
                img_path
            )
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
        def _you_have_internet_screen(self, wiface):
            self.remove_main_widget()
            title = _("You already have internet!")
            description = _("Do you want to change network?")
            buttons = [
                {
                    'label': _("NO"),
                    'color': 'red',
                    'callback': Gtk.main_quit,
                    'type': 'KanoButton'
                },
                {
                    'label': _("YES"),
                    'color': 'green',
                    'callback': self.refresh_networks,
                    'type': 'KanoButton',
                    'focus': True
                }
            ]
            img_path = os.path.join(img_dir, "internet.png")

            screen = Template(
                title,
                description,
                buttons,
                self.is_plug(),
                img_path
            )
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
        def _plug_in_wifi_dongle(self):
            self.remove_main_widget()
            title = _("You don't seem to have a WiFi dongle\nplugged in.")
            description = _("Plug one in and try again")
            buttons = [
                {
                    'label': ""
                },
                {
                    'label': _("TRY AGAIN"),
                    'color': 'green',
                    'callback': self._launch_application,
                    'type': 'KanoButton',
                    'focus': True
                },
                {
                    'label': _("Skip"),
                    'callback': Gtk.main_quit,
                    'type': 'OrangeButton'
                }
            ]

            img_path = os.path.join(img_dir, "dongle2.png")

            screen = Template(
                title,
                description,
                buttons,
                self.is_plug(),
                img_path
            )
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
    def _fail_screen(self, win):
        win.remove_main_widget()
        title = _("Cannot connect!")
        description = _("Maybe the signal was too weak to connect.")
        buttons = [
            {
                'label': ""
            },
            {
                'label': _("TRY AGAIN"),
                'type': 'KanoButton',
                'color': 'green',
                # Go to the network refresh screen
                'callback': self._go_to_network_screen
            },
            {
                'label': _("QUIT"),
                'type': 'OrangeButton',
                'callback': Gtk.main_quit
            }
        ]
        img_path = os.path.join(img_dir, "no-wifi.png")

        win.set_main_widget(
            Template(
                title,
                description,
                buttons,
                win.is_plug(),
                img_path
            )
        )
    def _weak_signal_screen(self):
        '''
        The network cannot be joined because the signal is too weak.
        Show an error message dialog, so the user can easily fix and retry.
        '''
        self._win.remove_main_widget()
        title = _("Cannot connect!")
        description = _("Maybe the signal was too weak to connect.")
        buttons = [
            {
                'label': ""
            },
            {
                'label': _("TRY AGAIN"),
                'type': 'KanoButton',
                'color': 'green',
                # Go to the network refresh screen
                'callback': self._go_to_spinner_screen
            },
            {
                'label': _("QUIT"),
                'type': 'OrangeButton',
                'callback': Gtk.main_quit
            }
        ]
        img_path = os.path.join(img_dir, "no-wifi.png")

        self._win.set_main_widget(
            Template(title, description, buttons, self._win.is_plug(),
                     img_path))
 def _disconnect_screen(self):
     self._win.remove_main_widget()
     title = _("Disconnect complete.")
     description = _("You're now offline")
     buttons = [
         {
             'label': _("CLOSE"),
             'type': 'KanoButton',
             'color': 'red',
             'callback': Gtk.main_quit
         },
         {
             'label': _("CONNECT"),
             'type': 'KanoButton',
             'color': 'green',
             'callback': self._go_to_spinner_screen
         }
     ]
     img_path = os.path.join(img_dir, "no-wifi.png")
     self._win.set_main_widget(
         Template(
             title,
             description,
             buttons,
             self._win.is_plug(),
             img_path
         )
     )
        def _you_have_internet_screen(self, wiface):
            self.remove_main_widget()
            title = _("You already have internet!")
            description = _("Do you want to change network?")
            buttons = [
                {"label": _("NO"), "color": "red", "callback": Gtk.main_quit, "type": "KanoButton"},
                {
                    "label": _("YES"),
                    "color": "green",
                    "callback": self.refresh_networks,
                    "type": "KanoButton",
                    "focus": True,
                },
            ]
            img_path = os.path.join(img_dir, "internet.png")

            screen = Template(title, description, buttons, self.is_plug(), img_path)
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
        def _you_have_internet_screen(self, wiface):
            self.remove_main_widget()
            title = _("You already have internet!")
            description = _("Do you want to change network?")
            buttons = [
                {
                    'label': _("NO"),
                    'color': 'red',
                    'callback': Gtk.main_quit,
                    'type': 'KanoButton'
                },
                {
                    'label': _("YES"),
                    'color': 'green',
                    'callback': self.refresh_networks,
                    'type': 'KanoButton',
                    'focus': True
                }
            ]
            img_path = os.path.join(img_dir, "internet.png")

            screen = Template(
                title,
                description,
                buttons,
                self.is_plug(),
                img_path
            )
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
        def _you_are_connected_via_ethernet(self):
            self.remove_main_widget()
            title = _("You are already connected via ethernet.")
            description = _("Do you still want to connect with WiFi?")

            # Decide which callback to use depending on if wifi dongle is
            # plugged in
            buttons = [
                {
                    'label': _("NO"),
                    'color': 'red',
                    'callback': Gtk.main_quit,
                    'type': 'KanoButton'
                },
                {
                    'label': _("YES"),
                    'color': 'green',
                    'callback': self._ethernet_next_step,
                    'type': 'KanoButton',
                    'focus': True
                }
            ]

            img_path = os.path.join(img_dir, "ethernet-2.png")

            screen = Template(
                title,
                description,
                buttons,
                self.is_plug(),
                img_path
            )
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
Exemple #10
0
        def _plug_in_wifi_dongle(self):
            self.remove_main_widget()
            title = _("You don't seem to have a WiFi dongle\nplugged in.")
            description = _("Plug one in and try again")
            buttons = [
                {
                    'label': ""
                },
                {
                    'label': _("TRY AGAIN"),
                    'color': 'green',
                    'callback': self._launch_application,
                    'type': 'KanoButton',
                    'focus': True
                },
                {
                    'label': _("Skip"),
                    'callback': Gtk.main_quit,
                    'type': 'OrangeButton'
                }
            ]

            img_path = os.path.join(img_dir, "dongle2.png")

            screen = Template(
                title,
                description,
                buttons,
                self.is_plug(),
                img_path
            )
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
        def _plug_in_wifi_dongle(self):
            self.remove_main_widget()
            title = _("You don't seem to have a WiFi dongle\nplugged in.")
            description = _("Plug one in and try again")
            buttons = [
                {"label": ""},
                {
                    "label": _("TRY AGAIN"),
                    "color": "green",
                    "callback": self._launch_application,
                    "type": "KanoButton",
                    "focus": True,
                },
                {"label": _("Skip"), "callback": Gtk.main_quit, "type": "OrangeButton"},
            ]

            img_path = os.path.join(img_dir, "dongle2.png")

            screen = Template(title, description, buttons, self.is_plug(), img_path)
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
        def _you_are_connected_via_ethernet(self):
            self.remove_main_widget()
            title = _("You are already connected via ethernet.")
            description = _("Do you still want to connect with WiFi?")

            # Decide which callback to use depending on if wifi dongle is
            # plugged in
            buttons = [
                {"label": _("NO"), "color": "red", "callback": Gtk.main_quit, "type": "KanoButton"},
                {
                    "label": _("YES"),
                    "color": "green",
                    "callback": self._ethernet_next_step,
                    "type": "KanoButton",
                    "focus": True,
                },
            ]

            img_path = os.path.join(img_dir, "ethernet-2.png")

            screen = Template(title, description, buttons, self.is_plug(), img_path)
            self.set_main_widget(screen)
            screen.button_grab_focus()
            screen.show_all()
Exemple #13
0
    def _success_screen(self):
        self._win.remove_main_widget()
        title = _("Success")
        description = _("You're connected")
        buttons = [{
            'label': _("OK"),
            'type': 'KanoButton',
            'color': 'green',
            'callback': Gtk.main_quit
        }]
        img_path = os.path.join(img_dir, "internet.png")

        self._win.set_main_widget(
            Template(title, description, buttons, self._win.is_plug(),
                     img_path))