Cylinder and Sphere effect have their own shortcut. Nevertheless it's still not possible to use cube and cylinder or sphere. That'll be fixed when the effects are merged into cube.
BUG: 175788 svn path=/trunk/KDE/kdebase/workspace/; revision=922033
This commit is contained in:
parent
daa32a53fb
commit
502fdbb751
5 changed files with 38 additions and 14 deletions
|
@ -81,17 +81,12 @@ CubeEffect::CubeEffect()
|
|||
, zPosition( 0.0 )
|
||||
, useForTabBox( false )
|
||||
, tabBoxMode( false )
|
||||
, shortcutsRegistered( false )
|
||||
, capListCreated( false )
|
||||
, recompileList( true )
|
||||
, glList( 0 )
|
||||
{
|
||||
reconfigure( ReconfigureAll );
|
||||
|
||||
KActionCollection* actionCollection = new KActionCollection( this );
|
||||
KAction* a = static_cast< KAction* >( actionCollection->addAction( "Cube" ));
|
||||
a->setText( i18n("Desktop Cube" ));
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::Key_F11 ));
|
||||
connect( a, SIGNAL( triggered( bool )), this, SLOT( toggle()));
|
||||
}
|
||||
|
||||
bool CubeEffect::supported()
|
||||
|
@ -204,6 +199,33 @@ void CubeEffect::loadConfig( QString config )
|
|||
verticalTimeLine.setDuration( rotationDuration );
|
||||
slideTimeLine.setCurveShape( TimeLine::EaseInOutCurve );
|
||||
slideTimeLine.setDuration( rotationDuration );
|
||||
|
||||
// do not connect the shortcut if we use cylinder or sphere
|
||||
KActionCollection* actionCollection = new KActionCollection( this );
|
||||
if( config == "Cube" && !shortcutsRegistered )
|
||||
{
|
||||
KAction* a = static_cast< KAction* >( actionCollection->addAction( "Cube" ));
|
||||
a->setText( i18n("Desktop Cube" ));
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::Key_F11 ));
|
||||
connect( a, SIGNAL( triggered( bool )), this, SLOT( toggle()));
|
||||
shortcutsRegistered = true;
|
||||
}
|
||||
if( config == "Cylinder" && !shortcutsRegistered )
|
||||
{
|
||||
KAction* a = static_cast< KAction* >( actionCollection->addAction( "Cylinder" ));
|
||||
a->setText( i18n("Desktop Cylinder" ));
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_F11 ));
|
||||
connect( a, SIGNAL( triggered( bool )), this, SLOT( toggle()));
|
||||
shortcutsRegistered = true;
|
||||
}
|
||||
if( config == "Sphere" && !shortcutsRegistered )
|
||||
{
|
||||
KAction* a = static_cast< KAction* >( actionCollection->addAction( "Sphere" ));
|
||||
a->setText( i18n("Desktop Sphere" ));
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::META + Qt::Key_F11 ));
|
||||
connect( a, SIGNAL( triggered( bool )), this, SLOT( toggle()));
|
||||
shortcutsRegistered = true;
|
||||
}
|
||||
}
|
||||
|
||||
CubeEffect::~CubeEffect()
|
||||
|
|
|
@ -39,6 +39,7 @@ CylinderEffect::CylinderEffect()
|
|||
, mValid( true )
|
||||
, mShader( 0 )
|
||||
{
|
||||
shortcutsRegistered = false;
|
||||
reconfigure( ReconfigureAll );
|
||||
}
|
||||
|
||||
|
|
|
@ -53,13 +53,13 @@ CylinderEffectConfig::CylinderEffectConfig(QWidget* parent, const QVariantList&
|
|||
m_ui->tabWidget->setTabText( 1, i18nc("@title:tab Advanced Settings", "Advanced") );
|
||||
|
||||
m_actionCollection = new KActionCollection( this, componentData() );
|
||||
m_actionCollection->setConfigGroup( "Cube" );
|
||||
m_actionCollection->setConfigGroup( "Cylinder" );
|
||||
m_actionCollection->setConfigGlobal(true);
|
||||
|
||||
KAction* a = (KAction*) m_actionCollection->addAction( "Cube" );
|
||||
a->setText( i18n("Desktop Cube" ));
|
||||
KAction* a = (KAction*) m_actionCollection->addAction( "Cylinder" );
|
||||
a->setText( i18n("Desktop Cylinder" ));
|
||||
a->setProperty("isConfigurationAction", true);
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::Key_F11 ));
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_F11 ));
|
||||
|
||||
m_ui->editor->addCollection(m_actionCollection);
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ SphereEffect::SphereEffect()
|
|||
, mValid( true )
|
||||
, mShader( 0 )
|
||||
{
|
||||
shortcutsRegistered = false;
|
||||
reconfigure( ReconfigureAll );
|
||||
}
|
||||
|
||||
|
|
|
@ -53,13 +53,13 @@ SphereEffectConfig::SphereEffectConfig(QWidget* parent, const QVariantList& args
|
|||
m_ui->tabWidget->setTabText( 1, i18nc("@title:tab Advanced Settings", "Advanced") );
|
||||
|
||||
m_actionCollection = new KActionCollection( this, componentData() );
|
||||
m_actionCollection->setConfigGroup( "Cube" );
|
||||
m_actionCollection->setConfigGroup( "Sphere" );
|
||||
m_actionCollection->setConfigGlobal(true);
|
||||
|
||||
KAction* a = (KAction*) m_actionCollection->addAction( "Cube" );
|
||||
a->setText( i18n("Desktop Cube" ));
|
||||
KAction* a = (KAction*) m_actionCollection->addAction( "Sphere" );
|
||||
a->setText( i18n("Desktop Sphere" ));
|
||||
a->setProperty("isConfigurationAction", true);
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::Key_F11 ));
|
||||
a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::META + Qt::Key_F11 ));
|
||||
|
||||
m_ui->editor->addCollection(m_actionCollection);
|
||||
|
||||
|
|
Loading…
Reference in a new issue