Exemplo n.º 1
0
  def config_start(self, profile):
    self.configure_profile = profile

    #get default values
    self.config_dict = self.init_config()

    #set already configured values
    self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

    bconfig = gcompris.configuration_window(_('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Tuxpaint', profile.name ),
                                                   self.apply_callback)


    gcompris.boolean_box(bconfig, _('Inherit fullscreen setting from GCompris'), 'fullscreen', eval(self.config_dict['fullscreen']))

    gcompris.separator(bconfig)

    gcompris.boolean_box(bconfig, _('Inherit size setting from GCompris (800x600, 640x480)'), 'size', eval(self.config_dict['size']))

    gcompris.separator(bconfig)

    gcompris.boolean_box(bconfig, _('Disable shape rotation'), 'disable_shape_rotation', eval(self.config_dict['disable_shape_rotation']))

    gcompris.separator(bconfig)

    gcompris.boolean_box(bconfig, _('Show Uppercase text only'), 'uppercase_text', eval(self.config_dict['uppercase_text']))

    gcompris.separator(bconfig)

    stamps = gcompris.boolean_box(bconfig, _('Disable stamps'), 'disable_stamps', eval(self.config_dict['disable_stamps']))
    stamps.connect("toggled", self.stamps_changed)

    self.stamps_control = gcompris.boolean_box(bconfig, 'Disable stamps control', 'disable_stamps_control', eval(self.config_dict['disable_stamps_control']))
    self.stamps_control.set_sensitive(not eval(self.config_dict['disable_stamps']))
Exemplo n.º 2
0
    def config_start(self, profile):
        # keep profile in mind
        self.configuring_profile = profile

        # init with default values
        self.config_dict = self.init_config()

        # get the configured values for that profile
        self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

        # Init configuration window:
        # all the configuration functions will use it
        # all the configuration functions returns values for their key in
        # the dict passed to the apply_callback
        # the returned value is the main GtkVBox of the window,
        # we can add what you want in it.

        bconf = gcompris.configuration_window(
            _("<b>%s</b> configuration\n for profile <b>%s</b>") % ("Login", (profile.name if profile else "")),
            self.ok_callback,
        )

        # toggle box
        uppercase = gcompris.boolean_box(
            bconf, _("Uppercase only text"), "uppercase_only", eval(self.config_dict["uppercase_only"])
        )

        # uppercase.set_sensitive(False)

        gcompris.separator(bconf)

        # toggle box
        entry_text = gcompris.boolean_box(
            bconf, _("Enter login to log in"), "entry_text", eval(self.config_dict["entry_text"])
        )
Exemplo n.º 3
0
    def config_start(self, profile):
        # keep profile in mind
        self.configuring_profile = profile

        # init with default values
        self.config_dict = self.init_config()

        #get the configured values for that profile
        self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

        # Init configuration window:
        # all the configuration functions will use it
        # all the configuration functions returns values for their key in
        # the dict passed to the apply_callback
        # the returned value is the main GtkVBox of the window,
        #we can add what you want in it.

        bconf = gcompris.configuration_window ( \
          _('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Login', profile.name ),
          self.ok_callback
          )

        # toggle box
        uppercase = gcompris.boolean_box(
            bconf, _('Uppercase only text'), 'uppercase_only',
            eval(self.config_dict['uppercase_only']))

        #uppercase.set_sensitive(False)

        gcompris.separator(bconf)

        # toggle box
        entry_text = gcompris.boolean_box(bconf, _('Enter login to log in'),
                                          'entry_text',
                                          eval(self.config_dict['entry_text']))
Exemplo n.º 4
0
    def config_start(self, profile):
        self.configure_profile = profile

        #get default values
        self.config_dict = self.init_config()

        #set already configured values
        self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

        # Translators : Do not translate the token {profile}
        bconfig = gcompris.configuration_window( \
          _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format( \
                            config='Tuxpaint',
                            # This is the name of the Default user profile
                            profile=profile.name if profile else _("Default")),
          self.apply_callback
          )

        gcompris.boolean_box(bconfig,
                             _('Inherit fullscreen setting from GCompris'),
                             'fullscreen',
                             eval(self.config_dict['fullscreen']))

        gcompris.separator(bconfig)

        gcompris.boolean_box(
            bconfig,
            _('Inherit size setting from GCompris (800x600, 640x480)'), 'size',
            eval(self.config_dict['size']))

        gcompris.separator(bconfig)

        gcompris.boolean_box(bconfig, _('Disable shape rotation'),
                             'disable_shape_rotation',
                             eval(self.config_dict['disable_shape_rotation']))

        gcompris.separator(bconfig)

        gcompris.boolean_box(bconfig, _('Show Uppercase text only'),
                             'uppercase_text',
                             eval(self.config_dict['uppercase_text']))

        gcompris.separator(bconfig)

        stamps = gcompris.boolean_box(bconfig, _('Disable stamps'),
                                      'disable_stamps',
                                      eval(self.config_dict['disable_stamps']))
        stamps.connect("toggled", self.stamps_changed)

        self.stamps_control = gcompris.boolean_box(
            bconfig, 'Disable stamps control', 'disable_stamps_control',
            eval(self.config_dict['disable_stamps_control']))
        self.stamps_control.set_sensitive(
            not eval(self.config_dict['disable_stamps']))
Exemplo n.º 5
0
    def config_start(self, profile):
        # keep profile in mind
        # profile can be Py_None
        self.configuring_profile = profile

        # init with default values
        self.config_dict = self.init_config()

        # get the configured values for that profile
        self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

        bconf = gcompris.configuration_window ( \
          _('Configuration\n for profile <b>%s</b>')
          % ( (profile.name if profile else _("Default") ) ),
          self.ok_callback
          )

        gcompris.combo_locales_asset(bconf, _("Select locale"),
                                     self.config_dict['locale_sound'],
                                     "voices/$LOCALE/words/red.ogg")
Exemplo n.º 6
0
  def config_start(self, profile):
    # keep profile in mind
    # profile can be Py_None
    self.configuring_profile = profile

    # init with default values
    self.config_dict = self.init_config()

    # get the configured values for that profile
    self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

    bconf = gcompris.configuration_window ( \
      _('Configuration\n for profile <b>%s</b>')
      % ( (profile.name if profile else _("Default") ) ),
      self.ok_callback
      )

    gcompris.combo_locales_asset(bconf, _("Select locale"),
                                 self.config_dict['locale_sound'],
                                 "voices/$LOCALE/words/red.ogg")
Exemplo n.º 7
0
  def config_start(self, profile):
    self.configure_profile = profile

    #get default values
    self.config_dict = self.init_config()

    #set already configured values
    self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

    # Translators : Do not translate the token {profile}
    bconfig = gcompris.configuration_window( \
      _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format( \
                        config='Tuxpaint',
                        # This is the name of the Default user profile
                        profile=profile.name if profile else _("Default")),
      self.apply_callback
      )


    gcompris.boolean_box(bconfig, _('Inherit fullscreen setting from GCompris'), 'fullscreen', eval(self.config_dict['fullscreen']))

    gcompris.separator(bconfig)

    gcompris.boolean_box(bconfig, _('Inherit size setting from GCompris (800x600, 640x480)'), 'size', eval(self.config_dict['size']))

    gcompris.separator(bconfig)

    gcompris.boolean_box(bconfig, _('Disable shape rotation'), 'disable_shape_rotation', eval(self.config_dict['disable_shape_rotation']))

    gcompris.separator(bconfig)

    gcompris.boolean_box(bconfig, _('Show Uppercase text only'), 'uppercase_text', eval(self.config_dict['uppercase_text']))

    gcompris.separator(bconfig)

    stamps = gcompris.boolean_box(bconfig, _('Disable stamps'), 'disable_stamps', eval(self.config_dict['disable_stamps']))
    stamps.connect("toggled", self.stamps_changed)

    self.stamps_control = gcompris.boolean_box(bconfig, 'Disable stamps control', 'disable_stamps_control', eval(self.config_dict['disable_stamps_control']))
    self.stamps_control.set_sensitive(not eval(self.config_dict['disable_stamps']))
Exemplo n.º 8
0
  def config_start(self, profile):
    # keep profile in mind
    self.configuring_profile = profile

    # init with default values
    self.config_dict = self.init_config()

    # get the configured values for that profile
    self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

    # Init configuration window:
    # all the configuration functions will use it
    # all the configuration functions returns values for their key in
    # the dict passed to the apply_callback
    # the returned value is the main GtkVBox of the window,
    #we can add what you want in it.

    bconf = gcompris.configuration_window ( \
      _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format( \
                        config='Login',
                        # This is the name of the Default user profile
                        profile=profile.name if profile else _("Default")),
      self.ok_callback
      )

    # toggle box
    uppercase = gcompris.boolean_box(bconf, _('Uppercase only text'),
                                        'uppercase_only',
                                        eval(self.config_dict['uppercase_only'])
                                        )

    #uppercase.set_sensitive(False)

    gcompris.separator(bconf)

    # toggle box
    entry_text = gcompris.boolean_box(bconf, _('Enter login to log in'),
                                        'entry_text',
                                        eval(self.config_dict['entry_text'])
                                        )
Exemplo n.º 9
0
  def config_start(self, profile):
    # keep profile in mind
    # profile can be Py_None
    self.configuring_profile = profile

    # init with default values
    self.config_dict = self.init_config()

    #get the configured values for that profile
    self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

    # Init configuration window:
    # all the configuration functions will use it
    # all the configuration functions returns values for their key in
    # the dict passed to the apply_callback
    # the returned value is the main GtkVBox of the window,
    #we can add what you want in it.

    bconf = gcompris.configuration_window ( \
      _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format( \
                        config='Pythontest',
                        # This is the name of the Default user profile
                        profile=profile.name if profile else _("Default")),
      self.ok_callback
      )

    # toggle box
    control_line = gcompris.boolean_box(bconf, _('Disable line drawing in circle'),
                                        'disable_line',
                                        eval(self.config_dict['disable_line'])
                                        )
    # sample of control in python
    control_line.connect("toggled", self.color_disable)

    # combo box
    self.color_choice = \
       gcompris.combo_box(bconf, _('Color of the line'),
                          self.config_colors_list,
                          'color_line',
                          self.config_dict['color_line']
                          )
    self.color_choice.set_sensitive(not eval(self.config_dict['disable_line']))

    gcompris.separator(bconf)

    #spin button for int
    self.distance_box = \
       gcompris.spin_int(bconf, _('Distance between circles'),
                         'distance_circle',
                         20,
                         200,
                         20,
                         eval(self.config_dict['distance_circle'])
                         )

    gcompris.separator(bconf)

    #radio buttons for circle or rectangle
    patterns = { 'circle': _('Use circles'),
                 'rectangle': _('Use rectangles')
                 }

    # FIXME radio button makes the configuration unstable
    #       the problem is perhaps in the C code but since
    #       no one use it, let's forget it for now.
    # gcompris.radio_buttons(bconf, _('Choice of pattern'),
    #                        'pattern',
    #                        patterns,
    #                        self.config_dict['pattern']
    #                        )

    print "List of locales shown in gcompris.combo_locale :"
    print gcompris.get_locales_list()

    gcompris.separator(bconf)

    gcompris.combo_locales(bconf, self.config_dict['locale'])

    gcompris.separator(bconf)

    print "List of locales shown in gcompris.combo_locales_asset :"
    locales_purple = gcompris.get_locales_asset_list( "purple.ogg" )
    print locales_purple

    gcompris.combo_locales_asset(bconf, _("Select sound locale"),
                                 self.config_dict['locale_sound'],
                                 "voices/$LOCALE/colors/red.ogg")
Exemplo n.º 10
0
  def config_start(self, profile):
    # keep profile in mind
    # profile can be Py_None
    self.configuring_profile = profile

    # init with default values
    self.config_dict = self.init_config()

    #get the configured values for that profile
    self.config_dict.update(gcompris.get_conf(profile, self.gcomprisBoard))

    # Init configuration window:
    # all the configuration functions will use it
    # all the configuration functions returns values for their key in
    # the dict passed to the apply_callback
    # the returned value is the main GtkVBox of the window,
    #we can add what you want in it.

    bconf = gcompris.configuration_window ( \
      _('<b>%s</b> configuration\n for profile <b>%s</b>') % ('Pythontest', profile.name ),
      self.ok_callback
      )

    # toggle box
    control_line = gcompris.boolean_box(bconf, _('Disable line drawing in circle'),
                                        'disable_line',
                                        eval(self.config_dict['disable_line'])
                                        )
    # sample of control in python
    control_line.connect("toggled", self.color_disable)

    # combo box
    self.color_choice = \
       gcompris.combo_box(bconf, _('Color of the line'),
                          self.config_colors_list,
                          'color_line',
                          self.config_dict['color_line']
                          )
    self.color_choice.set_sensitive(not eval(self.config_dict['disable_line']))

    gcompris.separator(bconf)

    #spin button for int
    self.distance_box = \
       gcompris.spin_int(bconf, _('Distance between circles'),
                         'distance_circle',
                         20,
                         200,
                         20,
                         eval(self.config_dict['distance_circle'])
                         )

    gcompris.separator(bconf)

    #radio buttons for circle or rectangle
    patterns = { 'circle': _('Use circles'),
                 'rectangle': _('Use rectangles')
                 }

    gcompris.radio_buttons(bconf, _('Choice of pattern'),
                           'pattern',
                           patterns,
                           self.config_dict['pattern']
                           )

    print "List of locales shown in gcompris.combo_locale :"
    print gcompris.get_locales_list()

    gcompris.separator(bconf)

    gcompris.combo_locales(bconf, self.config_dict['locale'])

    gcompris.separator(bconf)

    print "List of locales shown in gcompris.combo_locales_asset :"
    locales_purple = gcompris.get_locales_asset_list( "gcompris colors", None, "audio/x-ogg", "purple.ogg")
    print locales_purple

    label = gtk.Label()
    label.set_markup('<i>-- unused, but here for test --</i>')
    label.props.visibility = goocanvas.ITEM_VISIBLE
#    self.main_vbox.pack_start (label, False, False, 8)

    gcompris.combo_locales_asset(bconf, _("Select sound locale"),
                                 self.config_dict['locale_sound'],
                                 "voices/$LOCALE/colors/red.ogg" )

    print gcompris.utils.get_asset_file ("gcompris colors", None, "audio/x-ogg", "purple.ogg")
    print gcompris.utils.get_asset_file_locale ("gcompris colors", None, "audio/x-ogg", "purple.ogg", None)
    for lang in locales_purple:
      print gcompris.utils.get_asset_file_locale ("gcompris colors", None, "audio/x-ogg", "purple.ogg", lang)