VLMCPreferences.cpp 2.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*****************************************************************************
 * VLMCPreferences.cpp: VLMC preferences class
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Geoffroy Lacarriere <geoffroylaca@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#include "VLMCPreferences.h"
24
#include "SettingsManager.h"
25 26 27

#include "QDebug"

28 29
VLMCPreferences::VLMCPreferences( QWidget *parent )
        : PreferenceWidget( parent )
30 31 32 33 34 35
{
    m_ui.setupUi(this);
}

VLMCPreferences::~VLMCPreferences() { }

36
void    VLMCPreferences::load()
37
{
38
    SettingsManager* settMan = SettingsManager::getInstance();
39
    const QString& part = m_defaults ? "default" : m_settName;
40

41 42
    QString  outputFPS = settMan->getValue( part, "VLMCOutPutFPS" )->get().toString();
    QString  tracksNb = settMan->getValue( part, "VLMCTracksNb" )->get().toString();
43 44 45 46

    m_ui.outputFPS->setText( outputFPS );
    m_ui.tracksNb->setText( tracksNb );

47 48
}

Clement CHAVANCE's avatar
Clement CHAVANCE committed
49
void    VLMCPreferences::save()
50
{
51 52 53 54 55 56
    SettingsManager* settMan = SettingsManager::getInstance();
    QVariant outputFPS( m_ui.outputFPS->text() );
    QVariant tracksNb( m_ui.tracksNb->text() );

    settMan->setValue( m_settName, "VLMCOutPutFPS", outputFPS );
    settMan->setValue( m_settName, "VLMCTracksNb", tracksNb );
57
}