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

Removed all call to the old SettingsManager API ProjectManager now use the new SettingsManager API

Shortcut Management now use the new SettingsManager API

VlmcDebug now use the new SettingsManager API
Signed-off-by: default avatarHugo Beauzee-Luyssen <beauze.h@gmail.com>
parent 06c6c7d9
......@@ -12,7 +12,9 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QWidget* pa
QVariant set = SettingsManager::getInstance()->value( name );
if ( m_menu == false )
setKey( QKeySequence( set.toString() ) );
//connect( set, SIGNAL( changed( const QVariant& ) ), this, SLOT( shortcutUpdated( const QVariant& ) ) );
SettingsManager::getInstance()->watchValue( name, this,
SLOT( shortcutUpdated( const QVariant& ) ),
SettingsManager::QSett );
}
void KeyboardShortcutHelper::shortcutUpdated( const QVariant& value )
......
......@@ -476,9 +476,9 @@ void MainWindow::on_actionRedo_triggered()
}
#define INIT_SHORTCUT( instName, shortcutName, actionInstance ) \
QVariant instName = SettingsManager::getInstance()->value( shortcutName, "Ctrl+x" );\
QVariant instName = SettingsManager::getInstance()->value( "keyboard/" shortcutName );\
KeyboardShortcutHelper* helper##instName = new KeyboardShortcutHelper( shortcutName, this, true ); \
connect( helper##instName, SIGNAL( changed( const QString&, const QString&) ), this, SLOT( keyboardShortcutChanged(QString,QString)) ); \
connect( helper##instName, SIGNAL( changed( const QString&, const QString&) ), this, SLOT( keyboardShortcutChanged(const QString&, const QString&)) ); \
m_ui.actionInstance->setShortcut( instName.toString() );
void MainWindow::initializeMenuKeyboardShortcut()
......@@ -502,7 +502,6 @@ void MainWindow::initializeMenuKeyboardShortcut()
void MainWindow::keyboardShortcutChanged( const QString& name, const QString& val )
{
qDebug() << "shortcut" << name << "changed to" << val;
if ( name == "Help" )
m_ui.actionHelp->setShortcut( val );
else if ( name == "Quit" )
......
......@@ -20,8 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtDebug>
#include "KeyboardShortcut.h"
#include "KeyboardShortcutInput.h"
#include "SettingsManager.h"
......@@ -30,22 +28,22 @@ KeyboardShortcut::KeyboardShortcut( QWidget* parent )
: PreferenceWidget( parent ),
m_type( SettingsManager::QSett )
{
// m_layout = new QFormLayout( this );
// const SettingsPart* parts = SettingsManager::getInstance()->getConfigPart( "keyboard_shortcut" );
// Q_ASSERT( parts != NULL );
m_layout = new QFormLayout( this );
const QHash<QString, QVariant> shortcutGroup = SettingsManager::getInstance()->group( "keyboard", SettingsManager::QSett );
Q_ASSERT( !shortcutGroup.size() == 0 );
// SettingsPart::ConfigPair::const_iterator it = parts->m_data.begin();
// SettingsPart::ConfigPair::const_iterator ite = parts->m_data.end();
// while ( it != ite )
// {
// m_keySeq[it.key()] = new QKeySequence( it.value()->get().toString() );
// KeyboardShortcutInput* ksi = new KeyboardShortcutInput( it.key(), m_keySeq[it.key()]->toString(), this );
// m_layout->addRow( it.key(), ksi );
// connect( ksi, SIGNAL( changed( const QString&, const QString& ) ),
// this, SLOT( shortcutUpdated( const QString&, const QString& ) ) );
// ++it;
// }
// setLayout( m_layout );
QHash<QString, QVariant>::const_iterator it = shortcutGroup.begin();
QHash<QString, QVariant>::const_iterator ite = shortcutGroup.end();
while ( it != ite )
{
m_keySeq[it.key()] = new QKeySequence( it.value().toString() );
KeyboardShortcutInput* ksi = new KeyboardShortcutInput( it.key(), m_keySeq[it.key()]->toString(), this );
m_layout->addRow( it.key(), ksi );
connect( ksi, SIGNAL( changed( const QString&, const QString& ) ),
this, SLOT( shortcutUpdated( const QString&, const QString& ) ) );
++it;
}
setLayout( m_layout );
}
KeyboardShortcut::~KeyboardShortcut()
......
......@@ -77,22 +77,25 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
QVariant val =
SettingsManager::getInstance()->value( "project/ProjectName", unNamedProject, SettingsManager::XML );
#warning __LINE__ __FILE__ FIXME !!!!
//connect( val, SIGNAL( changed( QVariant) ), this, SLOT(projectNameChanged(QVariant) ) );
SettingsManager::getInstance()->watchValue( "project/ProjectName", this,
SLOT(projectNameChanged(QVariant) ),
SettingsManager::XML );
//Automatic save part :
m_timer = new QTimer( this );
connect( m_timer, SIGNAL( timeout() ), this, SLOT( autoSaveRequired() ) );
QVariant autoSaveEnabled =
SettingsManager::getInstance()->value( "global/AutomaticBackup", false, SettingsManager::QSett );
#warning __LINE__ __FILE__ FIXME !!!!
//connect( autoSaveEnabled, SIGNAL( changed( QVariant ) ),
// this, SLOT( automaticSaveEnabledChanged( QVariant ) ), Qt::QueuedConnection );
SettingsManager::getInstance()->watchValue( "global/AutomaticBackup", this,
SLOT( automaticSaveEnabledChanged(QVariant) ),
SettingsManager::QSett,
Qt::QueuedConnection );
QVariant autoSaveInterval =
SettingsManager::getInstance()->value( "global/AutomaticBackupInterval", 5, SettingsManager::QSett );
#warning __LINE__ __FILE__ FIXME !!!!
//connect( autoSaveInterval, SIGNAL( changed( QVariant ) ),
// this, SLOT( automaticSaveIntervalChanged(QVariant) ), Qt::QueuedConnection );
SettingsManager::getInstance()->watchValue( "global/AutomaticBackupInterval", this,
SLOT( automaticSaveIntervalChanged(QVariant) ),
SettingsManager::QSett,
Qt::QueuedConnection );
automaticSaveEnabledChanged( autoSaveEnabled );
}
......@@ -167,8 +170,7 @@ void ProjectManager::loadProject( const QString& fileName )
parseProjectNode( root.firstChildElement( "project" ) );
connect( Library::getInstance(), SIGNAL( projectLoaded() ), this, SLOT( loadTimeline() ) );
Library::getInstance()->loadProject( root.firstChildElement( "medias" ) );
#warning FIXME
//SettingsManager::getInstance()->load( root.firstChildElement( "project" ) );
SettingsManager::getInstance()->load( root.firstChildElement( "project" ) );
}
QString ProjectManager::acquireProjectFileName()
......@@ -222,10 +224,7 @@ void ProjectManager::__saveProject( const QString &fileName )
Library::getInstance()->saveProject( doc, rootNode );
MainWorkflow::getInstance()->saveProject( doc, rootNode );
#warning FIXME
//SettingsManager::getInstance()->saveSettings( "project", doc, rootNode );
#warning FIXME
//SettingsManager::getInstance()->saveSettings( "keyboard_shortcut", doc, rootNode );
SettingsManager::getInstance()->save( doc, rootNode );
doc.appendChild( rootNode );
......
......@@ -50,8 +50,9 @@ VlmcDebug::VlmcDebug() : m_logFile( NULL )
QVariant setVal = SettingsManager::getInstance()->value( "private/LogFile", "log.vlmc", SettingsManager::QSett );
#warning FIXME
//connect( setVal, SIGNAL( changed( QVariant ) ), this, SLOT( logFileChanged( const QVariant& ) ) );
SettingsManager::getInstance()->watchValue( "private/LogFile", this,
SLOT( logFileChanged( const QVariant& ) ),
SettingsManager::QSett );
QObject::connect( qApp,
SIGNAL( aboutToQuit() ),
this,
......
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