Commit ea4b3564 authored by Clement CHAVANCE's avatar Clement CHAVANCE Committed by Hugo Beauzee-Luyssen

loading values in preferenceWidgets is done

parent e5d44227
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include "AudioProjectPreferences.h"
#include "SettingsManager.h"
#include "QDebug"
......@@ -32,13 +33,16 @@
AudioProjectPreferences::~AudioProjectPreferences() { }
bool AudioProjectPreferences::load()
void AudioProjectPreferences::load()
{
qDebug() << "Loading AudioProjectPreferences values";
return true;
int sampleRate = SettingsManager::getInstance()->getValue( "AudioSampleRate" ).toInt();
m_ui.SampleRate->setValue( sampleRate );
return ;
}
void AudioProjectPreferences::save( QHash<QString, QVariant>& settings )
{
settings.insert( "AudioSampleRate", m_ui.SampleRate->value() );
settings.insert( "AudioSampleRate", m_ui.SampleRate->value() );
return ;
}
......@@ -34,7 +34,7 @@ class AudioProjectPreferences : public PreferenceWidget
public:
AudioProjectPreferences( QWidget *parent = 0 );
~AudioProjectPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::AudioProjectPreferences m_ui;
......
......@@ -36,7 +36,7 @@ class PreferenceWidget : public QWidget
PreferenceWidget( QWidget* parent = 0 );
virtual ~PreferenceWidget() {}
virtual bool load() = 0;
virtual void load() = 0;
virtual void save( QHash<QString, QVariant>& settings ) = 0;
};
......
......@@ -27,6 +27,7 @@
#include "ui_ProjectPreferences.h"
#include "ProjectPreferences.h"
#include "PreferenceWidget.h"
#include "SettingsManager.h"
ProjectPreferences::ProjectPreferences( QWidget* parent )
......@@ -37,14 +38,17 @@
ProjectPreferences::~ProjectPreferences() { }
bool ProjectPreferences::load()
void ProjectPreferences::load()
{
qDebug() << "Loading ProjectPreferences values";
return true;
QString Name = SettingsManager::getInstance()->getValue( "ProjectName" ).toString();
QString Dir = SettingsManager::getInstance()->getValue( "ProjectDirectory" ).toString();
m_ui.ProjectNameLineEdit->setText( Name );
m_ui.ProjectDirectoryLineEdit->setText( Dir );
}
void ProjectPreferences::save( QHash<QString, QVariant>& settings )
{
settings.insert( "ProjectName", QVariant( m_ui.ProjectNameLineEdit->text() ) );
settings.insert( "ProjectDirectory", QVariant( m_ui.ProjectDirectoryLineEdit->text() ) );
settings.insert( "ProjectName", QVariant( m_ui.ProjectNameLineEdit->text() ) );
settings.insert( "ProjectDirectory", QVariant( m_ui.ProjectDirectoryLineEdit->text() ) );
}
......@@ -35,7 +35,7 @@ class ProjectPreferences : public PreferenceWidget
public:
ProjectPreferences( QWidget* parent = 0 );
virtual ~ProjectPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::ProjectPreferences m_ui;
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include "VLMCPreferences.h"
#include "SettingsManager.h"
#include "QDebug"
......@@ -32,10 +33,16 @@ VLMCPreferences::VLMCPreferences( QWidget *parent )
VLMCPreferences::~VLMCPreferences() { }
bool VLMCPreferences::load()
void VLMCPreferences::load()
{
qDebug() << "Loading VLMCPreferences values";
return true;
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 );
}
void VLMCPreferences::save( QHash<QString, QVariant>& settings )
......
......@@ -34,7 +34,7 @@ class VLMCPreferences : public PreferenceWidget
public:
VLMCPreferences( QWidget *parent = 0 );
~VLMCPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::VLMCPreferences m_ui;
......
......@@ -21,26 +21,33 @@
*****************************************************************************/
#include "VideoProjectPreferences.h"
#include "SettingsManager.h"
#include "QDebug"
VideoProjectPreferences::VideoProjectPreferences( QWidget *parent )
: PreferenceWidget( parent )
: PreferenceWidget( parent )
{
m_ui.setupUi( this );
}
VideoProjectPreferences::~VideoProjectPreferences() { }
bool VideoProjectPreferences::load()
void VideoProjectPreferences::load()
{
qDebug() << "Loading VideoProjectPreferences values";
return true;
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 );
}
void VideoProjectPreferences::save( QHash<QString, QVariant>& settings )
{
settings.insert( "VideoProjectFPS", QVariant( m_ui.FPSSpinBox->value() ) );
settings.insert( "VideoProjectHeight", QVariant( m_ui.HeightSpinBox->value() ) );
settings.insert( "VideoProjectWidth", QVariant( m_ui.WidthSpinBox->value() ));
settings.insert( "VideoProjectFPS", QVariant( m_ui.FPSSpinBox->value() ) );
settings.insert( "VideoProjectHeight", QVariant( m_ui.HeightSpinBox->value() ) );
settings.insert( "VideoProjectWidth", QVariant( m_ui.WidthSpinBox->value() ));
return ;
}
......@@ -34,7 +34,7 @@ class VideoProjectPreferences : public PreferenceWidget
public:
VideoProjectPreferences( QWidget *parent = 0 );
~VideoProjectPreferences();
bool load();
void load();
void save( QHash<QString, QVariant>& settings );
private:
Ui::VideoProjectPreferences m_ui;
......
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