blob: 05904bcb81888963fb9ee82fef664a2c897f3c0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# python import
import logging
from gettext import gettext as _
# gtk import
import gobject
# ...
gobject.threads_init()
# sugar import
from sugar.activity import activity
# atoidepoc import
from atoidepoc.ui import screens, toolbar
# get application logger
logger = logging.getLogger('atoidepoc')
logger.setLevel(logging.DEBUG)
class AToiDePocActivity(activity.Activity):
def __init__(self, handle):
# init parent
activity.Activity.__init__(self, handle)
self.max_participants = 1
# get toolbox
_toolbox = activity.ActivityToolbox(self)
# add tool bars
self.set_toolbox(_toolbox)
# show
_toolbox.show()
# init toolbars
for _n in ['story']: # , 'graphic', 'sound'
# init toolbar
_t = toolbar.Toolbar(self, name=_n)
# if default toolbar .. set default screen
if _n == 'story':
screens.ScreenStory(_t)
# set default tab
_toolbox.set_current_toolbar(1)
# DEBUG
logger.debug('[activity] init - started ...')
def read_file(self, file_path):
'''Dummy overiding ...
'''
# DEBUG
logger.debug('[activity] read_file - file_path: %s' % file_path)
def write_file(self, file_path):
'''Dummy overiding ...
'''
# DEBUG
logger.debug('[activity] write_file - file_path: %s' % file_path)
def close(self, skip_save=False):
# DEBUG
activity.Activity.close(self, skip_save=True)
|