int *pi_list; /* Idem for integers */
char **ppsz_list_text; /* Friendly names for list values */
int i_list; /* Options list size */
+ vlc_callback_t pf_update_list; /*callback to initialize dropdownlists */
/* Actions list */
vlc_callback_t *ppf_action; /* List of possible actions for a config */
vlc_config_set (p_config, VLC_CONFIG_LIST, \
(size_t)(sizeof (list) / sizeof (char *)), \
(const char *const *)(list), \
- (const char *const *)(list_text))
+ (const char *const *)(list_text), \
+ list_update_func)
#define change_integer_list( list, list_text, list_update_func ) \
vlc_config_set (p_config, VLC_CONFIG_LIST, \
(size_t)(sizeof (list) / sizeof (int)), \
(const int *)(list), \
- (const char *const *)(list_text))
+ (const char *const *)(list_text), \
+ list_update_func)
#define change_float_list( list, list_text, list_update_func ) \
vlc_config_set (p_config, VLC_CONFIG_LIST, \
(size_t)(sizeof (list) / sizeof (float)), \
(const float *)(list), \
- (const char *const *)(list_text))
+ (const char *const *)(list_text), \
+ list_update_func)
#define change_integer_range( minv, maxv ) \
vlc_config_set (p_config, VLC_CONFIG_RANGE, (int)(minv), (int)(maxv))
/**
* Current plugin ABI version
*/
-# define MODULE_SYMBOL 0_9_0g
-# define MODULE_SUFFIX "__0_9_0g"
+# define MODULE_SYMBOL 0_9_0h
+# define MODULE_SUFFIX "__0_9_0h"
/*****************************************************************************
* Add a few defines. You do not want to read this section. Really.
combo->setMinimumWidth( MINWIDTH_BOX );
combo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
- module_config_t *p_module_config = config_FindConfig( p_this, getName() );
+ module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
+ if(p_module_config && p_module_config->pf_update_list)
+ {
+ vlc_value_t val;
+ val.psz_string = strdup(p_module_config->value.psz);
+
+ p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
+
+ // assume in a×y case that dirty was set to VLC_TRUE
+ // because lazy programmes will use the same callback for
+ // this, like the one behind the refresh push button?
+ p_module_config->b_dirty = VLC_FALSE;
+
+ if(val.psz_string) free(val.psz_string);
+ }
finish( p_module_config, bycat );
if( !l )
config_FindConfig( VLC_OBJECT(p_intf), configname );
if( p_config )
{
+ if(p_config->pf_update_list)
+ {
+ vlc_value_t val;
+ val.i_int = p_config->value.i;
+ p_config->pf_update_list(VLC_OBJECT(p_intf), configname, val, val, NULL);
+ // assume in any case that dirty was set to VLC_TRUE
+ // because lazy programmes will use the same callback for
+ // this, like the one behind the refresh push button?
+ p_config->b_dirty = VLC_FALSE;
+ }
+
for ( int i_index = 0; i_index < p_config->i_list; i_index++ )
{
combo->addItem( qfu( p_config->ppsz_list_text[i_index] ),
combo = new QComboBox();
combo->setMinimumWidth( MINWIDTH_BOX );
- module_config_t *p_module_config = config_FindConfig( p_this, getName() );
+ module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
+ if(p_module_config && p_module_config->pf_update_list)
+ {
+ vlc_value_t val;
+ val.i_int = p_module_config->value.i;
+
+ p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
+
+ // assume in any case that dirty was set to VLC_TRUE
+ // because lazy programmes will use the same callback for
+ // this, like the one behind the refresh push button?
+ p_module_config->b_dirty = VLC_FALSE;
+ }
+
finish( p_module_config, bycat );
if( !l )
combo = new wxComboBox( this, -1, wxT(""),
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
- UpdateCombo( p_item );
+
+ // was required to do so - because local p_item is a memcpy of
+ // this one, so it won't see the change done by pf_updat_list
+ module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
+ if(p_module_config && p_module_config->pf_update_list)
+ {
+ vlc_value_t val;
+ val.psz_string = strdup(p_module_config->value.psz);
+
+ p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
+
+ // assume in a×y case that dirty was set to VLC_TRUE
+ // because lazy programmes will use the same callback for
+ // this, like the one behind the refresh push button?
+ p_module_config->b_dirty = VLC_FALSE;
+
+ if(val.psz_string) free(val.psz_string);
+ }
+
+ UpdateCombo( p_module_config );
combo->SetToolTip( wxU(p_item->psz_longtext) );
sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
wxDefaultPosition, wxDefaultSize,
0, NULL, wxCB_READONLY );
- UpdateCombo( p_item );
+ module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name );
+ if(p_module_config && p_module_config->pf_update_list)
+ {
+ vlc_value_t val;
+ val.i_int = p_module_config->value.i;
+
+ p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL);
+
+ // assume in any case that dirty was set to VLC_TRUE
+ // because lazy programmes will use the same callback for
+ // this, like the one behind the refresh push button?
+ p_module_config->b_dirty = VLC_FALSE;
+ }
+
+ UpdateCombo( p_module_config );
combo->SetToolTip( wxU(p_item->psz_longtext) );
sizer->Add( combo, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
}
item->i_list = len;
+ item->pf_update_list = va_arg (ap, vlc_callback_t);
ret = 0;
break;
}