Commit fe521d0c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Use vlmc/ instead of general/ as a settings category

parent ffa7a222
...@@ -263,25 +263,25 @@ MainWindow::initVlmcPreferences() ...@@ -263,25 +263,25 @@ MainWindow::initVlmcPreferences()
QT_TRANSLATE_NOOP( "PreferenceWidget", "Select the cut/razor tool in the timeline" ), actionCut_mode ); QT_TRANSLATE_NOOP( "PreferenceWidget", "Select the cut/razor tool in the timeline" ), actionCut_mode );
//Setup VLMC Lang. Preferences... //Setup VLMC Lang. Preferences...
VLMC_CREATE_PREFERENCE_LANGUAGE( "general/VLMCLang", "default", VLMC_CREATE_PREFERENCE_LANGUAGE( "vlmc/VLMCLang", "default",
QT_TRANSLATE_NOOP( "PreferenceWidget", "Language" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "Language" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The VLMC's UI language" ) ); QT_TRANSLATE_NOOP( "PreferenceWidget", "The VLMC's UI language" ) );
SettingsManager::getInstance()->watchValue( "general/VLMCLang", SettingsManager::getInstance()->watchValue( "vlmc/VLMCLang",
LanguageHelper::getInstance(), LanguageHelper::getInstance(),
SLOT( languageChanged( const QVariant& ) ), SLOT( languageChanged( const QVariant& ) ),
SettingsManager::Vlmc ); SettingsManager::Vlmc );
//Setup VLMC General Preferences... //Setup VLMC General Preferences...
VLMC_CREATE_PREFERENCE_BOOL( "general/ConfirmDeletion", true, VLMC_CREATE_PREFERENCE_BOOL( "vlmc/ConfirmDeletion", true,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Confirm clip deletion"), QT_TRANSLATE_NOOP( "PreferenceWidget", "Confirm clip deletion"),
QT_TRANSLATE_NOOP( "PreferenceWidget", "Ask for confirmation before deleting a clip from the timeline" ) ); QT_TRANSLATE_NOOP( "PreferenceWidget", "Ask for confirmation before deleting a clip from the timeline" ) );
VLMC_CREATE_PREFERENCE_PATH( "general/DefaultProjectLocation", QDir::homePath(), VLMC_CREATE_PREFERENCE_PATH( "vlmc/DefaultProjectLocation", QDir::homePath(),
QT_TRANSLATE_NOOP( "PreferenceWidget", "Project default location" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "Project default location" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The default location where to store projects folders" ) ); QT_TRANSLATE_NOOP( "PreferenceWidget", "The default location where to store projects folders" ) );
VLMC_CREATE_PREFERENCE_PATH( "general/TempFolderLocation", QDir::tempPath() + "/VLMC/", VLMC_CREATE_PREFERENCE_PATH( "vlmc/TempFolderLocation", QDir::tempPath() + "/VLMC/",
QT_TRANSLATE_NOOP( "PreferenceWidget", "Temporary folder" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "Temporary folder" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The temporary folder used by VLMC to process videos." ) ); QT_TRANSLATE_NOOP( "PreferenceWidget", "The temporary folder used by VLMC to process videos." ) );
...@@ -519,7 +519,7 @@ void ...@@ -519,7 +519,7 @@ void
MainWindow::createGlobalPreferences() MainWindow::createGlobalPreferences()
{ {
m_globalPreferences = new Settings( SettingsManager::Vlmc, this ); m_globalPreferences = new Settings( SettingsManager::Vlmc, this );
m_globalPreferences->addCategory( "general", QT_TRANSLATE_NOOP( "Settings", "General" ), SettingsManager::Vlmc, m_globalPreferences->addCategory( "vlmc", QT_TRANSLATE_NOOP( "Settings", "General" ), SettingsManager::Vlmc,
QIcon( ":/images/vlmc" ) ); QIcon( ":/images/vlmc" ) );
m_globalPreferences->addCategory( "keyboard", QT_TRANSLATE_NOOP( "Settings", "Keyboard" ), SettingsManager::Vlmc, m_globalPreferences->addCategory( "keyboard", QT_TRANSLATE_NOOP( "Settings", "Keyboard" ), SettingsManager::Vlmc,
QIcon( ":/images/keyboard" ) ); QIcon( ":/images/keyboard" ) );
...@@ -564,18 +564,18 @@ void ...@@ -564,18 +564,18 @@ void
MainWindow::checkFolders() MainWindow::checkFolders()
{ {
QDir dirUtil; QDir dirUtil;
if ( !dirUtil.exists( VLMC_GET_STRING( "general/DefaultProjectLocation" ) ) ) if ( !dirUtil.exists( VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "general/DefaultProjectLocation" ) ); dirUtil.mkdir( VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ) );
if ( !dirUtil.exists( VLMC_GET_STRING( "general/TempFolderLocation" ) ) ) if ( !dirUtil.exists( VLMC_GET_STRING( "vlmc/TempFolderLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "general/TempFolderLocation" ) ); dirUtil.mkdir( VLMC_GET_STRING( "vlmc/TempFolderLocation" ) );
} }
void void
MainWindow::clearTemporaryFiles() MainWindow::clearTemporaryFiles()
{ {
QDir dirUtil; QDir dirUtil;
if( dirUtil.cd( VLMC_GET_STRING( "general/TempFolderLocation" ) ) ) if( dirUtil.cd( VLMC_GET_STRING( "vlmc/TempFolderLocation" ) ) )
foreach ( const QString &file, dirUtil.entryList( QDir::Files ) ) foreach ( const QString &file, dirUtil.entryList( QDir::Files ) )
dirUtil.remove( file ); dirUtil.remove( file );
} }
...@@ -681,8 +681,8 @@ MainWindow::on_actionShare_On_Internet_triggered() ...@@ -681,8 +681,8 @@ MainWindow::on_actionShare_On_Internet_triggered()
return; return;
checkFolders(); checkFolders();
QString fileName = VLMC_GET_STRING( "general/TempFolderLocation" ) + "/" + QString fileName = VLMC_GET_STRING( "vlmc/TempFolderLocation" ) + "/" +
VLMC_PROJECT_GET_STRING( "general/ProjectName" ) + VLMC_PROJECT_GET_STRING( "vlmc/ProjectName" ) +
"-vlmc.mp4"; "-vlmc.mp4";
loadGlobalProxySettings(); loadGlobalProxySettings();
......
...@@ -42,8 +42,8 @@ RendererSettings::RendererSettings( bool shareOnInternet ) ...@@ -42,8 +42,8 @@ RendererSettings::RendererSettings( bool shareOnInternet )
m_ui.outputFileName->setVisible( false ); m_ui.outputFileName->setVisible( false );
m_ui.outputFileNameButton->setVisible( false ); m_ui.outputFileNameButton->setVisible( false );
m_ui.outputFileName->setText( m_ui.outputFileName->setText(
VLMC_GET_STRING( "general/TempFolderLocation" ) + "/" + VLMC_GET_STRING( "vlmc/TempFolderLocation" ) + "/" +
VLMC_PROJECT_GET_STRING( "general/ProjectName" ) + "-vlmc.mp4" ); VLMC_PROJECT_GET_STRING( "vlmc/ProjectName" ) + "-vlmc.mp4" );
setWindowTitle( tr("Export Settings: Publish on Internet") ); setWindowTitle( tr("Export Settings: Publish on Internet") );
} }
......
...@@ -46,7 +46,7 @@ ShareOnInternet::ShareOnInternet( QWidget* parent ) ...@@ -46,7 +46,7 @@ ShareOnInternet::ShareOnInternet( QWidget* parent )
case YOUTUBE: case YOUTUBE:
m_ui.username->setText( VLMC_GET_STRING( "youtube/Username" ) ); m_ui.username->setText( VLMC_GET_STRING( "youtube/Username" ) );
m_ui.password->setText( VLMC_GET_STRING( "youtube/Password" ) ); m_ui.password->setText( VLMC_GET_STRING( "youtube/Password" ) );
m_ui.title->setText( VLMC_PROJECT_GET_STRING( "general/ProjectName" ) ); m_ui.title->setText( VLMC_PROJECT_GET_STRING( "vlmc/ProjectName" ) );
break; break;
} }
} }
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <QHeaderView> #include <QHeaderView>
#include <QMessageBox> #include <QMessageBox>
#include <QPalette> #include <QPalette>
#include <QSettings>
#include <QTime> #include <QTime>
#include <QTimer> #include <QTimer>
......
...@@ -43,25 +43,25 @@ GUIProjectManager::GUIProjectManager() ...@@ -43,25 +43,25 @@ GUIProjectManager::GUIProjectManager()
//Automatic save part : //Automatic save part :
m_timer = new QTimer( this ); m_timer = new QTimer( this );
connect( m_timer, SIGNAL( timeout() ), this, SLOT( autoSaveRequired() ) ); connect( m_timer, SIGNAL( timeout() ), this, SLOT( autoSaveRequired() ) );
VLMC_CREATE_PREFERENCE_BOOL( "general/AutomaticBackup", false, VLMC_CREATE_PREFERENCE_BOOL( "vlmc/AutomaticBackup", false,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "When this option is activated," QT_TRANSLATE_NOOP( "PreferenceWidget", "When this option is activated,"
"VLMC will automatically save your project " "VLMC will automatically save your project "
"at a specified interval" ) ); "at a specified interval" ) );
SettingsManager::getInstance()->watchValue( "general/AutomaticBackup", this, SettingsManager::getInstance()->watchValue( "vlmc/AutomaticBackup", this,
SLOT( automaticSaveEnabledChanged(QVariant) ), SLOT( automaticSaveEnabledChanged(QVariant) ),
SettingsManager::Vlmc, SettingsManager::Vlmc,
Qt::QueuedConnection ); Qt::QueuedConnection );
VLMC_CREATE_PREFERENCE_INT( "general/AutomaticBackupInterval", 5, VLMC_CREATE_PREFERENCE_INT( "vlmc/AutomaticBackupInterval", 5,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save interval" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "Automatic save interval" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "This is the interval that VLMC will wait " QT_TRANSLATE_NOOP( "PreferenceWidget", "This is the interval that VLMC will wait "
"between two automatic save" ) ); "between two automatic save" ) );
SettingsManager::getInstance()->watchValue( "general/AutomaticBackupInterval", this, SettingsManager::getInstance()->watchValue( "vlmc/AutomaticBackupInterval", this,
SLOT( automaticSaveIntervalChanged(QVariant) ), SLOT( automaticSaveIntervalChanged(QVariant) ),
SettingsManager::Vlmc, SettingsManager::Vlmc,
Qt::QueuedConnection ); Qt::QueuedConnection );
automaticSaveEnabledChanged( VLMC_GET_BOOL( "general/AutomaticBackup" ) ); automaticSaveEnabledChanged( VLMC_GET_BOOL( "vlmc/AutomaticBackup" ) );
SettingsManager::getInstance()->watchValue( "general/ProjectName", this, SettingsManager::getInstance()->watchValue( "vlmc/ProjectName", this,
SLOT(projectNameChanged(QVariant) ), SLOT(projectNameChanged(QVariant) ),
SettingsManager::Project ); SettingsManager::Project );
} }
...@@ -121,9 +121,9 @@ GUIProjectManager::createNewProjectFile( bool saveAs ) ...@@ -121,9 +121,9 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
{ {
bool relocate = false; bool relocate = false;
QString defaultPath = VLMC_PROJECT_GET_STRING( "general/Workspace" ); QString defaultPath = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
if ( defaultPath.length() == 0 ) if ( defaultPath.length() == 0 )
defaultPath = VLMC_GET_STRING( "general/DefaultProjectLocation" ); defaultPath = VLMC_GET_STRING( "vlmc/DefaultProjectLocation" );
QString outputFileName = QString outputFileName =
QFileDialog::getSaveFileName( NULL, tr( "Enter the output file name" ), QFileDialog::getSaveFileName( NULL, tr( "Enter the output file name" ),
defaultPath, tr( "VLMC project file(*.vlmc)" ) ); defaultPath, tr( "VLMC project file(*.vlmc)" ) );
...@@ -141,7 +141,7 @@ GUIProjectManager::createNewProjectFile( bool saveAs ) ...@@ -141,7 +141,7 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
outputFileName += ".vlmc"; outputFileName += ".vlmc";
m_projectFile = new QFile( outputFileName ); m_projectFile = new QFile( outputFileName );
QFileInfo fInfo( outputFileName ); QFileInfo fInfo( outputFileName );
SettingsManager::getInstance()->setValue( "general/Workspace", SettingsManager::getInstance()->setValue( "vlmc/Workspace",
fInfo.absolutePath(), SettingsManager::Project); fInfo.absolutePath(), SettingsManager::Project);
appendToRecentProject( projectName() ); appendToRecentProject( projectName() );
...@@ -201,7 +201,7 @@ GUIProjectManager::automaticSaveEnabledChanged( const QVariant& val ) ...@@ -201,7 +201,7 @@ GUIProjectManager::automaticSaveEnabledChanged( const QVariant& val )
if ( enabled == true ) if ( enabled == true )
{ {
int interval = VLMC_GET_INT( "general/AutomaticBackupInterval" ); int interval = VLMC_GET_INT( "vlmc/AutomaticBackupInterval" );
m_timer->start( interval * 1000 * 60 ); m_timer->start( interval * 1000 * 60 );
} }
else else
...@@ -211,7 +211,7 @@ GUIProjectManager::automaticSaveEnabledChanged( const QVariant& val ) ...@@ -211,7 +211,7 @@ GUIProjectManager::automaticSaveEnabledChanged( const QVariant& val )
void void
GUIProjectManager::automaticSaveIntervalChanged( const QVariant& val ) GUIProjectManager::automaticSaveIntervalChanged( const QVariant& val )
{ {
bool enabled = VLMC_GET_BOOL( "general/AutomaticBackup" ); bool enabled = VLMC_GET_BOOL( "vlmc/AutomaticBackup" );
if ( enabled == false ) if ( enabled == false )
return ; return ;
...@@ -302,7 +302,7 @@ GUIProjectManager::loadProject() ...@@ -302,7 +302,7 @@ GUIProjectManager::loadProject()
{ {
QString fileName = QString fileName =
QFileDialog::getOpenFileName( NULL, tr( "Please choose a project file" ), QFileDialog::getOpenFileName( NULL, tr( "Please choose a project file" ),
VLMC_GET_STRING( "general/DefaultProjectLocation" ), VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ),
tr( "VLMC project file(*.vlmc)" ) ); tr( "VLMC project file(*.vlmc)" ) );
if ( fileName.length() <= 0 ) //If the user canceled. if ( fileName.length() <= 0 ) //If the user canceled.
return ; return ;
......
...@@ -80,7 +80,7 @@ TracksScene::askRemoveSelectedItems() ...@@ -80,7 +80,7 @@ TracksScene::askRemoveSelectedItems()
if ( tv->currentAction() != TracksView::None ) if ( tv->currentAction() != TracksView::None )
return ; return ;
if ( VLMC_GET_BOOL( "general/ConfirmDeletion" ) == true ) if ( VLMC_GET_BOOL( "vlmc/ConfirmDeletion" ) == true )
{ {
QString message; QString message;
if ( selectedItems().size() == 1 ) if ( selectedItems().size() == 1 )
...@@ -101,7 +101,7 @@ TracksScene::askRemoveSelectedItems() ...@@ -101,7 +101,7 @@ TracksScene::askRemoveSelectedItems()
return ; return ;
if ( clicked == always ) if ( clicked == always )
{ {
SettingsManager::getInstance()->setValue( "general/ConfirmDeletion", SettingsManager::getInstance()->setValue( "vlmc/ConfirmDeletion",
false, SettingsManager::Vlmc ); false, SettingsManager::Vlmc );
} }
} }
......
...@@ -81,7 +81,7 @@ GeneralPage::initializePage() ...@@ -81,7 +81,7 @@ GeneralPage::initializePage()
ui.lineEditName->setText( projectName ); ui.lineEditName->setText( projectName );
//fetching the global workspace path //fetching the global workspace path
QString workspacePath = VLMC_GET_STRING( "general/DefaultProjectLocation" ); QString workspacePath = VLMC_GET_STRING( "vlmc/DefaultProjectLocation" );
ui.lineEditWorkspace->setText( workspacePath ); ui.lineEditWorkspace->setText( workspacePath );
//Reinit description field //Reinit description field
......
...@@ -100,9 +100,9 @@ ProjectWizard::accept() ...@@ -100,9 +100,9 @@ ProjectWizard::accept()
SettingsManager *sManager = SettingsManager::getInstance(); SettingsManager *sManager = SettingsManager::getInstance();
GUIProjectManager::getInstance()->newProject( field( "projectName" ).toString(), field( "projectPath" ).toString() ); GUIProjectManager::getInstance()->newProject( field( "projectName" ).toString(), field( "projectPath" ).toString() );
//Save the project workspace //Save the project workspace
sManager->setValue( "general/Workspace", field( "projectPath" ), SettingsManager::Project ); sManager->setValue( "vlmc/Workspace", field( "projectPath" ), SettingsManager::Project );
//And the default vlmc workspace //And the default vlmc workspace
sManager->setValue( "general/DefaultProjectLocation", field( "workspace" ), SettingsManager::Vlmc ); sManager->setValue( "vlmc/DefaultProjectLocation", field( "workspace" ), SettingsManager::Vlmc );
sManager->setValue( "video/VLMCOutputFPS", field( "fps" ), SettingsManager::Project ); sManager->setValue( "video/VLMCOutputFPS", field( "fps" ), SettingsManager::Project );
sManager->setValue( "video/VideoProjectHeight", field( "height" ), SettingsManager::Project ); sManager->setValue( "video/VideoProjectHeight", field( "height" ), SettingsManager::Project );
......
...@@ -142,7 +142,7 @@ WelcomePage::loadProject() ...@@ -142,7 +142,7 @@ WelcomePage::loadProject()
{ {
QString projectPath = QString projectPath =
QFileDialog::getOpenFileName( NULL, tr( "Select a project file" ), QFileDialog::getOpenFileName( NULL, tr( "Select a project file" ),
VLMC_GET_STRING( "general/DefaultProjectLocation" ), VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ),
tr( "VLMC project file(*.vlmc)" ) ); tr( "VLMC project file(*.vlmc)" ) );
if ( projectPath.isEmpty() ) return; if ( projectPath.isEmpty() ) return;
......
...@@ -65,7 +65,7 @@ Library::loadProject( const QDomElement& doc ) ...@@ -65,7 +65,7 @@ Library::loadProject( const QDomElement& doc )
if ( mrl.startsWith( Workspace::workspacePrefix ) == true ) if ( mrl.startsWith( Workspace::workspacePrefix ) == true )
{ {
//Transforming the workspace://[path] into [project-path]/[path] //Transforming the workspace://[path] into [project-path]/[path]
QString projectPath = VLMC_PROJECT_GET_STRING( "general/Workspace" ); QString projectPath = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
mrl = projectPath + mrl.mid( Workspace::workspacePrefix.length() ); mrl = projectPath + mrl.mid( Workspace::workspacePrefix.length() );
} }
Media* m = addMedia( mrl ); Media* m = addMedia( mrl );
......
...@@ -207,7 +207,7 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC ) ...@@ -207,7 +207,7 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
//Handle workspace stuff. //Handle workspace stuff.
if ( media.startsWith( Workspace::workspacePrefix ) == true ) if ( media.startsWith( Workspace::workspacePrefix ) == true )
media = media.replace( Workspace::workspacePrefix, VLMC_PROJECT_GET_STRING( "general/Workspace" ) ); media = media.replace( Workspace::workspacePrefix, VLMC_PROJECT_GET_STRING( "vlmc/Workspace" ) );
if ( m_medias.contains( media ) == true ) if ( m_medias.contains( media ) == true )
{ {
Media* m = m_medias[media]; Media* m = m_medias[media];
......
...@@ -70,7 +70,7 @@ VLMCmain( int argc, char **argv ) ...@@ -70,7 +70,7 @@ VLMCmain( int argc, char **argv )
QSettings s; QSettings s;
LanguageHelper::getInstance()->languageChanged( LanguageHelper::getInstance()->languageChanged(
s.value( "general/VLMCLang", "default" ) ); s.value( "vlmc/VLMCLang", "default" ) );
#if defined( Q_WS_WIN ) #if defined( Q_WS_WIN )
......
...@@ -43,7 +43,7 @@ Transcoder::Transcoder( Media* media ) : ...@@ -43,7 +43,7 @@ Transcoder::Transcoder( Media* media ) :
void void
Transcoder::transcodeToPs() Transcoder::transcodeToPs()
{ {
QString outputDir = VLMC_PROJECT_GET_STRING( "general/Workspace" ); QString outputDir = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
LibVLCpp::Media *media = new LibVLCpp::Media( m_media->fileInfo()->absoluteFilePath() ); LibVLCpp::Media *media = new LibVLCpp::Media( m_media->fileInfo()->absoluteFilePath() );
if ( outputDir.length() == 0 ) if ( outputDir.length() == 0 )
......
...@@ -77,12 +77,12 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false ) ...@@ -77,12 +77,12 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
QT_TRANSLATE_NOOP("PreferenceWidget", "Number of audio channels" ), QT_TRANSLATE_NOOP("PreferenceWidget", "Number of audio channels" ),
SettingValue::Clamped ); SettingValue::Clamped );
audioChannel->setLimits( 2, 2 ); audioChannel->setLimits( 2, 2 );
VLMC_CREATE_PROJECT_VAR( SettingValue::String, "general/ProjectName", unNamedProject, VLMC_CREATE_PROJECT_VAR( SettingValue::String, "vlmc/ProjectName", unNamedProject,
QT_TRANSLATE_NOOP( "PreferenceWidget", "Project name" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "Project name" ),
QT_TRANSLATE_NOOP( "PreferenceWidget", "The project name" ), QT_TRANSLATE_NOOP( "PreferenceWidget", "The project name" ),
SettingValue::NotEmpty ); SettingValue::NotEmpty );
VLMC_CREATE_PRIVATE_PROJECT_STRING( "general/Workspace", "" ); VLMC_CREATE_PRIVATE_PROJECT_STRING( "vlmc/Workspace", "" );
//We have to wait for the library to be loaded before loading the workflow //We have to wait for the library to be loaded before loading the workflow
connect( Library::getInstance(), SIGNAL( projectLoaded() ), this, SLOT( loadWorkflow() ) ); connect( Library::getInstance(), SIGNAL( projectLoaded() ), this, SLOT( loadWorkflow() ) );
...@@ -163,7 +163,7 @@ ProjectManager::loadProject( const QString& fileName ) ...@@ -163,7 +163,7 @@ ProjectManager::loadProject( const QString& fileName )
//Load settings first, as it contains some informations about the workspace. //Load settings first, as it contains some informations about the workspace.
SettingsManager::getInstance()->load( root ); SettingsManager::getInstance()->load( root );
SettingsManager::getInstance()->setValue( "general/Workspace", fInfo.absolutePath(), SettingsManager::Project ); SettingsManager::getInstance()->setValue( "vlmc/Workspace", fInfo.absolutePath(), SettingsManager::Project );
Timeline::getInstance()->renderer()->loadProject( root ); Timeline::getInstance()->renderer()->loadProject( root );
Library::getInstance()->loadProject( root ); Library::getInstance()->loadProject( root );
} }
......
...@@ -53,7 +53,7 @@ Workspace::~Workspace() ...@@ -53,7 +53,7 @@ Workspace::~Workspace()
bool bool
Workspace::copyToWorkspace( Media *media ) Workspace::copyToWorkspace( Media *media )
{ {
if ( VLMC_PROJECT_GET_STRING("general/Workspace").length() == 0 ) if ( VLMC_PROJECT_GET_STRING("vlmc/Workspace").length() == 0 )
{ {
setError( "There is no current workspace. Please create a project first."); setError( "There is no current workspace. Please create a project first.");
return false; return false;
...@@ -79,7 +79,7 @@ Workspace::copyToWorkspace( Media *media ) ...@@ -79,7 +79,7 @@ Workspace::copyToWorkspace( Media *media )
void void
Workspace::startCopyWorker( Media *media ) Workspace::startCopyWorker( Media *media )
{ {
const QString &projectPath = VLMC_PROJECT_GET_STRING( "general/Workspace" ); const QString &projectPath = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
const QString dest = projectPath + '/' + media->fileInfo()->fileName(); const QString dest = projectPath + '/' + media->fileInfo()->fileName();
if ( QFile::exists( dest ) == true ) if ( QFile::exists( dest ) == true )
...@@ -144,7 +144,7 @@ Workspace::copyTerminated( Media *media, QString dest ) ...@@ -144,7 +144,7 @@ Workspace::copyTerminated( Media *media, QString dest )
bool bool
Workspace::isInProjectDir( const QFileInfo &fInfo ) Workspace::isInProjectDir( const QFileInfo &fInfo )
{ {
const QString projectDir = VLMC_PROJECT_GET_STRING( "general/Workspace" ); const QString projectDir = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
return ( projectDir.length() > 0 && fInfo.absolutePath().startsWith( projectDir ) ); return ( projectDir.length() > 0 && fInfo.absolutePath().startsWith( projectDir ) );
} }
...@@ -166,7 +166,7 @@ Workspace::isInProjectDir(const Media *media) ...@@ -166,7 +166,7 @@ Workspace::isInProjectDir(const Media *media)
QString QString
Workspace::pathInProjectDir( const Media *media ) Workspace::pathInProjectDir( const Media *media )
{ {
const QString projectDir = VLMC_PROJECT_GET_STRING( "general/Workspace" ); const QString projectDir = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
return ( media->fileInfo()->absoluteFilePath().mid( projectDir.length() ) ); return ( media->fileInfo()->absoluteFilePath().mid( projectDir.length() ) );
} }
......
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