Removing the global shortcut for slow motion mode

svn path=/trunk/KDE/kdebase/workspace/; revision=782032
icc-effect-5.14.5
Martin Gräßlin 2008-03-04 10:27:32 +00:00
parent 0b1cef2414
commit 8d0137f788
5 changed files with 3 additions and 89 deletions

View File

@ -24,8 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDesktopWidget>
#include <QFont>
#include <QBitmap>
#include <kaction.h>
#include <kactioncollection.h>
#include <klocale.h>
#include <kapplication.h>
#include <kcolorscheme.h>
@ -52,7 +50,6 @@ CoverSwitchEffect::CoverSwitchEffect()
, stop( false )
, forward( true )
, rearrangeWindows( 0 )
, slowMotionMode( false )
, stopRequested( false )
, startRequested( false )
{
@ -62,13 +59,6 @@ CoverSwitchEffect::CoverSwitchEffect()
animateStart = conf.readEntry( "AnimateStart", true );
animateStop = conf.readEntry( "AnimateStop", true );
reflection = conf.readEntry( "Reflection", true );
slowMotionFactor = conf.readEntry( "SlowMotionFactor", 4 );
KActionCollection* actionCollection = new KActionCollection( this );
KAction* a = static_cast< KAction* >( actionCollection->addAction( "SlowMotion" ));
a->setText( i18n( "Slow Motion" ));
a->setGlobalShortcut( KShortcut( Qt::META + Qt::Key_S ));
connect( a, SIGNAL( triggered( bool )), this, SLOT( slowMotion()));
}
CoverSwitchEffect::~CoverSwitchEffect()
@ -802,17 +792,4 @@ void CoverSwitchEffect::paintWindows( QList< EffectWindow* >* windows, float tim
glPopMatrix();
}
void CoverSwitchEffect::slowMotion()
{
slowMotionMode = !slowMotionMode;
if( slowMotionMode )
{
animationDuration *= slowMotionFactor;
}
else
{
animationDuration /= slowMotionFactor;
}
}
} // namespace

View File

@ -28,9 +28,8 @@ namespace KWin
{
class CoverSwitchEffect
: public QObject, public Effect
: public Effect
{
Q_OBJECT
public:
CoverSwitchEffect();
~CoverSwitchEffect();
@ -43,8 +42,6 @@ class CoverSwitchEffect
virtual void tabBoxClosed();
virtual void tabBoxUpdated();
private slots:
void slowMotion();
private:
void paintScene( EffectWindow* frontWindow, QList< EffectWindow* >* leftWindows, QList< EffectWindow* >* rightWindows,
float timeFactor, bool reflectedWindows = false );
@ -65,8 +62,6 @@ class CoverSwitchEffect
int animationDuration;
int selectedWindow;
int rearrangeWindows;
bool slowMotionMode;
int slowMotionFactor;
bool stopRequested;
bool startRequested;
};

View File

@ -20,9 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "coverswitch_config.h"
#include <kwineffects.h>
#include <KActionCollection>
#include <kaction.h>
#include <KGlobalAccel>
#include <kconfiggroup.h>
#include <QGridLayout>
@ -47,22 +44,11 @@ CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariant
layout->addWidget(m_ui, 0, 0);
connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed()));
connect(m_ui->checkAnimateSwitch, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->checkAnimateStart, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->checkAnimateStop, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->checkReflection, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->spinDuration, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->spinSlowMotionFactor, SIGNAL(valueChanged(int)), this, SLOT(changed()));
KGlobalAccel::self()->overrideMainComponentData( componentData() );
m_actionCollection = new KActionCollection( this, componentData() );
m_actionCollection->setConfigGroup( "CoverSwitch" );
m_actionCollection->setConfigGlobal( true );
KAction* a = (KAction*)m_actionCollection->addAction( "SlowMotion" );
a->setText( i18n("Slow Motion" ) );
a->setGlobalShortcut( KShortcut( Qt::META + Qt::Key_S ) );
load();
}
@ -78,13 +64,11 @@ void CoverSwitchEffectConfig::load()
KConfigGroup conf = EffectsHandler::effectConfig( "CoverSwitch" );
int duration = conf.readEntry( "Duration", 300 );
int slowMotionFactor = conf.readEntry( "SlowMotionFactor", 4 );
bool animateSwitch = conf.readEntry( "AnimateSwitch", true );
bool animateStart = conf.readEntry( "AnimateStart", true );
bool animateStop = conf.readEntry( "AnimateStop", true );
bool reflection = conf.readEntry( "Reflection", true );
m_ui->spinDuration->setValue( duration );
m_ui->spinSlowMotionFactor->setValue( slowMotionFactor );
if( animateSwitch )
{
m_ui->checkAnimateSwitch->setCheckState( Qt::Checked );
@ -118,9 +102,6 @@ void CoverSwitchEffectConfig::load()
m_ui->checkReflection->setCheckState( Qt::Unchecked );
}
m_actionCollection->readSettings();
m_ui->editor->addCollection(m_actionCollection);
emit changed(false);
}
@ -129,14 +110,11 @@ void CoverSwitchEffectConfig::save()
KConfigGroup conf = EffectsHandler::effectConfig( "CoverSwitch" );
conf.writeEntry( "Duration", m_ui->spinDuration->value() );
conf.writeEntry( "SlowMotionFactor", m_ui->spinSlowMotionFactor->value() );
conf.writeEntry( "AnimateSwitch", m_ui->checkAnimateSwitch->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "AnimateStart", m_ui->checkAnimateStart->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "AnimateStop", m_ui->checkAnimateStop->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "Reflection", m_ui->checkReflection->checkState() == Qt::Checked ? true : false );
m_actionCollection->writeSettings();
conf.sync();
emit changed(false);
@ -146,7 +124,6 @@ void CoverSwitchEffectConfig::save()
void CoverSwitchEffectConfig::defaults()
{
m_ui->spinDuration->setValue( 300 );
m_ui->spinSlowMotionFactor->setValue( 4 );
m_ui->checkAnimateSwitch->setCheckState( Qt::Checked );
m_ui->checkAnimateStart->setCheckState( Qt::Checked );
m_ui->checkAnimateStop->setCheckState( Qt::Checked );

View File

@ -53,7 +53,6 @@ class CoverSwitchEffectConfig : public KCModule
private:
CoverSwitchEffectConfigForm* m_ui;
KActionCollection* m_actionCollection;
};
} // namespace

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>359</width>
<height>431</height>
<width>289</width>
<height>237</height>
</rect>
</property>
<layout class="QGridLayout" >
@ -67,45 +67,11 @@
</property>
</widget>
</item>
<item row="5" column="0" >
<widget class="QLabel" name="label_4" >
<property name="text" >
<string>Slow &amp;Motion Factor:</string>
</property>
<property name="buddy" >
<cstring>spinDuration</cstring>
</property>
</widget>
</item>
<item row="5" column="1" >
<widget class="QSpinBox" name="spinSlowMotionFactor" >
<property name="minimum" >
<number>1</number>
</property>
<property name="maximum" >
<number>10</number>
</property>
<property name="value" >
<number>4</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" >
<widget class="KWin::GlobalShortcutsEditor" native="1" name="editor" />
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KWin::GlobalShortcutsEditor</class>
<extends>QWidget</extends>
<header location="global" >kwineffects.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>checkAnimateSwitch</tabstop>
<tabstop>checkAnimateStart</tabstop>