Commit b0f05b29 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Saving keyboard shortcuts

parent 3d12a9ae
......@@ -89,6 +89,7 @@ void SettingsManager::saveSettings( const QString& part, QDomDocument& xmlfile,
m_globalLock.lockForRead();
if ( !m_data.contains( part ) )
{
qDebug() << "no part named" << part;
m_globalLock.unlock();
return ;
}
......
......@@ -61,3 +61,21 @@ void VLMCSettingsDefault::loadlanguageDefaults( const QString& part )
return ;
}
void VLMCSettingsDefault::loadKeyboardShortcutDefaults()
{
SettingsManager::getInstance()->addNewSettingsPart( "keyboard_shortcut" );
loadKeyboardShortcutDefaults( "default" );
loadKeyboardShortcutDefaults( "keyboard_shortcut" );
SettingsManager::getInstance()->commit();
}
void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part )
{
SettingsManager* setMan = SettingsManager::getInstance();
setMan->setValue( part, "cut_cursor", QVariant( QObject::tr( "x" ) ) );
setMan->setValue( part, "normal_cursor", QVariant( QObject::tr( "n" ) ) );
return ;
}
......@@ -27,10 +27,12 @@ class VLMCSettingsDefault
{
public:
static void load( const QString& part );
static void loadKeyboardShortcutDefaults();
private:
static void loadVLMCDefaults( const QString& part );
static void loadlanguageDefaults( const QString& part );
static void loadKeyboardShortcutDefaults( const QString& part );
private:
VLMCSettingsDefault();
~VLMCSettingsDefault();
......
......@@ -67,6 +67,7 @@ MainWindow::MainWindow( QWidget *parent ) :
// Settings
VLMCSettingsDefault::load( "default" );
VLMCSettingsDefault::load( "VLMC" );
VLMCSettingsDefault::loadKeyboardShortcutDefaults();
// GUI
DockWidgetManager::instance( this )->setMainWindow( this );
......@@ -269,6 +270,10 @@ void MainWindow::createGlobalPreferences()
new LanguagePreferences( m_globalPreferences ),
QIcon( ":/images/images/vlmc.png" ),
"Langage settings");
// m_projectPreferences->addWidget( "Keyboard",
// new KeyboardShortcut,
// QIcon( ":/images/images/keyboard.png" ),
// tr( "Keyboard Settings" ) );
m_globalPreferences->build();
}
......@@ -287,10 +292,6 @@ void MainWindow::createProjectPreferences()
new AudioProjectPreferences,
QIcon( ":/images/images/audio.png" ),
"Audio settings" );
// m_projectPreferences->addWidget( "Keyboard",
// new KeyboardShortcut,
// QIcon( ":/images/images/keyboard.png" ),
// tr( "Keyboard Settings" ) );
m_projectPreferences->build();
}
......
......@@ -128,6 +128,7 @@ void ProjectManager::saveProject( bool saveAs /*= true*/ )
Library::getInstance()->saveProject( doc, rootNode );
MainWorkflow::getInstance()->saveProject( doc, rootNode );
SettingsManager::getInstance()->saveSettings( "project", doc, rootNode );
SettingsManager::getInstance()->saveSettings( "keyboard_shortcut", doc, rootNode );
doc.appendChild( rootNode );
......
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