Exemplo n.º 1
0
    def load(self):
        config = get_config()
        self.ui.enable_tagger_scripts.setChecked(config.setting["enable_tagger_scripts"])
        for pos, name, enabled, text in config.setting["list_of_scripts"]:
            list_item = ScriptListWidgetItem(name, enabled, text)
            self.ui.script_list.addItem(list_item)

        # Select the last selected script item
        last_selected_script_pos = config.persist["last_selected_script_pos"]
        last_selected_script = self.ui.script_list.item(last_selected_script_pos)
        if last_selected_script:
            self.ui.script_list.setCurrentItem(last_selected_script)
            last_selected_script.setSelected(True)
Exemplo n.º 2
0
 def import_script(self):
     """Import from an external text file to a new script. Import can be either a plain text script or
     a Picard script package.
     """
     try:
         script_item = TaggingScript().import_script(self)
     except ScriptImportExportError as error:
         self.output_file_error(error.format, error.filename, error.error_msg)
         return
     if script_item:
         title = _("%s (imported)") % script_item["title"]
         list_item = ScriptListWidgetItem(title, False, script_item["script"])
         self.ui.script_list.addItem(list_item)
         self.ui.script_list.setCurrentRow(self.ui.script_list.count() - 1)
Exemplo n.º 3
0
    def load(self):
        self.ui.enable_tagger_scripts.setChecked(
            config.setting["enable_tagger_scripts"])
        for pos, name, enabled, text in config.setting["list_of_scripts"]:
            list_item = ScriptListWidgetItem(name, enabled, text)
            self.ui.script_list.addItem(list_item)

        # Select the last selected script item
        last_selected_script_pos = config.persist["last_selected_script_pos"]
        last_selected_script = self.ui.script_list.item(
            last_selected_script_pos)
        if last_selected_script:
            self.ui.script_list.setCurrentItem(last_selected_script)
            last_selected_script.setSelected(True)

        self.restore_state()

        args = {
            "picard-doc-scripting-url": PICARD_URLS['doc_scripting'],
        }
        text = _('<a href="%(picard-doc-scripting-url)s">Open Scripting'
                 ' Documentation in your browser</a>') % args
        self.ui.scripting_doc_link.setText(text)