Changeset b96154a2673604c3550a0ff0296a48d16420800a

Show
Ignore:
Timestamp:
03/03/08 19:57:43 (6 months ago)
Author:
André Weber <WeberAndre@gmx.de>
git-committer:
André Weber <WeberAndre@gmx.de> 1204570663 +0100
git-parent:

[487b2b1e7439028935350ce5550afcac098bd5f3]

git-author:
André Weber <WeberAndre@gmx.de> 1204570663 +0100
Message:

Enable the last parameter of the macros change_integer_list, change_string_list to supply a method to initialize update dynamic selectionlists inside the settings GUI allready on showing the gui. (f.e. the audio device list)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_configuration.h

    r262c049 rb96154a  
    170170    char       **ppsz_list_text;          /* Friendly names for list values */ 
    171171    int          i_list;                               /* Options list size */ 
     172    vlc_callback_t pf_update_list; /*callback to initialize dropdownlists */ 
    172173 
    173174    /* Actions list */ 
     
    436437                    (size_t)(sizeof (list) / sizeof (char *)), \ 
    437438                    (const char *const *)(list), \ 
    438                     (const char *const *)(list_text)) 
     439                    (const char *const *)(list_text), \ 
     440                    list_update_func) 
    439441 
    440442#define change_integer_list( list, list_text, list_update_func ) \ 
     
    442444                    (size_t)(sizeof (list) / sizeof (int)), \ 
    443445                    (const int *)(list), \ 
    444                     (const char *const *)(list_text)) 
     446                    (const char *const *)(list_text), \ 
     447                    list_update_func) 
    445448 
    446449#define change_float_list( list, list_text, list_update_func ) \ 
     
    448451                    (size_t)(sizeof (list) / sizeof (float)), \ 
    449452                    (const float *)(list), \ 
    450                     (const char *const *)(list_text)) 
     453                    (const char *const *)(list_text), \ 
     454                    list_update_func) 
    451455 
    452456#define change_integer_range( minv, maxv ) \ 
  • include/vlc_modules_macros.h

    rcc6e3d0 rb96154a  
    3636 * Current plugin ABI version 
    3737 */ 
    38 # define MODULE_SYMBOL 0_9_0g 
    39 # define MODULE_SUFFIX "__0_9_0g
     38# define MODULE_SYMBOL 0_9_0h 
     39# define MODULE_SUFFIX "__0_9_0h
    4040 
    4141/***************************************************************************** 
  • modules/gui/qt4/components/preferences_widgets.cpp

    r9ab3a05 rb96154a  
    374374    combo->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred ); 
    375375 
    376     module_config_t *p_module_config = config_FindConfig( p_this, getName() ); 
     376    module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); 
     377    if(p_module_config && p_module_config->pf_update_list)  
     378    { 
     379       vlc_value_t val; 
     380       val.psz_string = strdup(p_module_config->value.psz); 
     381        
     382       p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); 
     383 
     384       // assume in a×y case that dirty was set to VLC_TRUE 
     385       // because lazy programmes will use the same callback for 
     386       // this, like the one behind the refresh push button? 
     387       p_module_config->b_dirty = VLC_FALSE; 
     388 
     389       if(val.psz_string) free(val.psz_string); 
     390    } 
    377391 
    378392    finish( p_module_config, bycat ); 
     
    474488    if( p_config ) 
    475489    { 
     490       if(p_config->pf_update_list)  
     491        { 
     492            vlc_value_t val; 
     493            val.i_int = p_config->value.i; 
     494            p_config->pf_update_list(VLC_OBJECT(p_intf), configname, val, val, NULL); 
     495            // assume in any case that dirty was set to VLC_TRUE 
     496            // because lazy programmes will use the same callback for 
     497            // this, like the one behind the refresh push button? 
     498            p_config->b_dirty = VLC_FALSE; 
     499        } 
     500 
    476501        for ( int i_index = 0; i_index < p_config->i_list; i_index++ ) 
    477502        { 
     
    838863    combo->setMinimumWidth( MINWIDTH_BOX ); 
    839864 
    840     module_config_t *p_module_config = config_FindConfig( p_this, getName() ); 
     865    module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); 
     866    if(p_module_config && p_module_config->pf_update_list)  
     867    { 
     868       vlc_value_t val; 
     869       val.i_int = p_module_config->value.i; 
     870        
     871       p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); 
     872 
     873       // assume in any case that dirty was set to VLC_TRUE 
     874       // because lazy programmes will use the same callback for 
     875       // this, like the one behind the refresh push button? 
     876       p_module_config->b_dirty = VLC_FALSE; 
     877    } 
     878 
    841879 
    842880    finish( p_module_config, bycat ); 
  • modules/gui/wxwidgets/dialogs/preferences_widgets.cpp

    reb918f1 rb96154a  
    564564                            wxDefaultPosition, wxDefaultSize, 
    565565                            0, NULL, wxCB_READONLY ); 
    566     UpdateCombo( p_item ); 
     566 
     567    // was required to do so - because local p_item is a memcpy of 
     568    // this one, so it won't see the change done by pf_updat_list 
     569    module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); 
     570    if(p_module_config && p_module_config->pf_update_list) 
     571    { 
     572       vlc_value_t val; 
     573       val.psz_string = strdup(p_module_config->value.psz); 
     574 
     575       p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); 
     576 
     577       // assume in a� case that dirty was set to VLC_TRUE 
     578       // because lazy programmes will use the same callback for 
     579       // this, like the one behind the refresh push button? 
     580       p_module_config->b_dirty = VLC_FALSE; 
     581 
     582       if(val.psz_string) free(val.psz_string); 
     583    } 
     584 
     585    UpdateCombo( p_module_config ); 
    567586 
    568587    combo->SetToolTip( wxU(p_item->psz_longtext) ); 
     
    794813                            0, NULL, wxCB_READONLY ); 
    795814 
    796     UpdateCombo( p_item ); 
     815    module_config_t *p_module_config = config_FindConfig( p_this, p_item->psz_name ); 
     816    if(p_module_config && p_module_config->pf_update_list) 
     817    { 
     818       vlc_value_t val; 
     819       val.i_int = p_module_config->value.i; 
     820 
     821       p_module_config->pf_update_list(p_this, p_item->psz_name, val, val, NULL); 
     822 
     823       // assume in any case that dirty was set to VLC_TRUE 
     824       // because lazy programmes will use the same callback for 
     825       // this, like the one behind the refresh push button? 
     826       p_module_config->b_dirty = VLC_FALSE; 
     827    } 
     828 
     829    UpdateCombo( p_module_config ); 
    797830 
    798831    combo->SetToolTip( wxU(p_item->psz_longtext) ); 
  • src/modules/entry.c

    rb803dd3 rb96154a  
    369369 
    370370            item->i_list = len; 
     371            item->pf_update_list = va_arg (ap, vlc_callback_t); 
    371372            ret = 0; 
    372373            break;