vlc_linux/vlc-3.0.16/modules/gui/qt/dialogs/preferences.cpp
/* Actual apply and save for the preferences */
Actual apply and save for the preferences
Actual apply and save for the preferences
void PrefsDialog::save()
{
    if( simple->isChecked() && simple_tree->isVisible() )
    {
        msg_Dbg( p_intf, "Saving the simple preferences" );
        for( int i = 0 ; i< SPrefsMax; i++ ){
            if( simple_panels_stack->widget(i) )
                qobject_cast<SPrefsPanel *>(simple_panels_stack->widget(i))->apply();
        }
    }
    else if( all->isChecked() && advanced_tree->isVisible() )
    {
        msg_Dbg( p_intf, "Saving the advanced preferences" );
        advanced_tree->applyAll();
    }
    if( config_SaveConfigFile( p_intf ) != 0 )
    {
        ErrorsDialog::getInstance (p_intf)->addError( qtr( "Cannot save Configuration" ),
            qtr("Preferences file could not be saved") );
    }
    if( p_intf->p_sys->p_mi )
        p_intf->p_sys->p_mi->reloadPrefs();
    accept();
    QVLCTools::saveWidgetPosition( p_intf, "Preferences", this );
}
void PrefsDialog :: save ( ) { if ( simple -> isChecked ( ) && simple_tree -> isVisible ( ) ) { msg_Dbg ( p_intf , " " ) ; for ( int i = 0 ; i < SPrefsMax ; i ++ ) { if ( simple_panels_stack -> widget ( i ) ) qobject_cast < SPrefsPanel * > ( simple_panels_stack -> widget ( i ) ) -> apply ( ) ; } } else if ( all -> isChecked ( ) && advanced_tree -> isVisible ( ) ) { msg_Dbg ( p_intf , " " ) ; advanced_tree -> applyAll ( ) ; } if ( config_SaveConfigFile ( p_intf ) != 0 ) { ErrorsDialog :: getInstance ( p_intf ) -> addError ( qtr ( " " ) , qtr ( " " ) ) ; } if ( p_intf -> p_sys -> p_mi ) p_intf -> p_sys -> p_mi -> reloadPrefs ( ) ; accept ( ) ; QVLCTools :: saveWidgetPosition ( p_intf , " " , this ) ; }
Actual apply and save for the preferences
Actual apply and save for the preferences
/* Save to file */