Пример #1
0
    def initialize(self, name, default, help, field_metadata):
        variables = sorted(FORMAT_ARG_DESCS.keys())
        if name == "send_to_device":
            self.help_label.setText(
                self.orig_help_text
                + _(
                    ". This setting can be overridden for <b>individual devices</b>,"
                    ' by clicking the device icon and choosing "Configure this device".'
                )
            )
        rows = []
        for var in variables:
            rows.append(u"<tr><td>%s</td><td>&nbsp;</td><td>%s</td></tr>" % (var, FORMAT_ARG_DESCS[var]))
        rows.append(
            u"<tr><td>%s&nbsp;</td><td>&nbsp;</td><td>%s</td></tr>"
            % (_("Any custom field"), _('The lookup name of any custom field (these names begin with "#").'))
        )
        table = u"<table>%s</table>" % (u"\n".join(rows))
        self.template_variables.setText(table)

        self.field_metadata = field_metadata
        self.opt_template.initialize(name + "_template_history", default, help)
        self.opt_template.editTextChanged.connect(self.changed)
        self.opt_template.currentIndexChanged.connect(self.changed)
        self.option_name = name
        self.open_editor.clicked.connect(self.do_open_editor)
    def initialize(self, name, default, help):
        variables = sorted(FORMAT_ARG_DESCS.keys())
        rows = []
        for var in variables:
            rows.append(u'<tr><td>%s</td><td>&nbsp;</td><td>%s</td></tr>' %
                        (var, FORMAT_ARG_DESCS[var]))
        rows.append(u'<tr><td>%s&nbsp;</td><td>&nbsp;</td><td>%s</td></tr>' % (
            _('Any custom field'),
            _('The lookup name of any custom field (these names begin with "#").'
              )))
        table = u'<table>%s</table>' % (u'\n'.join(rows))
        self.template_variables.setText(table)

        self.opt_template.initialize(name + '_template_history', default, help)
        self.opt_template.editTextChanged.connect(self.changed)
        self.opt_template.currentIndexChanged.connect(self.changed)
        self.option_name = name
        self.open_editor.clicked.connect(self.do_open_editor)
Пример #3
0
    def initialize(self, name, default, help):
        variables = sorted(FORMAT_ARG_DESCS.keys())
        rows = []
        for var in variables:
            rows.append(u'<tr><td>%s</td><td>&nbsp;</td><td>%s</td></tr>'%
                    (var, FORMAT_ARG_DESCS[var]))
        rows.append(u'<tr><td>%s&nbsp;</td><td>&nbsp;</td><td>%s</td></tr>'%(
            _('Any custom field'),
            _('The lookup name of any custom field (these names begin with "#").')))
        table = u'<table>%s</table>'%(u'\n'.join(rows))
        self.template_variables.setText(table)

        self.opt_template.initialize(name+'_template_history',
                default, help)
        self.opt_template.editTextChanged.connect(self.changed)
        self.opt_template.currentIndexChanged.connect(self.changed)
        self.option_name = name
        self.open_editor.clicked.connect(self.do_open_editor)
Пример #4
0
    def initialize(self, name, default, help, field_metadata):
        variables = sorted(FORMAT_ARG_DESCS.keys())
        if name == 'send_to_device':
            self.help_label.setText(self.orig_help_text + ' ' + _(
                'This setting can be overridden for <b>individual devices</b>,'
                ' by clicking the device icon and choosing "Configure this device".'))
        rows = []
        for var in variables:
            rows.append(u'<tr><td>%s</td><td>&nbsp;</td><td>%s</td></tr>'%
                    (var, FORMAT_ARG_DESCS[var]))
        rows.append(u'<tr><td>%s&nbsp;</td><td>&nbsp;</td><td>%s</td></tr>'%(
            _('Any custom field'),
            _('The lookup name of any custom field (these names begin with "#").')))
        table = u'<table>%s</table>'%(u'\n'.join(rows))
        self.template_variables.setText(table)

        self.field_metadata = field_metadata
        self.opt_template.initialize(name+'_template_history',
                default, help)
        self.opt_template.editTextChanged.connect(self.changed)
        self.opt_template.currentIndexChanged.connect(self.changed)
        self.option_name = name
        self.open_editor.clicked.connect(self.do_open_editor)