Commit d9a62340 authored by Vincent Carrubba's avatar Vincent Carrubba

Updating setting files from origin/master

parent 7f107100
......@@ -93,6 +93,7 @@ void SettingsManager::saveSettings( QDomDocument& xmlfile, QDomElement& root )
void SettingsManager::loadSettings( const QDomElement& settings )
{
qDebug() << "Loading settings";
if ( settings.isNull() == true || settings.tagName() != "settings" )
{
qWarning() << "Invalid settings node";
......@@ -116,6 +117,6 @@ void SettingsManager::loadSettings( const QDomElement& settings )
QVariant( attrMap.item( 0 ).nodeValue() ));
}
m_lock.unlock();
emit settingsLoaded( m_data );
emit settingsLoaded();
}
......@@ -51,11 +51,11 @@ class SettingsManager : public QObject, public QSingleton<SettingsManager>
SettingsManager( QObject* parent = 0 );
~SettingsManager();
QHash<QString, QVariant> m_data;
QHash<QString, QVariant> m_data;
mutable QReadWriteLock m_lock;
signals:
void settingsLoaded( const QHash<QString, QVariant>& settings );
void settingsLoaded();
};
......
......@@ -43,13 +43,17 @@ Settings::Settings( QWidget* parent, Qt::WindowFlags f )
{
m_panel = new Panel( this );
m_stackedWidgets = new QStackedWidget( this );
connect( m_panel,
QObject::connect( m_panel,
SIGNAL( changePanel( int ) ),
SLOT( switchWidget( int ) ) );
QObject::connect( this,
SIGNAL( widgetSwitched( int ) ),
m_stackedWidgets,
SLOT( setCurrentIndex( int ) ));
QObject::connect( SettingsManager::getInstance(),
SIGNAL( settingsLoaded() ),
this,
SLOT( load() ) );
}
Settings::~Settings()
......@@ -64,11 +68,8 @@ void Settings::addWidget( const QString& name,
const QString& icon,
const QString& label )
{
qDebug() << "calling SettingsManager::addWidget()";
m_stackedWidgets->addWidget( pWidget );
QObject::connect( SettingsManager::getInstance(),
SIGNAL( settingsLoaded( const QHash<QString, QVariant>& ) ),
this,
SLOT( loadSettings( const QHash<QString, QVariant>& ) ) );
int idx = m_stackedWidgets->indexOf( pWidget );
m_widgets.insert( idx, name );
......@@ -175,6 +176,10 @@ void Settings::switchWidget( int widget )
emit widgetSwitched( widget );
}
void Settings::loadSettings( const QHash<QString, QVariant>& sett )
void Settings::load()
{
qDebug() << "Pwid size :" << m_pWidgets.size();
PreferenceWidget* pwidg;
foreach( pwidg, m_pWidgets )
pwidg->load();
}
......@@ -67,7 +67,7 @@ class Settings : public QDialog
public slots:
void switchWidget( int widget );
void loadSettings( const QHash<QString, QVariant>& );
void load();
private slots:
void buttonClicked( QAbstractButton* button );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment