Add config dialog for trackmouse.

It doesn't let you configure anything yet, just shows which keys activate the
  effect. But hopefully one day it will be configurable as well.

svn path=/trunk/KDE/kdebase/workspace/; revision=736297
This commit is contained in:
Rivo Laks 2007-11-13 21:50:00 +00:00
parent 1daba58c35
commit 797bece861
5 changed files with 155 additions and 0 deletions

View file

@ -140,6 +140,7 @@ if(OPENGL_FOUND)
mousemark_config.cpp
mousemark_config.ui
sharpen_config.cpp
trackmouse_config.cpp
)
install( FILES
invert_config.desktop
@ -147,6 +148,7 @@ if(OPENGL_FOUND)
magnifier_config.desktop
mousemark_config.desktop
sharpen_config.desktop
trackmouse_config.desktop
DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
endif(OPENGL_FOUND)

View file

@ -25,6 +25,7 @@ License. See the file "COPYING" for the exact licensing terms.
#include "mousemark_config.h"
#include "magnifier_config.h"
#include "sharpen_config.h"
#include "trackmouse_config.h"
#endif
#include <kwineffects.h>
@ -47,6 +48,7 @@ K_PLUGIN_FACTORY_DEFINITION(EffectFactory,
registerPlugin<KWin::MouseMarkEffectConfig>("mousemark");
registerPlugin<KWin::MagnifierEffectConfig>("magnifier");
registerPlugin<KWin::SharpenEffectConfig>("sharpen");
registerPlugin<KWin::TrackMouseEffectConfig>("trackmouse");
#endif
)
K_EXPORT_PLUGIN(EffectFactory("kwin"))

View file

@ -0,0 +1,76 @@
/*****************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
You can Freely distribute this program under the GNU General Public
License. See the file "COPYING" for the exact licensing terms.
******************************************************************/
#include "trackmouse_config.h"
#include <kwineffects.h>
#include <klocale.h>
#include <kdebug.h>
#include <KActionCollection>
#include <kaction.h>
#include <KShortcutsEditor>
#include <KGlobalAccel>
#include <QVBoxLayout>
#include <QLabel>
#ifndef KDE_USE_FINAL
KWIN_EFFECT_CONFIG_FACTORY
#endif
namespace KWin
{
TrackMouseEffectConfig::TrackMouseEffectConfig(QWidget* parent, const QVariantList& args) :
KCModule(EffectFactory::componentData(), parent, args)
{
KGlobalAccel::self()->overrideMainComponentData(componentData());
kDebug() ;
QVBoxLayout* layout = new QVBoxLayout(this);
QLabel* label = new QLabel(i18n("Hold Ctrl+Meta keys to see where the mouse cursor is."), this);
layout->addWidget(label);
layout->addStretch();
load();
}
TrackMouseEffectConfig::~TrackMouseEffectConfig()
{
kDebug() ;
}
void TrackMouseEffectConfig::load()
{
kDebug() ;
KCModule::load();
emit changed(false);
}
void TrackMouseEffectConfig::save()
{
kDebug() ;
KCModule::save();
emit changed(false);
EffectsHandler::sendReloadMessage( "trackmouse" );
}
void TrackMouseEffectConfig::defaults()
{
kDebug() ;
emit changed(true);
}
} // namespace
#include "trackmouse_config.moc"

View file

@ -0,0 +1,37 @@
[Desktop Entry]
Encoding=UTF-8
Type=Service
ServiceTypes=KCModule
X-KDE-Library=kcm_kwin4_effect_builtins
X-KDE-ParentComponents=kwin4_effect_trackmouse
X-KDE-PluginKeyword=trackmouse
Name=Track Mouse
Name[be]=Адследжваць мыш
Name[bg]=Мишка
Name[de]=Mausspur
Name[el]=Ανίχνευση ποντικιού
Name[es]=Seguir el ratón
Name[et]=Hiire jälgimine
Name[fa]=ردگیری موشی
Name[he]=עקבות עכבר
Name[ja]=
Name[kk]=Тышқандың ізі
Name[km]=
Name[ko]=
Name[nb]=Spor mus
Name[nds]=Muusspoor
Name[ne]=
Name[nl]=Muis volgen
Name[nn]=Følg mus
Name[pa]=
Name[pt]=Seguir o Rato
Name[pt_BR]=Seguir o Mouse
Name[sr]=Праћење миша
Name[sr@latin]=Praćenje miša
Name[sv]=Musspår
Name[vi]=Vết chut
Name[x-test]=xxTrack Mousexx
Name[zh_CN]=
Name[zh_TW]=

View file

@ -0,0 +1,38 @@
/*****************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
You can Freely distribute this program under the GNU General Public
License. See the file "COPYING" for the exact licensing terms.
******************************************************************/
#ifndef KWIN_TRACKMOUSE_CONFIG_H
#define KWIN_TRACKMOUSE_CONFIG_H
#define KDE3_SUPPORT
#include <kcmodule.h>
#undef KDE3_SUPPORT
class KShortcutsEditor;
namespace KWin
{
class TrackMouseEffectConfig : public KCModule
{
Q_OBJECT
public:
explicit TrackMouseEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
~TrackMouseEffectConfig();
public slots:
virtual void save();
virtual void load();
virtual void defaults();
};
} // namespace
#endif