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()
QT_TRANSLATE_NOOP( "PreferenceWidget", "Select the cut/razor tool in the timeline" ), actionCut_mode );
//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", "The VLMC's UI language" ) );
SettingsManager::getInstance()->watchValue( "general/VLMCLang",
SettingsManager::getInstance()->watchValue( "vlmc/VLMCLang",
LanguageHelper::getInstance(),
SLOT( languageChanged( const QVariant& ) ),
SettingsManager::Vlmc );
//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", "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", "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", "The temporary folder used by VLMC to process videos." ) );
......@@ -519,7 +519,7 @@ void
MainWindow::createGlobalPreferences()
{
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" ) );
m_globalPreferences->addCategory( "keyboard", QT_TRANSLATE_NOOP( "Settings", "Keyboard" ), SettingsManager::Vlmc,
QIcon( ":/images/keyboard" ) );
......@@ -564,18 +564,18 @@ void
MainWindow::checkFolders()
{
QDir dirUtil;
if ( !dirUtil.exists( VLMC_GET_STRING( "general/DefaultProjectLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "general/DefaultProjectLocation" ) );
if ( !dirUtil.exists( VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ) );
if ( !dirUtil.exists( VLMC_GET_STRING( "general/TempFolderLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "general/TempFolderLocation" ) );
if ( !dirUtil.exists( VLMC_GET_STRING( "vlmc/TempFolderLocation" ) ) )
dirUtil.mkdir( VLMC_GET_STRING( "vlmc/TempFolderLocation" ) );
}
void
MainWindow::clearTemporaryFiles()
{
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 ) )
dirUtil.remove( file );
}
......@@ -681,8 +681,8 @@ MainWindow::on_actionShare_On_Internet_triggered()
return;
checkFolders();
QString fileName = VLMC_GET_STRING( "general/TempFolderLocation" ) + "/" +
VLMC_PROJECT_GET_STRING( "general/ProjectName" ) +
QString fileName = VLMC_GET_STRING( "vlmc/TempFolderLocation" ) + "/" +
VLMC_PROJECT_GET_STRING( "vlmc/ProjectName" ) +
"-vlmc.mp4";
loadGlobalProxySettings();
......
......@@ -42,8 +42,8 @@ RendererSettings::RendererSettings( bool shareOnInternet )
m_ui.outputFileName->setVisible( false );
m_ui.outputFileNameButton->setVisible( false );
m_ui.outputFileName->setText(
VLMC_GET_STRING( "general/TempFolderLocation" ) + "/" +
VLMC_PROJECT_GET_STRING( "general/ProjectName" ) + "-vlmc.mp4" );
VLMC_GET_STRING( "vlmc/TempFolderLocation" ) + "/" +
VLMC_PROJECT_GET_STRING( "vlmc/ProjectName" ) + "-vlmc.mp4" );
setWindowTitle( tr("Export Settings: Publish on Internet") );
}
......
......@@ -46,7 +46,7 @@ ShareOnInternet::ShareOnInternet( QWidget* parent )
case YOUTUBE:
m_ui.username->setText( VLMC_GET_STRING( "youtube/Username" ) );
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;
}
}
......
......@@ -43,7 +43,6 @@
#include <QHeaderView>
#include <QMessageBox>
#include <QPalette>
#include <QSettings>
#include <QTime>
#include <QTimer>
......
......@@ -43,25 +43,25 @@ GUIProjectManager::GUIProjectManager()
//Automatic save part :
m_timer = new QTimer( this );
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", "When this option is activated,"
"VLMC will automatically save your project "
"at a specified interval" ) );
SettingsManager::getInstance()->watchValue( "general/AutomaticBackup", this,
SettingsManager::getInstance()->watchValue( "vlmc/AutomaticBackup", this,
SLOT( automaticSaveEnabledChanged(QVariant) ),
SettingsManager::Vlmc,
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", "This is the interval that VLMC will wait "
"between two automatic save" ) );
SettingsManager::getInstance()->watchValue( "general/AutomaticBackupInterval", this,
SettingsManager::getInstance()->watchValue( "vlmc/AutomaticBackupInterval", this,
SLOT( automaticSaveIntervalChanged(QVariant) ),
SettingsManager::Vlmc,
Qt::QueuedConnection );
automaticSaveEnabledChanged( VLMC_GET_BOOL( "general/AutomaticBackup" ) );
SettingsManager::getInstance()->watchValue( "general/ProjectName", this,
automaticSaveEnabledChanged( VLMC_GET_BOOL( "vlmc/AutomaticBackup" ) );
SettingsManager::getInstance()->watchValue( "vlmc/ProjectName", this,
SLOT(projectNameChanged(QVariant) ),
SettingsManager::Project );
}
......@@ -121,9 +121,9 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
{
bool relocate = false;
QString defaultPath = VLMC_PROJECT_GET_STRING( "general/Workspace" );
QString defaultPath = VLMC_PROJECT_GET_STRING( "vlmc/Workspace" );
if ( defaultPath.length() == 0 )
defaultPath = VLMC_GET_STRING( "general/DefaultProjectLocation" );
defaultPath = VLMC_GET_STRING( "vlmc/DefaultProjectLocation" );
QString outputFileName =
QFileDialog::getSaveFileName( NULL, tr( "Enter the output file name" ),
defaultPath, tr( "VLMC project file(*.vlmc)" ) );
......@@ -141,7 +141,7 @@ GUIProjectManager::createNewProjectFile( bool saveAs )
outputFileName += ".vlmc";
m_projectFile = new QFile( outputFileName );
QFileInfo fInfo( outputFileName );
SettingsManager::getInstance()->setValue( "general/Workspace",
SettingsManager::getInstance()->setValue( "vlmc/Workspace",
fInfo.absolutePath(), SettingsManager::Project);
appendToRecentProject( projectName() );
......@@ -201,7 +201,7 @@ GUIProjectManager::automaticSaveEnabledChanged( const QVariant& val )
if ( enabled == true )
{
int interval = VLMC_GET_INT( "general/AutomaticBackupInterval" );
int interval = VLMC_GET_INT( "vlmc/AutomaticBackupInterval" );
m_timer->start( interval * 1000 * 60 );
}
else
......@@ -211,7 +211,7 @@ GUIProjectManager::automaticSaveEnabledChanged( const QVariant& val )
void
GUIProjectManager::automaticSaveIntervalChanged( const QVariant& val )
{
bool enabled = VLMC_GET_BOOL( "general/AutomaticBackup" );
bool enabled = VLMC_GET_BOOL( "vlmc/AutomaticBackup" );
if ( enabled == false )
return ;
......@@ -302,7 +302,7 @@ GUIProjectManager::loadProject()
{
QString fileName =
QFileDialog::getOpenFileName( NULL, tr( "Please choose a project file" ),
VLMC_GET_STRING( "general/DefaultProjectLocation" ),
VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ),
tr( "VLMC project file(*.vlmc)" ) );
if ( fileName.length() <= 0 ) //If the user canceled.
return ;
......
......@@ -80,7 +80,7 @@ TracksScene::askRemoveSelectedItems()
if ( tv->currentAction() != TracksView::None )
return ;
if ( VLMC_GET_BOOL( "general/ConfirmDeletion" ) == true )
if ( VLMC_GET_BOOL( "vlmc/ConfirmDeletion" ) == true )
{
QString message;
if ( selectedItems().size() == 1 )
......@@ -101,7 +101,7 @@ TracksScene::askRemoveSelectedItems()
return ;
if ( clicked == always )
{
SettingsManager::getInstance()->setValue( "general/ConfirmDeletion",
SettingsManager::getInstance()->setValue( "vlmc/ConfirmDeletion",
false, SettingsManager::Vlmc );
}
}
......
......@@ -81,7 +81,7 @@ GeneralPage::initializePage()
ui.lineEditName->setText( projectName );
//fetching the global workspace path
QString workspacePath = VLMC_GET_STRING( "general/DefaultProjectLocation" );
QString workspacePath = VLMC_GET_STRING( "vlmc/DefaultProjectLocation" );
ui.lineEditWorkspace->setText( workspacePath );
//Reinit description field
......
......@@ -100,9 +100,9 @@ ProjectWizard::accept()
SettingsManager *sManager = SettingsManager::getInstance();
GUIProjectManager::getInstance()->newProject( field( "projectName" ).toString(), field( "projectPath" ).toString() );
//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
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/VideoProjectHeight", field( "height" ), SettingsManager::Project );
......
......@@ -142,7 +142,7 @@ WelcomePage::loadProject()
{
QString projectPath =
QFileDialog::getOpenFileName( NULL, tr( "Select a project file" ),
VLMC_GET_STRING( "general/DefaultProjectLocation" ),
VLMC_GET_STRING( "vlmc/DefaultProjectLocation" ),
tr( "VLMC project file(*.vlmc)" ) );
if ( projectPath.isEmpty() ) return;
......
......@@ -65,7 +65,7 @@ Library::loadProject( const QDomElement& doc )
if ( mrl.startsWith( Workspace::workspacePrefix ) == true )
{
//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() );
}
Media* m = addMedia( mrl );
......
......@@ -207,7 +207,7 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
//Handle workspace stuff.
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 )
{
Media* m = m_medias[media];
......
......@@ -70,7 +70,7 @@ VLMCmain( int argc, char **argv )
QSettings s;
LanguageHelper::getInstance()->languageChanged(
s.value( "general/VLMCLang", "default" ) );
s.value( "vlmc/VLMCLang", "default" ) );
#if defined( Q_WS_WIN )
......
......@@ -43,7 +43,7 @@ Transcoder::Transcoder( Media* media ) :
void
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() );
if ( outputDir.length() == 0 )
......
......@@ -77,12 +77,12 @@ ProjectManager::ProjectManager() : m_projectFile( NULL ), m_needSave( false )
QT_TRANSLATE_NOOP("PreferenceWidget", "Number of audio channels" ),
SettingValue::Clamped );
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", "The project name" ),
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
connect( Library::getInstance(), SIGNAL( projectLoaded() ), this, SLOT( loadWorkflow() ) );
......@@ -163,7 +163,7 @@ ProjectManager::loadProject( const QString& fileName )
//Load settings first, as it contains some informations about the workspace.
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 );
Library::getInstance()->loadProject( root );
}
......
......@@ -53,7 +53,7 @@ Workspace::~Workspace()
bool
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.");
return false;
......@@ -79,7 +79,7 @@ Workspace::copyToWorkspace( Media *media )
void
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();
if ( QFile::exists( dest ) == true )
......@@ -144,7 +144,7 @@ Workspace::copyTerminated( Media *media, QString dest )
bool
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 ) );
}
......@@ -166,7 +166,7 @@ Workspace::isInProjectDir(const Media *media)
QString
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() ) );
}
......
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