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