Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigText is not possible to use in OWIF setting Menus #917

Closed
anudanan opened this issue Feb 21, 2019 · 7 comments
Closed

ConfigText is not possible to use in OWIF setting Menus #917

anudanan opened this issue Feb 21, 2019 · 7 comments

Comments

@anudanan
Copy link
Contributor

If a plugin has a setup.xml file for using by OWIF setting menu, the plugin parameter type ConfigText does not work in OWIF.
I think in config.tmpl there is not template for ConfigText parameter

Is not urgent, but I have seen is by testing some new parameters for trancodingsetup plugin

@jbleyel
Copy link
Contributor

jbleyel commented Feb 21, 2019

What exactly setting do not work?

@anudanan
Copy link
Contributor Author

Example

a additional line in
plugin.py of transcodingsetup plugin

config.plugins.transcodingsetup.testtext= ConfigText(default = "xxx")

in setup.xml of that plugin then add the line for testtext

`

config.plugins.transcodingsetup.bitrate
config.plugins.transcodingsetup.resolution
config.plugins.transcodingsetup.testtext

After that in OWIF no parameter testtext is in the transcodingsetupmenu seen.
`
If have debugged getConfigs in controllers/models and the parameter was collected in config but the template config.tmpl has no methode for text type, only for select, checkbox, multicheckbox and number

`


$title



#for $config in $configs:
#if $config.data.type == "select"
$select($config)
#elif $config.data.type == "checkbox"
$checkbox($config)
#elif $config.data.type == "multicheckbox"
$multicheckbox($config)
#elif $config.data.type == "number"
$number($config)
#end if
#end for

`

@jbleyel
Copy link
Contributor

jbleyel commented Feb 21, 2019

do you have any other setting with ConfigText
I don't have "config.plugins.transcodingsetup.testtext"

@anudanan
Copy link
Contributor Author

anudanan commented Feb 21, 2019

Do you have the plugin.py and setup.xml of transcodingsetup plugin?

I think you can modify the config.plugins.transcodingsetup.port from ConfigInteger zu ConfigText in the beginning of plugin.py
With ConfigInteger you see the port and with ConfigText no in OWIF

You must include ConfigText from config in plugin.py

@jbleyel
Copy link
Contributor

jbleyel commented Feb 21, 2019

i will check this

@jbleyel
Copy link
Contributor

jbleyel commented Feb 21, 2019

Please try this config.tmpl ->


#def select($config)
<tr>
<td>$config.description</td>
<td>
	<select id="$config.path" onchange="saveConfig('$config.path', this.value);">
		#for $choice in $config.data.choices
			#if $config.data.current == $choice[0]
				<option value="$choice[0]" selected="true">$choice[1]</option>
			#else
				<option value="$choice[0]">$choice[1]</option>
			#end if
		#end for
	</select>
</td>
</tr>
#end def

#def checkbox($config)
<tr>
<td>$config.description</td>
<td>
	#if $config.data.current
		<input type="checkbox" id="$config.path" checked="true" onclick="saveConfig('$config.path', this.checked);" />
	#else
		<input type="checkbox" id="$config.path" onclick="saveConfig('$config.path', this.checked);" />
	#end if
</td>
</tr>
#end def

#def multicheckbox($config)
<tr>
<td>$config.description</td>
<td>
	#for $choice in $config.data.choices
		#if $choice in $config.data.current
			<input type="checkbox" id="${config.path}_${choice}" checked="true" onclick="saveConfig('$config.path', $choice);" />
		#else
			<input type="checkbox" id="${config.path}_${choice}" onclick="saveConfig('$config.path', $choice);" />
		#end if
		$choice
	#end for
</td>
</tr>
#end def

#def number($config)
<tr>
<td>$config.description</td>
<td>
	<input type="text" id="${config.path}" value="$config.data.current" onkeydown="numberTextboxKeydownFilter(event);" onchange="saveConfig('$config.path', this.value);">
</td>
</tr>
#end def

#def text($config)
<tr>
<td>$config.description</td>
<td>
	<input type="text" id="${config.path}" value="$config.data.current" onchange="saveConfig('$config.path', this.value);">
</td>
</tr>
#end def

<div id="content_main">
	<h3 class="ui-widget-header">$title</h3>
	<table id="configuration">
		#for $config in $configs:
			#if $config.data.type == "select"
				$select($config)
			#elif $config.data.type == "checkbox"
				$checkbox($config)
			#elif $config.data.type == "multicheckbox"
				$multicheckbox($config)
			#elif $config.data.type == "number"
				$number($config)
			#elif $config.data.type == "text"
				$text($config)
			#end if
		#end for
	</table>
</div>

@anudanan
Copy link
Contributor Author

That works. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants