Commit 1c26afc1 authored by Clement CHAVANCE's avatar Clement CHAVANCE Committed by Hugo Beauzee-Luyssen
Browse files

updated videoPage default values and shortcuts initialisation



videoPage default values are now hardcoded

keyboard shortcuts are now initialized in the entry point of the program
Signed-off-by: default avatarHugo Beauzee-Luyssen <beauze.h@gmail.com>
parent 1882a36d
......@@ -61,11 +61,10 @@ void VideoPage::initializePage()
{
SettingsManager* sManager = SettingsManager::getInstance();
#warning __LINE__ __FILE__ DEFAULT VALUES !!!!!!
int projectFps = sManager->value( "default/VideoProjectFPS" ).toDouble();
int projectHeight = sManager->value( "default/VideoProjectHeight" ).toInt();
int projectWidth = sManager->value( "default/VideoProjectWidth" ).toInt();
int sampleRate = sManager->value( "default/AudioSampleRate" ).toInt();
int projectFps = 30;
int projectHeight = 300;
int projectWidth = 480;
int sampleRate = 44000;
ui.comboBoxVideoPresets->setCurrentIndex( 0 );
ui.comboBoxAudioPresets->setCurrentIndex( 0 );
......
......@@ -27,6 +27,7 @@
*/
#include "MainWindow.h"
#include "SettingsManager.h"
#include <QFile>
......@@ -34,6 +35,7 @@
#include <QColor>
#include <QPalette>
#include <QSettings>
#include <QKeySequence>
#ifndef VLMC_VERSION
#define VLMC_VERSION Unknown
......@@ -42,6 +44,36 @@
#define EXPAND( x ) #x
#define STRINGIFY( x ) EXPAND( x )
#define ADD_SHORTCUT(NAME, KEYS) key = QString("keyboard/").append( QObject::tr( NAME ) ); \
settMan->setImmediateValue( key, QVariant( QObject::tr( KEYS ) ), SettingsManager::QSett )
static void initShorcuts()
{
QString key;
SettingsManager* settMan = 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
/**
* VLMC Entry point
* \brief this is the VLMC entry point
......@@ -96,6 +128,8 @@ VLMCmain( int argc, char **argv )
p.setColor( QPalette::LinkVisited, QColor( 177, 202, 0, 255 ) );
app.setPalette( p );
initShorcuts();
MainWindow w;
QSettings s;
s.setValue( "VlmcVersion", STRINGIFY( VLMC_VERSION ) );
......
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