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

Adding (editabke) keyboard shortcut for cut and default mouse mode.

parent fa2e5431
...@@ -9,7 +9,6 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QWidget* pa ...@@ -9,7 +9,6 @@ KeyboardShortcutHelper::KeyboardShortcutHelper( const QString& name, QWidget* pa
m_name( name ) m_name( name )
{ {
const SettingValue* set = SettingsManager::getInstance()->getValue( "keyboard_shortcut", name ); const SettingValue* set = SettingsManager::getInstance()->getValue( "keyboard_shortcut", name );
qDebug() << set->get().toString();
setKey( QKeySequence( set->get().toString() ) ); setKey( QKeySequence( set->get().toString() ) );
connect( set, SIGNAL( changed( const QVariant& ) ), this, SLOT( shortcutUpdated( const QVariant& ) ) ); connect( set, SIGNAL( changed( const QVariant& ) ), this, SLOT( shortcutUpdated( const QVariant& ) ) );
} }
......
...@@ -76,7 +76,7 @@ void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part ) ...@@ -76,7 +76,7 @@ void VLMCSettingsDefault::loadKeyboardShortcutDefaults( const QString& part )
{ {
SettingsManager* setMan = SettingsManager::getInstance(); SettingsManager* setMan = SettingsManager::getInstance();
ADD_SHORTCUT( "Selection mode", "n" ); ADD_SHORTCUT( "Default mode", "n" );
ADD_SHORTCUT( "Cut mode", "x" ); ADD_SHORTCUT( "Cut mode", "x" );
ADD_SHORTCUT( "Launch media preview", "Ctrl+Return" ); ADD_SHORTCUT( "Launch media preview", "Ctrl+Return" );
ADD_SHORTCUT( "Start render preview", "Space" ); ADD_SHORTCUT( "Start render preview", "Space" );
......
...@@ -171,12 +171,14 @@ void MainWindow::createStatusBar() ...@@ -171,12 +171,14 @@ void MainWindow::createStatusBar()
{ {
// Mouse (default) tool // Mouse (default) tool
QToolButton* mouseTool = new QToolButton( this ); QToolButton* mouseTool = new QToolButton( this );
mouseTool->setAutoRaise( true );
mouseTool->setCheckable( true ); mouseTool->setCheckable( true );
mouseTool->setIcon( QIcon( ":/images/mouse" ) ); mouseTool->setIcon( QIcon( ":/images/mouse" ) );
m_ui.statusbar->addPermanentWidget( mouseTool ); m_ui.statusbar->addPermanentWidget( mouseTool );
// Cut/Split tool // Cut/Split tool
QToolButton* splitTool = new QToolButton( this ); QToolButton* splitTool = new QToolButton( this );
splitTool->setAutoRaise( true );
splitTool->setCheckable( true ); splitTool->setCheckable( true );
splitTool->setIcon( QIcon( ":/images/editcut" ) ); splitTool->setIcon( QIcon( ":/images/editcut" ) );
m_ui.statusbar->addPermanentWidget( splitTool ); m_ui.statusbar->addPermanentWidget( splitTool );
...@@ -188,6 +190,12 @@ void MainWindow::createStatusBar() ...@@ -188,6 +190,12 @@ void MainWindow::createStatusBar()
toolButtonGroup->setExclusive( true ); toolButtonGroup->setExclusive( true );
mouseTool->setChecked( true ); mouseTool->setChecked( true );
//Shortcut part:
KeyboardShortcutHelper* defaultModeShortcut = new KeyboardShortcutHelper( "Default mode", this );
KeyboardShortcutHelper* cutModeShortcut = new KeyboardShortcutHelper( "Cut mode", this );
connect( defaultModeShortcut, SIGNAL( activated() ), mouseTool, SLOT( click() ) );
connect( cutModeShortcut, SIGNAL( activated() ), splitTool, SLOT( click() ) );
connect( toolButtonGroup, SIGNAL( buttonClicked( int ) ), connect( toolButtonGroup, SIGNAL( buttonClicked( int ) ),
this, SLOT( toolButtonClicked( int ) ) ); this, SLOT( toolButtonClicked( int ) ) );
......
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