Example #1
0
    def __init__(self, win):

        self.win = win
        self.win.set_decorated(False)

        img_width = 590
        img_height = 270

        header = _("Oops! You need Internet to make a profile")
        subheader = _(
            "But you can skip this if you have no connection right now")
        image_filename = get_image('login', "", 'no-internet',
                                   str(img_width) + 'x' + str(img_height))
        kano_button_label = _("CONNECT")
        orange_button_label = _("Register later")

        Template.__init__(self, image_filename, header, subheader,
                          kano_button_label, orange_button_label)

        self.win.set_main_widget(self)
        self.kano_button.connect('button_release_event', self.connect)

        # Since cannot pass with keyboard, set it so it cannot receive
        # keyboard focus
        self.kano_button.set_can_focus(False)

        self.orange_button.connect('button_release_event', self.register_later)
        self.kano_button.grab_focus()
        self.win.show_all()
Example #2
0
    def __init__(self):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        kano_button_text = _("CREATE")
        skip_button_text = _("Skip")
        login_button_text = _("I have a profile")
        header = _('Keep your creations safe')
        subheader = _(
            'Create a Kano World account so you never lose your progress...\n'
            'and to get inspired by creations from the community')
        img_width = 590
        img_height = 270

        self.skip_button = OrangeButton(skip_button_text)
        self.login_button = OrangeButton(login_button_text)

        image_filename = get_image('login', "", 'first-screen',
                                   str(img_width) + 'x' + str(img_height))
        self.image = Gtk.Image.new_from_file(image_filename)
        self.pack_start(self.image, False, False, 0)

        self.heading = Heading(header, subheader)
        self.kano_button = KanoButton(kano_button_text)

        self.pack_start(self.heading.container, False, False, 0)

        self.button_box = Gtk.ButtonBox(spacing=10)
        self.button_box.set_layout(Gtk.ButtonBoxStyle.SPREAD)
        self.pack_start(self.button_box, False, False, 0)

        self.button_box.pack_start(self.login_button, False, False, 0)
        self.button_box.pack_start(self.kano_button, False, False, 0)
        self.button_box.pack_start(self.skip_button, False, False, 0)
Example #3
0
    def __init__(self):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        kano_button_text = _("CREATE")
        skip_button_text = _("Skip")
        login_button_text = _("I have a profile")
        header = _("Now let's make your online Profile")
        subheader = _("So you can save badges, games, and projects")
        img_width = 590
        img_height = 270

        self.skip_button = OrangeButton(skip_button_text)
        self.login_button = OrangeButton(login_button_text)

        image_filename = get_image(
            'login', "", 'first-screen', str(img_width) + 'x' + str(img_height)
        )
        self.image = Gtk.Image.new_from_file(image_filename)
        self.pack_start(self.image, False, False, 0)

        self.heading = Heading(header, subheader)
        self.kano_button = KanoButton(kano_button_text)

        self.pack_start(self.heading.container, False, False, 0)

        self.button_box = Gtk.ButtonBox(spacing=10)
        self.button_box.set_layout(Gtk.ButtonBoxStyle.SPREAD)
        self.pack_start(self.button_box, False, False, 0)

        self.button_box.pack_start(self.login_button, False, False, 0)
        self.button_box.pack_start(self.kano_button, False, False, 0)
        self.button_box.pack_start(self.skip_button, False, False, 0)
Example #4
0
    def __init__(self, win):

        self.win = win
        self.win.set_decorated(False)

        img_width = 590
        img_height = 270

        header = _("Oops! You need Internet to make a profile")
        subheader = _(
            "But you can skip this if you have no connection right now"
        )
        image_filename = get_image('login', "", 'no-internet',
                                   str(img_width) + 'x' + str(img_height))
        kano_button_label = _("CONNECT")
        orange_button_label = _("Register later")

        Template.__init__(self, image_filename, header, subheader,
                          kano_button_label, orange_button_label)

        self.win.set_main_widget(self)
        self.kano_button.connect('button_release_event', self.connect)

        # Since cannot pass with keyboard, set it so it cannot receive
        # keyboard focus
        self.kano_button.set_can_focus(False)

        self.orange_button.connect('button_release_event', self.register_later)
        self.kano_button.grab_focus()
        self.win.show_all()
    def __init__(self):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL)

        kano_button_text = _("CREATE")
        skip_button_text = _("Skip")
        login_button_text = _("I have a profile")
        header = _('Keep your creations safe')
        subheader = _(
            'Create a Kano World account so you never lose your progress...\n'
            'and to get inspired by creations from the community'
        )
        img_width = 590
        img_height = 270

        self.skip_button = OrangeButton(skip_button_text)
        self.login_button = OrangeButton(login_button_text)

        image_filename = get_image(
            'login', "", 'first-screen', str(img_width) + 'x' + str(img_height)
        )
        self.image = Gtk.Image.new_from_file(image_filename)
        self.pack_start(self.image, False, False, 0)

        self.heading = Heading(header, subheader)
        self.kano_button = KanoButton(kano_button_text)

        self.pack_start(self.heading.container, False, False, 0)

        self.button_box = Gtk.ButtonBox(spacing=10)
        self.button_box.set_layout(Gtk.ButtonBoxStyle.SPREAD)
        self.pack_start(self.button_box, False, False, 0)

        self.button_box.pack_start(self.login_button, False, False, 0)
        self.button_box.pack_start(self.kano_button, False, False, 0)
        self.button_box.pack_start(self.skip_button, False, False, 0)
    def __init__(self, win):

        # Set window
        self.win = win
        self.win.set_decorated(False)
        self.win.set_resizable(True)

        # Set text depending on login
        login = is_registered()
        if login:
            header = _("Profile activated!")
            subheader = _(
                u"Now you can share stuff, build your character, " \
                u"and connect with friends! You've earned some " \
                u"rewards\N{HORIZONTAL ELLIPSIS}"
            )
            image_name = 'profile-created'
            button_label = _("LET'S GO")
        else:
            header = _("No online profile - for now.")
            subheader = _(
                "Your profile stores all your rewards, projects, and " \
                "challenges. But fear not - we'll save everything for " \
                "when you have internet."
            )
            image_name = 'no-profile-new'
            button_label = _("LET'S GO")

        # Set image
        img_width = 590
        img_height = 270
        image_filename = get_image(
            'login', '', image_name, str(img_width) + 'x' + str(img_height)
        )

        # Create template
        Template.__init__(self, image_filename, header, subheader,
                          button_label, "")

        self.win.set_main_widget(self)
        self.kano_button.connect('button_release_event', self.next_screen)
        self.kano_button.connect('key_release_event', self.next_screen)
        self.kano_button.grab_focus()
        self.win.show_all()

        # Force the cross button to hide
        self.win.headerbar.close_button.hide()
Example #7
0
    def __init__(self, win):

        # Set window
        self.win = win
        self.win.set_decorated(False)
        self.win.set_resizable(True)

        # Set text depending on login
        login = is_registered()
        if login:
            header = _("Profile activated!")
            subheader = _(
                u"Now you can share stuff, build your character, " \
                u"and connect with friends! You've earned some " \
                u"rewards\N{HORIZONTAL ELLIPSIS}"
            )
            image_name = 'profile-created'
            button_label = _("LET'S GO")
        else:
            header = _("No online profile - for now.")
            subheader = _(
                "Your profile stores all your rewards, projects, and " \
                "challenges. But fear not - we'll save everything for " \
                "when you have internet."
            )
            image_name = 'no-profile-new'
            button_label = _("LET'S GO")

        # Set image
        img_width = 590
        img_height = 270
        image_filename = get_image('login', '', image_name,
                                   str(img_width) + 'x' + str(img_height))

        # Create template
        Template.__init__(self, image_filename, header, subheader,
                          button_label, "")

        self.win.set_main_widget(self)
        self.kano_button.connect('button_release_event', self.next_screen)
        self.kano_button.connect('key_release_event', self.next_screen)
        self.kano_button.grab_focus()
        self.win.show_all()

        # Force the cross button to hide
        self.win.headerbar.close_button.hide()