Removing the global shortcut for slow motion mode
svn path=/trunk/KDE/kdebase/workspace/; revision=782032icc-effect-5.14.5
parent
0b1cef2414
commit
8d0137f788
|
@ -24,8 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
#include <kaction.h>
|
|
||||||
#include <kactioncollection.h>
|
|
||||||
#include <klocale.h>
|
#include <klocale.h>
|
||||||
#include <kapplication.h>
|
#include <kapplication.h>
|
||||||
#include <kcolorscheme.h>
|
#include <kcolorscheme.h>
|
||||||
|
@ -52,7 +50,6 @@ CoverSwitchEffect::CoverSwitchEffect()
|
||||||
, stop( false )
|
, stop( false )
|
||||||
, forward( true )
|
, forward( true )
|
||||||
, rearrangeWindows( 0 )
|
, rearrangeWindows( 0 )
|
||||||
, slowMotionMode( false )
|
|
||||||
, stopRequested( false )
|
, stopRequested( false )
|
||||||
, startRequested( false )
|
, startRequested( false )
|
||||||
{
|
{
|
||||||
|
@ -62,13 +59,6 @@ CoverSwitchEffect::CoverSwitchEffect()
|
||||||
animateStart = conf.readEntry( "AnimateStart", true );
|
animateStart = conf.readEntry( "AnimateStart", true );
|
||||||
animateStop = conf.readEntry( "AnimateStop", true );
|
animateStop = conf.readEntry( "AnimateStop", true );
|
||||||
reflection = conf.readEntry( "Reflection", 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()
|
CoverSwitchEffect::~CoverSwitchEffect()
|
||||||
|
@ -802,17 +792,4 @@ void CoverSwitchEffect::paintWindows( QList< EffectWindow* >* windows, float tim
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoverSwitchEffect::slowMotion()
|
|
||||||
{
|
|
||||||
slowMotionMode = !slowMotionMode;
|
|
||||||
if( slowMotionMode )
|
|
||||||
{
|
|
||||||
animationDuration *= slowMotionFactor;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
animationDuration /= slowMotionFactor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -28,9 +28,8 @@ namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
class CoverSwitchEffect
|
class CoverSwitchEffect
|
||||||
: public QObject, public Effect
|
: public Effect
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
CoverSwitchEffect();
|
CoverSwitchEffect();
|
||||||
~CoverSwitchEffect();
|
~CoverSwitchEffect();
|
||||||
|
@ -43,8 +42,6 @@ class CoverSwitchEffect
|
||||||
virtual void tabBoxClosed();
|
virtual void tabBoxClosed();
|
||||||
virtual void tabBoxUpdated();
|
virtual void tabBoxUpdated();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void slowMotion();
|
|
||||||
private:
|
private:
|
||||||
void paintScene( EffectWindow* frontWindow, QList< EffectWindow* >* leftWindows, QList< EffectWindow* >* rightWindows,
|
void paintScene( EffectWindow* frontWindow, QList< EffectWindow* >* leftWindows, QList< EffectWindow* >* rightWindows,
|
||||||
float timeFactor, bool reflectedWindows = false );
|
float timeFactor, bool reflectedWindows = false );
|
||||||
|
@ -65,8 +62,6 @@ class CoverSwitchEffect
|
||||||
int animationDuration;
|
int animationDuration;
|
||||||
int selectedWindow;
|
int selectedWindow;
|
||||||
int rearrangeWindows;
|
int rearrangeWindows;
|
||||||
bool slowMotionMode;
|
|
||||||
int slowMotionFactor;
|
|
||||||
bool stopRequested;
|
bool stopRequested;
|
||||||
bool startRequested;
|
bool startRequested;
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,9 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include "coverswitch_config.h"
|
#include "coverswitch_config.h"
|
||||||
#include <kwineffects.h>
|
#include <kwineffects.h>
|
||||||
|
|
||||||
#include <KActionCollection>
|
|
||||||
#include <kaction.h>
|
|
||||||
#include <KGlobalAccel>
|
|
||||||
#include <kconfiggroup.h>
|
#include <kconfiggroup.h>
|
||||||
|
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
|
@ -47,22 +44,11 @@ CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariant
|
||||||
|
|
||||||
layout->addWidget(m_ui, 0, 0);
|
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->checkAnimateSwitch, SIGNAL(stateChanged(int)), this, SLOT(changed()));
|
||||||
connect(m_ui->checkAnimateStart, 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->checkAnimateStop, SIGNAL(stateChanged(int)), this, SLOT(changed()));
|
||||||
connect(m_ui->checkReflection, 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->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();
|
load();
|
||||||
}
|
}
|
||||||
|
@ -78,13 +64,11 @@ void CoverSwitchEffectConfig::load()
|
||||||
KConfigGroup conf = EffectsHandler::effectConfig( "CoverSwitch" );
|
KConfigGroup conf = EffectsHandler::effectConfig( "CoverSwitch" );
|
||||||
|
|
||||||
int duration = conf.readEntry( "Duration", 300 );
|
int duration = conf.readEntry( "Duration", 300 );
|
||||||
int slowMotionFactor = conf.readEntry( "SlowMotionFactor", 4 );
|
|
||||||
bool animateSwitch = conf.readEntry( "AnimateSwitch", true );
|
bool animateSwitch = conf.readEntry( "AnimateSwitch", true );
|
||||||
bool animateStart = conf.readEntry( "AnimateStart", true );
|
bool animateStart = conf.readEntry( "AnimateStart", true );
|
||||||
bool animateStop = conf.readEntry( "AnimateStop", true );
|
bool animateStop = conf.readEntry( "AnimateStop", true );
|
||||||
bool reflection = conf.readEntry( "Reflection", true );
|
bool reflection = conf.readEntry( "Reflection", true );
|
||||||
m_ui->spinDuration->setValue( duration );
|
m_ui->spinDuration->setValue( duration );
|
||||||
m_ui->spinSlowMotionFactor->setValue( slowMotionFactor );
|
|
||||||
if( animateSwitch )
|
if( animateSwitch )
|
||||||
{
|
{
|
||||||
m_ui->checkAnimateSwitch->setCheckState( Qt::Checked );
|
m_ui->checkAnimateSwitch->setCheckState( Qt::Checked );
|
||||||
|
@ -118,9 +102,6 @@ void CoverSwitchEffectConfig::load()
|
||||||
m_ui->checkReflection->setCheckState( Qt::Unchecked );
|
m_ui->checkReflection->setCheckState( Qt::Unchecked );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_actionCollection->readSettings();
|
|
||||||
m_ui->editor->addCollection(m_actionCollection);
|
|
||||||
|
|
||||||
emit changed(false);
|
emit changed(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,14 +110,11 @@ void CoverSwitchEffectConfig::save()
|
||||||
KConfigGroup conf = EffectsHandler::effectConfig( "CoverSwitch" );
|
KConfigGroup conf = EffectsHandler::effectConfig( "CoverSwitch" );
|
||||||
|
|
||||||
conf.writeEntry( "Duration", m_ui->spinDuration->value() );
|
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( "AnimateSwitch", m_ui->checkAnimateSwitch->checkState() == Qt::Checked ? true : false );
|
||||||
conf.writeEntry( "AnimateStart", m_ui->checkAnimateStart->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( "AnimateStop", m_ui->checkAnimateStop->checkState() == Qt::Checked ? true : false );
|
||||||
conf.writeEntry( "Reflection", m_ui->checkReflection->checkState() == Qt::Checked ? true : false );
|
conf.writeEntry( "Reflection", m_ui->checkReflection->checkState() == Qt::Checked ? true : false );
|
||||||
|
|
||||||
m_actionCollection->writeSettings();
|
|
||||||
|
|
||||||
conf.sync();
|
conf.sync();
|
||||||
|
|
||||||
emit changed(false);
|
emit changed(false);
|
||||||
|
@ -146,7 +124,6 @@ void CoverSwitchEffectConfig::save()
|
||||||
void CoverSwitchEffectConfig::defaults()
|
void CoverSwitchEffectConfig::defaults()
|
||||||
{
|
{
|
||||||
m_ui->spinDuration->setValue( 300 );
|
m_ui->spinDuration->setValue( 300 );
|
||||||
m_ui->spinSlowMotionFactor->setValue( 4 );
|
|
||||||
m_ui->checkAnimateSwitch->setCheckState( Qt::Checked );
|
m_ui->checkAnimateSwitch->setCheckState( Qt::Checked );
|
||||||
m_ui->checkAnimateStart->setCheckState( Qt::Checked );
|
m_ui->checkAnimateStart->setCheckState( Qt::Checked );
|
||||||
m_ui->checkAnimateStop->setCheckState( Qt::Checked );
|
m_ui->checkAnimateStop->setCheckState( Qt::Checked );
|
||||||
|
|
|
@ -53,7 +53,6 @@ class CoverSwitchEffectConfig : public KCModule
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CoverSwitchEffectConfigForm* m_ui;
|
CoverSwitchEffectConfigForm* m_ui;
|
||||||
KActionCollection* m_actionCollection;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>359</width>
|
<width>289</width>
|
||||||
<height>431</height>
|
<height>237</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
|
@ -67,45 +67,11 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0" >
|
|
||||||
<widget class="QLabel" name="label_4" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Slow &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>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="KWin::GlobalShortcutsEditor" native="1" name="editor" />
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>KWin::GlobalShortcutsEditor</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global" >kwineffects.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>checkAnimateSwitch</tabstop>
|
<tabstop>checkAnimateSwitch</tabstop>
|
||||||
<tabstop>checkAnimateStart</tabstop>
|
<tabstop>checkAnimateStart</tabstop>
|
||||||
|
|
Loading…
Reference in New Issue