コード例 #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']))
コード例 #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 ),
          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']))
コード例 #3
0
ファイル: login.py プロジェクト: neela23/GCompris
    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"])
        )
コード例 #4
0
ファイル: wordlist.py プロジェクト: GNOME/gcompris
  def __init__(self, db_connect, db_cursor, profile):

    self.cur = db_cursor
    self.con = db_connect
    self.active_profile = profile

    files = glob.glob('wordlist_*.xml')

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

    self.prop = gcompris.get_properties()

    self.wordlist_dir = self.prop.shared_dir +'/wordlist'

    gcompris.textview('Words list',
                      'wordlist',
                      'Enter the words, comma, space, return separated. Then click on th check button.',
                      '',
                      self.wordlist_validate)
コード例 #5
0
ファイル: board_list.py プロジェクト: Goumez/GCompris
  def locales(self, button):
    conf_locales = self.get_configured(self.active_profile, 'locale', 'NULL')
    bconf = gcompris.configuration_window ( \
      _('<b>Locale</b> configuration\n for profile <b>{profile}</b>').\
        format(profile=self.active_profile.name),
      self.ok_callback
      )

    gcompris.combo_locales(bconf, conf_locales)
コード例 #6
0
  def locales(self, button):
    conf_locales = self.get_configured(self.active_profile, 'locale', 'NULL')
    bconf = gcompris.configuration_window ( \
      _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format(config='Locale',
                                                                               profile=self.active_profile.name),
      self.ok_callback
      )

    gcompris.combo_locales(bconf, conf_locales)
コード例 #7
0
    def locales(self, button):
        conf_locales = self.get_configured(self.active_profile, 'locale',
                                           'NULL')
        # Translators : Do not translate the token {profile}
        bconf = gcompris.configuration_window ( \
          _('<b>Locale</b> configuration\n for profile <b>{profile}</b>').\
            format(profile=self.active_profile.name),
          self.ok_callback
          )

        gcompris.combo_locales(bconf, conf_locales)
コード例 #8
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']))
コード例 #9
0
ファイル: board_list.py プロジェクト: laya/gcompris-1
    def locales_sound(self, button):

        conf_locales = self.get_configured(self.active_profile, 'locale_sound',
                                           'NULL')
        bconf = gcompris.configuration_window ( \
          _('<b>Locale sound</b> configuration\n for profile <b>{profile}</b>').\
            format(profile=self.active_profile.name),
          self.ok_callback
          )

        gcompris.combo_locales_asset(bconf, _("Select sound locale"),
                                     conf_locales,
                                     "voices/$LOCALE/colors/red.ogg")
コード例 #10
0
ファイル: board_list.py プロジェクト: Goumez/GCompris
  def locales_sound(self, button):

    conf_locales = self.get_configured(self.active_profile,
                                       'locale_sound', 'NULL')
    bconf = gcompris.configuration_window ( \
      _('<b>Locale sound</b> configuration\n for profile <b>{profile}</b>').\
        format(profile=self.active_profile.name),
      self.ok_callback
      )

    gcompris.combo_locales_asset( bconf,
                                  _("Select sound locale"),
                                  conf_locales,
                                  "voices/$LOCALE/colors/red.ogg" )
コード例 #11
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")
コード例 #12
0
ファイル: lang.py プロジェクト: GNOME/gcompris
  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")
コード例 #13
0
ファイル: tuxpaint.py プロジェクト: GNOME/gcompris
  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']))
コード例 #14
0
ファイル: login.py プロジェクト: GNOME/gcompris
  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'])
                                        )
コード例 #15
0
    def __init__(self, db_connect, db_cursor, profile):

        self.cur = db_cursor
        self.con = db_connect
        self.active_profile = profile

        files = glob.glob('wordlist_*.xml')

        self.main_vbox = gcompris.configuration_window ( \
          _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format(config='Wordlist',
                                                                                   profile=self.active_profile.name),
          self.wordlist_callback
          )

        self.prop = gcompris.get_properties()

        self.wordlist_dir = self.prop.shared_dir + '/wordlist'

        gcompris.textview(
            'Words list', 'wordlist',
            'Enter the words, comma, space, return separated. Then click on th check button.',
            '', self.wordlist_validate)
コード例 #16
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")
コード例 #17
0
ファイル: pythontest.py プロジェクト: afenkart/gcompris-devel
  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)