コード例 #1
0
    def build_widget(self):
        ew = EditWidget(self.options.__setitem__, self.options.get)
        ew.set_name(_("Initial Advene configuration"))
        ew.add_label(
            _("<span size='large'><b>Welcome in Advene</b>\nThis is the first time that you run Advene. Please answer some basic configuration questions. You will be able to modify these choices from the Advene interface, in the Edit/Preferences menu.</span>"
              ))
        ew.add_option(_("Interface language"), 'language',
                      _("Language used for the interface"), {
                          "English": 'C',
                          "Francais": 'fr_FR',
                          _("System default"): '',
                      })
        ew.add_checkbox(
            _("Weekly check for Advene updates on the Advene website"),
            'update-check',
            _("Weekly check for updates on the Advene website"))

        ew.add_dir_selector(
            _("Preferred directory for data files"), "data",
            _("Preferred directory for storing data files (Advene packages)"))
        #ew.add_dir_selector(_("Imagecache"), "imagecache", _("Directory for storing the snapshot cache"))
        ew.add_dir_selector(
            _("Directories to search for movies"), "moviepath",
            _("List of directories (separated by %(pathsep)s) to search for movie files."
              ) % {'pathsep': os.path.pathsep})
        ew.add_checkbox(
            _("First look for movie file in the same directory as the package"
              ), 'movie-in-package-dir',
            _("If checked, the movie file will be searched for in the same directory as the referencing package."
              ))
        return ew
コード例 #2
0
ファイル: transcription.py プロジェクト: pchampin/advene
    def edit_options(self, button):
        user_defined = object()
        cache = dict(self.options)
        for c in ('representation', 'separator'):
            cache[c] = cache[c].replace('\n', '\\n').replace('\t', '\\t')
        old_representation = cache['representation']
        cache['user-separator'] = cache['separator']
        if cache['separator'] not in (' ', '\\n', '\\t', ' - '):
            cache['separator'] = user_defined

        ew = EditWidget(cache.__setitem__, cache.get)
        ew.set_name(_("Transcription options"))
        ew.add_checkbox(_("Default representation"), "default-representation",
                        _("Use the default representation for annotations"))
        ew.add_entry(
            _("Representation"), "representation",
            _("If default representation is unchecked,\nthis TALES expression that will be used to format the annotations."
              ))
        ew.add_option(
            _("Separator"), "separator",
            _("This separator will be inserted between the annotations."), {
                _('Whitespace'): ' ',
                _('Newline'): "\\n",
                _('Tabulation'): "\\t",
                _('Dash'): " - ",
                _('User defined'): user_defined,
            })
        ew.add_entry(
            _("User-defined separator"), "user-separator",
            _("Separator used if user-defined is selected.Use \\n for a newline and \\t for a tabulation."
              ))
        ew.add_checkbox(_("Display timestamps"), "display-time",
                        _("Insert timestsamp values"))
        ew.add_checkbox(_("Display annotation bounds"), 'display-bounds',
                        _("Display annotation bounds"))
        res = ew.popup()

        if res:
            if old_representation != cache['representation']:
                # The user-defined representation was changed. In most
                # cases, this means that the user wants to use it
                # instead of the default representation, so force
                # default-representation to False
                cache['default-representation'] = False
            if cache['separator'] == user_defined:
                # User-defined has been selected. Use the user-separator value
                cache['separator'] = cache['user-separator']
            self.options.update(cache)
            # Process special characters
            for c in ('representation', 'separator'):
                self.options[c] = self.options[c].replace('\\n', '\n').replace(
                    '\\t', '\t')
            self.generate_buffer_content()
        return True
コード例 #3
0
ファイル: initialconfig.py プロジェクト: eamexicano/advene
    def build_widget(self):
        ew=EditWidget(self.options.__setitem__, self.options.get)
        ew.set_name(_("Initial Advene configuration"))
        ew.add_label(_("<span size='large'><b>Welcome in Advene</b>\nThis is the first time that you run Advene. Please answer some basic configuration questions. You will be able to modify these choices from the Advene interface, in the Edit/Preferences menu.</span>"))
        ew.add_option(_("Interface language"), 'language', _("Language used for the interface"),
                      {
                "English": 'C',
                "Francais": 'fr_FR',
                _("System default"): '',
                })
        ew.add_checkbox(_("Weekly check for Advene updates on the Advene website"), 'update-check', _("Weekly check for updates on the Advene website"))

        ew.add_dir_selector(_("Preferred directory for data files"), "data", _("Preferred directory for storing data files (Advene packages)"))
        #ew.add_dir_selector(_("Imagecache"), "imagecache", _("Directory for storing the snapshot cache"))
        ew.add_dir_selector(_("Directories to search for movies"), "moviepath", _("List of directories (separated by %(pathsep)s) to search for movie files.") % { 'pathsep': os.path.pathsep })
        ew.add_checkbox(_("First look for movie file in the same directory as the package"), 'movie-in-package-dir', _("If checked, the movie file will be searched for in the same directory as the referencing package."))
        return ew
コード例 #4
0
ファイル: transcription.py プロジェクト: oaubert/advene2
    def edit_options(self, button):
        user_defined=object()
        cache=dict(self.options)
        for c in ('representation', 'separator'):
            cache[c] = cache[c].replace('\n', '\\n').replace('\t', '\\t')
        old_representation=cache['representation']
        cache['user-separator']=cache['separator']
        if cache['separator'] not in (' ', '\\n', '\\t', ' - '):
            cache['separator']=user_defined

        ew=EditWidget(cache.__setitem__, cache.get)
        ew.set_name(_("Transcription options"))
        ew.add_checkbox(_("Default representation"), "default-representation", _("Use the default representation for annotations"))
        ew.add_entry(_("Representation"), "representation", _("If default representation is unchecked,\nthis TALES expression that will be used to format the annotations."))
        ew.add_option(_("Separator"), "separator",
                      _("This separator will be inserted between the annotations."),
                      { _('Whitespace'): ' ',
                        _('Newline'): "\\n",
                        _('Tabulation'): "\\t",
                        _('Dash'): " - ",
                        _('User defined'): user_defined,
                        })
        ew.add_entry(_("User-defined separator"), "user-separator", _("Separator used if user-defined is selected.Use \\n for a newline and \\t for a tabulation."))
        ew.add_checkbox(_("Display timestamps"), "display-time", _("Insert timestsamp values"))
        ew.add_checkbox(_("Display annotation bounds"), 'display-bounds', _("Display annotation bounds"))
        res=ew.popup()

        if res:
            if old_representation != cache['representation']:
                # The user-defined representation was changed. In most
                # cases, this means that the user wants to use it
                # instead of the default representation, so force
                # default-representation to False
                cache['default-representation']=False
            if cache['separator'] == user_defined:
                # User-defined has been selected. Use the user-separator value
                cache['separator']=cache['user-separator']
            self.options.update(cache)
            # Process special characters
            for c in ('representation', 'separator'):
                self.options[c]=self.options[c].replace('\\n', '\n').replace('\\t', '\t')
            self.generate_buffer_content()
        return True