def __init__(self, handle):
        sugar3.activity.activity.Activity.__init__(self, handle)
        self.set_title(_("Typing Turtle"))
        self.max_participants = 1

        self.build_toolbox()

        self.screens = []
        self.screenbox = Gtk.VBox()

        self.nick = profile.get_nick_name()

        self.wordlist = []

        # All data which is saved in the Journal entry is placed in this dictionary.
        self.data = {'motd': 'welcome', 'history': [], 'medals': {}}

        # This calls the read_file method when restoring from the Journal.
        self.set_canvas(self.screenbox)

        # Start with the main screen.
        self.mainscreen = mainscreen.MainScreen(self)
        self.push_screen(self.mainscreen)

        self.show_all()

        self.editorbtn = sugar3.graphics.toolbutton.ToolButton('view-source')
        self.editorbtn.set_tooltip(_("Edit Lessons"))
        self.editorbtn.connect('clicked', self.editor_clicked_cb)

        activity_toolbar = self.toolbar_box.toolbar
        activity_toolbar.insert(self.editorbtn, 1)

        self.editorbtn.show_all()
    def __init__(self, handle):
        sugar.activity.activity.Activity.__init__(self, handle)
        self.set_title(_("Typing Turtle"))

        self.build_toolbox()

        self.screens = []
        self.screenbox = gtk.VBox()

        self.owner = presenceservice.get_instance().get_owner()

        # All data which is saved in the Journal entry is placed in this dictionary.
        self.data = {
            'motd': 'welcome',
            'level': 0,
            'history': [],
            'medals': {}
        }

        if DEBUG_LESSONS:
            self.data['level'] = 1000

        # This has to happen last, because it calls the read_file method when restoring from the Journal.
        self.set_canvas(self.screenbox)

        # Start with the main screen.
        self.mainscreen = mainscreen.MainScreen(self)
        self.push_screen(self.mainscreen)

        self.show_all()

        # Hide the sharing button from the activity toolbar since we don't support sharing.
        activity_toolbar = self.tbox.get_activity_toolbar()
        activity_toolbar.share.props.visible = False
예제 #3
0
 def add(self):
     self.add_widget(loginscreen.LoginScreen(name='LoginScreen'))
     self.add_widget(mainscreen.MainScreen(name='MainScreen'))
     self.add_widget(t)
     self.add_widget(pl)
     self.add_widget(a)
     self.add_widget(ac)
     self.add_widget(a2)
     self.add_widget(t2)
     self.add_widget(registerscreen.RegisterScreen(name='RegisterScreen'))