/* Choice for types */
types = new QGroupBox( "Show settings" );
types->setAlignment( Qt::AlignHCenter );
+ types->setToolTip( qtr("You have to apply the preferences before\n"
+ "switching settings details if you want\n"
+ "to keep them") );
QHBoxLayout *types_l = new QHBoxLayout(0);
types_l->setSpacing( 3 ); types_l->setMargin( 3 );
small = new QRadioButton( "Basic", types ); types_l->addWidget( small );
/* Buttons */
QDialogButtonBox *buttonsBox = new QDialogButtonBox();
QPushButton *save = new QPushButton( qtr( "&Save" ) );
+ QPushButton *apply = new QPushButton( qtr( "&Apply" ) );
QPushButton *cancel = new QPushButton( qtr( "&Cancel" ) );
QPushButton *reset = new QPushButton( qtr( "&Reset Preferences" ) );
buttonsBox->addButton( save, QDialogButtonBox::AcceptRole );
+ buttonsBox->addButton( apply, QDialogButtonBox::AcceptRole );
buttonsBox->addButton( cancel, QDialogButtonBox::RejectRole );
buttonsBox->addButton( reset, QDialogButtonBox::ActionRole );
}
BUTTONACT( save, save() );
+ BUTTONACT( apply, apply() );
BUTTONACT( cancel, cancel() );
BUTTONACT( reset, reset() );
BUTTONACT( small, setSmall() );
}
void PrefsDialog::save()
+{
+ apply();
+ hide();
+}
+
+void PrefsDialog::apply()
{
if( small->isChecked() && simple_tree )
{
else if( all->isChecked() && advanced_tree )
advanced_tree->applyAll();
config_SaveConfigFile( p_intf, NULL );
- hide();
+
+ /* Delete the other panel in order to force its reload after clicking
+ on apply - UGLY but will work for now. */
+ if( simple_panel->isVisible() )
+ delete advanced_panel;
+ if( advanced_panel->isVisible() )
+ delete simple_panel;
+
}
void PrefsDialog::cancel()