X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fcomplete_preferences.cpp;h=d6cd6160c7e0c5678fc38933337286147623d41f;hb=b5277240aa78e2515cc4f32ca4b582160b2ee8d8;hp=a953ff534b126913070684d463c66ecd2b7dcb75;hpb=a1cd7082492c4bba5c359a0bbc386954b3f5e212;p=vlc diff --git a/modules/gui/qt4/components/complete_preferences.cpp b/modules/gui/qt4/components/complete_preferences.cpp index a953ff534b..d6cd6160c7 100644 --- a/modules/gui/qt4/components/complete_preferences.cpp +++ b/modules/gui/qt4/components/complete_preferences.cpp @@ -62,34 +62,20 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) ); setTextElideMode( Qt::ElideNone ); - setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn ); /* Nice icons */ #define BI( a,b) QIcon a##_icon = QIcon( QPixmap( b )) - BI( audio, ":/pixmaps/advprefs_audio.png" ); - BI( video, ":/pixmaps/advprefs_video.png" ); - BI( input, ":/pixmaps/advprefs_codec.png" ); - BI( sout, ":/pixmaps/advprefs_sout.png" ); - BI( advanced, ":/pixmaps/advprefs_extended.png" ); - BI( playlist, ":/pixmaps/advprefs_playlist.png" ); - BI( interface, ":/pixmaps/advprefs_intf.png" ); + BI( audio, ":/advprefs_audio" ); + BI( video, ":/advprefs_video" ); + BI( input, ":/advprefs_codec" ); + BI( sout, ":/advprefs_sout" ); + BI( advanced, ":/advprefs_extended" ); + BI( playlist, ":/advprefs_playlist" ); + BI( interface, ":/advprefs_intf" ); #undef BI /* Build the tree for the main module */ - const module_t *p_module = NULL; - vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, - FIND_ANYWHERE ); - if( !p_list ) return; - - /* Find the main module */ - for( unsigned i = 0; p_module == NULL; i++ ) - { - assert (i < (unsigned)p_list->i_count); - - const module_t *p_main = (module_t *)p_list->p_values[i].p_object; - if( strcmp( module_GetObjName( p_main ), "main" ) == 0 ) - p_module = p_main; - } + module_t *p_module = module_GetMainModule( p_intf ); /* Initialisation and get the confsize */ PrefsItemData *data = NULL; @@ -207,7 +193,11 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : } } module_PutConfig( p_config ); + vlc_object_release( (vlc_object_t*)p_module ); + + vlc_list_t *p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, + FIND_ANYWHERE ); /* Build the tree of plugins */ for( int i_index = 0; i_index < p_list->i_count; i_index++ ) { @@ -215,7 +205,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : p_module = (module_t *)p_list->p_values[i_index].p_object; // Main module excluded - if( !strcmp( module_GetObjName( p_module ), "main" ) ) continue; + if( module_IsMainModule( p_module) ) continue; unsigned i_subcategory = 0, i_category = 0, confsize; bool b_options = false; @@ -286,7 +276,7 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) : module_data->help.clear(); // TODO image QTreeWidgetItem *module_item = new QTreeWidgetItem(); - module_item->setText( 0, qtr( module_GetName( p_module, VLC_FALSE ) ) ); + module_item->setText( 0, qtr( module_GetName( p_module, false ) ) ); //item->setIcon( 0 , XXX ); module_item->setData( 0, Qt::UserRole, QVariant::fromValue( module_data) ); @@ -372,10 +362,10 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, if( data->i_type == TYPE_CATEGORY ) return; else if( data->i_type == TYPE_MODULE ) - p_module = module_Find( VLC_OBJECT(p_intf), data->psz_name ); + p_module = module_Find( p_intf, data->psz_name ); else { - p_module = module_Find( VLC_OBJECT(p_intf), "main" ); + p_module = module_GetMainModule( p_intf ); assert( p_module ); } @@ -460,7 +450,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ( p_item->i_type == CONFIG_CATEGORY || p_item->i_type == CONFIG_SUBCATEGORY ) ) break; - if( p_item->b_internal == VLC_TRUE ) continue; + if( p_item->b_internal == true ) continue; if( p_item->i_type == CONFIG_SECTION ) { @@ -471,6 +461,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, i_line++; } box = new QGroupBox( qtr( p_item->psz_text ) ); + box->hide(); boxlayout = new QGridLayout(); } /* Only one hotkey control */ @@ -504,6 +495,7 @@ AdvPrefsPanel::AdvPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, if( box ) { box->setLayout( boxlayout ); + box->show(); layout->addWidget( box, i_line, 0, 1, -1 ); }