コード例 #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
ファイル: tagbag.py プロジェクト: eamexicano/advene
    def edit_options(self, *p):
        cache=dict(self.options)

        ew=EditWidget(cache.__setitem__, cache.get)
        ew.set_name(_("Tag bag options"))
        ew.add_checkbox(_("Update with new tags"), "display-new-tags", _("Automatically display new defined tags"))
        res=ew.popup()

        if res:
            self.options.update(cache)
        return True
コード例 #3
0
ファイル: tagbag.py プロジェクト: chrstn-hntschl/advene
    def edit_options(self, *p):
        cache = dict(self.options)

        ew = EditWidget(cache.__setitem__, cache.get)
        ew.set_name(_("Tag bag options"))
        ew.add_checkbox(_("Update with new tags"), "display-new-tags",
                        _("Automatically display new defined tags"))
        res = ew.popup()

        if res:
            self.options.update(cache)
        return True
コード例 #4
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
コード例 #5
0
ファイル: transcribe.py プロジェクト: oaubert/advene
    def edit_preferences(self, *p):
        cache=dict(self.options)

        ew=EditWidget(cache.__setitem__, cache.get)
        ew.set_name(_("Preferences"))
        ew.add_checkbox(_("Timestamp"), "timestamp", _("Click inserts timestamp marks"))
        ew.add_checkbox(_("Insert on single-click"), 'insert-on-single-click', _("A single click will insert the mark (else a double click is needed)"))
        ew.add_checkbox(_("Play on scroll"), "play-on-scroll", _("Play the new position upon timestamp modification"))
        ew.add_checkbox(_("Generate empty annotations"), "empty-annotations", _("If checked, generate annotations for empty text"))
        ew.add_spin(_("Reaction time"), "delay", _("Reaction time (substracted from current player time, except when paused.)"), -5000, 5000)
        ew.add_checkbox(_("Auto-insert"), "autoinsert", _("Automatic timestamp mark insertion"))
        ew.add_spin(_("Automatic insertion delay"), 'automatic-mark-insertion-delay', _("If autoinsert is active, timestamp marks will be automatically inserted when text is entered after no interaction since this delay (in ms).\n1000 is typically a good value."), 0, 100000)
        ew.add_spin(_("Font size"), "font-size", _("Font size for text (0 for standard size)"), 0, 48)

        res=ew.popup()
        if res:
            if cache['font-size'] != self.options['font-size']:
                # Font-size was changed. Update the textview.
                self.update_font_size(cache['font-size'])
            self.options.update(cache)
        return True
コード例 #6
0
    def edit_preferences(self, *p):
        cache=dict(self.options)

        ew=EditWidget(cache.__setitem__, cache.get)
        ew.set_name(_("Preferences"))
        ew.add_checkbox(_("Timestamp"), "timestamp", _("Click inserts timestamp marks"))
        ew.add_checkbox(_("Insert on double-click"), 'insert-on-double-click', _("A double click inserts the mark"))
        ew.add_checkbox(_("Insert on single-click"), 'insert-on-single-click', _("A single click inserts the mark"))
        ew.add_entry(_("Mark prefix"), 'mark-prefix', _("Text to insert before a mark (use \\n for newline)"))
        ew.add_entry(_("Mark suffix"), 'mark-suffix', _("Text to insert after a mark (use \\n for newline)"))
        ew.add_checkbox(_("Play on scroll"), "play-on-scroll", _("Play the new position upon timestamp modification"))
        ew.add_checkbox(_("Generate empty annotations"), "empty-annotations", _("If checked, generate annotations for empty text"))
        ew.add_spin(_("Reaction time"), "delay", _("Reaction time (substracted from current player time, except when paused.)"), -5000, 5000)
        ew.add_checkbox(_("Auto-insert"), "autoinsert", _("Automatic timestamp mark insertion"))
        ew.add_spin(_("Automatic insertion delay"), 'automatic-mark-insertion-delay', _("If autoinsert is active, timestamp marks will be automatically inserted when text is entered after no interaction since this delay (in ms).\n1000 is typically a good value."), 0, 100000)
        ew.add_spin(_("Font size"), "font-size", _("Font size for text (0 for standard size)"), 0, 48)

        res=ew.popup()
        if res:
            if cache['font-size'] != self.options['font-size']:
                # Font-size was changed. Update the textview.
                self.update_font_size(cache['font-size'])
            self.options.update(cache)
        return True
コード例 #7
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
コード例 #8
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