that->myPrefs = _prefs_;
connect( myPrefs, SIGNAL( preferenceChanged( QString&, QString&, QString& ) ),
- this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ) );
+ this, SLOT( onPreferenceChanged( QString&, QString&, QString& ) ), Qt::UniqueConnection );
+ connect( myPrefs, SIGNAL( resetToDefaults() ),
+ this, SIGNAL( preferenceResetToDefaults() ), Qt::UniqueConnection );
if ( !crt )
return myPrefs;
void studySaved();
void studyClosed();
void preferenceChanged( const QString&, const QString&, const QString& );
+ void preferenceResetToDefaults();
void operationFinished( const QString&, const QString&, const QStringList& );
public slots:
QAbstractButton* impBtn = userButton( insertButton( tr( "IMPORT_BTN_TEXT" ) ) );
if( impBtn )
connect( impBtn, SIGNAL( clicked() ), this, SLOT( onImportPref() ) );
+ connect( this, SIGNAL( defaultPressed() ), prefs, SIGNAL( resetToDefaults() ) );
setMinimumSize( 800, 600 );
}
/*! Restore default preferences*/
void LightApp_PreferencesDlg::onDefault()
{
- if( SUIT_MessageBox::Ok == SUIT_MessageBox::question( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ),
- SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
- SUIT_MessageBox::Ok ) )
+ if ( SUIT_MessageBox::Ok == SUIT_MessageBox::question( this, tr( "WARNING" ), tr( "DEFAULT_QUESTION" ),
+ SUIT_MessageBox::Ok | SUIT_MessageBox::Cancel,
+ SUIT_MessageBox::Ok ) )
+ {
+ if ( myPrefs && myPrefs->resourceMgr() )
{
- if ( myPrefs && myPrefs->resourceMgr() )
- {
- QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
- myPrefs->retrieve();
- myPrefs->resourceMgr()->setWorkingMode( prev );
- }
+ QtxResourceMgr::WorkingMode prev = myPrefs->resourceMgr()->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
+ myPrefs->retrieve();
+ myPrefs->resourceMgr()->setWorkingMode( prev );
}
+ emit defaultPressed();
+ }
}
/*! Import preferences from some file */