Commit 3b764043 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Realy removing unused preferences files.

parent 2f9a31e3
/*****************************************************************************
* ProjectSettingsDefault.cpp: Project default Settings class
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
*
* 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 "SettingsManager.h"
#include "ProjectSettingsDefault.h"
#include "ProjectManager.h"
#include <QtDebug>
void ProjectSettingsDefault::load( const QString& part )
{
SettingsManager::getInstance()->addNewSettingsPart( part );
ProjectSettingsDefault::loadAudioDefaults( part );
ProjectSettingsDefault::loadVideoDefaults( part );
ProjectSettingsDefault::loadProjectDefaults( part );
SettingsManager::getInstance()->commit();
return ;
}
void ProjectSettingsDefault::loadAudioDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
QVariant defaultSampleRate = 0;
setMan->setValue( part, "AudioSampleRate", defaultSampleRate );
return ;
}
void ProjectSettingsDefault::loadVideoDefaults( const QString& part )
{
SettingsManager* settingsMan = SettingsManager::getInstance();
QVariant defaultProjectFPS = 30;
QVariant defaultProjectWidth = 480;
QVariant defaultProjectHeight = 300;
settingsMan->setValue( part,
"VideoProjectFPS",
defaultProjectFPS );
settingsMan->setValue( part,
"VideoProjectHeight",
defaultProjectHeight );
settingsMan->setValue( part,
"VideoProjectWidth",
defaultProjectWidth );
return ;
}
void ProjectSettingsDefault::loadProjectDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
setMan->setValue( part, "ProjectName", ProjectManager::unNamedProject );
return ;
}
/*****************************************************************************
* ProjectSettingsDefault.h: Project default Settings class
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
*
* 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.
*****************************************************************************/
#ifndef PROJECTSETTINGSDEFAULT_H
#define PROJECTSETTINGSDEFAULT_H
#include <QString>
/**
* \class ProjectSettingsDefault
*
* \brief Static class for loading default parameters
* for the project
*/
class ProjectSettingsDefault
{
public:
/**
* \brief load all the project defaults parameters
* \param part the settings part in wich the default values will
* be loaded
*/
static void load( const QString& part );
private:
/**
* \brief will load the project Audio related values.
* \param part the settings part in wich the audio default
* values will be loaded
*/
static void loadAudioDefaults( const QString& part );
/**
* \brief will load the project Video related values.
* \param part the settings part in wich the audio default
* values will be loaded
*/
static void loadVideoDefaults( const QString& part );
/**
* \brief will load the Project global values.
* \param part the settings part in wich the project default
* values will be loaded
*/
static void loadProjectDefaults( const QString& part );
private:
ProjectSettingsDefault();
~ProjectSettingsDefault();
ProjectSettingsDefault( const ProjectSettingsDefault & );
ProjectSettingsDefault& operator = ( const ProjectSettingsDefault& );
};
#endif
/*****************************************************************************
* VLMCSettingsDefault.cpp: VLMC default Settings class
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
*
* 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 <QtDebug>
#include <QVariant>
#include <QDir>
#include "VLMCSettingsDefault.h"
#include "SettingsManager.h"
void VLMCSettingsDefault::load( const QString& part )
{
SettingsManager::getInstance()->addNewSettingsPart( part );
VLMCSettingsDefault::loadVLMCDefaults( part );
VLMCSettingsDefault::loadlanguageDefaults( part );
SettingsManager::getInstance()->commit();
return ;
}
void VLMCSettingsDefault::loadVLMCDefaults( const QString& part )
{
SettingsManager* settingsMan = SettingsManager::getInstance();
settingsMan->setValue( part,
"VLMCOutPutFPS", "30" );
settingsMan->setValue( part,
"VLMCTracksNb",
"64" );
settingsMan->setValue( part,
"VLMCWorkspace",
QDir::homePath() );
settingsMan->setValue( part, "AutomaticBackup", false );
settingsMan->setValue( part, "AutomaticBackupInterval", 5 );
settingsMan->setValue( "private", "LogLevel", QtWarningMsg );
settingsMan->setValue( "private", "LogFile", "vlmc.log" );
return ;
}
void VLMCSettingsDefault::loadlanguageDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
setMan->setValue( part, "VLMCLang", "en_US" );
return ;
}
void VLMCSettingsDefault::loadKeyboardShortcutDefaults()
{
SettingsManager::getInstance()->addNewSettingsPart( "keyboard_shortcut" );
loadKeyboardShortcutDefaults( "default" );
loadKeyboardShortcutDefaults( "keyboard_shortcut" );
SettingsManager::getInstance()->commit();
}
#define ADD_SHORTCUT(NAME, KEYS) setMan->setValue( part, QObject::tr( NAME ), QVariant( QObject::tr( KEYS ) ) )
void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
ADD_SHORTCUT( "Default mode", "n" );
ADD_SHORTCUT( "Cut mode", "x" );
ADD_SHORTCUT( "Launch media preview", "Ctrl+Return" );
ADD_SHORTCUT( "Start render preview", "Space" );
//A bit nasty, but we better use what Qt's providing as default shortcut
ADD_SHORTCUT( "Undo", QKeySequence( QKeySequence::Undo ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Redo", QKeySequence( QKeySequence::Redo ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Help", QKeySequence( QKeySequence::HelpContents ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Quit", "Ctrl+Q" );
ADD_SHORTCUT( "Preferences", "Alt+P" );
ADD_SHORTCUT( "Fullscreen", "F" );
ADD_SHORTCUT( "New project", QKeySequence( QKeySequence::New ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Open project", QKeySequence( QKeySequence::Open ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Save", QKeySequence( QKeySequence::Save ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Save as", "Ctrl+Shift+S" );
ADD_SHORTCUT( "Close project", QKeySequence( QKeySequence::Close ).toString().toLocal8Bit() );
ADD_SHORTCUT( "Import media", "Ctrl+I" );
ADD_SHORTCUT( "Render project", "Ctrl+R" );
return ;
}
#undef ADD_SHORTCUT
/*****************************************************************************
* VLMCSettingsDefault.h: VLMC default Settings class
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
*
* 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.
*****************************************************************************/
#ifndef VLMCSETTINGSDEFAULT_H
#define VLMCSETTINGSDEFAULT_H
#include <QString>
/**
* \class VLMCSettingsDefault
*
* \brief Static class for loading default parameters
* for the application
*/
class VLMCSettingsDefault
{
public:
/**
* \brief load all the application defaults parameters
* \param part the settings part in wich the default values will
* be loaded
*/
static void load( const QString& part );
/**
* \brief will load the values for the shortcuts settings.
*
* This method will create a new part in the settings Manager
* called keyboard_shortcut
* \sa loadKeyboardShortcutDefaults( const QString& part )
*/
static void loadKeyboardShortcutDefaults();
private:
/**
* \brief will load the values for the application global values.
* \param part the settings part in wich the global default
* values will be loaded
*/
static void loadVLMCDefaults( const QString& part );
/**
* \brief will load the values for the language settings.
* \param part the settings part in wich the language
* default values will be loaded
*/
static void loadlanguageDefaults( const QString& part );
/**
* \brief will load the values for the shortcuts settings.
* \param part the settings part in wich the language
* default values will be loaded
*/
static void loadKeyboardShortcutDefaults( const QString& part );
private:
VLMCSettingsDefault();
~VLMCSettingsDefault();
VLMCSettingsDefault( const VLMCSettingsDefault& );
VLMCSettingsDefault& operator = ( const VLMCSettingsDefault& );
};
#endif
......@@ -58,7 +58,6 @@
#include "ProjectWizard.h"
#include "ProjectPreferences.h"
#include "VLMCPreferences.h"
#include "VLMCSettingsDefault.h"
#include "AudioProjectPreferences.h"
#include "VideoProjectPreferences.h"
#include "LanguagePreferences.h"
......
/*****************************************************************************
* CustomWizardPage.cpp: Generic wizard page with embeded preferenceWidget
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
*
* 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 <QVBoxLayout>
#include <QtDebug>
#include "CustomWizardPage.h"
#include "VideoProjectPreferences.h"
CustomWizardPage::CustomWizardPage( const char* title, QWidget* parent )
: QWizardPage( parent )
{
setTitle( tr( title ) );
if ( parent != 0 )
{
QObject::connect( parent,
SIGNAL( flush() ),
this,
SLOT( restart() ) );
}
}
CustomWizardPage::~CustomWizardPage()
{
//Nothing to do
}
void CustomWizardPage::setInternalWidget( PreferenceWidget* widg )
{
m_widget = widg;
m_widget->setDefaults( true );
m_widget->setName( "project" );
m_widget->load();
QVBoxLayout* layout = new QVBoxLayout( this );
layout->addWidget( m_widget );
setLayout( layout );
}
bool CustomWizardPage::validatePage()
{
m_widget->save();
return true;
}
void CustomWizardPage::restart()
{
m_widget->load();
}
/*****************************************************************************
* CustomWizardPage.h: Generic wizard page with embeded preferenceWidget
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
*
* 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.
*****************************************************************************/
#ifndef CUSTOMWIZARDPAGE_H
#define CUSTOMWIZARDPAGE_H
#include <QWidget>
#include <QWizardPage>
#include "PreferenceWidget.h"
class CustomWizardPage : public QWizardPage
{
Q_OBJECT
public:
CustomWizardPage( const char* title, QWidget* parent = 0 );
~CustomWizardPage();
void setInternalWidget( PreferenceWidget* widg );
bool validatePage();
private:
PreferenceWidget* m_widget;
public slots:
void restart();
};
#endif
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