Commit e79c89c7 authored by Clement CHAVANCE's avatar Clement CHAVANCE

Preferences widget uses the new settingsmanager interface

parent 184dad75
......@@ -26,9 +26,15 @@ void ProjectSettingsDefault::loadVideoDefaults( void )
QVariant defaultProjectHeight = 800;
QVariant defaultProjectWidth = 600;
//settingsMan->setValue( "VideoProjectFPS", defaultProjectFPS );
//settingsMan->setValue( "VideoProjectHeight", defaultProjectHeight );
//settingsMan->setValue( "VideoProjectWidth", defaultProjectWidth );
settingsMan->setValue( "default",
"VideoProjectFPS",
defaultProjectFPS );
settingsMan->setValue( "default",
"VideoProjectHeight",
defaultProjectHeight );
settingsMan->setValue( "default",
"VideoProjectWidth",
defaultProjectWidth );
return ;
}
......
......@@ -19,11 +19,16 @@ void VLMCSettingsDefault::loadVLMCDefaults( void )
QVariant defaultPreviewFPS = "25";
QVariant defaultTrackNb = "64";
// settingsMan->setValue( "VLMCOutPutFPS", defaultOutputPFS );
// settingsMan->setValue( "VLMCPreviewFPS", defaultPreviewFPS );
// settingsMan->setValue( "VLMCTracksNb", defaultTrackNb );
//
// return ;
settingsMan->setValue( "default",
"VLMCOutPutFPS", defaultOutputPFS );
settingsMan->setValue( "default",
"VLMCPreviewFPS",
defaultPreviewFPS );
settingsMan->setValue( "default",
"VLMCTracksNb",
defaultTrackNb );
return ;
}
void VLMCSettingsDefault::loadlanguageDefaults( void )
......
......@@ -35,14 +35,18 @@ AudioProjectPreferences::~AudioProjectPreferences() { }
void AudioProjectPreferences::load()
{
//int sampleRate = SettingsManager::getInstance()->getValue( "AudioSampleRate" ).toInt();
//m_ui.SampleRate->setValue( sampleRate );
SettingsManager* setMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "defaults" : m_settName;
int sampleRate = setMan->getValue( part, "AudioSampleRate" ).toInt();
m_ui.SampleRate->setValue( sampleRate );
return ;
}
void AudioProjectPreferences::save()
{
//settings.insert( "AudioSampleRate", m_ui.SampleRate->value() );
SettingsManager* setMan = SettingsManager::getInstance();
QVariant sampleRate( m_ui.SampleRate->value() );
setMan->setValue( m_settName, "AudioSampleRate", sampleRate );
return ;
}
......@@ -42,7 +42,7 @@ class PreferenceWidget : public QWidget
virtual void load() = 0;
virtual void save() = 0;
private:
protected:
bool m_defaults;
QString m_settName;
};
......
......@@ -40,16 +40,19 @@ ProjectPreferences::~ProjectPreferences() { }
void ProjectPreferences::load()
{
//qDebug() << "Loading preferences : Project";
//QString Name = SettingsManager::getInstance()->getValue( "project", "Name" ).toString();
//QString Dir = SettingsManager::getInstance()->getValue( "project", "path" ).toString();
SettingsManager* settMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "defaults" : m_settName;
QString Name = settMan->getValue( part, "project", "Name" ).toString();
QString Dir = settMan->getValue( part, "project", "path" ).toString();
//m_ui.ProjectNameLineEdit->setText( Name );
//m_ui.ProjectDirectoryLineEdit->setText( Dir );
m_ui.ProjectNameLineEdit->setText( Name );
m_ui.ProjectDirectoryLineEdit->setText( Dir );
}
void ProjectPreferences::save()
{
//settings.insert( "ProjectName", QVariant( m_ui.ProjectNameLineEdit->text() ) );
//settings.insert( "ProjectDirectory", QVariant( m_ui.ProjectDirectoryLineEdit->text() ) );
SettingsManager* settMan = SettingsManager::getInstance();
settMan->setValue( m_settName, "ProjectName", QVariant( m_ui.ProjectNameLineEdit->text() ) );
settMan->setValue( m_settName, "ProjectDirectory", QVariant( m_ui.ProjectDirectoryLineEdit->text() ) );
}
......@@ -35,20 +35,27 @@ VLMCPreferences::~VLMCPreferences() { }
void VLMCPreferences::load()
{
// qDebug() << "Loading Prefs : VLMC";
// QString outputFPS = SettingsManager::getInstance()->getValue( "VLMCOutPutFPS" ).toString();
// QString previewFPS = SettingsManager::getInstance()->getValue( "VLMCPreviewFPS" ).toString();
// QString tracksNb = SettingsManager::getInstance()->getValue( "VLMCTracksNb" ).toString();
//
// m_ui.outputFPS->setText( outputFPS );
// m_ui.previewFPS->setText( previewFPS );
// m_ui.tracksNb->setText( tracksNb );
//
SettingsManager* settMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "defaults" : m_settName;
QString outputFPS = settMan->getValue( part, "VLMCOutPutFPS" ).toString();
QString previewFPS = settMan->getValue( part, "VLMCPreviewFPS" ).toString();
QString tracksNb = settMan->getValue( part, "VLMCTracksNb" ).toString();
m_ui.outputFPS->setText( outputFPS );
m_ui.previewFPS->setText( previewFPS );
m_ui.tracksNb->setText( tracksNb );
}
void VLMCPreferences::save()
{
// settings.insert( "VLMCOutPutFPS", QVariant( m_ui.outputFPS->text() ) );
// settings.insert( "VLMCPreviewFPS", QVariant( m_ui.previewFPS->text() ) );
// settings.insert( "VLMCTracksNb", QVariant( m_ui.tracksNb->text() ) );
SettingsManager* settMan = SettingsManager::getInstance();
QVariant outputFPS( m_ui.outputFPS->text() );
QVariant previewFPS( m_ui.previewFPS->text() );
QVariant tracksNb( m_ui.tracksNb->text() );
settMan->setValue( m_settName, "VLMCOutPutFPS", outputFPS );
settMan->setValue( m_settName, "VLMCPreviewFPS", previewFPS );
settMan->setValue( m_settName, "VLMCTracksNb", tracksNb );
}
......@@ -35,20 +35,26 @@ VideoProjectPreferences::~VideoProjectPreferences() { }
void VideoProjectPreferences::load()
{
// qDebug() << "Loading Prefs : VideoProject";
// int projectFps = SettingsManager::getInstance()->getValue( "VideoProjectFPS" ).toInt();
// int projectHeight = SettingsManager::getInstance()->getValue( "VideoProjectHeight" ).toInt();
// int projectWidth = SettingsManager::getInstance()->getValue( "VideoProjectWidth" ).toInt();
//
// m_ui.FPSSpinBox->setValue( projectFps );
// m_ui.HeightSpinBox->setValue( projectHeight );
// m_ui.WidthSpinBox->setValue( projectWidth );
SettingsManager* setMan = SettingsManager::getInstance();
const QString& part = m_defaults ? "defaults" : m_settName;
int projectFps = setMan->getValue( part, "VideoProjectFPS" ).toInt();
int projectHeight = setMan->getValue( part, "VideoProjectHeight" ).toInt();
int projectWidth = setMan->getValue( part, "VideoProjectWidth" ).toInt();
m_ui.FPSSpinBox->setValue( projectFps );
m_ui.HeightSpinBox->setValue( projectHeight );
m_ui.WidthSpinBox->setValue( projectWidth );
}
void VideoProjectPreferences::save()
{
// settings.insert( "VideoProjectFPS", QVariant( m_ui.FPSSpinBox->value() ) );
// settings.insert( "VideoProjectHeight", QVariant( m_ui.HeightSpinBox->value() ) );
// settings.insert( "VideoProjectWidth", QVariant( m_ui.WidthSpinBox->value() ));
SettingsManager* settMan = SettingsManager::getInstance();
QVariant projectFps( m_ui.FPSSpinBox->value() );
QVariant projectHeight( m_ui.HeightSpinBox->value() );
QVariant projectWidth( m_ui.WidthSpinBox->value() );
settMan->setValue( m_settName,"VideoProjectFPS", projectFps );
settMan->setValue( m_settName,"VideoProjectHeight", projectHeight );
settMan->setValue( m_settName,"VideoProjectWidth", projectWidth);
return ;
}
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