Add config dialog for videorecord

svn path=/trunk/KDE/kdebase/workspace/; revision=736260
This commit is contained in:
Rivo Laks 2007-11-13 19:43:13 +00:00
parent 1bfe2b9afd
commit f016495c80
4 changed files with 172 additions and 1 deletions

View file

@ -186,7 +186,8 @@ macro_log_feature(CAPTURY_FOUND "Capseo framework" "libcaptury is a framework re
macro_bool_to_01( CAPTURY_FOUND HAVE_CAPTURY )
if( HAVE_CAPTURY )
KWIN4_ADD_EFFECT(videorecord videorecord.cpp)
KWIN4_ADD_EFFECT_CONFIG(videorecord videorecord_config.cpp)
target_link_libraries(kwin4_effect_videorecord ${CAPTURY_LDFLAGS})
install( FILES videorecord.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
install( FILES videorecord.desktop videorecord_config.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kwin )
endif( HAVE_CAPTURY )

View file

@ -0,0 +1,88 @@
/*****************************************************************
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 "videorecord_config.h"
#include <kwineffects.h>
#include <klocale.h>
#include <kdebug.h>
#include <KActionCollection>
#include <kaction.h>
#include <KShortcutsEditor>
#include <KGlobalAccel>
#include <QVBoxLayout>
#ifndef KDE_USE_FINAL
KWIN_EFFECT_CONFIG_FACTORY
#endif
K_PLUGIN_FACTORY_DEFINITION(EffectFactory,
registerPlugin<KWin::VideoRecordEffectConfig>("videorecord");
)
K_EXPORT_PLUGIN(EffectFactory("kwin"))
namespace KWin
{
VideoRecordEffectConfig::VideoRecordEffectConfig(QWidget* parent, const QVariantList& args) :
KCModule(EffectFactory::componentData(), parent, args)
{
KGlobalAccel::self()->overrideMainComponentData(componentData());
kDebug() ;
QVBoxLayout* layout = new QVBoxLayout(this);
KActionCollection* actionCollection = new KActionCollection( this, KComponentData("kwin") );
KAction* a = static_cast<KAction*>(actionCollection->addAction( "VideoRecord" ));
a->setText( i18n("Toggle Video Recording" ));
a->setGlobalShortcut(KShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_F11));
mShortcutEditor = new KShortcutsEditor(actionCollection, this,
KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed);
connect(mShortcutEditor, SIGNAL(keyChange()), this, SLOT(changed()));
layout->addWidget(mShortcutEditor);
layout->addStretch();
load();
}
VideoRecordEffectConfig::~VideoRecordEffectConfig()
{
kDebug() ;
}
void VideoRecordEffectConfig::load()
{
kDebug() ;
KCModule::load();
emit changed(false);
}
void VideoRecordEffectConfig::save()
{
kDebug() ;
KCModule::save();
emit changed(false);
EffectsHandler::sendReloadMessage( "videorecord" );
}
void VideoRecordEffectConfig::defaults()
{
kDebug() ;
mShortcutEditor->allDefault();
emit changed(true);
}
} // namespace
#include "videorecord_config.moc"

View file

@ -0,0 +1,41 @@
[Desktop Entry]
Encoding=UTF-8
Type=Service
ServiceTypes=KCModule
X-KDE-Library=kcm_kwin4_effect_videorecord
X-KDE-ParentComponents=kwin4_effect_videorecord
X-KDE-PluginKeyword=videorecord
Name=Video Record
Name[ar]=تسجيل المرئيات
Name[be]=Відэазапіс
Name[bg]=Запис на звук
Name[ca]=Gravador de vídeo
Name[csb]=Nagranié wideò
Name[de]=Video-Aufnahme
Name[el]=Εγγραφή βίντεο
Name[es]=Grabación de vídeo
Name[et]=Videosalvestus
Name[fa]=ضبط ویدیو
Name[he]=הקלטת סרט
Name[it]=Registra video
Name[ja]=
Name[kk]=Бейне жазып алу
Name[km]=
Name[ko]=
Name[nb]=Videoopptak
Name[nds]=Video opnehmen
Name[ne]=िि
Name[nl]=Video-opname
Name[nn]=Videoopptak
Name[pa]=ਿ ਿ
Name[pt]=Gravação de Vídeo
Name[pt_BR]=Gravar Vídeo
Name[sr]=Видеоснимање
Name[sr@latin]=Videosnimanje
Name[sv]=Videoinspelning
Name[vi]=Thu nh đng
Name[x-test]=xxVideo Recordxx
Name[zh_CN]=
Name[zh_TW]=

View file

@ -0,0 +1,41 @@
/*****************************************************************
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_VIDEORECORD_CONFIG_H
#define KWIN_VIDEORECORD_CONFIG_H
#define KDE3_SUPPORT
#include <kcmodule.h>
#undef KDE3_SUPPORT
class KShortcutsEditor;
namespace KWin
{
class VideoRecordEffectConfig : public KCModule
{
Q_OBJECT
public:
explicit VideoRecordEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList());
~VideoRecordEffectConfig();
public slots:
virtual void save();
virtual void load();
virtual void defaults();
private:
KShortcutsEditor* mShortcutEditor;
};
} // namespace
#endif