kglobalaccel: drop it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-22 00:18:26 +03:00
parent df65bab6e9
commit b636ba6903
43 changed files with 3 additions and 6217 deletions

View file

@ -312,7 +312,6 @@ add_subdirectory(kmail)
add_subdirectory(kfreespace) add_subdirectory(kfreespace)
# Background processes # Background processes
add_subdirectory(kdontchangethehostname) add_subdirectory(kdontchangethehostname)
add_subdirectory(kglobalaccel)
# Command-line tools (e.g. for shell scripts) # Command-line tools (e.g. for shell scripts)
add_subdirectory(kdeeject) add_subdirectory(kdeeject)
add_subdirectory(kfile) add_subdirectory(kfile)

View file

@ -21,7 +21,6 @@ add_subdirectory( krdb )
add_subdirectory( style ) add_subdirectory( style )
add_subdirectory( desktoptheme ) add_subdirectory( desktoptheme )
add_subdirectory( standard_actions ) add_subdirectory( standard_actions )
add_subdirectory( keys )
add_subdirectory( workspaceoptions ) add_subdirectory( workspaceoptions )
add_subdirectory( icons ) add_subdirectory( icons )

View file

@ -1,48 +0,0 @@
########### next target ###############
set(kcm_keys_PART_SRCS
kglobalshortcutseditor.cpp
globalshortcuts.cpp
select_scheme_dialog.cpp
kglobalaccel_interface.cpp
kglobalaccel_component_interface.cpp
export_scheme_dialog.cpp
export_scheme_dialog.ui
kglobalshortcutseditor.ui
select_scheme_dialog.ui
)
set(kglobalaccel_xml ${KDE4_DBUS_INTERFACES_INSTALL_DIR}/org.kde.KGlobalAccel.xml)
set_source_files_properties(${kglobalaccel_xml} PROPERTIES INCLUDE "kglobalshortcutinfo_p.h")
qt4_add_dbus_interface(kdeui_LIB_SRCS ${kglobalaccel_xml} kglobalaccel_interface )
set(kglobalaccel_component_xml ${KDE4_DBUS_INTERFACES_INSTALL_DIR}/org.kde.kglobalaccel.Component.xml)
set_source_files_properties(${kglobalaccel_component_xml} PROPERTIES INCLUDE "kglobalshortcutinfo_p.h")
qt4_add_dbus_interface(kdeui_LIB_SRCS ${kglobalaccel_component_xml} kglobalaccel_component_interface)
kde4_add_plugin(kcm_keys ${kcm_keys_PART_SRCS})
target_link_libraries(kcm_keys KDE4::kdeui KDE4::kio ${X11_X11_LIB})
########### install files ###############
install(
TARGETS kcm_keys
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
)
install(
FILES keys.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)
install(
FILES
schemes/kde3.kksrc
schemes/kde4.kksrc
schemes/mac4.kksrc
schemes/unix3.kksrc
schemes/win3.kksrc
schemes/win4.kksrc
schemes/wm3.kksrc
DESTINATION ${KDE4_DATA_INSTALL_DIR}/kcmkeys
)

View file

@ -1,7 +0,0 @@
#!/bin/bash
# customkeys=`grep "^.include .\.\." keyconfig.cpp | sed -e "s#.*\"\(.*\)\"#\1#"`
# $XGETTEXT *.cpp $customkeys -o $podir/kcmkeys.pot
$EXTRACTRC *.ui >> rc.cpp
$XGETTEXT *.cpp -o $podir/kcmkeys.pot
rm -f rc.cpp

View file

@ -1,7 +0,0 @@
CHANGES V0.2
- Global keys stored by default in ~/.kde/share/config/kdeglobals
[Global Keys] group
- KKeyDialog checks new key choices against exising bindings for the widget
and against entries in .kderc [Global Keys]
- kcmkeys now has two standard kcontrol pages - one for standard desktop
accelerators and one for global keybindings.

View file

@ -1,75 +0,0 @@
/**
* Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "export_scheme_dialog.h"
#include <KDebug>
#include <KLocale>
#include <QtGui/QCheckBox>
ExportSchemeDialog::ExportSchemeDialog(QStringList components, QWidget *parent)
: KDialog(parent),
ui(),
mComponents(components)
{
QWidget *w = new QWidget(this);
ui.setupUi(w);
setMainWidget(w);
// We allow to check more than one button
mButtons.setExclusive(false);
// A grid layout for the buttons
QGridLayout *vb = new QGridLayout(this);
int item=0;
Q_FOREACH(QString component, mComponents)
{
QCheckBox *cb = new QCheckBox(component);
vb->addWidget(cb, item / 2, item % 2);
mButtons.addButton(cb, item);
++item;
}
ui.components->setLayout(vb);
}
ExportSchemeDialog::~ExportSchemeDialog()
{}
QStringList ExportSchemeDialog::selectedComponents() const
{
QStringList rc;
Q_FOREACH(QAbstractButton const *button, mButtons.buttons())
{
if (button->isChecked())
{
// Remove the '&' added by KAcceleratorManager magically
rc.append(KGlobal::locale()->removeAcceleratorMarker(button->text()));
}
}
return rc;
}
#include "moc_export_scheme_dialog.cpp"

View file

@ -1,59 +0,0 @@
#ifndef EXPORT_SCHEME_DIALOG_H
#define EXPORT_SCHEME_DIALOG_H
/**
* Copyright (C) 2009 Michael Jansen <kde@michael-jansen.biz>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "ui_export_scheme_dialog.h"
#include <QtGui/QButtonGroup>
#include <KDialog>
/**
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class ExportSchemeDialog : public KDialog
{
Q_OBJECT
public:
ExportSchemeDialog (QStringList components, QWidget *parent=NULL);
virtual ~ExportSchemeDialog();
// Get the list of currently selected components
QStringList selectedComponents() const;
private:
Ui::ExportSchemeDialog ui;
// list of components to choose from
QStringList mComponents;
// list of buttons for the components
QButtonGroup mButtons;
}; // ExportSchemeDialog
#endif /* EXPORT_SCHEME_DIALOG_H */

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ExportSchemeDialog</class>
<widget class="QWidget" name="ExportSchemeDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="components_label">
<property name="text">
<string>Select the Components to Export</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="components">
<property name="title">
<string>Components</string>
</property>
</widget>
</item>
</layout>
</widget>
<connections/>
</ui>

View file

@ -1,92 +0,0 @@
/*
* Copyright 2007 Andreas Pakulat <apaku@gmx.de>
* Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "globalshortcuts.h"
#include "kglobalshortcutseditor.h"
#include <KLocale>
#include <KMessageBox>
#include <KPluginFactory>
#include <QtGui/QLayout>
K_PLUGIN_FACTORY(GlobalShortcutsModuleFactory, registerPlugin<GlobalShortcutsModule>();)
K_EXPORT_PLUGIN(GlobalShortcutsModuleFactory("kcmkeys"))
GlobalShortcutsModule::GlobalShortcutsModule(QWidget *parent, const QVariantList &args)
: KCModule(GlobalShortcutsModuleFactory::componentData(), parent, args),
editor(0)
{
KCModule::setButtons(KCModule::Buttons(KCModule::Default | KCModule::Apply | KCModule::Help));
// Create the kglobaleditor
editor = new KGlobalShortcutsEditor(this, KShortcutsEditor::GlobalAction);
connect(editor, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
// Layout the hole bunch
QVBoxLayout *global = new QVBoxLayout;
global->addWidget(editor);
setLayout(global);
}
GlobalShortcutsModule::~GlobalShortcutsModule()
{}
void GlobalShortcutsModule::load()
{
editor->load();
}
void GlobalShortcutsModule::defaults()
{
switch (KMessageBox::questionYesNoCancel(
this,
i18n("You are about to reset all shortcuts to their default values."),
i18n("Reset to defaults"),
KGuiItem(i18n("Current Component")),
KGuiItem(i18n("All Components"))))
{
case KMessageBox::Yes:
editor->defaults(KGlobalShortcutsEditor::CurrentComponent);
break;
case KMessageBox::No:
editor->defaults(KGlobalShortcutsEditor::AllComponents);
break;
default:
return;
}
}
void GlobalShortcutsModule::save()
{
editor->save();
}
#include "moc_globalshortcuts.cpp"

View file

@ -1,44 +0,0 @@
/*
* Copyright 2007 Andreas Pakulat <apaku@gmx.de>
* Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SHORTCUTS_MODULE_H
#define SHORTCUTS_MODULE_H
#include <kcmodule.h>
#include <QtCore/QHash>
class KGlobalShortcutsEditor;
class GlobalShortcutsModule : public KCModule
{
Q_OBJECT
public:
GlobalShortcutsModule(QWidget *parent, const QVariantList &args);
~GlobalShortcutsModule();
virtual void save();
virtual void load();
virtual void defaults();
private:
KGlobalShortcutsEditor *editor;
};
#endif

View file

@ -1,227 +0,0 @@
[Desktop Entry]
Exec=kcmshell4 keys
Icon=preferences-desktop-keyboard-shortcut
Type=Service
X-KDE-ServiceTypes=KCModule
X-DocPath=kcontrol/keys/index.html
X-KDE-Library=kcm_keys
X-KDE-ParentApp=kcontrol
X-KDE-System-Settings-Parent-Category=shortcuts-and-gestures
X-KDE-Weight=160
Name=Global Keyboard Shortcuts
Name[ar]=اختصارات لوحة المفاتيح العمومية
Name[ast]=Accesos rápidos de tecláu globales
Name[be@latin]=Paŭsiudnyja klavijaturnyja skaroty
Name[bg]=Общи бързи клавиши
Name[bn]=
Name[bn_IN]=ি- -
Name[bs]=Globalne prečice sa tastature
Name[ca]=Dreceres de teclat globals
Name[ca@valencia]=Dreceres de teclat globals
Name[cs]=Globální klávesové zkratky
Name[csb]=Globalné klawiszowé skrodzënë
Name[da]=Globale tastaturgenveje
Name[de]=Globale Kurzbefehle
Name[el]=Καθολικές συντομεύσεις πληκτρολογίου
Name[en_GB]=Global Keyboard Shortcuts
Name[eo]=Ĝeneralaj Klavkombinoj
Name[es]=Accesos rápidos de teclado globales
Name[et]=Globaalsed kiirklahvid
Name[eu]=Laster-tekla orokorrak
Name[fa]=میانبرهای صفحه کلید سراسری
Name[fi]=Työpöydänlaajuiset pikanäppäimet
Name[fr]=Raccourcis globaux de clavier
Name[fy]=Globale fluchkeppelings
Name[ga]=Aicearraí Comhchoiteanna Méarchláir
Name[gl]=Atallos de teclado globais
Name[gu]=
Name[he]=קיצורי מקשים גלובליים
Name[hi]=ि
Name[hne]=ि
Name[hr]=Globalni prečaci tipkovnice
Name[hsb]=Globalne tastaturowe skrótšenki
Name[hu]=Globális billentyűparancsok
Name[ia]=Vias breve global de claviero
Name[id]=Jalan Pintas Papan Ketik Global
Name[is]=Víðværir flýtilyklar
Name[it]=Scorciatoie globali della tastiera
Name[ja]=
Name[kk]=Жалпы жүйелік перне тіркесімдер
Name[km]=
Name[kn]=ಿ ಿ ( )
Name[ko]=
Name[ku]=Kurteriyên Klavyeyê yên Giştî
Name[lt]=Globalieji spartieji klavišai
Name[lv]=Globālie tastatūras īsceļi
Name[mai]=ि
Name[mk]=Глобални кратенки на тастатурата
Name[ml]= ി ി
Name[mr]=ि
Name[nb]=Globale hurtigtaster
Name[nds]=Globaal Tastkombinatschonen
Name[nl]=Globale sneltoetsen
Name[nn]=Globale snøgg­tastar
Name[or]=ି ି ି
Name[pa]= -
Name[pl]=Globalne skróty klawiszowe
Name[pt]=Atalhos Globais do Teclado
Name[pt_BR]=Atalhos de teclado globais
Name[ro]=Acceleratori de tastatură globali
Name[ru]=Глобальные комбинации клавиш
Name[si]=
Name[sk]=Globálne klávesové skratky
Name[sl]=Splošne tipkovne bližnjice
Name[sr]=Глобалне пречице са тастатуре
Name[sr@ijekavian]=Глобалне пречице са тастатуре
Name[sr@ijekavianlatin]=Globalne prečice sa tastature
Name[sr@latin]=Globalne prečice sa tastature
Name[sv]=Globala snabbtangenter
Name[ta]= ி ி
Name[te]=
Name[tg]=Глобальные комбинации клавиш
Name[th]=
Name[tr]=Genel Klavye Kısayolları
Name[ug]=ئومۇمىيەت ھەرپتاختا تېزلەتمىسى
Name[uk]=Загальні клавіатурні скорочення
Name[vi]=Phím tt toàn h thng
Name[wa]=Rascourtis del taprece po ttavå
Name[x-test]=xxGlobal Keyboard Shortcutsxx
Name[zh_CN]=
Name[zh_TW]=
Comment=Configuration of keybindings
Comment[af]=Opstelling van sleutel bindinge
Comment[ar]=إعداد ارتباطات المفاتيح
Comment[ast]=Configuración de les asociaciones de les tecles
Comment[be]=Настаўленні клавішных скаротаў
Comment[be@latin]=Nałady dla poviaziaŭ klavišaŭ z roznymi aperacyjami
Comment[bg]=Настройки на бързи клавиши
Comment[bn]=-ি ি
Comment[bn_IN]=ি-ি ি
Comment[br]=Kefluniañ ereoù stokell
Comment[bs]=Postava prečica sa tastature
Comment[ca]=Configuració dels lligams de tecles
Comment[ca@valencia]=Configuració dels lligams de tecles
Comment[cs]=Nastavení klávesových zkratek
Comment[csb]=Nastôw klawiszowëch skrodzënów
Comment[cy]=Furfweddiad o rwymiadau bysell
Comment[da]=Indstilling af tastebindinger
Comment[de]=Einrichtung von Tastenzuordnungen
Comment[el]=Διαμόρφωση συνδυασμών πλήκτρων
Comment[en_GB]=Configuration of keybindings
Comment[eo]=Agordo de klavkombinoj
Comment[es]=Configuración de las asociaciones de las teclas
Comment[et]=Kiirklahvide seadistamine
Comment[eu]=Laster-teklen konfigurazioa
Comment[fa]=پیکربندی مقیدسازیهای کلید
Comment[fi]=Näppäinsidosten asetukset
Comment[fy]=Ynstellings foar fluchtoetsen
Comment[ga]=Cumraíocht ceangal eochracha
Comment[gl]=Configuración dos atallos de teclado
Comment[gu]=
Comment[he]=הגדרות מיפוי מקשים
Comment[hi]=-ि ि
Comment[hne]=-ि ि
Comment[hr]=Konfiguriranje prečaca tipkovnice
Comment[hsb]=Připrawjenje přirjadowanjow tastow
Comment[hu]=A billentyűparancsok beállításai
Comment[ia]=Configuration de keybindings (ligamines de claves)
Comment[id]=Konfigurasi pengikat tombol
Comment[is]=Stillingar altækra flýtihnappa
Comment[ka]=
Comment[kk]=Перне тіркесімдерді баптау
Comment[km]=
Comment[kn]=ಿ ಿ (ಿ)
Comment[ko]=
Comment[ku]=Veavakirina bicîkirina bişkojkan
Comment[lt]=Klavišų siečių derinimas
Comment[lv]=Taustiņsasaistes konfigurēšana
Comment[mai]=-ि ' ि
Comment[mk]=Конфигурација на врски меѓу копчиња и акции
Comment[ml]=ിി
Comment[mr]=ि
Comment[ms]=Konfigurasi untuk pengikatan kekunci
Comment[nb]=Oppsett av hurtigtaster
Comment[nds]=Instellen vun Tastkombinatschonen
Comment[ne]= ि ि
Comment[nl]=Instellingen voor sneltoetsen
Comment[nn]=Oppsett av snøggtastar
Comment[or]=ିି
Comment[pa]=-ਿ
Comment[pl]=Ustawienia powiązań klawiszowych
Comment[pt]=Configuração das teclas
Comment[pt_BR]=Configuração dos atalhos de teclado
Comment[ro]=Configurează asocierile de taste
Comment[ru]=Настройка глобальных комбинаций клавиш
Comment[se]=Jođánisboaluid heiveheapmi
Comment[si]=
Comment[sk]=Nastavenie globálnych klávesových skratiek
Comment[sl]=Nastavitve tipkovnih bližnjic
Comment[sr]=Поставке пречица са тастатуре
Comment[sr@ijekavian]=Поставке пречица са тастатуре
Comment[sr@ijekavianlatin]=Postavke prečica sa tastature
Comment[sr@latin]=Postavke prečica sa tastature
Comment[sv]=Anpassa kortkommandon
Comment[ta]=ி ி
Comment[te]=
Comment[tg]=Танзимоти тугмаҳои якҷояшуда
Comment[th]=
Comment[tr]=Tuş bağıntılarının yapılandırılması
Comment[ug]=كۇنۇپكا باغلاش سەپلىمە
Comment[uk]=Налаштування прив'язок клавіш
Comment[uz]=Tugmalar birikmasini moslash
Comment[uz@cyrillic]=Тугмалар бирикмасини мослаш
Comment[vi]=Cu hình các t hp phím
Comment[wa]=Apontiaedje des rascourtis di tapes
Comment[xh]=Uqwalaselo lwezibopheleo zesitshixo
Comment[x-test]=xxConfiguration of keybindingsxx
Comment[zh_CN]=
Comment[zh_TW]=
X-KDE-Keywords=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts
X-KDE-Keywords[bs]=Tipke, Globalni vezovi tipki, Šema tipki, Veze tipki, Prečice, Prečice za aplikacije, globalne Prečice
X-KDE-Keywords[ca]=Tecles,Assignació de tecles globals,Esquema de tecles,Assignació de tecles,dreceres,dreceres d'aplicació,dreceres globals
X-KDE-Keywords[ca@valencia]=Tecles,Assignació de tecles globals,Esquema de tecles,Assignació de tecles,dreceres,dreceres d'aplicació,dreceres globals
X-KDE-Keywords[da]=Taster,globale tastebindinger,tasteskema,tastebindinger,genveje,programgenveje,globale genveje
X-KDE-Keywords[de]=Tasten,Tastenzuordnung,Tastenkürzel,Kurzbefehle,Tastenschema,Tastaturlayout
X-KDE-Keywords[el]=Πλήκτρα,δεσμεύσεις καθολικών πλήκτρων, σχήμα πλήκτρων, δεσμεύσεις πλήκτρων,συντομεύσεις,συντομεύσεις εφαρμογών,καθολικές συντομεύσεις
X-KDE-Keywords[en_GB]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts
X-KDE-Keywords[es]=Teclas,Asociaciones globales de teclas,Esquema de teclas,Asociaciones de teclas,accesos rápidos,accesos rápidos de aplicaciones,accesos rápidos globales
X-KDE-Keywords[et]=klahvid,globaalsed kiirklahvid,klaviatuuriskeem,klahviseosed,kiirklahvid,rakenduse kiirklahvid,globaalsed kiirklahvid
X-KDE-Keywords[eu]=tekla,laster-tekla orokor,tekla-eskema,laster-tekla,lasterbide,aplikazioen laster-teklak
X-KDE-Keywords[fi]=näppäimet,globaalit näppäinsidokset,yleiset näppäinsidokset,työpöydänlaajuiset näppäinsidokset,globaalit pikanäppäimet,työpöydänlaajuiset pikanäppäimet,globaalit näppäinyhdistelmät,työpöydänlaajuiset näppäinyhdistelmät,näppäimistön yleispikavalinnat,näppäimistön globaalit pikavalinnat,näppäinsidokset,pikanäppäimet,näppäimistön pikavalinnat, näppäinyhdistelmät,näppäinoikotiet,sovellusten pikanäppäimet,sovellusten näppäinyhdistelmät,sovellusten näppäinoikotiet
X-KDE-Keywords[fr]=Touches, Association globale des touches, Schéma des touches, Association de touches, Raccourci des applications, Raccourcis globaux
X-KDE-Keywords[ga]=Eochracha,Ceangail chomhchoiteanna eochracha,Scéim eochracha,Ceangail eochracha,aicearraí,aicearraí feidhmchláir,aicearraí comhchoiteanna
X-KDE-Keywords[gl]=tecla, atallo, asociación, esquema de teclas, atallo de teclado, asociación de teclas, atallo a programa, atallos globais
X-KDE-Keywords[hu]=Billentyűk,Globális gyorsbillentyűk,Billentyűséma,Gyorsbillentyűk,alkalmazás gyorsbillentyűk,globális gyorsbillentyűk
X-KDE-Keywords[ia]=Claves,ligamines de clave global,schema de clave,ligamines de clave,vias breve,vias breve de application,vias breve global
X-KDE-Keywords[it]=tasti,scorciatoie globali di tastiera,schema di tasti,scorciatoie,scorciatoie delle applicazioni,scorciatoie globali
X-KDE-Keywords[kk]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts
X-KDE-Keywords[km]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts
X-KDE-Keywords[ko]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,, , ,,
X-KDE-Keywords[mr]=, ि, , ि, , ि ,
X-KDE-Keywords[nb]=Taster,Globale tastebindinger,Tastaturutforming,Tastebindinger,snarveier,programsnarveier,globale snarveier
X-KDE-Keywords[nds]=Tasten,Globaal Tasttowiesen,Tasttowiesen,Tastkombinatschonen,Programm-Tastkombinatschonen,Globaal Tastkombinatschonen
X-KDE-Keywords[nl]=toetsen,globale toetsbindingen,toetsenschema,toetsbindingen,sneltoetsen,sneltoetsen van toepassing,globale sneltoetsen
X-KDE-Keywords[pl]=Klawisze,Globalne powiązania klawiszy,Motyw klawiszy,Powiązania klawiszy,skróty,skróty programów,globalne skróty
X-KDE-Keywords[pt]=Teclas,combinações de teclas,global,esquema de teclas,atalhos de teclado,atalhos,atalhos das aplicações
X-KDE-Keywords[pt_BR]=Teclas,combinações de teclas global,esquema de teclas,atalhos de teclado,atalhos,atalhos dos aplicativos, atalhos globais
X-KDE-Keywords[ru]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,клавиши,глобальные привязки клавиш,схема,привязки клавиш,комбинации клавиш,комбинации клавиш в приложениях,глобальные привязки клавиш
X-KDE-Keywords[sk]=Klávesy,Globálne klávesové skratky,Klávesová schéma,Klávesové skratky,skratky,skratky aplikácie,globálne skratky
X-KDE-Keywords[sl]=tipke,splošne tipkovne bližnjice,tipkovna shema,shema tipk,tipkovne bližnjice,vezave tipk,bližnjice,programske bližnjice,splošne bližnjice
X-KDE-Keywords[sr]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,тастери,глобалне свезе тастера,шема тастера,свезе тастера,пречице,пречице програма,глобалне пречице
X-KDE-Keywords[sr@ijekavian]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,тастери,глобалне свезе тастера,шема тастера,свезе тастера,пречице,пречице програма,глобалне пречице
X-KDE-Keywords[sr@ijekavianlatin]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,tasteri,globalne sveze tastera,šema tastera,sveze tastera,prečice,prečice programa,globalne prečice
X-KDE-Keywords[sr@latin]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,tasteri,globalne sveze tastera,šema tastera,sveze tastera,prečice,prečice programa,globalne prečice
X-KDE-Keywords[sv]=Tangenter,Globala tangentbindingar,Tangentschema,Tangentbindingar,genvägar,programgenvägar,globala genvägar
X-KDE-Keywords[tr]=Tuşlar,Genel kısayollar,Klavye şeması,Klavye Kısayolları,kısayollar,uygulama kısayolları,genel kısayollar, kısayol tuşları
X-KDE-Keywords[uk]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,клавіатура,скорочення,клавіатурні скорочення,схема,загальні клавіатурні скорочення,клавіатурні скорочення програми,загальні скорочення
X-KDE-Keywords[vi]=Phím,t hp phím toàn cc,phi hp phím,t hp phím,gõ tt,gõ tt cho ng dng
X-KDE-Keywords[x-test]=xxKeys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcutsxx
X-KDE-Keywords[zh_CN]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts,,,,,,,
X-KDE-Keywords[zh_TW]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,global shortcuts
Categories=Qt;KDE;X-KDE-settings-accessibility;

View file

@ -1,677 +0,0 @@
/*
* Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kglobalshortcutseditor.h"
#include "ui_kglobalshortcutseditor.h"
#include "export_scheme_dialog.h"
#include "select_scheme_dialog.h"
#include "globalshortcuts.h"
#include "kglobalaccel_interface.h"
#include "kglobalaccel_component_interface.h"
#include <KActionCollection>
#include <KDebug>
#include <KFileDialog>
#include <KGlobalAccel>
#include <KMessageBox>
#include <KShortcut>
#include <KStringHandler>
#include <KLocale>
#include <QtGui/QStackedWidget>
#include <QtGui/QMenu>
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QStandardItemModel>
#include <QtCore/QHash>
#include <QDBusConnection>
#include <QDBusError>
#include <QDBusReply>
/*
* README
*
* This class was created because the kshortcutseditor class has some shortcomings. That class uses
* QTreeWidget and therefore makes it impossible for an outsider to switch the models. But the
* global shortcuts editor did that. Each global component ( kded, krunner, kopete ... ) was
* destined to be separately edited. If you selected another component the kshortcutseditor was
* cleared and refilled. But the items take care of undoing. Therefore when switching the component
* you lost the undo history.
*
* To solve that problem this class keeps one kshortcuteditor for each component. That is easier
* than rewrite that dialog to a model/view framework.
*
* It perfectly covers a bug of KExtedableItemDelegate when clearing and refilling the associated
* model.
*/
class ComponentData
{
public:
ComponentData(
const QString &uniqueName,
const QDBusObjectPath &path,
KShortcutsEditor *_editor);
~ComponentData();
QString uniqueName() const;
KShortcutsEditor *editor();
QDBusObjectPath dbusPath();
private:
QString _uniqueName;
QDBusObjectPath _path;
QPointer<KShortcutsEditor> _editor;
};
ComponentData::ComponentData(
const QString &uniqueName,
const QDBusObjectPath &path,
KShortcutsEditor *editor)
: _uniqueName(uniqueName),
_path(path),
_editor(editor)
{}
ComponentData::~ComponentData()
{
delete _editor; _editor = 0;
}
QString ComponentData::uniqueName() const
{
return _uniqueName;
}
QDBusObjectPath ComponentData::dbusPath()
{
return _path;
}
KShortcutsEditor *ComponentData::editor()
{
return _editor;
}
class KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate
{
public:
KGlobalShortcutsEditorPrivate(KGlobalShortcutsEditor *q)
: q(q),
stack(0),
bus(QDBusConnection::sessionBus())
{}
//! Setup the gui
void initGUI();
//! Delete the currently selected component
void removeComponent();
//! Load the component at @a componentPath
bool loadComponent(const QDBusObjectPath &componentPath);
//! Return the componentPath for component
QDBusObjectPath componentPath(const QString &componentUnique);
//! Remove the component
void removeComponent(const QString &componentUnique);
KGlobalShortcutsEditor *q;
Ui::KGlobalShortcutsEditor ui;
QStackedWidget *stack;
KShortcutsEditor::ActionTypes actionTypes;
QHash<QString, ComponentData*> components;
QDBusConnection bus;
};
void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::initGUI()
{
ui.setupUi(q);
// Create a stacked widget.
stack = new QStackedWidget(q);
q->layout()->addWidget(stack);
// Connect our components
connect(ui.components, SIGNAL(activated(QString)),
q, SLOT(activateComponent(QString)));
// Build the menu
QMenu *menu = new QMenu(q);
menu->addAction( KIcon("document-import"), i18n("Import Scheme..."), q, SLOT(importScheme()));
menu->addAction( KIcon("document-export"), i18n("Export Scheme..."), q, SLOT(exportScheme()));
menu->addAction( i18n("Set All Shortcuts to None"), q, SLOT(clearConfiguration()));
menu->addAction( KIcon("edit-delete"), i18n("Remove Component"), q, SLOT(removeComponent()));
ui.menu_button->setMenu(menu);
QSortFilterProxyModel *proxyModel = new QSortFilterProxyModel(q);
proxyModel->setSourceModel(new QStandardItemModel(0, 1, proxyModel));
proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
ui.components->setModel(proxyModel);
}
KGlobalShortcutsEditor::KGlobalShortcutsEditor(QWidget *parent, KShortcutsEditor::ActionTypes actionTypes)
: QWidget(parent),
d(new KGlobalShortcutsEditorPrivate(this))
{
d->actionTypes = actionTypes;
// Setup the ui
d->initGUI();
}
KGlobalShortcutsEditor::~KGlobalShortcutsEditor()
{
// Before closing the door, undo all changes
undo();
qDeleteAll(d->components);
delete d;
}
void KGlobalShortcutsEditor::activateComponent(const QString &component)
{
QHash<QString, ComponentData*>::Iterator iter = d->components.find(component);
if (iter == d->components.end()) {
Q_ASSERT(iter != d->components.end());
return;
} else {
int index = d->ui.components->findText(component);
Q_ASSERT(index != -1);
if (index > -1) {
// Known component. Get it.
d->ui.components->setCurrentIndex(index);
d->stack->setCurrentWidget((*iter)->editor());
}
}
}
void KGlobalShortcutsEditor::addCollection(
KActionCollection *collection,
const QDBusObjectPath &objectPath,
const QString &id,
const QString &friendlyName)
{
KShortcutsEditor *editor;
// Check if this component is known
QHash<QString, ComponentData*>::Iterator iter = d->components.find(friendlyName);
if (iter == d->components.end()) {
// Unknown component. Create an editor.
editor = new KShortcutsEditor(this, d->actionTypes);
d->stack->addWidget(editor);
// try to find one appropriate icon ( allowing NULL pixmap to be returned)
QPixmap pixmap = KIconLoader::global()->loadIcon(id, KIconLoader::Small, 0,
KIconLoader::DefaultState, QStringList(), 0, true);
// if NULL pixmap is returned, use the F.D.O "system-run" icon
if (pixmap.isNull()) {
pixmap = KIconLoader::global()->loadIcon("system-run", KIconLoader::Small);
}
// Add to the component combobox
d->ui.components->addItem(pixmap, friendlyName);
d->ui.components->model()->sort(0);
// Add to our component registry
ComponentData *cd = new ComponentData(id, objectPath, editor);
d->components.insert(friendlyName, cd);
connect(editor, SIGNAL(keyChange()), this, SLOT(_k_key_changed()));
} else {
// Known component.
editor = (*iter)->editor();
}
// Add the collection to the editor of the component
editor->addCollection(collection, friendlyName);
if (d->ui.components->count() > -1) {
d->ui.components->setCurrentIndex(0);
activateComponent(d->ui.components->itemText(0));
}
}
void KGlobalShortcutsEditor::clearConfiguration()
{
QString name = d->ui.components->currentText();
d->components[name]->editor()->clearConfiguration();
}
void KGlobalShortcutsEditor::defaults(ComponentScope scope)
{
switch (scope)
{
case AllComponents:
Q_FOREACH (ComponentData *cd, d->components) {
// The editors are responsible for the reset
cd->editor()->allDefault();
}
break;
case CurrentComponent: {
QString name = d->ui.components->currentText();
// The editors are responsible for the reset
d->components[name]->editor()->allDefault();
}
break;
default:
Q_ASSERT(false);
};
}
void KGlobalShortcutsEditor::clear()
{
// Remove all components and their associated editors
qDeleteAll(d->components);
d->components.clear();
d->ui.components->clear();
}
static bool compare(const QString &a, const QString &b)
{
return a.toLower().localeAwareCompare(b.toLower()) < 0;
}
void KGlobalShortcutsEditor::exportScheme()
{
QStringList keys = d->components.keys();
qSort(keys.begin(), keys.end(), compare);
ExportSchemeDialog dia(keys);
if (dia.exec() != KMessageBox::Ok) {
return;
}
KUrl url = KFileDialog::getSaveFileName(KUrl(), "*.kksrc", this);
if (!url.isEmpty()) {
KConfig config(url.path(), KConfig::SimpleConfig);
// TODO: Bug ossi to provide a method for this
Q_FOREACH(const QString &group, config.groupList())
{
// do not overwrite the Settings group. That makes it possible to
// update the standard scheme kksrc file with the editor.
if (group == "Settings") continue;
config.deleteGroup(group);
}
exportConfiguration(dia.selectedComponents(), &config);
}
}
void KGlobalShortcutsEditor::importScheme()
{
// Check for unsaved modifications
if (isModified()) {
int choice = KMessageBox::warningContinueCancel(
this,
i18n("Your current changes will be lost if you load another scheme before saving this one"),
i18n("Load Shortcut Scheme"),
KGuiItem(i18n("Load")));
if (choice != KMessageBox::Continue) {
return;
}
}
SelectSchemeDialog dialog(this);
if (dialog.exec() != KDialog::Accepted) {
return;
}
KUrl url = dialog.selectedScheme();
if (!url.isLocalFile()) {
KMessageBox::sorry(this, i18n("This file (%1) does not exist. You can only select local files.",
url.url()));
return;
}
KConfig config(url.path(), KConfig::SimpleConfig);
importConfiguration(&config);
}
void KGlobalShortcutsEditor::load()
{
// Connect to kglobalaccel. If that fails there is no need to continue.
qRegisterMetaType<QList<int> >();
qDBusRegisterMetaType<QList<int> >();
qDBusRegisterMetaType<QList<KGlobalShortcutInfo> >();
qDBusRegisterMetaType<KGlobalShortcutInfo>();
org::kde::KGlobalAccel kglobalaccel(
"org.kde.kglobalaccel",
"/kglobalaccel",
d->bus);
if (!kglobalaccel.isValid()) {
QString errorString;
QDBusError error = kglobalaccel.lastError();
// The global shortcuts DBus service manages all global shortcuts and we
// can't do anything useful without it.
if (error.isValid()) {
errorString = i18n("Message: %1\nError: %2", error.message(), error.name());
}
KMessageBox::sorry(
this,
i18n("Failed to contact the KDE global shortcuts daemon\n")
+ errorString );
return;
}
// Undo all changes not yet applied
undo();
clear();
QDBusReply< QList<QDBusObjectPath> > componentsRc = kglobalaccel.allComponents();
if (!componentsRc.isValid())
{
// Sometimes error pop up only after the first real call.
QString errorString;
QDBusError error = componentsRc.error();
// The global shortcuts DBus service manages all global shortcuts and we
// can't do anything useful without it.
if (error.isValid()) {
errorString = i18n("Message: %1\nError: %2", error.message(), error.name());
}
KMessageBox::sorry(
this,
i18n("Failed to contact the KDE global shortcuts daemon\n")
+ errorString );
return;
}
QList<QDBusObjectPath> components = componentsRc;
Q_FOREACH(const QDBusObjectPath &componentPath, components) {
d->loadComponent(componentPath);
} // Q_FOREACH(component)
}
void KGlobalShortcutsEditor::save()
{
// The editors are responsible for the saving
kDebug() << "Save the changes";
Q_FOREACH (ComponentData *cd, d->components) {
cd->editor()->commit();
}
}
void KGlobalShortcutsEditor::importConfiguration(KConfigBase *config)
{
kDebug() << config->groupList();
// In a first step clean out the current configurations. We do this
// because we want to minimize the chance of conflicts.
Q_FOREACH (ComponentData *cd, d->components) {
KConfigGroup group(config, cd->uniqueName());
kDebug() << cd->uniqueName() << group.name();
if (group.exists()) {
kDebug() << "Removing" << cd->uniqueName();
cd->editor()->clearConfiguration();
}
}
// Now import the new configurations.
Q_FOREACH (ComponentData *cd, d->components) {
KConfigGroup group(config, cd->uniqueName());
if (group.exists()) {
kDebug() << "Importing" << cd->uniqueName();
cd->editor()->importConfiguration(&group);
}
}
}
void KGlobalShortcutsEditor::exportConfiguration(QStringList components, KConfig *config) const
{
Q_FOREACH (const QString &componentFriendly, components)
{
QHash<QString, ComponentData*>::Iterator iter = d->components.find(componentFriendly);
if (iter == d->components.end())
{
Q_ASSERT(iter != d->components.end());
continue;
}
else
{
KConfigGroup group(config, (*iter)->uniqueName());
(*iter)->editor()->exportConfiguration(&group);
}
}
}
void KGlobalShortcutsEditor::undo()
{
// The editors are responsible for the undo
kDebug() << "Undo the changes";
Q_FOREACH (ComponentData *cd, d->components) {
cd->editor()->undoChanges();
}
}
bool KGlobalShortcutsEditor::isModified() const
{
Q_FOREACH (ComponentData *cd, d->components) {
if (cd->editor()->isModified()) {
return true;
}
}
return false;
}
void KGlobalShortcutsEditor::_k_key_changed()
{
emit changed(isModified());
}
QDBusObjectPath KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::componentPath(const QString &componentUnique)
{
return QDBusObjectPath(QLatin1String("/component/") + componentUnique);
}
void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::removeComponent()
{
QString name = ui.components->currentText();
QString componentUnique = components.value(name)->uniqueName();
// The confirmation text is different when the component is active
if (KGlobalAccel::isComponentActive(componentUnique)) {
if (KMessageBox::questionYesNo(
q,
i18n("Component '%1' is currently active. Only global shortcuts currently not active will be removed from the list.\n"
"All global shortcuts will reregister themselves with their defaults when they are next started.", componentUnique),
i18n("Remove component")) != KMessageBox::Yes) {
return;
}
} else {
if (KMessageBox::questionYesNo(
q,
i18n("Are you sure you want to remove the registered shortcuts for component '%1'? "
"The component and shortcuts will reregister themselves with their default settings"
" when they are next started.",
componentUnique),
i18n("Remove component")) != KMessageBox::Yes) {
return;
}
}
// Initiate the removing of the component.
if (KGlobalAccel::cleanComponent(componentUnique)) {
// Get the objectPath BEFORE we delete the source of it
QDBusObjectPath oPath = components.value(name)->dbusPath();
// Remove the component from the gui
removeComponent(componentUnique);
// Load it again
// #############
if (loadComponent(oPath)) {
// Active it
q->activateComponent(name);
}
}
}
bool KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::loadComponent(const QDBusObjectPath &componentPath)
{
// Get the component
org::kde::kglobalaccel::Component component(
"org.kde.kglobalaccel",
componentPath.path(),
bus);
if (!component.isValid()) {
kDebug() << "Component " << componentPath.path() << "not valid! Skipping!";
return false;
}
// Get the shortcut contexts.
QDBusReply<QStringList> shortcutContextsRc = component.getShortcutContexts();
if (!shortcutContextsRc.isValid()) {
kDebug() << "Failed to get contexts for component "
<< componentPath.path() <<"! Skipping!";
kDebug() << shortcutContextsRc.error();
return false;
}
QStringList shortcutContexts = shortcutContextsRc;
// We add the shortcuts for all shortcut contexts to the editor. This
// way the user keeps full control of it's shortcuts.
Q_FOREACH (const QString &shortcutContext, shortcutContexts) {
QDBusReply< QList<KGlobalShortcutInfo> > shortcutsRc =
component.allShortcutInfos(shortcutContext);
if (!shortcutsRc.isValid())
{
kDebug() << "allShortcutInfos() failed for " << componentPath.path() << shortcutContext;
continue;
}
QList<KGlobalShortcutInfo> shortcuts = shortcutsRc;
// Shouldn't happen. But you never know
if (shortcuts.isEmpty()) {
kDebug() << "Got shortcut context" << shortcutContext << "without shortcuts for"
<< componentPath.path();
continue;
}
// It's safe now
const QString componentUnique = shortcuts[0].componentUniqueName();
QString componentContextId = componentUnique;
// kglobalaccel knows that '|' is our separator between
// component and context
if (shortcutContext != "default") {
componentContextId += QString("|") + shortcutContext;
}
// Create a action collection for our current component:context
KActionCollection* col = new KActionCollection(
q,
KComponentData(componentContextId.toAscii()));
// Now add the shortcuts.
Q_FOREACH (const KGlobalShortcutInfo &shortcut, shortcuts) {
const QString &objectName = shortcut.uniqueName();
KAction *action = col->addAction(objectName);
action->setProperty("isConfigurationAction", QVariant(true)); // see KAction::~KAction
action->setText(shortcut.friendlyName());
// Always call this to enable global shortcuts for the action. The editor widget
// checks it.
// Also actually loads the shortcut using the KAction::Autoloading mechanism.
// Avoid setting the default shortcut; it would just be written to the global
// configuration so we would not get the real one below.
action->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
// The default shortcut will never be loaded because it's pointless in a real
// application. There are no scarce resources [i.e. physical keys] to manage
// so applications can set them at will and there's no autoloading.
QList<QKeySequence> sc = shortcut.defaultKeys();
if (sc.count()>0) {
action->setGlobalShortcut(KShortcut(sc[0]), KAction::DefaultShortcut);
}
} // Q_FOREACH(shortcut)
QString componentFriendlyName = shortcuts[0].componentFriendlyName();
if (shortcuts[0].contextUniqueName() != "default")
{
componentFriendlyName +=
QString('[') + shortcuts[0].contextFriendlyName() + QString(']');
}
q->addCollection(col, componentPath, componentContextId, componentFriendlyName );
} // Q_FOREACH(context)
return true;
}
void KGlobalShortcutsEditor::KGlobalShortcutsEditorPrivate::removeComponent(
const QString &componentUnique )
{
// TODO: Remove contexts too.
Q_FOREACH (const QString &text, components.keys())
{
if (components.value(text)->uniqueName() == componentUnique)
{
// Remove from QComboBox
int index = ui.components->findText(text);
Q_ASSERT(index != -1);
ui.components->removeItem(index);
// Remove from QStackedWidget
stack->removeWidget(components[text]->editor());
// Remove the componentData
delete components.take(text);
}
}
}
#include "moc_kglobalshortcutseditor.cpp"

View file

@ -1,156 +0,0 @@
/*
* Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KGLOBALSHORTCUTSEDITOR_H
#define KGLOBALSHORTCUTSEDITOR_H
#include <QWidget>
#include "kshortcutseditor.h"
class KActionCollection;
class KShortcut;
class KConfig;
#include <QDBusObjectPath>
/**
* Combine a KShortcutsEditor with a KComboBox.
*
* @see KShortcutsEditor
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class KGlobalShortcutsEditor : public QWidget
{
Q_OBJECT
public:
/**
* Constructor
*
* @param parent parent widget
*/
KGlobalShortcutsEditor(QWidget *parent,
KShortcutsEditor::ActionTypes actionTypes = KShortcutsEditor::AllActions);
~KGlobalShortcutsEditor();
/**
* Insert an action collection, i.e. add all it's actions to the ones already associated
* with the KShortcutsEditor object.
*
* @param collection the collection to add
* @param component title for the component
* @param title title for the subtree in the component
*/
void addCollection(KActionCollection *, const QDBusObjectPath &path, const QString &id, const QString &name);
/**
* Clear all collections were currently hosting. Current changes are not
* undone? Do that before calling this method.
*/
void clear();
/**
* Revert all changes made since the last save.
*/
void undo();
/**
* Load the shortcuts from the configuration.
*/
void importConfiguration(KConfigBase *config);
/**
* Save the shortcuts to the configuration.
*/
void exportConfiguration(QStringList componentsFriendly, KConfig *config) const;
/**
* Are the unsaved changes?
*/
bool isModified() const;
enum ComponentScope
{
AllComponents,
CurrentComponent
};
Q_SIGNALS:
/**
* Indicate that state of the modules contents has changed.
*
* @param state changed or not
*/
void changed(bool);
public Q_SLOTS:
/**
* Activate the component \a component.
*
* @param component the component
*/
void activateComponent(const QString &component);
/**
* Set all shortcuts to none.
*/
void clearConfiguration();
/**
* Load/Reload the global shortcuts
*/
void load();
/**
* Make the changes persistent.
*
* That's function is not really saving. Global shortcuts are saved immediately. This
* prevent the undo on deleting the editor.
*/
void save();
/**
* Set shortcuts to their default value;
*/
void defaults(ComponentScope scope);
virtual void importScheme();
virtual void exportScheme();
private Q_SLOTS:
void _k_key_changed();
private:
friend class KGlobalShortcutsEditorPrivate;
class KGlobalShortcutsEditorPrivate;
KGlobalShortcutsEditorPrivate *const d;
Q_DISABLE_COPY(KGlobalShortcutsEditor)
Q_PRIVATE_SLOT(d, void removeComponent())
}; // class KGlobalShortcutsEditor
#endif // KGLOBALSHORTCUTSEDITOR_H

View file

@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>KGlobalShortcutsEditor</class>
<widget class="QWidget" name="KGlobalShortcutsEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>612</width>
<height>516</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>KDE component:</string>
</property>
</widget>
</item>
<item>
<widget class="KComboBox" name="components">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="menu_button">
<property name="text">
<string>File</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>components</tabstop>
<tabstop>menu_button</tabstop>
</tabstops>
<connections/>
</ui>

View file

@ -1,159 +0,0 @@
[Settings]
Name=KDE Default for 3 Modifier Keys
Name[af]=Standaard KDE vir 3 verandering sleutels
Name[ar]=مبدئي كدي لـ3 مفاتيح مغيرة
Name[ast]=Predetermináu de KDE de 3 modificadores de tecláu
Name[be]=Стандартны для KDE з трыма клавішамі мадыфікацыі
Name[be@latin]=Zmoŭčanaja schiema „KDE” dla 3 klavišnych madyfikataraŭ
Name[bg]=KDE (с 3 модификационни клавиша)
Name[ca]=Omissió del KDE per a 3 tecles modificadores
Name[ca@valencia]=Omissió del KDE per a 3 tecles modificadores
Name[cs]=Výchozí pro KDE (3 modifikátory)
Name[csb]=Domëslny nastôw KDE dlô 3 klawiszów zjinaczi
Name[cy]=Rhagosodion KDE i 3 Bysell Addasu
Name[da]=KDE-standard med 3 modifikatortaster
Name[de]=KDE-Standard für 3 Sondertasten
Name[el]=Προκαθορισμένο του KDE για 3 τροποποιητές
Name[en_GB]=KDE Default for 3 Modifier Keys
Name[eo]=KDE-defaŭlto por 3 modifoklavoj
Name[es]=Predeterminado de KDE de 3 modificadores de teclado
Name[et]=KDE vaikeskeem 3 muuteklahviga
Name[eu]=KDE lehenetsia 3 tekla modifikatzailekin
Name[fa]=پیش‌فرض KDE برای ۳ کلید تغییردهنده
Name[fi]=KDE oletus 3:lle muokkausnäppäimelle
Name[fr]=KDE par défaut pour 3 touches de modifications
Name[fy]=KDE-standert foar 3 modifikaasjetoetsen
Name[ga]=Réamhshocrú KDE le haghaidh trí eochair mhionathraithe
Name[gl]=Predeterminado de KDE para 3 teclas modificadoras
Name[gu]=૩ બદલેલ કળો માટે KDE મૂળભૂત
Name[he]=ברירת המחדל של KDE עבור 3 כפתורים משני מצב
Name[hi]=3 मॉडीफ़ायर कुंजियों के लिए केडीई डिफ़ॉल्ट
Name[hne]=3 माडीफायर कुंजी मन बर केडीई डिफाल्ट
Name[hr]=KDE zadano za 3 modifikatorske tipke
Name[hsb]=KDE-standard za tři modifikowace tasty
Name[hu]=KDE-s alapértelmezés (3 módosító billentyűvel)
Name[ia]=KDE predefinite pro 3 claves modificator
Name[id]=Standar KDE untuk 3 Tombol Pengubah
Name[is]=Sjálfgefið KDE fyrir 3 breytilykla
Name[it]=Predefinito di KDE per 3 tasti modificatori
Name[ja]=KDE 標準 (修飾キー 3 個)
Name[kk]=3 түрлендіру пернелі KDE-нің әдетті баптауы
Name[km]=លំនាំដើម​របស់ KDE សម្រាប់​សោ​កែប្រែ ៣
Name[kn]=೩ ಪರಿವರ್ತಕ ಕೀಲಿಗಳಿಗೆ ಕೆಡಿಇ ಪೂರ್ವನಿಯೋಜನೆ
Name[ko]=세 개의 수정자 키를 사용하는 KDE 기본값
Name[ku]=KDE Standard ji bo 3 Bişkojkên Guherker
Name[lt]=KDE numatytoji 3 lygio klavišams modifikatoriams
Name[lv]=KDE noklusējums ar 3 modifikācijas taustiņiem
Name[mai]=3 माडीफायर कुंजीसभ क' लेल केडीई पूर्वनिर्धारित
Name[mk]=KDE-стандардно за 3 копчиња-модификатори
Name[ml]=3 മോഡിഫയര്‍ കീകള്‍ക്കു് കെഡിഇയുടെ സഹജമായതു്
Name[mr]=3 संपादन की करीता KDE मुलभूत
Name[ms]=Piawai KDE untuk 3 Kekunci Pengubah Suai
Name[nb]=KDE-standard for tre valgtaster
Name[nds]=KDE-Standard för 3 Sünnertasten
Name[ne]=३ परिमार्जक कुञ्जीका लागि पूर्वनिर्धारित केडीई
Name[nl]=KDE-standaard voor 3 modificatietoetsen
Name[nn]=KDE-standard med tre valtastar
Name[or]=3ଟି ପରିବର୍ତ୍ତକ କି ପାଇଁ KDE ପୂର୍ବନିର୍ଦ୍ଧାରିତ
Name[pa]=3 ਮੋਡੀਫਾਇਰ ਸਵਿੱਚਾਂ ਲਈ KDE ਡਿਫਾਲਟ
Name[pl]=Ustawienia domyślne KDE dla 3 klawiszy modyfikatorów
Name[pt]=Predefinição do KDE para 3 Teclas Modificadoras
Name[pt_BR]=Padrão do KDE para 3 teclas modificadoras
Name[ro]=Implicit KDE pentru 3 modificatori
Name[ru]=KDE с тремя клавишами-модификаторами
Name[se]=KDE-standárda mas leat golbma válljeboalu
Name[si]=3 වෙනස් යතුරු සඳහා KDE පෙරනිමියන්
Name[sk]=KDE štandardné (3 modifikačné klávesy)
Name[sl]=Privzeto za 3 spremenilne tipke
Name[sr]=КДЕ‑ово подразумевано за три модификаторска тастера
Name[sr@ijekavian]=КДЕ‑ово подразумијевано за три модификаторска тастера
Name[sr@ijekavianlatin]=KDEovo podrazumijevano za tri modifikatorska tastera
Name[sr@latin]=KDEovo podrazumevano za tri modifikatorska tastera
Name[sv]=KDE-förinställt med 3 väljartangenter
Name[ta]=KDE Default for 3 Modifier Keys
Name[te]=3 సవరింపు కీలకొరకు KDE అప్రమేయం
Name[tg]=KDE с тремя клавишами-модификаторами
Name[th]=ค่าปริยายของ KDE สำหรับปุ่มเปลี่ยนหน้าที่ 3 ปุ่ม
Name[tr]=3 Değiştirici Anahtar için KDE Varsayılan
Name[uk]=Типова для KDE з 3 клавішами-модифікаторами
Name[vi]=Mặc định KDE cho 3 Phím Bổ trợ
Name[wa]=Prémetou KDE (3 tapes modifieueses)
Name[xh]=KDE Engagqibekanga ye 3 Izitsixo Mofifier
Name[x-test]=xxKDE Default for 3 Modifier Keysxx
Name[zh_CN]=三个修饰键的 KDE 默认值
Name[zh_TW]=KDE 預設 3 個變更鍵
Uses Win Modifier=false
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=Ctrl+Alt+Del
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=Ctrl+Alt+Esc
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=Ctrl+F10
Switch to Desktop 11=Ctrl+F11
Switch to Desktop 12=Ctrl+F12
Switch to Desktop 13=Ctrl+Shift+F1
Switch to Desktop 14=Ctrl+Shift+F2
Switch to Desktop 15=Ctrl+Shift+F3
Switch to Desktop 16=Ctrl+Shift+F4
Switch to Desktop 1=Ctrl+F1
Switch to Desktop 2=Ctrl+F2
Switch to Desktop 3=Ctrl+F3
Switch to Desktop 4=Ctrl+F4
Switch to Desktop 5=Ctrl+F5
Switch to Desktop 6=Ctrl+F6
Switch to Desktop 7=Ctrl+F7
Switch to Desktop 8=Ctrl+F8
Switch to Desktop 9=Ctrl+F9
Switch to Next Desktop=none
Switch to Previous Desktop=none
Toggle Window Raise/Lower=none
Walk Through Desktop List (Reverse)=Ctrl+Shift+Tab
Walk Through Desktop List=Ctrl+Tab
Walk Through Desktops (Reverse)=none
Walk Through Desktops=none
Toggle Present Windows (Current desktop)=Alt+Tab
Toggle Present Windows (Window class)=Alt+Shift+Tab
Window Close=Alt+F4
Window Lower=none
Window Maximize Horizontal=none
Window Maximize Vertical=none
Window Maximize=none
Window Minimize=none
Window Move=none
Window Operations Menu=Alt+F3
Window Raise=none
Window Resize=none
Window Screenshot to Clipboard=Alt+Print
Window Shade=none
Window to Desktop 10=none
Window to Desktop 11=none
Window to Desktop 12=none
Window to Desktop 13=none
Window to Desktop 14=none
Window to Desktop 15=none
Window to Desktop 16=none
Window to Desktop 1=none
Window to Desktop 2=none
Window to Desktop 3=none
Window to Desktop 4=none
Window to Desktop 5=none
Window to Desktop 6=none
Window to Desktop 7=none
Window to Desktop 8=none
Window to Desktop 9=none
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Ctrl+Alt+K
[kickoff][Global Shortcuts]
Run Command=Alt+F2

View file

@ -1,160 +0,0 @@
[Settings]
Name=KDE Default for 4 Modifier Keys
Name[af]=Standaard KDE vir 4 verandering sleutels
Name[ar]=مبدئي كدي لـ4 مفاتيح مغيرة
Name[ast]=Predetermináu de KDE de 4 modificadores de tecláu
Name[be]=Стандартны для KDE з чатырма клавішамі мадыфікацыі
Name[be@latin]=Zmoŭčanaja schiema „KDE” dla 4 klavišnych madyfikataraŭ
Name[bg]=KDE (с 4 модификационни клавиша)
Name[ca]=Omissió del KDE per a 4 tecles modificadores
Name[ca@valencia]=Omissió del KDE per a 4 tecles modificadores
Name[cs]=Výchozí pro KDE (4 modifikátory)
Name[csb]=Domëslny nastôw KDE dlô 4 klawiszów zjinaczi
Name[cy]=Rhagosodion KDE i 4 Bysell Addasu
Name[da]=KDE-standard med 4 modifikatortaster
Name[de]=KDE-Standard für 4 Sondertasten
Name[el]=Προκαθορισμένο του KDE για 4 τροποποιητές
Name[en_GB]=KDE Default for 4 Modifier Keys
Name[eo]=KDE-defaŭlto por 4 modifoklavoj
Name[es]=Predeterminado de KDE de 4 modificadores de teclado
Name[et]=KDE vaikeskeem 4 muuteklahviga
Name[eu]=KDE lehenetsia 4 tekla modifikatzailekin
Name[fa]=پیش‌فرض KDE برای ۴ کلید تغییردهنده
Name[fi]=KDE oletus 4:lle muokkausnäppäimelle
Name[fr]=KDE par défaut pour 4 touches de modifications
Name[fy]=KDE-standert foar 4 modifikaasjetoetsen
Name[ga]=Réamhshocrú KDE le haghaidh ceithre eochair mhionathraithe
Name[gl]=Predeterminado de KDE para 4 teclas modificadoras
Name[gu]=૪ બદલેલ કળો માટે KDE મૂળભૂત
Name[he]=ברירת המחדל של KDE עבור 4 כפתורים משני מצב
Name[hi]=4 मॉडीफ़ायर कुंजियों के लिए केडीई डिफ़ॉल्ट
Name[hne]=4 माडीफायर कुंजी मन बर केडीई डिफाल्ट
Name[hr]=KDE zadano za 4 modifikatorske tipke
Name[hsb]=KDE-standard za štyri modifikowace tasty
Name[hu]=KDE-s alapértelmezés (4 módosító billentyűvel)
Name[ia]=KDE predefinite pro 4 claves modificator
Name[id]=Standar KDE untuk 4 Tombol Pengubah
Name[is]=Sjálfgefið KDE fyrir 4 breytilykla
Name[it]=Predefinito di KDE per 4 tasti modificatori
Name[ja]=KDE 標準 (修飾キー 4 個)
Name[kk]=4 түрлендіру пернелі KDE-нің әдетті баптауы
Name[km]=លំនាំដើម​របស់ KDE សម្រាប់​សោ​កែប្រែ ៤
Name[kn]=೪ ಪರಿವರ್ತಕ ಕೀಲಿಗಳಿಗೆ ಕೆಡಿಇ ಪೂರ್ವನಿಯೋಜನೆ
Name[ko]=네 개의 수정자 키를 사용하는 KDE 기본값
Name[ku]=KDE Standard ji bo 4 Bişkojkên Guherker
Name[lt]=KDE numatytoji 4 lygio klavišams modifikatoriams
Name[lv]=KDE noklusējums ar 4 modifikācijas taustiņiem
Name[mai]=4 माडीफायर कुंजियों क' लेल केडीई पूर्वनिर्धारित
Name[mk]=KDE-стандардно за 4 копчиња-модификатори
Name[ml]=4 മോഡിഫയര്‍ കീകള്‍ക്കു് കെഡിഇയുടെ സഹജമായതു്
Name[mr]=4 संपादन की करीता KDE मुलभूत
Name[ms]=Piawai KDE untuk 4 Kekunci Pengubah Suai
Name[nb]=KDE-standard for fire valgtaster
Name[nds]=KDE-Standard för 4 Sünnertasten
Name[ne]=४ परिमार्जक कुञ्जीका लागि पूर्वनिर्धारित केडीई
Name[nl]=KDE-standaard voor 4 modificatietoetsen
Name[nn]=KDE-standard med fire valtastar
Name[or]=4ଟି ପରିବର୍ତ୍ତକ କି ପାଇଁ KDE ପୂର୍ବନିର୍ଦ୍ଧାରିତ
Name[pa]=4 ਮੋਡੀਫਾਇਰ ਸਵਿੱਚਾਂ ਲਈ KDE ਡਿਫਾਲਟ
Name[pl]=Ustawienia domyślne KDE dla 4 klawiszy modyfikatorów
Name[pt]=Predefinição do KDE para 4 Teclas Modificadoras
Name[pt_BR]=Padrão do KDE para 4 teclas modificadoras
Name[ro]=Implicit KDE pentru 4 modificatori
Name[ru]=KDE с четырьмя клавишами-модификаторами
Name[se]=KDE-standárda mas leat njeallje válljenboalu
Name[si]=4 වෙනස් යතුරු සඳහා KDE පෙරනිමියන්
Name[sk]=KDE štandardné (4 modifikačné klávesy)
Name[sl]=Privzeto za 4 spremenilne tipke
Name[sr]=КДЕ‑ово подразумевано за четири модификаторска тастера
Name[sr@ijekavian]=КДЕ‑ово подразумијевано за четири модификаторска тастера
Name[sr@ijekavianlatin]=KDEovo podrazumijevano za četiri modifikatorska tastera
Name[sr@latin]=KDEovo podrazumevano za četiri modifikatorska tastera
Name[sv]=KDE-förinställt med 4 väljartangenter
Name[ta]=KDE Default for 4 Modifier Keys
Name[te]=4 సవరింపు కీలకొరకు KDE అప్రమేయం
Name[tg]=KDE с четырьмя клавишами-модификаторами
Name[th]=ค่าปริยายของ KDE สำหรับปุ่มเปลี่ยนหน้าที่ 4 ปุ่ม
Name[tr]=4 Değiştirici Anahtar için KDE Varsayılan
Name[uk]=Типова для KDE з 4 клавішами-модифікаторами
Name[vi]=Mặc định KDE cho 4 Phím Bổ trợ
Name[wa]=Prémetou KDE (4 tapes modifieueses)
Name[xh]=KDE Engagqibekanga ye 4 Izitsixo Mofifier
Name[x-test]=xxKDE Default for 4 Modifier Keysxx
Name[zh_CN]=四个修饰键的 KDE 默认值
Name[zh_TW]=KDE 預設 4 個變更鍵
Uses Win Modifier=true
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=Meta+Esc
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=Meta+Ctrl+Del
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=Meta+F10
Switch to Desktop 11=none
Switch to Desktop 12=none
Switch to Desktop 13=none
Switch to Desktop 14=none
Switch to Desktop 15=none
Switch to Desktop 16=none
Switch to Desktop 1=Meta+F1
Switch to Desktop 2=Meta+F2
Switch to Desktop 3=Meta+F3
Switch to Desktop 4=Meta+F4
Switch to Desktop 5=Meta+F5
Switch to Desktop 6=Meta+F6
Switch to Desktop 7=Meta+F7
Switch to Desktop 8=Meta+F8
Switch to Desktop 9=Meta+F9
Switch to Next Desktop=none
Switch to Previous Desktop=none
Toggle Window Raise/Lower=none
Walk Through Desktop List (Reverse)=none
Walk Through Desktop List=none
Walk Through Desktops (Reverse)=Meta+Shift+Tab
Walk Through Desktops=Meta+Tab
Toggle Present Windows (Current desktop)=Alt+Tab
Toggle Present Windows (Window class)=Alt+Shift+Tab
Window Close=Alt+Esc; Alt+F4
Window Lower=none
Window Maximize Horizontal=Meta+=
Window Maximize Vertical=Meta+|
Window Maximize=Meta++
Window Minimize=Meta+-
Window Move=none
Window Operations Menu=Alt+Menu
Window Raise=none
Window Resize=none
Window Screenshot to Clipboard=Alt+Print
Window Shade=Meta+_
Window to Desktop 10=Meta+Alt+F10
Window to Desktop 11=none
Window to Desktop 12=none
Window to Desktop 13=none
Window to Desktop 14=none
Window to Desktop 15=none
Window to Desktop 16=none
Window to Desktop 1=Meta+Alt+F1
Window to Desktop 2=Meta+Alt+F2
Window to Desktop 3=Meta+Alt+F3
Window to Desktop 4=Meta+Alt+F4
Window to Desktop 5=Meta+Alt+F5
Window to Desktop 6=Meta+Alt+F6
Window to Desktop 7=Meta+Alt+F7
Window to Desktop 8=Meta+Alt+F8
Window to Desktop 9=Meta+Alt+F9
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Meta+Ctrl+K
[kickoff][Global Shortcuts]
Run Command=Meta+Return; Alt+F2

View file

@ -1,164 +0,0 @@
[Settings]
Name=Mac Scheme
Name[af]=Mac Tema
Name[ar]=مخطط الماك
Name[ast]=Tema Mac
Name[be]=Схема Mac
Name[be@latin]=Schiema „Mac”
Name[bg]=Mac
Name[bn]=ম্যাক্ স্কীম
Name[bn_IN]=Mac স্কিম
Name[br]=Steuñv Mac
Name[ca]=Esquema Mac
Name[ca@valencia]=Esquema Mac
Name[cs]=Mac schéma
Name[csb]=Mòtiw Mac-a
Name[cy]=Cynllun Mac
Name[da]=Mac-system
Name[de]=Mac-Design
Name[el]=Σχήμα Mac
Name[en_GB]=Mac Scheme
Name[eo]=Makintoŝa aranĝo
Name[es]=Tema Mac
Name[et]=Maci skeem
Name[eu]=Mac eskema
Name[fa]=طرحواره مکینتاش
Name[fi]=Mac-skeema
Name[fr]=Agencement Mac
Name[fy]=Mac-skema
Name[ga]=Scéim Mac
Name[gl]=Esquema de Mac
Name[gu]=મેક પધ્ધતિ
Name[he]=ערכת Mac
Name[hi]=मॅक प्रसंग
Name[hne]=मॅक प्रसंग
Name[hr]=Mac shema
Name[hsb]=Mac-šema
Name[hu]=Mac
Name[ia]=Schema Mac
Name[id]=Skema Mac
Name[is]=Mac þema
Name[it]=Schema Mac
Name[ja]=Macintosh スキーマ
Name[ka]=Mac სქემა
Name[kk]=Mac сұлбасы
Name[km]=គ្រោងការណ៍ Mac
Name[kn]=ಮ್ಯಾಕ್ ಪದ್ಧತಿ (ಸ್ಕೀಮ್)
Name[ko]=Mac 배열
Name[ku]=Dirbê Mac
Name[lt]=Mac schema
Name[lv]=Mac shēma
Name[mai]=मैक प्रसंग
Name[mk]=Mac-шема
Name[ml]=മാക് പദ്ധതി
Name[mr]=मॅक सुत्रयोजना
Name[nb]=Mac-oppsett
Name[nds]=Mac-Vörbild
Name[ne]=म्याक योजना
Name[nl]=Mac-schema
Name[nn]=Mac-oppsett
Name[or]=Mac ଯୋଜନା
Name[pa]=Mac ਸਕੀਮ
Name[pl]=Motyw Mac-a
Name[pt]=Esquema do Mac
Name[pt_BR]=Esquema do Mac
Name[ro]=Schemă Mac
Name[ru]=Mac
Name[se]=Mac-coakkáldat
Name[si]=Mac ක්‍රමය
Name[sk]=Mac schéma
Name[sl]=Shema Mac
Name[sr]=Мекинтошева шема
Name[sr@ijekavian]=Мекинтошева шема
Name[sr@ijekavianlatin]=Macintosheva šema
Name[sr@latin]=Macintosheva šema
Name[sv]=Mac schema
Name[ta]=Mac முறைமை
Name[te]=Mac స్కీమ్
Name[tg]=Нақшаи Mac
Name[th]=ใช้แบบของ MAC
Name[tr]=Mac Şeması
Name[uk]=Схема Mac
Name[uz]=Mac mavzusi
Name[uz@cyrillic]=Mac мавзуси
Name[vi]=Phối hợp của Mac
Name[wa]=Djeu d' rascourtis Mac
Name[xh]=Udweliso lwe Mac
Name[x-test]=xxMac Schemexx
Name[zh_CN]=Mac 方案
Name[zh_TW]=Mac 機制
Uses Win Modifier=true
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=Ctrl+Alt+Del
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=Ctrl+Alt+Esc
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=Ctrl+F10
Switch to Desktop 11=Ctrl+F11
Switch to Desktop 12=Ctrl+F12
Switch to Desktop 13=Ctrl+Shift+F1
Switch to Desktop 14=Ctrl+Shift+F2
Switch to Desktop 15=Ctrl+Shift+F3
Switch to Desktop 16=Ctrl+Shift+F4
Switch to Desktop 1=Ctrl+F1
Switch to Desktop 2=Ctrl+F2
Switch to Desktop 3=Ctrl+F3
Switch to Desktop 4=Ctrl+F4
Switch to Desktop 5=Ctrl+F5
Switch to Desktop 6=Ctrl+F6
Switch to Desktop 7=Ctrl+F7
Switch to Desktop 8=Ctrl+F8
Switch to Desktop 9=Ctrl+F9
Switch to Next Desktop=none
Switch to Previous Desktop=none
Toggle Window Raise/Lower=Ctrl+E
Walk Through Desktop List (Reverse)=none
Walk Through Desktop List=none
Walk Through Desktops (Reverse)=Alt+Shift+Tab
Walk Through Desktops=Alt+Tab
Toggle Present Windows (Current desktop)=Ctrl+Tab
Toggle Present Windows (Window class)=Ctrl+Shift+Tab
Window Close=Alt+F4
Window Lower=none
Window Maximize Horizontal=none
Window Maximize Vertical=none
Window Maximize=none
Window Minimize=none
Window Move=none
Window Operations Menu=Alt+F3
Window Raise=none
Window Resize=none
Window Screenshot to Clipboard=Ctrl+Shift+4
Window Shade=none
Window to Desktop 10=none
Window to Desktop 11=none
Window to Desktop 12=none
Window to Desktop 13=none
Window to Desktop 14=none
Window to Desktop 15=none
Window to Desktop 16=none
Window to Desktop 1=none
Window to Desktop 2=none
Window to Desktop 3=none
Window to Desktop 4=none
Window to Desktop 5=none
Window to Desktop 6=none
Window to Desktop 7=none
Window to Desktop 8=none
Window to Desktop 9=none
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Ctrl+Alt+K
[kickoff][Global Shortcuts]
Run Command=Alt+F2

View file

@ -1,165 +0,0 @@
[Settings]
Name=UNIX Scheme
Name[af]=UNIX Tema
Name[ar]=مخطط يونِكس
Name[ast]=Esquema UNIX
Name[be]=Схема UNIX
Name[be@latin]=Schiema „UNIX”
Name[bg]=UNIX
Name[bn]=ইউনিক্স স্কীম
Name[bn_IN]=UNIX স্কিম
Name[br]=Steuñv UNIX
Name[ca]=Esquema UNIX
Name[ca@valencia]=Esquema UNIX
Name[cs]=Unixové schéma
Name[csb]=Mòtiw Uniksa
Name[cy]=Cynllun UNIX
Name[da]=UNIX-system
Name[de]=UNIX-Design
Name[el]=Σχήμα UNIX
Name[en_GB]=UNIX Scheme
Name[eo]=Uniksa aranĝo
Name[es]=Esquema UNIX
Name[et]=UNIX-i skeem
Name[eu]=UNIX eskema
Name[fa]=طرحواره یونیکس
Name[fi]=UNIX-skeema
Name[fr]=Agencement UNIX
Name[fy]=UNIX-skema
Name[ga]=Scéim UNIX
Name[gl]=Esquema de UNIX
Name[gu]=UNIX પધ્ધતિ
Name[he]=ערכת UNIX
Name[hi]=यूनिक्स प्रसंग
Name[hne]=यूनिक्स प्रसंग
Name[hr]=UNIX shema
Name[hsb]=UNIX-šema
Name[hu]=UNIX
Name[ia]=Schema UNIX
Name[id]=Skema UNIX
Name[is]=UNIX þema
Name[it]=Schema UNIX
Name[ja]=UNIX スキーマ
Name[ka]=UNIX სქემა
Name[kk]=UNIX сұлбасы
Name[km]=គ្រោងការណ៍​យូនីក
Name[kn]=ಯುನೀಕ್ಸ್ ಪದ್ಧತಿ (ಸ್ಕೀಮ್)
Name[ko]=UNIX 배열
Name[ku]=Şemaya UNIX'ê
Name[lt]=UNIX schema
Name[lv]=UNIX shēma
Name[mai]=यूनिक्स प्रसंग
Name[mk]=UNIX-шема
Name[ml]=യൂണിക്സ് പദ്ധതി
Name[mr]=UNIX सुत्रयोजना
Name[nb]=UNIX-oppsett
Name[nds]=UNIX-Vörbild
Name[ne]=यूनिक्स योजना
Name[nl]=UNIX-schema
Name[nn]=UNIX-oppsett
Name[or]=UNIX ଯୋଜନା
Name[pa]=UNIX ਸਕੀਮ
Name[pl]=Motyw Uniksa
Name[pt]=Esquema do UNIX
Name[pt_BR]=Esquema do UNIX
Name[ro]=Schemă UNIX
Name[ru]=UNIX
Name[se]=UNIX-čoahkkáldat
Name[si]=UNIX ක්‍රමය
Name[sk]=UNIX schéma
Name[sl]=Shema UNIX
Name[sr]=Уникс шема
Name[sr@ijekavian]=Уникс шема
Name[sr@ijekavianlatin]=Unix šema
Name[sr@latin]=Unix šema
Name[sv]=Unix schema
Name[ta]=UNIX முறைமை
Name[te]=UNIX స్కీమ్
Name[tg]=Нақшаи UNIX
Name[th]=ใช้แบบของ UNIX
Name[tr]=UNIX Şeması
Name[uk]=Схема UNIX
Name[uz]=UNIX mavzusi
Name[uz@cyrillic]=UNIX мавзуси
Name[vi]=Phối hợp của Unix
Name[wa]=Djeu d' rascourtis Unix
Name[xh]=Udweliso lwe UNIX
Name[x-test]=xxUNIX Schemexx
Name[zh_CN]=Unix 方案
Name[zh_TW]=UNIX 機制
Uses Win Modifier=false
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=Ctrl+Alt+Del
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=Alt+F9
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=Ctrl+F10
Switch to Desktop 11=Ctrl+F11
Switch to Desktop 12=Ctrl+F12
Switch to Desktop 13=Ctrl+Shift+F1
Switch to Desktop 14=Ctrl+Shift+F2
Switch to Desktop 15=Ctrl+Shift+F3
Switch to Desktop 16=Ctrl+Shift+F4
Switch to Desktop 1=Ctrl+F1
Switch to Desktop 2=Ctrl+F2
Switch to Desktop 3=Ctrl+F3
Switch to Desktop 4=Ctrl+F4
Switch to Desktop 5=Ctrl+F5
Switch to Desktop 6=Ctrl+F6
Switch to Desktop 7=Ctrl+F7
Switch to Desktop 8=Ctrl+F8
Switch to Desktop 9=Ctrl+F9
Switch to Next Desktop=none
Switch to Previous Desktop=none
Toggle Window Raise/Lower=none
Walk Through Desktop List (Reverse)=Ctrl+Shift+Tab
Walk Through Desktop List=none
Walk Through Desktops (Reverse)=none
Walk Through Desktops=Ctrl+Tab
Toggle Present Windows (Current desktop)=Alt+F11
Toggle Present Windows (Window class)=Alt+Shift+Tab
Window Close=none
Window Lower=none
Window Maximize Horizontal=none
Window Maximize Vertical=none
Window Maximize=Alt+Shift+F3
Window Minimize=Alt+F4
Window Move=Alt+F5
Window Operations Menu=none
Window Raise=none
Window Resize=Alt+F6
Window Screenshot to Clipboard=none
Window Shade=none
Window to Desktop 10=none
Window to Desktop 11=none
Window to Desktop 12=none
Window to Desktop 13=none
Window to Desktop 14=none
Window to Desktop 15=none
Window to Desktop 16=none
Window to Desktop 1=none
Window to Desktop 2=none
Window to Desktop 3=none
Window to Desktop 4=none
Window to Desktop 5=none
Window to Desktop 6=none
Window to Desktop 7=none
Window to Desktop 8=none
Window to Desktop 9=none
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Ctrl+Alt+K
[kickoff][Global Shortcuts]
Run Command=Alt+F2

View file

@ -1,163 +0,0 @@
[Settings]
Name=Windows Scheme (Without Win Key)
Name[af]=Venster Skema (Sonder Win Sleutel)
Name[ar]=مخطط ويندوز (بدون مفتاح Win)
Name[ast]=Esquema Windows (Ensin tecla Win)
Name[be]=Схема Windows (без клавішы "Win")
Name[be@latin]=Schiema „Windows” (biaz klavišy „Win”)
Name[bg]=Windows (без клавиша Win)
Name[bn]=উইণ্ডোস্ স্কীম (উইন্ কী ব্যতীত)
Name[br]=Steuñv Windows (hep stokell Win)
Name[ca]=Esquema Windows (sense la tecla Win)
Name[ca@valencia]=Esquema Windows (sense la tecla Win)
Name[cs]=Schéma Windows (bez klávesy Win)
Name[csb]=Mòtiw Windows (bez klawiszë Win)
Name[cy]=Cynllun Windows (Heb Allwedd Win)
Name[da]=Windows-system (uden Win-tast)
Name[de]=Windows-Design (ohne Windows-Taste)
Name[el]=Σχήμα Windows (Χωρίς πλήκτρο Win)
Name[en_GB]=Windows Scheme (Without Win Key)
Name[eo]=Vindoza aranĝo (sen Vindozoklavo)
Name[es]=Esquema Windows (Sin tecla Win)
Name[et]=Windowsi skeem (ilma Win-klahvita)
Name[eu]=Windows eskema (Win teklarik gabe)
Name[fa]=طرحواره ویندوز( بدون کلید پنجره)
Name[fi]=Windows-skeema (ilman Win-näppäintä)
Name[fr]=Agencement Windows (sans la touche « Win »)
Name[fy]=Windows-skema (sûnder Win-toets)
Name[ga]=Scéim Windows (Gan Eochair Win)
Name[gl]=Esquema de Windows (sen tecla de Windows)
Name[gu]=વિન્ડોઝ પધ્ધતિ (વિન કળ વગર)
Name[he]=ערכת חלונות (בלי מקש Win)
Name[hi]=विंडोज़ प्रसंग (विन कुंजी के बगैर)
Name[hne]=विंडोज प्रसंग (विन कुंजी के बिना)
Name[hr]=Windows shema (bez Windows tipki)
Name[hsb]=Windows-šema (bjez Win-tasty)
Name[hu]=Windows (Win billentyű nélkül)
Name[ia]=Schema Windows (Sin clave Win)
Name[id]=Skema Windows (Tanpa Tombol Win)
Name[is]=Windowsþema (án Win lykils)
Name[it]=Schema Windows (senza tasto Win)
Name[ja]=Windows スキーマ (Win キーなし)
Name[kk]=Windows сұлбасы (Win пернесіз)
Name[km]=គ្រោងការណ៍ វីនដូ (គ្មាន​គ្រាប់ចុច Win)
Name[kn]=ವಿಂಡೋಸ್ ಪದ್ಧತಿ (ವಿನ್ ಕೀಲಿ ರಹಿತ)
Name[ko]=윈도 배열 (윈도 키 사용 안함)
Name[ku]=Şemaya Windowsê (Bêyê Bişkojka Winê)
Name[lt]=Windows schema (be Win klavišo)
Name[lv]=Windows shēma (bez Win taustiņa)
Name[mai]=विंडोज प्रसंग (विन कुँजी केर बगैर)
Name[mk]=Windows-шема (без копчето Win)
Name[ml]=വിന്‍ഡോസ് പദ്ധതി (വിന്‍ കീ ഇല്ലാതെ)
Name[mr]=Windows सुत्रयोजना (विना Win किल्ली)
Name[ms]=Skim Tetingkap (Tanpa Kekunci Win)
Name[nb]=Windows-oppsett (uten Windows-tast)
Name[nds]=Windows-Schema (ahn Windows-Tast)
Name[ne]=विण्डोज योजना (विन कुञ्जी बाहेक)
Name[nl]=Windows-schema (zonder Win-toets)
Name[nn]=Windows-oppsett (utan Windows-tast)
Name[or]=ୱିଣ୍ଡୋ ଯୋଜନା (ୱିନ କି ବିନା)
Name[pa]=Windows ਸਕੀਮ (ਬਿਨਾਂ Win ਸਵਿੱਚ)
Name[pl]=Motyw Windows (bez klawisza Win)
Name[pt]=Esquema do Windows (Sem a Tecla Win)
Name[pt_BR]=Esquema do Windows (sem a tecla Win)
Name[ro]=Schemă Windows (fără tasta Win)
Name[ru]=Windows (без клавиши Win)
Name[se]=Windows-čoakkáldat (Windows-boalu haga)
Name[si]=Windows ක්‍රමය (Win යතුර නොමැතිව)
Name[sk]=Windows schéma (bez klávesu Win)
Name[sl]=Shema Windows (brez tipke Win)
Name[sr]=Виндоузова шема (без тастера Win)
Name[sr@ijekavian]=Виндоузова шема (без тастера Win)
Name[sr@ijekavianlatin]=Windowsova šema (bez tastera Win)
Name[sr@latin]=Windowsova šema (bez tastera Win)
Name[sv]=Windows schema (utan Win-tangent)
Name[ta]=சாளர முறைமை (விண் விசை இல்லாமல்)
Name[te]=Windows స్కీమ్ (విన్ కీ లేకుండా)
Name[tg]=Нақшаи Windows (Бе тугмаи Win)
Name[th]=ใช้แบบของวินโดวส์ (โดยไม่ใช้ปุ่ม Win)
Name[tr]=Windows Şeması (Win Key'siz)
Name[uk]=Схема Windows (без клавіші Win)
Name[uz]=Windows qolipi (Win tugmasi bilan)
Name[uz@cyrillic]=Windows қолипи (Win тугмаси билан)
Name[vi]=Phối hợp của Windows (không có phím Cửa sổ)
Name[wa]=Djeu Windows (sins tape Win)
Name[xh]=Window Yodweliso (Ngaphandle kwe Win key)
Name[x-test]=xxWindows Scheme (Without Win Key)xx
Name[zh_CN]=Windows 方案(无 Win 键)
Name[zh_TW]=Windows 機制(沒有 Win 鍵)
Uses Win Modifier=false
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=none
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=none
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=none
Switch to Desktop 11=none
Switch to Desktop 12=none
Switch to Desktop 13=none
Switch to Desktop 14=none
Switch to Desktop 15=none
Switch to Desktop 16=none
Switch to Desktop 1=none
Switch to Desktop 2=none
Switch to Desktop 3=none
Switch to Desktop 4=none
Switch to Desktop 5=none
Switch to Desktop 6=none
Switch to Desktop 7=none
Switch to Desktop 8=none
Switch to Desktop 9=none
Switch to Next Desktop=Alt+Shift+Tab
Switch to Previous Desktop=none
Toggle Window Raise/Lower=none
Walk Through Desktop List (Reverse)=none
Walk Through Desktop List=none
Walk Through Desktops (Reverse)=Ctrl+Alt+Shift+Tab
Walk Through Desktops=Ctrl+Alt+Tab
Toggle Present Windows (Current desktop)=Alt+Tab
Toggle Present Windows (Window class)=Alt+Shift+Tab
Window Close=Alt+F4
Window Lower=none
Window Maximize Horizontal=none
Window Maximize Vertical=none
Window Maximize=none
Window Minimize=none
Window Move=none
Window Operations Menu=Alt+Space
Window Raise=none
Window Resize=none
Window Screenshot to Clipboard=Alt+Print
Window Shade=none
Window to Desktop 10=none
Window to Desktop 11=none
Window to Desktop 12=none
Window to Desktop 13=none
Window to Desktop 14=none
Window to Desktop 15=none
Window to Desktop 16=none
Window to Desktop 1=none
Window to Desktop 2=none
Window to Desktop 3=none
Window to Desktop 4=none
Window to Desktop 5=none
Window to Desktop 6=none
Window to Desktop 7=none
Window to Desktop 8=none
Window to Desktop 9=none
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Ctrl+Alt+K
[kickoff][Global Shortcuts]
Run Command=none

View file

@ -1,164 +0,0 @@
[Settings]
Name=Windows Scheme (With Win Key)
Name[af]=Windows Skema (Met Win Sleutel)
Name[ar]=مخطط ويندوز (مع مفتاح Win)
Name[ast]=Esquema Windows (Con tecla Win)
Name[be]=Схема Windows (з клавішай "Win")
Name[be@latin]=Schiema „Windows” (z klavišaj „Win”)
Name[bg]=Windows (с клавиша Win)
Name[bn]=উইণ্ডোস্ স্কীম (উইন্ কী সমেত)
Name[br]=Steuñv Windows (gant stokell Win)
Name[ca]=Esquema Windows (amb la tecla Win)
Name[ca@valencia]=Esquema Windows (amb la tecla Win)
Name[cs]=Schéma Windows (s klávesou Win)
Name[csb]=Mòtiw Windows (z klawiszą Win)
Name[cy]=Cynllun Windows (Gyda'r Allwedd Win)
Name[da]=Windows-system (med Win-tast)
Name[de]=Windows-Design (mit Windows-Taste)
Name[el]=Σχήμα Windows (με πλήκτρο Win)
Name[en_GB]=Windows Scheme (With Win Key)
Name[eo]=Vindoza aranĝo (kun Vindozoklavo)
Name[es]=Esquema Windows (Con tecla Win)
Name[et]=Windowsi skeem (Win-klahviga)
Name[eu]=Windows eskema (Win teklarekin)
Name[fa]=طرحواره پنجره( با کلید پنجره)
Name[fi]=Windows-skeema (Win-näppäimellä)
Name[fr]=Agencement Windows (avec la touche « Win »)
Name[fy]=Windows-skema (mei Win-toets)
Name[ga]=Scéim Windows (Le hEochair Win)
Name[gl]=Esquema de Windows (con tecla de Windows)
Name[gu]=વિન્ડોઝ પધ્ધતિ (વિન કળ સાથે)
Name[he]=ערכת חלונות (עם מקש Win)
Name[hi]=विंडोज प्रसंग (विन कुंजी समेत)
Name[hne]=विंडोज प्रसंग (विन कुंजी समेत)
Name[hr]=Windows shema (s Windows tipkama)
Name[hsb]=Windows-šema (z Win-tastu)
Name[hu]=Windows (Win billentyűvel)
Name[ia]=Schema Windows (con clave Win)
Name[id]=Skema Windows (Dengan Tombol Win)
Name[is]=Windowsþema (með Win lykli)
Name[it]=Schema Windows (con tasto Win)
Name[ja]=Windows スキーマ (Win キーあり)
Name[ka]=Windows სქემა (Win კლავიშით)
Name[kk]=Windows сұлбасы (Win пернемен)
Name[km]=គ្រោងការណ៍ វីនដូ (មាន​គ្រាប់ចុច Win)
Name[kn]=ವಿಂಡೋಸ್ ಪದ್ಧತಿ (ವಿನ್ ಕೀಲಿ ಸಹಿತ)
Name[ko]=윈도 배열 (윈도 키 사용)
Name[ku]=Şemaya Windowsê (Digel Bişkojka Winê)
Name[lt]=Windows schema (su Win klavišu)
Name[lv]=Windows shēma (ar Win taustiņu)
Name[mai]=विंडोज प्रसंग (विन कुँजी समेत)
Name[mk]=Windows-шема (со копчето Win)
Name[ml]=വിന്‍ഡോസ് പദ്ധതി (വിന്‍ കീയോടൊപ്പം)
Name[mr]=Windows सुत्रयोजना (विन किल्ली सह)
Name[nb]=Windows-oppsett (med Windows-tast)
Name[nds]=Windows-Schema (mit Windows-Tast)
Name[ne]=विण्डोज योजना (विन कुञ्जीसँग)
Name[nl]=Windows-schema (met Win-toets)
Name[nn]=Windows-oppsett (med Windows-tast)
Name[or]=ୱିଣ୍ଡୋ ଯୋଜନା (ୱିନ କି ବିନା)
Name[pa]=Windows ਸਕੀਮ (Win ਸਵਿੱਚ ਨਾਲ)
Name[pl]=Motyw Windows (z klawiszem Win)
Name[pt]=Esquema do Windows (Com a Tecla Win)
Name[pt_BR]=Esquema do Windows (com a tecla Win)
Name[ro]=Schemă Windows (cu tasta Win)
Name[ru]=Windows (поддержка клавиши Win)
Name[se]=Windows-čoakkáldat (Windows-boaluin)
Name[si]=Windows ක්‍රමය (Win යතුර සමඟ)
Name[sk]=Windows schéma (s klávesom Win)
Name[sl]=Shema Windows (s tipko Win)
Name[sr]=Виндоузова шема (са тастером Win)
Name[sr@ijekavian]=Виндоузова шема (са тастером Win)
Name[sr@ijekavianlatin]=Windowsova šema (sa tasterom Win)
Name[sr@latin]=Windowsova šema (sa tasterom Win)
Name[sv]=Windows schema (med Win-tangent)
Name[ta]=சாளர முறைமை (விண் விசையுடன்)
Name[te]=విండోస్ పధకం (విన్ కీ తో)
Name[tg]=Нақшаи Windows (Бо тугмаи Win)
Name[th]=ใช้แบบของวินโดวส์ (ใช้ปุ่ม Win)
Name[tr]=Windows Şeması (Win Key İle)
Name[uk]=Схема Windows (з клавішею Win)
Name[uz]=Windows qolipi (Win tugmasiz)
Name[uz@cyrillic]=Windows қолипи (Win тугмасиз)
Name[vi]=Phối hợp của Windows (có phím Cửa sổ)
Name[wa]=Djeu Windows (avou tape Win)
Name[xh]=Windows Ezingagqibekanga (Nge Win-key)
Name[x-test]=xxWindows Scheme (With Win Key)xx
Name[zh_CN]=Windows 方案(有 Win 键)
Name[zh_TW]=Windows 機制(有 Win 鍵)
Uses Win Modifier=true
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=none
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=none
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=Meta+F10
Switch to Desktop 11=none
Switch to Desktop 12=none
Switch to Desktop 13=none
Switch to Desktop 14=none
Switch to Desktop 15=none
Switch to Desktop 16=none
Switch to Desktop 1=Meta+F1
Switch to Desktop 2=Meta+F2
Switch to Desktop 3=Meta+F3
Switch to Desktop 4=Meta+F4
Switch to Desktop 5=Meta+F5
Switch to Desktop 6=Meta+F6
Switch to Desktop 7=Meta+F7
Switch to Desktop 8=Meta+F8
Switch to Desktop 9=Meta+F9
Switch to Next Desktop=none
Switch to Previous Desktop=none
Toggle Window Raise/Lower=none
Walk Through Desktop List (Reverse)=none
Walk Through Desktop List=none
Walk Through Desktops (Reverse)=Meta+Shift+Tab
Walk Through Desktops=Meta+Tab
Toggle Present Windows (Current desktop)=Alt+Tab
Toggle Present Windows (Window class)=Alt+Shift+Tab
Window Close=Alt+F4
Window Lower=none
Window Maximize Horizontal=none
Window Maximize Vertical=none
Window Maximize=none
Window Minimize=none
Window Move=none
Window Operations Menu=Alt+Space
Window Raise=none
Window Resize=none
Window Screenshot to Clipboard=Alt+Print
Window Shade=none
Window to Desktop 10=none
Window to Desktop 11=none
Window to Desktop 12=none
Window to Desktop 13=none
Window to Desktop 14=none
Window to Desktop 15=none
Window to Desktop 16=none
Window to Desktop 1=none
Window to Desktop 2=none
Window to Desktop 3=none
Window to Desktop 4=none
Window to Desktop 5=none
Window to Desktop 6=none
Window to Desktop 7=none
Window to Desktop 8=none
Window to Desktop 9=none
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Ctrl+Alt+K
[kickoff][Global Shortcuts]
Run Command=Meta+R

View file

@ -1,158 +0,0 @@
[Settings]
Name=WindowMaker (3 Modifier Keys)
Name[af]=WindowMaker (3 verandering sleutels)
Name[ar]=صانع النوافذ (3 مفاتيح مغيرة)
Name[ast]=WindowMaker (3 tecles de modificación)
Name[be]=WindowMaker (тры клавішы мадыфікацыі)
Name[be@latin]=Schiema „WindowMaker” (z 3 madyfikacyjnymi klavišami)
Name[bg]=WindowMaker (с 3 модификационни клавиша)
Name[bn]=উইণ্ডো-মেকার (৩-টি মডিফায়ার কী)
Name[ca]=WindowMaker (3 tecles modificadores)
Name[ca@valencia]=WindowMaker (3 tecles modificadores)
Name[cs]=WindowMaker (3 modifikátory)
Name[csb]=WindowMaker (3 klawisze zjinaczi)
Name[cy]=WindowMaker (3 Bysell Addasu)
Name[da]=Windowmaker (3 modifikatortaster)
Name[de]=WindowMaker (3 Sondertasten)
Name[el]=WindowMaker (3 τροποποιητές)
Name[en_GB]=WindowMaker (3 Modifier Keys)
Name[eo]=WindowMaker (3 modifoklavoj)
Name[es]=WindowMaker (3 teclas de modificación)
Name[et]=WindowMaker (3 muuteklahviga)
Name[eu]=WindowMaker (3 tekla modifikatzailekin)
Name[fa]=WindowMaker (۳کلید تغییردهنده)
Name[fi]=WindowMaker (3 muokkausnäppäintä)
Name[fr]=WindowMaker (3 touches de modifications)
Name[fy]=WindowMaker (3 modifikaasjetoetsen)
Name[ga]=WindowMaker (3 Eochair Mhionathraithe)
Name[gl]=WindowMaker (3 teclas modificadoras)
Name[gu]=વિન્ડોમેકર (૩ બદલનાર કળો)
Name[he]=WindowMaker (עם 3 מקשים משני מצב)
Name[hi]=विंडोमेकर (3 मॉडीफ़ॉयर कुंजियाँ)
Name[hne]=विंडोमेकर (3 माडीफायर कुंजियाँ)
Name[hr]=WindowMaker (3 modifikatorske tipke)
Name[hsb]=WindowMaker (3 modifikowace tasty)
Name[hu]=WindowMaker (3 módosító billentyű)
Name[ia]=Windowmaker (3 Claves Modificator)
Name[id]=WindowMaker (3 Tombol Pengubah)
Name[is]=WindowMaker (3 breytilyklar)
Name[it]=WindowMaker (3 tasti modificatori)
Name[ja]=WindowMaker (修飾キー 3 個)
Name[ka]=WindowMaker (3 ცვლადი კლავიში)
Name[kk]=WindowMaker (3 түрлендіру перне)
Name[km]=WindowMaker (សោ​​កែប្រែ ៣)
Name[kn]=ವಿಂಡೋಮೇಕರ್ (೩ ಪರಿವರ್ತಕ ಕೀಲಿಗಳು)
Name[ko]=WindowMaker (수정자 키 세 개)
Name[ku]=WindowMaker(3 Bişkojkên Guherker)
Name[lt]=WindowMaker (3 lygio klavišai modifikatoriai)
Name[lv]=WindowMaker (3 modifikācijas taustiņi)
Name[mai]=विंडोमेकर (3 माडीफायर कुंजीसभ)
Name[mk]=WindowMaker (3 копчиња-модификатори)
Name[ml]=വിന്‍ഡോമേക്കര്‍ (3 മോഡിഫയര്‍ കീകള്‍)
Name[mr]=चौकटमेकर (3 संपादन की)
Name[nb]=WindowMaker (tre valgtaster)
Name[nds]=WindowMaker (3 Sünnertasten)
Name[ne]=विण्डोज निर्माता (३ परिमार्जक कुञ्जी)
Name[nl]=WindowMaker (3 modificatietoetsen)
Name[nn]=WindowMaker (tre valtastar)
Name[or]=WindowMaker (3ଟି ପରିବର୍ତ୍ତକ କି)
Name[pa]=WindowMaker (3 ਸੋਧ ਸਵਿੱਚਾਂ)
Name[pl]=WindowMaker (3 klawisze modyfikatorów)
Name[pt]=WindowMaker (3 Teclas Modificadoras)
Name[pt_BR]=WindowMaker (3 teclas modificadoras)
Name[ro]=WindowMaker (3 modificatori)
Name[ru]=WindowMaker (3 клавиши-модификатора)
Name[se]=WindowMaker (golbma válljenboaluiguin)
Name[si]=කවුළු සැකසීම (3 වෙනස්කම් යතුරු)
Name[sk]=WindowMaker (3 modifikačné klávesy)
Name[sl]=WindowMaker (3 spremenilne tipke)
Name[sr]=Виндоумејкер (три модификаторска тастера)
Name[sr@ijekavian]=Виндоумејкер (три модификаторска тастера)
Name[sr@ijekavianlatin]=WindowMaker (tri modifikatorska tastera)
Name[sr@latin]=WindowMaker (tri modifikatorska tastera)
Name[sv]=Windowmaker (3 väljartangenter)
Name[ta]=WindowMaker (3 Modifier Keys)
Name[te]=విండోమేకర్ (3 సవరణి కీలు)
Name[tg]=WindowMaker (3 тугмаи якҷояшуда)
Name[th]=วินโดว์เมกเกอร์ (ใช้ปุ่มเปลี่ยนหน้าที่ 3ปุ่ม)
Name[tr]=WindowMaker (3 Değiştirici Anahtar)
Name[uk]=WindowMaker (3 клавіші-модифікатори)
Name[vi]=WindowMaker (3 Phím Bổ trợ)
Name[wa]=Djeu WindowMaker (3 tapes modifieuses)
Name[x-test]=xxWindowMaker (3 Modifier Keys)xx
Name[zh_CN]=WindowMaker (三个修饰键)
Name[zh_TW]=WindowMaker3 個變更鍵)
[ksmserver][Global Shortcuts]
Halt Without Confirmation=none
Log Out Without Confirmation=none
Log Out=Ctrl+Alt+Del
Reboot Without Confirmation=none
[kwin][Global Shortcuts]
Kill Window=Ctrl+Alt+Esc
Switch One Desktop Down=none
Switch One Desktop Up=none
Switch One Desktop to the Left=none
Switch One Desktop to the Right=none
Switch to Desktop 10=Alt+Shift+1
Switch to Desktop 11=Alt+Shift+2
Switch to Desktop 12=Alt+Shift+3
Switch to Desktop 13=Alt+Shift+4
Switch to Desktop 14=Alt+Shift+5
Switch to Desktop 15=Alt+Shift+6
Switch to Desktop 16=Alt+Shift+7
Switch to Desktop 1=Alt+1
Switch to Desktop 2=Alt+2
Switch to Desktop 3=Alt+3
Switch to Desktop 4=Alt+4
Switch to Desktop 5=Alt+5
Switch to Desktop 6=Alt+6
Switch to Desktop 7=Alt+7
Switch to Desktop 8=Alt+8
Switch to Desktop 9=Alt+9
Switch to Next Desktop=none
Switch to Previous Desktop=none
Toggle Window Raise/Lower=none
Walk Through Desktop List (Reverse)=Ctrl+Shift+Tab
Walk Through Desktop List=Ctrl+Tab
Walk Through Desktops (Reverse)=none
Walk Through Desktops=none
Toggle Present Windows (Current desktop)=Alt+Tab
Toggle Present Windows (Window class)=Alt+Shift+Tab
Window Close=Alt+Esc
Window Lower=none
Window Maximize Horizontal=none
Window Maximize Vertical=none
Window Maximize=none
Window Minimize=none
Window Move=none
Window Operations Menu=Alt+F3
Window Raise=none
Window Resize=none
Window Screenshot to Clipboard=Alt+Print
Window Shade=none
Window to Desktop 10=Ctrl+Alt+Shift+1
Window to Desktop 11=Ctrl+Alt+Shift+2
Window to Desktop 12=Ctrl+Alt+Shift+3
Window to Desktop 13=Ctrl+Alt+Shift+4
Window to Desktop 14=Ctrl+Alt+Shift+5
Window to Desktop 15=Ctrl+Alt+Shift+6
Window to Desktop 16=Ctrl+Alt+Shift+7
Window to Desktop 1=Ctrl+Alt+1
Window to Desktop 2=Ctrl+Alt+2
Window to Desktop 3=Ctrl+Alt+3
Window to Desktop 4=Ctrl+Alt+4
Window to Desktop 5=Ctrl+Alt+5
Window to Desktop 6=Ctrl+Alt+6
Window to Desktop 7=Ctrl+Alt+7
Window to Desktop 8=Ctrl+Alt+8
Window to Desktop 9=Ctrl+Alt+9
Window to Next Desktop=none
Window to Previous Desktop=none
[kxkb][Global Shortcuts]
Switch to Next Keyboard Layout=Ctrl+Alt+K
[kickoff][Global Shortcuts]
Run Command=Alt+F2

View file

@ -1,79 +0,0 @@
/*
* Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "select_scheme_dialog.h"
#include "ui_select_scheme_dialog.h"
#include "KDialog"
#include "KStandardDirs"
#include <KLineEdit>
SelectSchemeDialog::SelectSchemeDialog(QWidget *parent)
: KDialog(parent),
ui(new Ui_SelectSchemeDialog)
{
m_schemes = KGlobal::dirs()->findAllResources("data", "kcmkeys/*.kksrc");
ui->setupUi(this);
setMainWidget(ui->layoutWidget);
foreach (const QString &res, m_schemes) {
KConfig config(res, KConfig::SimpleConfig);
KConfigGroup group(&config, "Settings");
QString name = group.readEntry("Name");
if (name.isEmpty()) {
name = res;
}
ui->m_schemes->addItem(name);
}
ui->m_schemes->setCurrentIndex(-1);
ui->m_url->setMode(KFile::LocalOnly | KFile::ExistingOnly);
connect(ui->m_schemes, SIGNAL(activated(int)),
this, SLOT(schemeActivated(int)));
connect(ui->m_url->lineEdit(), SIGNAL(textChanged(QString)),
this, SLOT(slotUrlChanged(QString)));
enableButtonOk(false);
}
SelectSchemeDialog::~SelectSchemeDialog()
{
delete ui;
}
void SelectSchemeDialog::schemeActivated(int index)
{
ui->m_url->setUrl(m_schemes[index]);
}
KUrl SelectSchemeDialog::selectedScheme() const
{
return ui->m_url->url();
}
void SelectSchemeDialog::slotUrlChanged(const QString &_text)
{
enableButtonOk(!_text.isEmpty());
}
#include "moc_select_scheme_dialog.cpp"

View file

@ -1,48 +0,0 @@
/*
* Copyright 2008 Michael Jansen <kde@michael-jansen.biz>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SELECT_SCHEME_DIALOG_H
#define SELECT_SCHEME_DIALOG_H
#include <KDialog>
#include <KUrl>
QT_BEGIN_NAMESPACE
class Ui_SelectSchemeDialog;
QT_END_NAMESPACE
class SelectSchemeDialog : public KDialog
{
Q_OBJECT
public:
SelectSchemeDialog(QWidget *parent = 0);
~SelectSchemeDialog();
KUrl selectedScheme() const;
private slots:
void schemeActivated(int index);
void slotUrlChanged(const QString &);
private:
Ui_SelectSchemeDialog *ui;
QStringList m_schemes;
}; // SelectSchemeDialog
#endif

View file

@ -1,149 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<author>Michael Jansen</author>
<class>SelectSchemeDialog</class>
<widget class="KDialog" name="SelectSchemeDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>717</width>
<height>224</height>
</rect>
</property>
<property name="windowTitle">
<string>Select Shortcut Scheme</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<widget class="QWidget" name="layoutWidget">
<property name="geometry">
<rect>
<x>32</x>
<y>12</y>
<width>671</width>
<height>71</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="baseSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="whatsThis">
<string>Select one of the standard KDE shortcut schemes</string>
</property>
<property name="text">
<string>&amp;Standard scheme:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>m_schemes</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="m_schemes">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="whatsThis">
<string>Select a shortcut scheme file</string>
</property>
<property name="text">
<string>&amp;Path:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>m_url</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KUrlRequester" name="m_url">
<property name="sizeIncrement">
<size>
<width>3</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="filter">
<string notr="true">*.kksrc</string>
</property>
<property name="clickMessage">
<string>Select Shortcut Scheme</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>KComboBox</class>
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
<customwidget>
<class>KDialog</class>
<extends>QDialog</extends>
<header>kdialog.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>KUrlRequester</class>
<extends>QFrame</extends>
<header>kurlrequester.h</header>
</customwidget>
</customwidgets>
<connections/>
</ui>

View file

@ -1,42 +0,0 @@
project(kglobalaccel)
###############################################################################
### KDED Global Accel Daemon
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1219)
set(kglobalaccel_SRCS
main.cpp
kglobalacceld.cpp
component.cpp
globalshortcut.cpp
globalshortcutsregistry.cpp
globalshortcutcontext.cpp
kglobalaccel_x11.cpp
)
add_executable(kglobalaccel ${kglobalaccel_SRCS})
target_link_libraries(kglobalaccel
KDE4::kdeui
KDE4::kio
${X11_LIBRARIES}
)
# Install application and configuration
install(
TARGETS kglobalaccel
DESTINATION ${KDE4_BIN_INSTALL_DIR}
)
# install(FILES kglobalaccel.desktop DESTINATION ${KDE4_AUTOSTART_INSTALL_DIR})
install(
FILES kglobalaccel.desktop
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
)
# KNotify configuration
install(
FILES kglobalaccel.notifyrc
DESTINATION ${KDE4_CONFIG_INSTALL_DIR}/notifications
)
kde4_add_dbus_service(org.kde.kglobalaccel.service.in)

View file

@ -1,2 +0,0 @@
#!/bin/bash
$XGETTEXT *.cpp -o $podir/kglobalaccel.pot

View file

@ -1,435 +0,0 @@
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "component.h"
#include "globalshortcut.h"
#include "globalshortcutcontext.h"
#include "globalshortcutsregistry.h"
#include <KDebug>
#include <KRun>
#include <QtCore/QStringList>
#include <QKeySequence>
#ifdef Q_WS_X11
#include <QApplication>
#include <QtGui/qx11info_x11.h>
#endif
static QList<int> keysFromString(const QString &str)
{
QList<int> ret;
if (str == QLatin1String("none")) {
return ret;
}
const QStringList strList = str.split('\t');
foreach (const QString &s, strList) {
const int key = QKeySequence(s)[0];
if (key != 0) {
// sanity check just in case
ret.append(key);
}
}
return ret;
}
static QString stringFromKeys(const QList<int> &keys)
{
if (keys.isEmpty()) {
return QString::fromLatin1("none");
}
QString ret;
foreach (const int key, keys) {
ret.append(QKeySequence(key).toString());
ret.append('\t');
}
ret.chop(1);
return ret;
}
namespace KdeDGlobalAccel {
Component::Component(const QString &uniqueName, const QString &friendlyName, GlobalShortcutsRegistry *registry)
: _uniqueName(uniqueName),
_friendlyName(friendlyName),
_registry(registry)
{
// Make sure we do no get uniquenames still containing the context
Q_ASSERT(uniqueName.indexOf("|") == -1);
// Register ourselve with the registry
if (_registry) {
_registry->addComponent(this);
}
createGlobalShortcutContext("default", "Default Context");
_current = _contexts.value("default");
}
Component::~Component()
{
// Remove ourselve from the registry
if (_registry) {
_registry->takeComponent(this);
}
// We delete all shortcuts from all contexts
qDeleteAll(_contexts);
}
bool Component::activateGlobalShortcutContext(const QString &uniqueName)
{
if (!_contexts.value(uniqueName)) {
createGlobalShortcutContext(uniqueName, "TODO4");
return false;
}
// Deactivate the current contexts shortcuts
deactivateShortcuts();
// Switch the context
_current = _contexts.value(uniqueName);
return true;
}
void Component::activateShortcuts()
{
Q_FOREACH (GlobalShortcut *shortcut, _current->_actions) {
shortcut->setActive();
}
}
QList<GlobalShortcut*> Component::allShortcuts(const QString &contextName) const
{
GlobalShortcutContext *context = _contexts.value(contextName);
if (!context) {
Q_ASSERT(false); // Unknown context
return QList<GlobalShortcut*> ();
}
return context->_actions.values();
}
QList<KGlobalShortcutInfo> Component::allShortcutInfos(const QString &contextName) const
{
QList<KGlobalShortcutInfo> rc;
GlobalShortcutContext *context = _contexts.value(contextName);
if (!context) {
Q_ASSERT(false); // Unknown context
return rc;
}
return context->allShortcutInfos();
}
bool Component::cleanUp()
{
bool changed = false;;
// unregistration changes the actions hash thus deep-copy
const QHash<QString, GlobalShortcut*> actionscopy = _current->_actions;
Q_FOREACH (GlobalShortcut *shortcut, actionscopy) {
kDebug() << _current->_actions.size();
if (!shortcut->isPresent()) {
changed = true;
shortcut->unRegister();
}
}
if (changed) {
_registry->writeSettings();
// We could be destroyed after this call!
}
return changed;
}
bool Component::createGlobalShortcutContext(const QString &uniqueName, const QString &friendlyName)
{
if (_contexts.value(uniqueName)) {
kDebug() << "Shortcut Context " << uniqueName << "already exists for component " << _uniqueName;
return false;
}
_contexts.insert(uniqueName, new GlobalShortcutContext(uniqueName, friendlyName, this));
return true;
}
GlobalShortcutContext *Component::currentContext()
{
return _current;
}
QDBusObjectPath Component::dbusPath() const
{
QString dbusPath = _uniqueName;
// Clean up for dbus usage: any non-alphanumeric char should be turned into '_'
const int len = dbusPath.length();
for ( int i = 0; i < len; ++i ) {
if (!dbusPath[i].isLetterOrNumber())
dbusPath[i] = QLatin1Char('_');
}
// QDBusObjectPath could be a little bit easier to handle :-)
return QDBusObjectPath(_registry->dbusPath().path() + "component/" + dbusPath);
}
void Component::deactivateShortcuts(bool temporarily)
{
Q_FOREACH (GlobalShortcut *shortcut, _current->_actions) {
if (temporarily && uniqueName() == "kwin" && shortcut->uniqueName() == "Block Global Shortcuts") {
continue;
}
shortcut->setInactive();
}
}
void Component::emitGlobalShortcutPressed(const GlobalShortcut &shortcut)
{
#ifdef Q_WS_X11
// pass X11 timestamp
long timestamp = QX11Info::appTime();
// Make sure kglobalacceld has ungrabbed the keyboard after receiving the
// keypress, otherwise actions in application that try to grab the
// keyboard (e.g. in kwin) may fail to do so. There is still a small race
// condition with this being out-of-process.
qApp->syncX();
#else
long timestamp = 0;
#endif
// Make sure it is one of ours
if (shortcut.context()->component() != this) {
Q_ASSERT(shortcut.context()->component() == this);
// In production mode do nothing
return;
}
emit globalShortcutPressed(shortcut.context()->component()->uniqueName(), shortcut.uniqueName(), timestamp);
}
void Component::invokeShortcut(const QString &shortcutName, const QString &context)
{
GlobalShortcut *shortcut = getShortcutByName(shortcutName, context);
if (shortcut) {
emitGlobalShortcutPressed(*shortcut);
}
}
QString Component::friendlyName() const
{
if (_friendlyName.isEmpty()) {
return _uniqueName;
}
return _friendlyName;
}
GlobalShortcut *Component::getShortcutByKey(int key) const
{
return _current->getShortcutByKey(key);
}
QList<GlobalShortcut *> Component::getShortcutsByKey(int key) const
{
QList <GlobalShortcut *> rc;
Q_FOREACH (GlobalShortcutContext *context, _contexts) {
GlobalShortcut *sc = context->getShortcutByKey(key);
if (sc) {
rc.append(sc);
}
}
return rc;
}
GlobalShortcut *Component::getShortcutByName(const QString &uniqueName, const QString &contextName) const
{
GlobalShortcutContext *context = _contexts.value(contextName);
if (!context) {
return nullptr;
}
return context->_actions.value(uniqueName);
}
QStringList Component::getShortcutContexts() const
{
return _contexts.keys();
}
bool Component::isActive() const
{
// The component is active if at least one of it's global shortcuts is
// present.
Q_FOREACH (GlobalShortcut *shortcut, _current->_actions) {
if (shortcut->isPresent()) {
return true;
}
}
return false;
}
bool Component::isShortcutAvailable(int key, const QString &component, const QString &context) const
{
kDebug() << QKeySequence(key).toString() << component;
// if this component asks for the key. only check the keys in the same
// context
if (component==uniqueName()) {
Q_FOREACH (GlobalShortcut *sc, shortcutContext(context)->_actions) {
if (sc->keys().contains(key)) {
return false;
}
}
} else {
Q_FOREACH (GlobalShortcutContext *ctx, _contexts) {
Q_FOREACH (GlobalShortcut *sc, ctx->_actions) {
if (sc->keys().contains(key)) {
return false;
}
}
}
}
return true;
}
void Component::loadSettings(KConfigGroup &configGroup)
{
// GlobalShortcutsRegistry::loadSettings handles contexts.
Q_FOREACH (const QString &confKey, configGroup.keyList()) {
const QStringList entry = configGroup.readEntry(confKey, QStringList());
if (entry.size() != 3) {
continue;
}
// The shortcut will register itself with us
GlobalShortcut *shortcut = new GlobalShortcut(confKey, entry[2], _current);
QList<int> keys = keysFromString(entry[0]);
shortcut->setDefaultKeys(keysFromString(entry[1]));
shortcut->setIsFresh(false);
QMutableListIterator<int> keysit(keys);
while (keysit.hasNext()) {
const int key = keysit.next();
if (key != 0) {
if (GlobalShortcutsRegistry::self()->getShortcutByKey(key)) {
// The shortcut is already used. The config file is
// broken. Ignore the request.
keysit.remove();
kWarning() << "Shortcut found twice in kglobalshortcutsrc.";
}
}
}
shortcut->setKeys(keys);
}
}
void Component::setFriendlyName(const QString &name)
{
_friendlyName = name;
}
GlobalShortcutContext *Component::shortcutContext(const QString &contextName)
{
return _contexts.value(contextName);
}
GlobalShortcutContext const *Component::shortcutContext(const QString &contextName) const
{
return _contexts.value(contextName);
}
QStringList Component::shortcutNames(const QString &contextName) const
{
GlobalShortcutContext *context = _contexts.value(contextName);
if (!context) {
Q_ASSERT(false); // Unknown context
return QStringList();
}
return context->_actions.keys();
}
bool Component::showKCM()
{
return KRun::runCommand("kcmshell4 keys", NULL);
}
QString Component::uniqueName() const
{
return _uniqueName;
}
void Component::unregisterShortcut(const QString &uniqueName)
{
// Now wrote all contexts
Q_FOREACH( GlobalShortcutContext *context, _contexts) {
if (context->_actions.value(uniqueName)) {
delete context->takeShortcut(context->_actions.value(uniqueName));
}
}
}
void Component::writeSettings(KConfigGroup& configGroup) const
{
// If we don't delete the current content global shortcut
// registrations will never not deleted after forgetGlobalShortcut()
configGroup.deleteGroup();
// Now write all contexts
Q_FOREACH( GlobalShortcutContext *context, _contexts) {
KConfigGroup contextGroup;
if (context->uniqueName() == "default") {
contextGroup = configGroup;
// Write the friendly name
contextGroup.writeEntry("_k_friendly_name", friendlyName());
} else {
contextGroup = KConfigGroup(&configGroup, context->uniqueName());
// Write the friendly name
contextGroup.writeEntry("_k_friendly_name", context->friendlyName());
}
// kDebug() << "writing group " << _uniqueName << ":" << context->uniqueName();
Q_FOREACH(const GlobalShortcut *shortcut, context->_actions) {
// kDebug() << "writing" << shortcut->uniqueName();
// We do not write fresh shortcuts.
// We do not write session shortcuts
if (shortcut->isFresh() || shortcut->isSessionShortcut()) {
continue;
}
// kDebug() << "really writing" << shortcut->uniqueName();
QStringList entry(stringFromKeys(shortcut->keys()));
entry.append(stringFromKeys(shortcut->defaultKeys()));
entry.append(shortcut->friendlyName());
contextGroup.writeEntry(shortcut->uniqueName(), entry);
}
}
}
#include "moc_component.cpp"
} // namespace KdeDGlobalAccel

View file

@ -1,169 +0,0 @@
#ifndef COMPONENT_H
#define COMPONENT_H
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "globalshortcut.h"
#include "kglobalshortcutinfo.h"
#include "kconfiggroup.h"
#include <QtCore/QObject>
#include <QtCore/QHash>
class GlobalShortcut;
class GlobalShortcutContext;
class GlobalShortcutsRegistry;
namespace KdeDGlobalAccel {
/**
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class Component : public QObject
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.kglobalaccel.Component")
Q_SCRIPTABLE Q_PROPERTY( QString friendlyName READ friendlyName )
Q_SCRIPTABLE Q_PROPERTY( QString uniqueName READ uniqueName )
public:
//! Creates a new component. The component will be registered with @p
//! registry if specified and registered with dbus.
Component(const QString &uniqueName, const QString &friendlyName, GlobalShortcutsRegistry *registry = nullptr);
~Component();
bool activateGlobalShortcutContext(const QString &uniqueName);
void activateShortcuts();
//! Returns all shortcuts in context @context
QList<GlobalShortcut *> allShortcuts(const QString &context = "default") const;
//! Creates the new global shortcut context @p context
bool createGlobalShortcutContext(const QString &context, const QString &friendlyName="");
//! Return the current context
GlobalShortcutContext* currentContext();
//! Return uniqueName converted to a valid dbus path
QDBusObjectPath dbusPath() const;
//! Deactivate all currently active shortcuts
void deactivateShortcuts(bool temporarily = false);
//! Returns the friendly name
QString friendlyName() const;
//! Returns the currently active shortcut for key
GlobalShortcut *getShortcutByKey(int key) const;
//! Returns the shortcut context @p name or NULL
GlobalShortcutContext *shortcutContext(const QString &name);
GlobalShortcutContext const *shortcutContext(const QString &name) const;
/**
* Returns the list of shortcuts (different context) registered with @p
* key.
*/
QList<GlobalShortcut *> getShortcutsByKey(int key) const;
//! Returns the shortcut by unique name. Only the active context is
//! searched.
GlobalShortcut *getShortcutByName(const QString &uniqueName, const QString &context = "default") const;
/**
* Check if @a key is available for component @p component
*/
bool isShortcutAvailable(int key, const QString &component, const QString &context) const;
//! Load the settings from config group @p config
void loadSettings(KConfigGroup &config);
//! Sets the human readable name for this component.
void setFriendlyName(const QString &name);
QString uniqueName() const;
//! Unregister @a shortcut. This will remove its siblings from all contexts
void unregisterShortcut(const QString &uniqueName);
void writeSettings(KConfigGroup &config) const;
public Q_SLOTS:
// For dbus Q_SCRIPTABLE has to be on slots. Scriptable methods are not
// exported.
/**
* Remove all currently not used global shortcuts registrations for this
* component and if nothing is left the component too.
*
* If the method returns true consider all information previously acquired
* from this component as void.
*
* The method will cleanup in all contexts.
*
* @return @c true if a change was made, @c false if not.
*/
Q_SCRIPTABLE bool cleanUp();
/**
* Check if the component is currently active.
*
* A component is active if at least one of it's global shortcuts is
* currently present.
*/
Q_SCRIPTABLE bool isActive() const;
//! Get all shortcutnames living in @a context
Q_SCRIPTABLE QStringList shortcutNames(const QString &context = "default") const;
//! Returns all shortcut in @a context
Q_SCRIPTABLE QList<KGlobalShortcutInfo> allShortcutInfos(const QString &context = "default") const;
//! Returns the shortcut contexts available for the component.
Q_SCRIPTABLE QStringList getShortcutContexts() const;
//! Start the global shortcuts kcm and show this component.
Q_SCRIPTABLE bool showKCM();
void emitGlobalShortcutPressed(const GlobalShortcut &shortcut);
Q_SCRIPTABLE void invokeShortcut(const QString &shortcutName, const QString &context = "default");
Q_SIGNALS:
//! Signals that a action for this component was triggered
Q_SCRIPTABLE void globalShortcutPressed(const QString &componentUnique, const QString &shortcutUnique, qlonglong timestamp);
private:
QString _uniqueName;
//the name as it would be found in a magazine article about the application,
//possibly localized if a localized name exists.
QString _friendlyName;
GlobalShortcutsRegistry *_registry;
GlobalShortcutContext *_current;
QHash<QString, GlobalShortcutContext *> _contexts;
};
}
#endif /* #ifndef COMPONENT_H */

View file

@ -1,209 +0,0 @@
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "globalshortcut.h"
#include "component.h"
#include "globalshortcutcontext.h"
#include "globalshortcutsregistry.h"
#include <kdebug.h>
#include <QKeySequence>
GlobalShortcut::GlobalShortcut()
: _isPresent(false),
_isRegistered(false),
_isFresh(true),
_context(NULL),
_uniqueName(),
_friendlyName(),
_keys(),
_defaultKeys()
{
}
GlobalShortcut::GlobalShortcut(const QString &uniqueName, const QString &friendlyName, GlobalShortcutContext *context)
: _isPresent(false),
_isRegistered(false),
_isFresh(true),
_context(context),
_uniqueName(uniqueName),
_friendlyName(friendlyName),
_keys(),
_defaultKeys()
{
context->addShortcut(this);
}
GlobalShortcut::~GlobalShortcut()
{
setInactive();
}
GlobalShortcut::operator KGlobalShortcutInfo () const
{
KGlobalShortcutInfo info;
info.d->uniqueName = _uniqueName;
info.d->friendlyName = _friendlyName;
info.d->contextUniqueName = context()->uniqueName();
info.d->contextFriendlyName = context()->friendlyName();
info.d->componentUniqueName = context()->component()->uniqueName();
info.d->componentFriendlyName = context()->component()->friendlyName();
Q_FOREACH (int key, _keys) {
info.d->keys.append(QKeySequence(key));
}
Q_FOREACH (int key, _defaultKeys) {
info.d->defaultKeys.append(QKeySequence(key));
}
return info;
}
bool GlobalShortcut::isActive() const
{
return _isRegistered;
}
bool GlobalShortcut::isFresh() const
{
return _isFresh;
}
bool GlobalShortcut::isPresent() const
{
return _isPresent;
}
bool GlobalShortcut::isSessionShortcut() const
{
return uniqueName().startsWith(QLatin1String("_k_session:"));
}
void GlobalShortcut::setIsFresh(bool value)
{
_isFresh = value;
}
void GlobalShortcut::setIsPresent(bool value)
{
// (de)activate depending on old/new value
_isPresent = value;
value ? setActive() : setInactive();
}
GlobalShortcutContext *GlobalShortcut::context()
{
return _context;
}
GlobalShortcutContext const *GlobalShortcut::context() const
{
return _context;
}
QString GlobalShortcut::uniqueName() const
{
return _uniqueName;
}
void GlobalShortcut::unRegister()
{
return _context->component()->unregisterShortcut(uniqueName());
}
QString GlobalShortcut::friendlyName() const
{
return _friendlyName;
}
void GlobalShortcut::setFriendlyName(const QString &name)
{
_friendlyName = name;
}
QList<int> GlobalShortcut::keys() const
{
return _keys;
}
void GlobalShortcut::setKeys(const QList<int> &newKeys)
{
bool active = _isRegistered;
if (active) {
setInactive();
}
_keys = QList<int>();
Q_FOREACH(const int key, newKeys) {
if (key !=0 && !GlobalShortcutsRegistry::self()->getShortcutByKey(key)) {
_keys.append(key);
} else {
kDebug() << _uniqueName << "skipping because key" << QKeySequence(key).toString() << "(" << key << ") is already taken";
_keys.append(0);
}
}
if (active) {
setActive();
}
}
QList<int> GlobalShortcut::defaultKeys() const
{
return _defaultKeys;
}
void GlobalShortcut::setDefaultKeys(const QList<int> newKeys)
{
_defaultKeys = newKeys;
}
void GlobalShortcut::setActive()
{
if (!_isPresent || _isRegistered) {
// The corresponding application is not present or the keys are
// already grabbed
return;
}
Q_FOREACH (const int key, _keys) {
if (key != 0 && !GlobalShortcutsRegistry::self()->registerKey(key, this)) {
kDebug() << uniqueName() << ": Failed to register " << QKeySequence(key).toString();
}
}
_isRegistered = true;
}
void GlobalShortcut::setInactive()
{
if (!_isRegistered) {
// The keys are not grabbed currently
return;
}
Q_FOREACH (const int key, _keys) {
if (key != 0 && !GlobalShortcutsRegistry::self()->unregisterKey(key, this)) {
kDebug() << uniqueName() << ": Failed to unregister " << QKeySequence(key).toString();
}
}
_isRegistered = false;
}

View file

@ -1,118 +0,0 @@
#ifndef GLOBALSHORTCUT_H
#define GLOBALSHORTCUT_H
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kglobalshortcutinfo_p.h"
#include <QtCore/QObject>
class GlobalShortcutContext;
/**
* Represents a global shortcut.
*
* @internal
*
* \note This class can handle multiple keys (default and active). This
* feature isn't used currently. kde4 only allows setting one key per global
* shortcut.
*
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class GlobalShortcut
{
public:
GlobalShortcut(const QString &uniqueName, const QString &friendlyName, GlobalShortcutContext *context);
GlobalShortcut();
~GlobalShortcut();
//! Returns the context the shortcuts belongs to
GlobalShortcutContext *context();
GlobalShortcutContext const *context() const;
//! Returns the default keys for this shortcut.
QList<int> defaultKeys() const;
//! Return the friendly display name for this shortcut.
QString friendlyName() const;
//! Check if the shortcut is active. It's keys are grabbed
bool isActive() const;
//! Check if the shortcut is fresh/new. Is an internal state
bool isFresh() const;
//! Check if the shortcut is present. It application is running.
bool isPresent() const;
//! Returns true if the shortcut is a session shortcut
bool isSessionShortcut() const;
//! Returns a list of keys associated with this shortcut.
QList<int> keys() const;
//! Activates the shortcut. The keys are grabbed.
void setActive();
//! Sets the default keys for this shortcut.
void setDefaultKeys(const QList<int>);
//! Sets the friendly name for the shortcut. For display.
void setFriendlyName(const QString &);
//! Sets the shortcut inactive. No longer grabs the keys.
void setInactive();
void setIsPresent(bool);
void setIsFresh(bool);
//! Sets the keys activated with this shortcut. The old keys are freed.
void setKeys(const QList<int> &newKeys);
//! Returns the unique name aka id for the shortcuts.
QString uniqueName() const;
operator KGlobalShortcutInfo () const;
//! Remove this shortcut and it's siblings
void unRegister();
private:
//! means the associated application is present.
bool _isPresent;
//! means the shortcut is registered with GlobalShortcutsRegistry
bool _isRegistered;
//! means the shortcut is new
bool _isFresh;
//! The context the shortcut belongs too
GlobalShortcutContext *_context;
QString _uniqueName;
QString _friendlyName; //usually localized
QList<int> _keys;
QList<int> _defaultKeys;
};
#endif /* #ifndef GLOBALSHORTCUT_H */

View file

@ -1,100 +0,0 @@
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "globalshortcutcontext.h"
#include "globalshortcut.h"
#include "kdebug.h"
GlobalShortcutContext::GlobalShortcutContext(const QString &uniqueName, const QString &friendlyName, KdeDGlobalAccel::Component *component)
: _uniqueName(uniqueName),
_friendlyName(friendlyName),
_component(component),
_actions()
{
}
GlobalShortcutContext::~GlobalShortcutContext()
{
qDeleteAll(_actions); _actions.clear();
}
void GlobalShortcutContext::addShortcut(GlobalShortcut *shortcut)
{
_actions.insert(shortcut->uniqueName(), shortcut);
}
QList<KGlobalShortcutInfo> GlobalShortcutContext::allShortcutInfos() const
{
QList<KGlobalShortcutInfo> rc;
Q_FOREACH (GlobalShortcut *shortcut, _actions) {
rc.append(static_cast<KGlobalShortcutInfo>(*shortcut));
}
return rc;
}
KdeDGlobalAccel::Component const *GlobalShortcutContext::component() const
{
return _component;
}
KdeDGlobalAccel::Component *GlobalShortcutContext::component()
{
return _component;
}
QString GlobalShortcutContext::friendlyName() const
{
return _friendlyName;
}
GlobalShortcut *GlobalShortcutContext::getShortcutByKey(int key) const
{
// Qt triggers both shortcuts that include Shift+Backtab and Shift+Tab
// when user presses Shift+Tab. Do the same here.
int keySym = key & ~Qt::KeyboardModifierMask;
int keyMod = key & Qt::KeyboardModifierMask;
if ((keyMod & Qt::SHIFT) && (keySym == Qt::Key_Backtab || keySym == Qt::Key_Tab)) {
Q_FOREACH(GlobalShortcut *sc, _actions) {
if (sc->keys().contains(keyMod | Qt::Key_Tab) ||
sc->keys().contains(keyMod | Qt::Key_Backtab)) {
return sc;
}
}
} else {
Q_FOREACH(GlobalShortcut *sc, _actions) {
if (sc->keys().contains(key)) {
return sc;
}
}
}
return NULL;
}
GlobalShortcut *GlobalShortcutContext::takeShortcut(GlobalShortcut *shortcut)
{
// Try to take the shortcut. Result could be null if the shortcut doesn't
// belong to this component.
return _actions.take(shortcut->uniqueName());
}
QString GlobalShortcutContext::uniqueName() const
{
return _uniqueName;
}

View file

@ -1,86 +0,0 @@
#ifndef GLOBALSHORTCUTCONTEXT_H
#define GLOBALSHORTCUTCONTEXT_H
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kglobalshortcutinfo.h"
#include <QtCore/QString>
#include <QtCore/QHash>
namespace KdeDGlobalAccel {
class Component;
}
class GlobalShortcut;
/**
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class GlobalShortcutContext
{
public:
/**
* Default constructor
*/
GlobalShortcutContext(const QString &uniqueName, const QString &friendlyName, KdeDGlobalAccel::Component *component );
/**
* Destructor
*/
virtual ~GlobalShortcutContext();
//! Adds @p shortcut to the context
void addShortcut(GlobalShortcut *shortcut);
//! Return KGlobalShortcutInfos for all shortcuts
QList<KGlobalShortcutInfo> allShortcutInfos() const;
/**
* Get the name for the context
*/
QString uniqueName() const;
QString friendlyName() const;
KdeDGlobalAccel::Component *component();
KdeDGlobalAccel::Component const *component() const;
//! Get shortcut for @p key or NULL
GlobalShortcut *getShortcutByKey(int key) const;
//! Remove @p shortcut from the context. The shortcut is not deleted.
GlobalShortcut *takeShortcut(GlobalShortcut *shortcut);
private:
friend class KdeDGlobalAccel::Component;
//! The unique name for this context
QString _uniqueName;
//! The unique name for this context
QString _friendlyName;
//! The component the context belongs too
KdeDGlobalAccel::Component *_component;
//! The actions associated with this context
QHash<QString, GlobalShortcut*> _actions;
};
#endif /* #ifndef GLOBALSHORTCUTCONTEXT_H */

View file

@ -1,327 +0,0 @@
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "globalshortcutsregistry.h"
#include "component.h"
#include "globalshortcut.h"
#include "globalshortcutcontext.h"
#include "kdebug.h"
#include "kglobal.h"
#include "klocale.h"
#include "knotification.h"
#include <QKeySequence>
#include <QDBusConnection>
#ifdef Q_WS_X11
#include "kglobalaccel_x11.h"
#include <QtGui/qx11info_x11.h>
#include <QApplication>
#else
#include "kglobalaccel_qws.h"
#endif
GlobalShortcutsRegistry::GlobalShortcutsRegistry()
: QObject(),
_active_keys(),
_components(),
_manager(new KGlobalAccelImpl(this)),
_config("kglobalshortcutsrc", KConfig::SimpleConfig)
{
_manager->setEnabled(true);
}
GlobalShortcutsRegistry::~GlobalShortcutsRegistry()
{
_manager->setEnabled(false);
// Ungrab all keys. We don't go over GlobalShortcuts because
// GlobalShortcutsRegistry::self() doesn't work anymore.
Q_FOREACH (const int key, _active_keys.keys()) {
_manager->grabKey(key, false);
}
_active_keys.clear();
}
KdeDGlobalAccel::Component *GlobalShortcutsRegistry::addComponent(KdeDGlobalAccel::Component *component)
{
if (_components.value(component->uniqueName())) {
Q_ASSERT_X(false, "GlobalShortcutsRegistry::addComponent", "component already registered?!?!");
return _components.value(component->uniqueName());
}
_components.insert(component->uniqueName(), component);
QDBusConnection conn(QDBusConnection::sessionBus());
conn.registerObject(component->dbusPath().path(), component, QDBusConnection::ExportScriptableContents);
return component;
}
void GlobalShortcutsRegistry::activateShortcuts()
{
Q_FOREACH (KdeDGlobalAccel::Component *component, _components) {
component->activateShortcuts();
}
}
QList<KdeDGlobalAccel::Component*> GlobalShortcutsRegistry::allMainComponents() const
{
return _components.values();
}
void GlobalShortcutsRegistry::clear()
{
Q_FOREACH(KdeDGlobalAccel::Component *component, _components) {
delete component;
}
_components.clear();
// The shortcuts should have deregistered themselves
Q_ASSERT(_active_keys.isEmpty());
}
QDBusObjectPath GlobalShortcutsRegistry::dbusPath() const
{
return _dbusPath;
}
void GlobalShortcutsRegistry::deactivateShortcuts(bool temporarily)
{
Q_FOREACH (KdeDGlobalAccel::Component *component, _components) {
component->deactivateShortcuts(temporarily);
}
}
GlobalShortcut *GlobalShortcutsRegistry::getActiveShortcutByKey(int key) const
{
return _active_keys.value(key);
}
KdeDGlobalAccel::Component *GlobalShortcutsRegistry::getComponent(const QString &uniqueName)
{
return _components.value(uniqueName);
}
GlobalShortcut *GlobalShortcutsRegistry::getShortcutByKey(int key) const
{
Q_FOREACH (KdeDGlobalAccel::Component *component, _components) {
GlobalShortcut *rc = component->getShortcutByKey(key);
if (rc) {
return rc;
}
}
return NULL;
}
QList<GlobalShortcut*> GlobalShortcutsRegistry::getShortcutsByKey(int key) const
{
QList<GlobalShortcut *> rc;
Q_FOREACH (KdeDGlobalAccel::Component *component, _components) {
rc = component->getShortcutsByKey(key);
if (!rc.isEmpty()) {
return rc;
}
}
return rc;
}
bool GlobalShortcutsRegistry::isShortcutAvailable(int shortcut, const QString &componentName, const QString &contextName) const
{
Q_FOREACH (KdeDGlobalAccel::Component *component, _components) {
if (!component->isShortcutAvailable(shortcut, componentName, contextName)) {
return false;
}
}
return true;
}
GlobalShortcutsRegistry * GlobalShortcutsRegistry::self()
{
K_GLOBAL_STATIC(GlobalShortcutsRegistry, self);
return self;
}
bool GlobalShortcutsRegistry::keyPressed(int keyQt)
{
GlobalShortcut *shortcut = getShortcutByKey(keyQt);
if (!shortcut) {
// This can happen for example with the ALT-Print shortcut of kwin.
// ALT+PRINT is SYSREQ on my keyboard. So we grab something we think
// is ALT+PRINT but symXToKeyQt and modXToQt make ALT+SYSREQ of it
// when pressed (correctly). We can't match that.
kDebug() << "Got unknown key" << QKeySequence(keyQt).toString();
// In production mode just do nothing.
return false;
} else if (!shortcut->isActive()) {
kDebug() << "Got inactive key" << QKeySequence(keyQt).toString();
// In production mode just do nothing.
return false;
}
kDebug() << QKeySequence(keyQt).toString() << "=" << shortcut->uniqueName();
#ifdef Q_WS_X11
// Make sure kglobalacceld has ungrabbed the keyboard after receiving the
// keypress, otherwise actions in application that try to grab the
// keyboard (e.g. in kwin) may fail to do so. There is still a small race
// condition with this being out-of-process.
qApp->syncX();
#endif
// 1st Invoke the action
shortcut->context()->component()->emitGlobalShortcutPressed( *shortcut );
// Then do anything else
KNotification *notification = new KNotification(this);
notification->setEventID("kglobalaccel/globalshortcutpressed");
notification->setText(i18n("The global shortcut for %1 was issued.", shortcut->friendlyName()));
notification->send();
return true;
}
void GlobalShortcutsRegistry::loadSettings()
{
Q_FOREACH (const QString &groupName, _config.groupList()) {
kDebug() << "Loading group " << groupName;
Q_ASSERT(groupName.indexOf('\x1d')==-1);
// loadSettings isn't designed to be called in between. Only at the
// beginning.
Q_ASSERT(!getComponent(groupName));
KConfigGroup configGroup(&_config, groupName);
// We previously stored the friendly name in a separate group. migrate
// that
QString friendlyName;
KConfigGroup friendlyGroup(&configGroup, "Friendly Name");
if (friendlyGroup.isValid()) {
friendlyName = friendlyGroup.readEntry("Friendly Name");
friendlyGroup.deleteGroup();
} else {
friendlyName = configGroup.readEntry("_k_friendly_name");
}
// Create the component
KdeDGlobalAccel::Component *component = new KdeDGlobalAccel::Component(groupName, friendlyName, this);
// Now load the contexts
Q_FOREACH(const QString& context, configGroup.groupList()) {
// Skip the friendly name group
if (context == "Friendly Name") {
continue;
}
KConfigGroup contextGroup(&configGroup, context);
QString contextFriendlyName = contextGroup.readEntry("_k_friendly_name");
component->createGlobalShortcutContext(context, contextFriendlyName);
component->activateGlobalShortcutContext(context);
component->loadSettings(contextGroup);
}
// Load the default context
component->activateGlobalShortcutContext("default");
component->loadSettings(configGroup);
}
}
void GlobalShortcutsRegistry::grabKeys()
{
activateShortcuts();
}
bool GlobalShortcutsRegistry::registerKey(int key, GlobalShortcut *shortcut)
{
if (key == 0) {
kDebug() << shortcut->uniqueName() << ": Key '" << QKeySequence(key).toString()
<< "' already taken by " << _active_keys.value(key)->uniqueName() << ".";
return false;
} else if (_active_keys.value(key)) {
kDebug() << shortcut->uniqueName() << ": Attempt to register key 0.";
return false;
}
kDebug() << "Registering key" << QKeySequence(key).toString() << "for"
<< shortcut->context()->component()->uniqueName() << ":" << shortcut->uniqueName();
_active_keys.insert(key, shortcut);
return _manager->grabKey(key, true);
}
void GlobalShortcutsRegistry::setAccelManager(KGlobalAccelImpl *manager)
{
_manager = manager;
}
void GlobalShortcutsRegistry::setDBusPath(const QDBusObjectPath &path)
{
_dbusPath = path;
}
KdeDGlobalAccel::Component *GlobalShortcutsRegistry::takeComponent(KdeDGlobalAccel::Component *component)
{
QDBusConnection conn(QDBusConnection::sessionBus());
conn.unregisterObject(component->dbusPath().path());
return _components.take(component->uniqueName());
}
void GlobalShortcutsRegistry::ungrabKeys()
{
deactivateShortcuts();
}
bool GlobalShortcutsRegistry::unregisterKey(int key, GlobalShortcut *shortcut)
{
if (_active_keys.value(key) != shortcut) {
// The shortcut doesn't own the key or the key isn't grabbed
return false;
}
kDebug() << "Unregistering key" << QKeySequence(key).toString() << "for"
<< shortcut->context()->component()->uniqueName() << ":" << shortcut->uniqueName();
_manager->grabKey(key, false);
_active_keys.take(key);
return true;
}
void GlobalShortcutsRegistry::writeSettings() const
{
Q_FOREACH(const KdeDGlobalAccel::Component *component, GlobalShortcutsRegistry::self()->allMainComponents()) {
KConfigGroup configGroup(&_config, component->uniqueName());
if (component->allShortcuts().isEmpty()) {
configGroup.deleteGroup();
delete component;
} else {
component->writeSettings(configGroup);
}
}
_config.sync();
}
#include "moc_globalshortcutsregistry.cpp"

View file

@ -1,161 +0,0 @@
#ifndef GLOBALSHORTCUTSREGISTRY_H
#define GLOBALSHORTCUTSREGISTRY_H
/* Copyright (C) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "ksharedconfig.h"
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtDBus/qdbusextratypes.h>
class GlobalShortcut;
class KGlobalAccelImpl;
namespace KdeDGlobalAccel
{
class Component;
}
/**
* Global Shortcut Registry.
*
* Shortcuts are registered by component. A component is for example kmail or
* amarok.
*
* A component can have contexts. Currently on plasma is planned to support
* that feature. A context enables plasma to keep track of global shortcut
* settings when switching containments.
*
* A shortcut (WIN+x) can be registered by one component only. The component
* is allowed to register it more than once in different contexts.
*
* @author Michael Jansen <kde@michael-jansen.biz>
*/
class GlobalShortcutsRegistry : public QObject
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.KdedGlobalAccel.GlobalShortcutsRegistry")
public:
/**
* Activate all shortcuts having their application present.
*/
void activateShortcuts();
/**
* Return a list of all main components
*/
QList<KdeDGlobalAccel::Component *> allMainComponents() const;
/**
* Return the root dbus path for the registry.
*/
QDBusObjectPath dbusPath() const;
/**
* Deactivate all currently active shortcuts.
*/
void deactivateShortcuts(bool temporarily=false);
/**
* Get the shortcut corresponding to key. Only active shortcut are
* considered.
*/
GlobalShortcut *getActiveShortcutByKey(int key) const;
/**
*/
KdeDGlobalAccel::Component *getComponent(const QString &uniqueName);
/**
* Get the shortcut corresponding to key. Active and inactive shortcuts
* are considered. But if the matching application uses contexts only one
* shortcut is returned.
*
* @see getShortcutsByKey(int key)
*/
GlobalShortcut *getShortcutByKey(int key) const;
/**
* Get the shortcuts corresponding to key. Active and inactive shortcuts
* are considered.
*
* @see getShortcutsByKey(int key)
*/
QList<GlobalShortcut*> getShortcutsByKey(int key) const;
/**
* Checks if @p shortcut is available for @p component.
*
* It is available if not used by another component in any context or used
* by @p component only in not active contexts.
*/
bool isShortcutAvailable(int shortcut, const QString &component, const QString &context) const;
static GlobalShortcutsRegistry *self();
bool registerKey(int key, GlobalShortcut *shortcut);
void setAccelManager(KGlobalAccelImpl *manager);
void setDBusPath(const QDBusObjectPath &path);
bool unregisterKey(int key, GlobalShortcut *shortcut);
public Q_SLOTS:
void clear();
void loadSettings();
void writeSettings() const;
// Grab the keys
void grabKeys();
// Ungrab the keys
void ungrabKeys();
private:
friend class KdeDGlobalAccel::Component;
friend class KGlobalAccelImpl;
KdeDGlobalAccel::Component *addComponent(KdeDGlobalAccel::Component *component);
KdeDGlobalAccel::Component *takeComponent(KdeDGlobalAccel::Component *component);
//called by the implementation to inform us about key presses
//returns true if the key was handled
bool keyPressed(int keyQt);
GlobalShortcutsRegistry();
~GlobalShortcutsRegistry();
QHash<int, GlobalShortcut*> _active_keys;
QHash<QString, KdeDGlobalAccel::Component *> _components;
KGlobalAccelImpl *_manager;
mutable KConfig _config;
QDBusObjectPath _dbusPath;
};
#endif /* #ifndef GLOBALSHORTCUTSREGISTRY_H */

View file

@ -1,87 +0,0 @@
[Desktop Entry]
Type=Service
Icon=preferences-desktop-keyboard
Exec=kglobalaccel
X-KDE-autostart-phase=1
X-KDE-ServiceTypes=
StartupNotify=false
Name=KDED Global Shortcuts Server
Name[ar]=خادم اختصارات كدي دي العمومية
Name[ast]=Sirvidor d'accesos rápidos globales KDED
Name[be@latin]=Słužba paŭsiudnych klavijaturnych skarotaŭ dla KDE
Name[bg]=Сървър KDED Global Shortcuts
Name[bn]=.ি..ি
Name[bs]=KDED server globalnih prečica
Name[ca]=Servidor KDED de dreceres globals
Name[ca@valencia]=Servidor KDED de dreceres globals
Name[cs]=Server globálních klávesových zkratek KDE
Name[csb]=Globalnô serwera skrodzënów KDED
Name[da]=KDED global genvejsserver
Name[de]=KDED-Server für globale Tastenkürzel
Name[el]=Εξυπηρετητής καθολικών συντομεύσεων KDED
Name[en_GB]=KDED Global Shortcuts Server
Name[eo]=Servilo de ĉieaj fulmoklavoj de KDED
Name[es]=Servidor de accesos rápidos globales KDED
Name[et]=KDE globaalsete kiirklahvide server
Name[eu]=KDED laster-tekla globalen zerbitzaria
Name[fa]=خادم میانبرهای سراسری KDED
Name[fi]=KDED:n työpöydänlaajuisten pikanäppäinten palvelin
Name[fr]=Serveur général de raccourcis KDED
Name[fy]=KDED globale fluchtoets tsjinnner
Name[ga]=Freastalaí Aicearraí Comhchoiteanna KDED
Name[gl]=Servidor de atallos de teclado globais de KDED
Name[gu]=KDED
Name[he]=שרת קיצורי מקשים גלובליים KDED
Name[hi]=
Name[hne]= ि
Name[hr]=KDED Globalni poslužitelj prečaca tipkovnice
Name[hsb]=Serwer za globalne KDE-skrótšenki
Name[hu]=KDE-szolgáltatás a globális billentyűparancsok lekérdezéséhez
Name[ia]=KDED Servitor global de vias breve
Name[id]=Server Jalan Pintas Global KDED
Name[is]=KDED víðtækur tenglaþjónn
Name[it]=Server KDED di scorciatoie globali
Name[ja]=KDED
Name[kk]=Жалпы жүйелік перне тіркесімдер KDED сервері:
Name[km]= KDED
Name[kn]=KDED ಿ (-) ಿ
Name[ko]=KDED
Name[ku]=KDED Pêşkêşkera Kurterê yên Giştî
Name[lt]=KDED globalinių trumpių serveris
Name[lv]=KDED globālo īsceļu serveris
Name[mai]=
Name[mk]=KDED сервер за глобални кратенки
Name[ml]=ിി ി
Name[mr]=D ि
Name[nb]=KDED-tjener for globale snarveier
Name[nds]=KDED-Tastkombinatschonen-Server
Name[nl]=KDED globale-sneltoetsen-server
Name[nn]=KDED-tenar for globale snøggtastar
Name[or]=KDED ି ି ି
Name[pa]=KDED
Name[pl]=Globalny serwer skrótów KDED
Name[pt]=Servidor de Atalhos Globais do KDED
Name[pt_BR]=Servidor de atalhos globais do KDED
Name[ro]=Server de scurtături globale KDED
Name[ru]=Поддержка глобальных комбинаций клавиш
Name[se]=KDED-bálvá globála njuolggobálgáid várás
Name[si]=KDED
Name[sk]=KDED server globálnych skratiek
Name[sl]=Strežnik KDED za globalne bližnjice
Name[sr]=КДЕД сервер глобалних пречица
Name[sr@ijekavian]=КДЕД сервер глобалних пречица
Name[sr@ijekavianlatin]=KDED server globalnih prečica
Name[sr@latin]=KDED server globalnih prečica
Name[sv]=KDED global snabbtangentserver
Name[ta]=KDED ி ி
Name[tg]=Сервери умумии миёнбурҳои KDED
Name[th]= KDED
Name[tr]=KDED Genel Kısayol Sunucusu
Name[ug]=KDED ئومۇمىيەت تېزلەتمە مۇلازىمېتىرى
Name[uk]=Сервер загальних клавіатурних скорочень KDED
Name[vi]=Máy ch phím tt h thng KDED
Name[wa]=Sierveu des rascourtis globås po KDED
Name[x-test]=xxKDED Global Shortcuts Serverxx
Name[zh_CN]=KDED
Name[zh_TW]=KDED

View file

@ -1,436 +0,0 @@
[kglobalaccel]
IconName=preferences-desktop-keyboard
Comment=Global Keyboard Shortcuts
Comment[ar]=اختصارات لوحة المفاتيح العمومية
Comment[ast]=Accesos rápidos de tecláu globales
Comment[bg]=Глобални бързи клавиши
Comment[bn]=গ্লোবাল কীবোর্ড শর্টকাট
Comment[bs]=Globalne prečice sa tastature
Comment[ca]=Dreceres de teclat globals
Comment[ca@valencia]=Dreceres de teclat globals
Comment[cs]=Globální klávesové zkratky
Comment[da]=Globale tastaturgenveje
Comment[de]=Globale Kurzbefehle
Comment[el]=Καθολικές συντομεύσεις πληκτρολογίου
Comment[en_GB]=Global Keyboard Shortcuts
Comment[eo]=Ĉieaj fulmoklavoj
Comment[es]=Accesos rápidos de teclado globales
Comment[et]=Globaalsed kiirklahvid
Comment[eu]=Laster-tekla globalak
Comment[fa]=میان‌برهای صفحه‌ کلید سراسری
Comment[fi]=Työpöydänlaajuiset pikanäppäimet
Comment[fr]=Raccourcis clavier globaux
Comment[ga]=Aicearraí Comhchoiteanna Méarchláir
Comment[gl]=Atallos de teclado globais
Comment[gu]=વૈશ્વિક કીબોર્ડ ટૂંકાણો
Comment[he]=קיצורי מקלדת גלובליים
Comment[hi]=वैश्विक कुंजीपट शॉर्टकट
Comment[hr]=Globalni tipkovnički prečaci
Comment[hu]=Globális billentyűparancsok
Comment[ia]=Vias breve de claviero global
Comment[id]=Jalan Pintas Papan Ketik Global
Comment[is]=Víðværir flýtilyklar
Comment[it]=Scorciatoie globali della tastiera
Comment[ja]=グローバルキーボードショートカット
Comment[kk]=Жалпы жүйелік перне тіркесімдер
Comment[km]=ផ្លូវកាត់​ក្ដារចចុ​សកល
Comment[kn]=ಸಾರ್ವತ್ರಿಕ ಕೀಲಿಮಣೆ ಶೀಘ್ರಮಾರ್ಗಗಳು (ಶಾರ್ಟ್ ಕಟ್)
Comment[ko]=전역 키보드 단축키
Comment[lt]=Globalieji spartieji klavišai
Comment[lv]=Globālie tastatūras īsceļi
Comment[mai]=वैश्विक कुंजीपटल शार्टकट
Comment[ml]=ആഗോളമായ കീബോര്‍ഡിലെ കുറക്കുവഴികള്‍
Comment[mr]=जागतिक कळफलक शॉर्टकट
Comment[nb]=Globale hurtigtaster
Comment[nds]=Globaal Tastkombinatschonen
Comment[nl]=Globale sneltoetsen
Comment[nn]=Globale snøggtastar
Comment[pa]=ਗਲੋਬਲ ਕੀ-ਬੋਰਡ ਸ਼ਾਰਟਕੱਟ
Comment[pl]=Globalne skróty klawiszowe
Comment[pt]=Atalhos Globais do Teclado
Comment[pt_BR]=Atalhos de teclado globais
Comment[ro]=Acceleratori de tastatură globali
Comment[ru]=Глобальные комбинации клавиш
Comment[si]=ගෝලීය යතුරුපුවරු කෙටිමං
Comment[sk]=Globálne klávesové skratky
Comment[sl]=Globalne tipkovne bližnjice
Comment[sr]=Глобалне пречице са тастатуре
Comment[sr@ijekavian]=Глобалне пречице са тастатуре
Comment[sr@ijekavianlatin]=Globalne prečice sa tastature
Comment[sr@latin]=Globalne prečice sa tastature
Comment[sv]=Globala snabbtangenter
Comment[tg]=Миёнбурҳои умумии клавиатура
Comment[th]=ปุ่มพิมพ์ลัดใช้งานส่วนรวม
Comment[tr]=Genel Klavye Kısayolları
Comment[ug]=ئومۇمىيەت ھەرپتاختا تېزلەتمىسى
Comment[uk]=Загальні клавіатурні скорочення
Comment[vi]=Phím tắt hệ thống
Comment[wa]=Rascourtis del taprece po ttavå
Comment[x-test]=xxGlobal Keyboard Shortcutsxx
Comment[zh_CN]=全局键盘快捷键
Comment[zh_TW]=全域鍵盤捷徑
Name=kglobalaccel
Name[ar]=kglobalaccel
Name[ast]=kglobalaccel
Name[bg]=kglobalaccel
Name[bn]=kglobalaccel
Name[bs]=Kglobalne-prečice
Name[ca]=kglobalaccel
Name[ca@valencia]=kglobalaccel
Name[cs]=kglobalaccel
Name[csb]=kglobalaccel
Name[da]=kglobalaccel
Name[de]=kglobalaccel
Name[el]=kglobalaccel
Name[en_GB]=kglobalaccel
Name[eo]=kglobalaccel
Name[es]=kglobalaccel
Name[et]=kglobalaccel
Name[eu]=kglobalaccel
Name[fa]=kglobalaccel
Name[fi]=kglobalaccel
Name[fr]=kglobalaccel
Name[fy]=kglobalaccel
Name[ga]=kglobalaccel
Name[gl]=kglobalaccel
Name[gu]=kglobalaccel
Name[he]=kglobalaccel
Name[hi]=kglobalaccel
Name[hr]=kglobalaccel
Name[hu]=kglobalaccel
Name[ia]=kglobalaccel
Name[id]=kglobalaccel
Name[is]=kglobalaccel
Name[it]=kglobalaccel
Name[ja]=kglobalaccel
Name[ka]=kglobalaccel
Name[kk]=kglobalaccel
Name[km]=kglobalaccel
Name[kn]=kglobalaccel
Name[ko]=kglobalaccel
Name[lt]=kglobalaccel
Name[lv]=kglobalaccel
Name[mai]=kglobalaccel
Name[mk]=kglobalaccel
Name[ml]=കെആഗൊളആക്സല്‍
Name[mr]=kglobalaccel
Name[nb]=kglobalaccel
Name[nds]=kglobalaccel
Name[nl]=kglobalaccel
Name[nn]=kglobalaccel
Name[pa]=kglobalaccel
Name[pl]=kglobalaccel
Name[pt]=kglobalaccel
Name[pt_BR]=kglobalaccel
Name[ro]=kglobalaccel
Name[ru]=kglobalaccel
Name[si]=kglobalaccel
Name[sk]=kglobalaccel
Name[sl]=kglobalaccel
Name[sr]=К‑глобалне-пречице
Name[sr@ijekavian]=К‑глобалне-пречице
Name[sr@ijekavianlatin]=Kglobalne-prečice
Name[sr@latin]=Kglobalne-prečice
Name[sv]=Kglobalsnabbtangent
Name[tg]=kglobalaccel
Name[th]=kglobalaccel
Name[tr]=kglobalaccel
Name[ug]=kglobalaccel
Name[uk]=kglobalaccel
Name[vi]=kglobalaccel
Name[wa]=kglobalaccel
Name[x-test]=xxkglobalaccelxx
Name[zh_CN]=kglobalaccel
Name[zh_TW]=kglobalaccel
[kglobalaccel/newshortcutregistered]
Name=Global Shortcut Registration
Name[ar]=تسجيل الاختصارات العمومية
Name[ast]=Rexistru d'accesu rápidu global
Name[bg]=Централно указване на съкратени клавиши
Name[bn]=গ্লোবাল শর্টকাট নথীভুক্তকরণ
Name[bs]=Registracija globalnih prečica
Name[ca]=Registre de drecera global
Name[ca@valencia]=Registre de drecera global
Name[cs]=Registrace globální klávesové zkratky
Name[csb]=Globalnô registracëjô skrodzënë
Name[da]=Registrering af global genvej
Name[de]=Registrierung für globale Tastenkürzel
Name[el]=Καταχώρηση καθολικών συντομεύσεων
Name[en_GB]=Global Shortcut Registration
Name[eo]=Registriĝo de ĉieaj fulmoklavoj
Name[es]=Registro de acceso rápido global
Name[et]=Globaalsete kiirklahvide registreerimine
Name[eu]=Laster-tekla globalen erregistroa
Name[fa]=ثبت میان‌برهای سراسری
Name[fi]=Työpöydänlaajuisten pikanäppäinten rekisteröinti
Name[fr]=Référencement des raccourcis globaux
Name[fy]=Globale fluchtoets registraasje
Name[ga]=Clárú Aicearraí Comhchoiteanna
Name[gl]=Rexistro de atallo global
Name[gu]=વૈશ્ર્વિક ટૂંકાણ રજીસ્ટ્રેશન
Name[he]=רישום קיצורי מקשים גלובליים
Name[hi]=केडीईडी ग्लोबल शॉर्टकट पंजीकरण
Name[hr]=Prijava globalnih prečaca tipkovnice
Name[hu]=Globális billentyűparancs regisztrálása
Name[ia]=Registration global de via breve
Name[id]=Registrasi Jalan Pintas Global
Name[is]=Víðtækur tenglaþjónn
Name[it]=Registrazione delle scorciatoie globali
Name[ja]=グローバルショートカットの登録
Name[kk]=Жалпы жүйелік перне тіркесімі тіркелді
Name[km]=ការ​ចុះឈ្មោះ​ផ្លូវកាត់​សកល
Name[kn]=ಸಾರ್ವತ್ರಿಕ ಕೀಲಿಮಣೆ ಶೀಘ್ರಮಾರ್ಗಗಳ (ಶಾರ್ಟ್ ಕಟ್) ನೋಂದಣಿ
Name[ko]=전역 단축키 등록
Name[lt]=KDE globaliųjų klavišų registracija
Name[lv]=Globālo īsceļu reģistrēšana
Name[mai]=ग्लोबल शॉर्टकट पंजीयन
Name[mk]=Регистрација на глобални кратенки
Name[ml]=ആഗോള കുറക്കുവഴി പേരുചേര്‍ക്കല്‍
Name[mr]=जागतिक शॉर्टकट नोंदणी
Name[nb]=Global snarveisregistrering
Name[nds]=Globaal Tastkombinatschoon inmeldt
Name[nl]=Globale-sneltoetsen-registratie
Name[nn]=Registrering av globale snøggtastar
Name[pa]=ਗਲੋਬਲ ਸ਼ਾਰਟਕੱਟ ਰਜਿਸਟਰੇਸ਼ਨ
Name[pl]=Rejestracja globalnego skrótu
Name[pt]=Registo de Atalhos Globais
Name[pt_BR]=Registro de atalhos globais
Name[ro]=Înregistrare acceleratori globali
Name[ru]=Регистрация глобальных комбинаций клавиш
Name[si]=ගෝලීය කෙටිමං ලියාපදිංචිය
Name[sk]=Registrácia globálnej skratky
Name[sl]=Registracija globalne bližnjice
Name[sr]=Регистрација глобалних пречица
Name[sr@ijekavian]=Регистрација глобалних пречица
Name[sr@ijekavianlatin]=Registracija globalnih prečica
Name[sr@latin]=Registracija globalnih prečica
Name[sv]=Registrering av globala snabbtangenter
Name[tg]=Қайдкунии миёнбурҳои умумӣ
Name[th]=การลงทะเบียนปุ่มพิมพ์ลัดใช้งานส่วนรวม
Name[tr]=Genel Kısayol Kaydı
Name[ug]=ئومۇمىيەت تېزلەتمە خەتلىتىش
Name[uk]=Реєстрація загальних скорочень
Name[vi]=Đăng ký phím tắt hệ thống
Name[wa]=Rashiaedje do rascourti po ttavå
Name[x-test]=xxGlobal Shortcut Registrationxx
Name[zh_CN]=全局快捷键注册
Name[zh_TW]=全域捷徑註冊
Comment=An application registered new global shortcuts.
Comment[ar]=تطبيق مسجل اختصارات عمومية جديدة.
Comment[ast]=Una aplicación rexistró nuevos accesos rápidos globales.
Comment[bg]=Програма регистрира нови общи бързи клавиши.
Comment[bn]=একটি অ্যাপলিকেশন নতুন গ্লোবাল শর্টকাট নথীভুক্ত করেছে।
Comment[bs]=Program je registrovao nove globalne prečice.
Comment[ca]=Una aplicació ha registrat dreceres globals noves.
Comment[ca@valencia]=Una aplicació ha registrat dreceres globals noves.
Comment[cs]=Aplikace zaregistrovala nové globální klávesové zkratky.
Comment[csb]=Aplikacëjô zaregistrowa nową globalną skrodzënã.
Comment[da]=Et program registrerede nye globale genveje.
Comment[de]=Eine Anwendung hat neue globale Tastenkürzel definiert.
Comment[el]=Μια εφαρμογή καταχώρησε νέες καθολικές συντομεύσεις
Comment[en_GB]=An application registered new global shortcuts.
Comment[eo]=Aplikaĵo registris novajn ĉieajn klavkombinojn.
Comment[es]=Una aplicación ha registrado nuevos accesos rápidos globales.
Comment[et]=Rakendus registreeris uued globaalsed kiirklahvid.
Comment[eu]=Aplikazio batek laster-tekla global berriak erregistratu ditu.
Comment[fa]=برنامه‌ای میانبر سراسری جدیدی را ثبت کرد.
Comment[fi]=Sovellus rekisteröi uusia työpöydänlaajuisia pikanäppäimiä.
Comment[fr]=Une application a référencé un nouveau raccourci global.
Comment[fy]=In applikaasje registrearre nije globale fluchtoetsen.
Comment[ga]=Chláraigh feidhmchlár aicearraí nua comhchoiteanna.
Comment[gl]=Un programa rexistrou novos atallos globais.
Comment[gu]=કાર્યક્રમે નવી વૈશ્વિક ટૂંકાણ નોધણી કરી છે.
Comment[he]=יישום רשם קיצורי דרך גלובאלי חדש.
Comment[hi]=अनुप्रयोग नया वैश्विक शॉर्टकट पंजीकृत किया.
Comment[hr]=Aplikacija je prijavila nove globalne prečace.
Comment[hu]=Egy alkalmazás új globális billentyűparancsokat regisztrált.
Comment[ia]=Un application registrava nove vias breve global.
Comment[id]=Sebuah aplikasi yang mendaftarkan jalan pintas global baru.
Comment[is]=Forrit skráði nýja víðværa flýtilykla.
Comment[it]=Un'applicazione ha registrato nuove scorciatoie globali.
Comment[ja]=アプリケーションがグローバルショートカットを登録しました。
Comment[kk]=Қолданба жалпы жүйелік перне тіркесімін тіркеді
Comment[km]=កម្មវិធី​ដែលបាន​ចុះឈ្មោះ​​ផ្លូវកាត់​សកល​ថ្មី
Comment[kn]=ಒಂದು ಅನ್ವಯವು ಹೊಸ ಸಾರ್ವತ್ರಿಕ ಶೀಘ್ರಮಾರ್ಗ(ಶಾರ್ಟ್ ಕಟ್)ಗಳನ್ನು ನೋಂದಾಯಿಸಿದೆ.
Comment[ko]=프로그램에서 전역 단축키를 등록했습니다.
Comment[lt]=Programa užregistravo naujus globalius sparčiuosius klavišus.
Comment[lv]=Programma reģistrēja jaunus globālos īsceļus.
Comment[mk]=Некоја апликација регистрираше нови глобални кратенки.
Comment[ml]=ഒരു പ്രയോഗം പുതിയ ആഗോള കുറക്കുവഴികളില്‍ പേരു് ചേര്‍ത്തു
Comment[mr]=एका अनुप्रयोगाने नवीन जागतिक शॉर्टकटची नोंदणी केली.
Comment[nb]=Et program registrerte nye globale snarveier.
Comment[nds]=En Programm hett niege globale Tastkombinatschonen inmeldt.
Comment[nl]=Een programma heeft nieuwe globale sneltoetsen geregistreerd.
Comment[nn]=Eit program registrerte nye globale snøggtastar.
Comment[pa]=ਐਪਲੀਕੇਸ਼ਨ ਨੇ ਨਵਾਂ ਗਲੋਬਲ ਸ਼ਾਰਟਕੱਟ ਰਜਿਸਟਰ ਕੀਤਾ ਹੈ।
Comment[pl]=Program zarejestrował nowe globalne skróty.
Comment[pt]=Uma aplicação registou novos atalhos globais.
Comment[pt_BR]=Um aplicativo registrou novos atalhos globais.
Comment[ro]=O aplicație a înregistrat acceleratori globali noi.
Comment[ru]=Приложение добавило новые глобальные комбинации клавиш.
Comment[si]=නව විශ්ව කෙටිමං ලියාපදිංචි කල භාවිතයෙදවුම
Comment[sk]=Aplikácia zaregistrovala nové globálne skratky.
Comment[sl]=Program je registriral nove globalne bližnjice.
Comment[sr]=Програм је регистровао нове глобалне пречице.
Comment[sr@ijekavian]=Програм је регистровао нове глобалне пречице.
Comment[sr@ijekavianlatin]=Program je registrovao nove globalne prečice.
Comment[sr@latin]=Program je registrovao nove globalne prečice.
Comment[sv]=Ett program registrerade nya globala snabbtangenter.
Comment[tg]=Барнома миёнбурҳои умумии навро қайд кард.
Comment[th]=โปรแกรมได้ทำการลงทะเบียนปุ่มพิมพ์ลัดใช้งานส่วนรวม
Comment[tr]=Bir uygulama yeni bir genel kısayol kaydetti.
Comment[ug]=بىر پروگرامما يېڭىدىن ئومۇمىيەت تېزلەتمىلىرىنى خەتلەتتى.
Comment[uk]=Програма зареєструвала нові загальні скорочення.
Comment[vi]=Một ứng dụng đã đăng ký phím tắt hệ thống mới.
Comment[wa]=On programe a eredjistré des noveas rascourtis globås.
Comment[x-test]=xxAn application registered new global shortcuts.xx
Comment[zh_CN]=用于注册新全局快捷键的应用程序。
Comment[zh_TW]=一個應用程式註冊了新的全域捷徑
Actions=
[kglobalaccel/globalshortcutpressed]
Name=Global Shortcut Triggered
Name[ar]=تم إطلاق اختصار عمومي
Name[ast]=Activación d'accesu rápidu global
Name[bg]=Задействан е общ бърз клавиш
Name[bn]=গ্লোবাল শর্টকাট ব্যবহৃত হয়েছে
Name[bs]=Okinuta globalna prečica
Name[ca]=Activació de drecera global
Name[ca@valencia]=Activació de drecera global
Name[cs]=Aktivována globální klávesová zkratka
Name[csb]=Zrëszonô globalnô skrodzëna
Name[da]=Global genvej udløst
Name[de]=Globales Tastenkürzel ausgelöst
Name[el]=Ενεργοποίηση καθολικών συντομεύσεων
Name[en_GB]=Global Shortcut Triggered
Name[eo]=Ĉiea fulmoklavo ekagigita
Name[es]=Activación de acceso rápido global
Name[et]=Kasutati globaalset kiirklahvi
Name[eu]=Laster-tekla globalak abiarazita
Name[fa]=میان‌برهای سراسری شروع به کار کردند
Name[fi]=Työpöydänlaajuinen pikanäppäin laukaistu
Name[fr]=Raccourci global déclenché
Name[fy]=Globale fluchtoets aktivearre
Name[ga]=Gníomhachtaíodh Aicearra Comhchoiteann
Name[gl]=Iniciouse un atallo de teclado global
Name[gu]=વૈશ્વીક ટૂંકાણો શરુ કરવામાં આવ્યા
Name[he]=קיצור מקשים גלובלי הופעל
Name[hi]=वैश्विक शॉर्टकट ट्रिगर किया गया
Name[hr]=Globalni prečac je korišten
Name[hu]=Globális billentyűparancs aktiválódott
Name[ia]=Via breve global discatenate
Name[id]=Jalan Pintas Global Dipicu
Name[is]=Víðvær flýtilykill var ræstur
Name[it]=Scorciatoia globale attivata
Name[ja]=グローバルショートカットの使用
Name[kk]=Жалпы жүйелік перне тіркесімі жұмсалды
Name[km]=បានកេះ​ផ្លូវកាត់​សកល
Name[kn]=ಸಾರ್ವತ್ರಿಕ ಕೀಲಿಮಣೆ ಶೀಘ್ರಮಾರ್ಗ (ಶಾರ್ಟ್ ಕಟ್) ಪ್ರಚೋದಿಸಲ್ಪಟ್ಟಿದೆ
Name[ko]=전역 단축키 눌림
Name[lt]=Sužadinti globalieji spartieji klavišai
Name[lv]=Globālais īsceļš nospiests
Name[mai]=ग्लोबल शॉर्टकट ट्रिगर कएल गेल
Name[mk]=Активирана е глобална кратенка
Name[ml]=ആഗോള കുറക്കുവഴി തുടങ്ങി
Name[mr]=जागतिक शॉर्टकट सुरु केला
Name[nb]=Global snarvei utløst
Name[nds]=Globaal Tastkombinatschoon utlööst
Name[nl]=Globale sneltoetsen geactiveerd
Name[nn]=Global snøggtast utløyst
Name[pa]=ਗਲੋਬਲ ਸ਼ਾਰਟਕੱਟ ਟਰਿੱਗਰ
Name[pl]=Użyto globalnego skrótu
Name[pt]=Atalho Global Despoletado
Name[pt_BR]=Atalhos globais ativados
Name[ro]=Accelerator global declanșat
Name[ru]=Нажата глобальная комбинация клавиш
Name[si]=ගෝලීය කෙටිමං ක්‍රියාරම්භ කරන ලදි
Name[sk]=Aktivovaná globálna skratka
Name[sl]=Sprožena globalna bližnjica
Name[sr]=Окинута глобална пречица
Name[sr@ijekavian]=Окинута глобална пречица
Name[sr@ijekavianlatin]=Okinuta globalna prečica
Name[sr@latin]=Okinuta globalna prečica
Name[sv]=Global snabbtangent aktiverad
Name[tg]=Миёнбурҳои умумии корандоз
Name[th]=มีการเรียกใช้ปุ่มพิมพ์ลัดใช้งานส่วนรวม
Name[tr]=Genel Kısayol Tetiklendi
Name[ug]=ئومۇمىي تېزلەتمىگە چېقىلدى
Name[uk]=Використано загальне скорочення
Name[vi]=Phím tắt hệ thống đã bật
Name[wa]=Rascourti po ttavå eclitchî
Name[x-test]=xxGlobal Shortcut Triggeredxx
Name[zh_CN]=全局快捷键被触发
Name[zh_TW]=全域捷徑被觸發
Comment=The user triggered a global shortcut
Comment[ar]=المستخدم أطلق اختصاراً عمومياً
Comment[ast]=L'usuariu activó un accesu rápidu global
Comment[bg]=Потребителят задейства общ бърз клавиш
Comment[bn]=একটি গ্লোবাল শর্টকাট ব্যবহার করা হয়েছে
Comment[bs]=Korisnik je okinuo globalnu prečicu
Comment[ca]=L'usuari ha activat una drecera global
Comment[ca@valencia]=L'usuari ha activat una drecera global
Comment[cs]=Uživatel aktivoval globální klávesovou zkratku
Comment[csb]=Brëkòwnik zrëszëł globalną skrodzënã
Comment[da]=Brugeren udløste en global genvej
Comment[de]=Der Benutzer hat ein globales Tastenkürzel ausgelöst.
Comment[el]=Ο χρήστης ενεργοποίησε μία καθολική συντόμευση
Comment[en_GB]=The user triggered a global shortcut
Comment[eo]=La uzanto ekagigis ĉiean klavkombinon
Comment[es]=El usuario ha activado un acceso rápido global
Comment[et]=Kasutaja kasutas globaalset kiirklahvi
Comment[eu]=Erabiltzaileak laster-tekla global bat abiarazi du
Comment[fa]=کاربر یک میانبر سراسری را راه اندازی کرد
Comment[fi]=Käyttäjän laukaisema työpöydänlaajuinen pikanäppäin
Comment[fr]=L'utilisateur a déclenché un raccourci global
Comment[fy]=De brûker hat in globale fluchtoets aktivearre
Comment[ga]=Ghníomhachtaigh an t-úsáideoir aicearra comhchoiteann
Comment[gl]=O usuario iniciou un atallo global
Comment[gu]=વપરાશકર્તાએ વૈશ્વિક જોડાણો શરુ કર્યા
Comment[he]=המשתמש הפעיל קיצור מקשים גלובאלי
Comment[hi]=उपयोगकर्ता एक वैश्विक शॉर्टकट को ट्रिगर किया
Comment[hr]=Korisnik je koristio globalni prečac
Comment[hu]=A felhasználó elvégzett egy globális billentyűparancsot
Comment[ia]=Le usator discatenava un via breve global
Comment[id]=Pengguna memicu jalan pintas global
Comment[is]=Notandinn ræsti víðværan flýtilykil
Comment[it]=L'utente ha attivato una scorciatoia globale
Comment[ja]=グローバルショートカットが使用されました。
Comment[kk]=Пайдаланушы жалпы жүйелік перне тіркесімді жұмсады
Comment[km]=អ្នក​ប្រើ​បានកេះ​ផ្លូវកាត់​សកល
Comment[kn]=ಬಳಕೆದಾರನು ಒಂದು ಸಾರ್ವತ್ರಿಕ ಶೀಘ್ರಮಾರ್ಗ(ಶಾರ್ಟ್ ಕಟ್) ವನ್ನು ಪ್ರಚೋದಿಸಿದ್ದಾನೆ
Comment[ko]=사용자가 전역 단축키를 누름
Comment[lt]=Naudotojas sužadino globalųjį spartųjį klavišą
Comment[lv]=Lietotājs nospieda globālo īsceļu
Comment[mk]=Корисникот активираше глобална кратенка
Comment[ml]=ഉപയോക്താവ് ഒരു ആഗോള കുറക്കുവഴി ഉപയോഗിച്ചു
Comment[mr]=वापरकर्त्याने जागतिक शॉर्टकट सुरु केला
Comment[nb]=Brukeren utløste en global snarvei
Comment[nds]=De Bruker hett en globaal Tastkombinatschoon utlööst
Comment[nl]=De gebruiker heeft een globale sneltoets geactiveerd
Comment[nn]=Brukaren utløyste ein global snøggtast
Comment[pa]=ਯੂਜ਼ਰ ਨੇ ਗਲੋਬਲ ਸ਼ਾਰਟਕੱਟ ਬਦਲਿਆ
Comment[pl]=Użytkownik skorzystał z globalnego skrótu
Comment[pt]=O utilizador despoletou um atalho global
Comment[pt_BR]=O usuário ativou um atalho global
Comment[ro]=Utilizatorul a declanșat un accelerator global
Comment[ru]=Пользователь нажал глобальную комбинацию клавиш
Comment[si]=සැකසූ විශ්ව කෙටිමඟ භාවිත කරන්න
Comment[sk]=Užívateľ aktivoval globálnu skratku
Comment[sl]=Uporabnik je sprožil globalno bližnjico
Comment[sr]=Корисник је окинуо глобалну пречицу
Comment[sr@ijekavian]=Корисник је окинуо глобалну пречицу
Comment[sr@ijekavianlatin]=Korisnik je okinuo globalnu prečicu
Comment[sr@latin]=Korisnik je okinuo globalnu prečicu
Comment[sv]=Användaren aktiverade en global snabbtangent
Comment[tg]=Корбар миёнбури умумиро таъин кард
Comment[th]=ผู้ใช้ได้ทำการเรียกใช้ปุ่มพิมพ์ลัดใช้งานส่วนรวม
Comment[tr]=Kullanıcı bir genel kısayolu tetikledi
Comment[ug]=ئىشلەتكۈچى ئومۇمىي تېزلەتمىگە چېقىلدى
Comment[uk]=Користувач використав загальне скорочення
Comment[vi]=Người dùng đã bật một phím tắt hệ thống
Comment[wa]=L' uzeu a (e/dis)clitchî on rascourti po ttavå
Comment[x-test]=xxThe user triggered a global shortcutxx
Comment[zh_CN]=用户触发了一个全局快捷键
Comment[zh_TW]=使用者觸發了一個全域捷徑
Actions=

View file

@ -1,282 +0,0 @@
/* This file is part of the KDE libraries
Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config-X11.h"
#include "kglobalaccel_x11.h"
#include "globalshortcutsregistry.h"
#include <QRegExp>
#include <QWidget>
#include <QMetaObject>
#include <QMenu>
#include <qwindowdefs.h>
#include <KAction>
#include <KApplication>
#include <KXErrorHandler>
#include <KDebug>
#include <kkeyserver.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef HAVE_XKB
# include <X11/XKBlib.h>
#endif
#include <X11/keysym.h>
#include <fixx11h.h>
extern "C" {
static int XGrabErrorHandler(Display *, XErrorEvent *e) {
if (e->error_code != BadAccess) {
kWarning() << "grabKey: got X error " << e->type << " instead of BadAccess";
}
return 1;
}
}
// g_keyModMaskXAccel
// mask of modifiers which can be used in shortcuts
// (meta, alt, ctrl, shift)
// g_keyModMaskXOnOrOff
// mask of modifiers where we don't care whether they are on or off
// (caps lock, num lock, scroll lock)
static uint g_keyModMaskXAccel = 0;
static uint g_keyModMaskXOnOrOff = 0;
static void calculateGrabMasks()
{
g_keyModMaskXAccel = KKeyServer::accelModMaskX();
g_keyModMaskXOnOrOff =
KKeyServer::modXLock() |
KKeyServer::modXNumLock() |
KKeyServer::modXScrollLock() |
KKeyServer::modXModeSwitch();
//kDebug() << "g_keyModMaskXAccel = " << g_keyModMaskXAccel
// << "g_keyModMaskXOnOrOff = " << g_keyModMaskXOnOrOff;
}
//----------------------------------------------------
KGlobalAccelImpl::KGlobalAccelImpl(GlobalShortcutsRegistry *owner)
: m_owner(owner)
{
calculateGrabMasks();
}
bool KGlobalAccelImpl::grabKey(int keyQt, bool grab)
{
if( !keyQt ) {
kDebug() << "Tried to grab key with null code.";
return false;
}
int keyCodeX;
uint keyModX;
uint keySymX;
// Resolve the modifier
if (!KKeyServer::keyQtToModX(keyQt, &keyModX)) {
kDebug() << "keyQt (0x" << QByteArray::number(keyQt, 16) << ") failed to resolve to x11 modifier";
return false;
}
// Resolve the X symbol
if (!KKeyServer::keyQtToSymX(keyQt, (int *)&keySymX) ) {
kDebug() << "keyQt (0x" << QByteArray::number(keyQt, 16) << ") failed to resolve to x11 keycode";
return false;
}
keyCodeX = XKeysymToKeycode( QX11Info::display(), keySymX);
// Check if shift needs to be added to the grab since KKeySequenceWidget
// can remove shift for some keys. (all the %&* and such)
if( !(keyQt & Qt::SHIFT) && !KKeyServer::isShiftAsModifierAllowed(keyQt) &&
#ifdef HAVE_XKB
keySymX != XkbKeycodeToKeysym(QX11Info::display(), keyCodeX, 0, 0) &&
keySymX == XkbKeycodeToKeysym(QX11Info::display(), keyCodeX, 1, 0))
#else
keySymX != XKeycodeToKeysym(QX11Info::display(), keyCodeX, 0) &&
keySymX == XKeycodeToKeysym(QX11Info::display(), keyCodeX, 1))
#endif
{
kDebug() << "adding shift to the grab";
keyModX |= KKeyServer::modXShift();
}
keyModX &= g_keyModMaskXAccel; // Get rid of any non-relevant bits in mod
if (!keyCodeX) {
kDebug() << "keyQt (0x" << QByteArray::number(keyQt, 16) << ") was resolved to x11 keycode 0";
return false;
}
KXErrorHandler handler(XGrabErrorHandler);
// We'll have to grab 8 key modifier combinations in order to cover all
// combinations of CapsLock, NumLock, ScrollLock.
// Does anyone with more X-savvy know how to set a mask on QX11Info::appRootWindow so that
// the irrelevant bits are always ignored and we can just make one XGrabKey
// call per accelerator? -- ellis
#ifndef NDEBUG
QString sDebug = QString("\tcode: 0x%1 state: 0x%2 | ").arg(keyCodeX,0,16).arg(keyModX,0,16);
#endif
uint keyModMaskX = ~g_keyModMaskXOnOrOff;
for (uint irrelevantBitsMask = 0; irrelevantBitsMask <= 0xff; irrelevantBitsMask++) {
if ((irrelevantBitsMask & keyModMaskX) == 0) {
#ifndef NDEBUG
sDebug += QString("0x%3, ").arg(irrelevantBitsMask, 0, 16);
#endif
if (grab) {
XGrabKey(QX11Info::display(), keyCodeX, keyModX | irrelevantBitsMask,
QX11Info::appRootWindow(), True, GrabModeAsync, GrabModeSync);
} else {
XUngrabKey(QX11Info::display(), keyCodeX, keyModX | irrelevantBitsMask, QX11Info::appRootWindow());
}
}
}
bool failed = false;
if (grab) {
failed = handler.error(true); // sync now
if (failed) {
kDebug() << "grab failed!";
for (uint m = 0; m <= 0xff; m++ ) {
if ((m & keyModMaskX) == 0) {
XUngrabKey(QX11Info::display(), keyCodeX, keyModX | m, QX11Info::appRootWindow());
}
}
}
}
return !failed;
}
bool KGlobalAccelImpl::x11Event( XEvent* event )
{
switch( event->type ) {
case MappingNotify: {
kDebug() << "Got XMappingNotify event";
XRefreshKeyboardMapping(&event->xmapping);
x11MappingNotify();
return true;
}
case XKeyPress: {
kDebug() << "Got XKeyPress event";
return x11KeyPress(event);
}
default: {
// We get all XEvents. Just ignore them.
return false;
}
}
Q_ASSERT(false);
return false;
}
void KGlobalAccelImpl::x11MappingNotify()
{
// Maybe the X modifier map has been changed.
// uint oldKeyModMaskXAccel = g_keyModMaskXAccel;
// uint oldKeyModMaskXOnOrOff = g_keyModMaskXOnOrOff;
// First ungrab all currently grabbed keys. This is needed because we
// store the keys as qt keycodes and use KKeyServer to map them to x11 key
// codes. After calling KKeyServer::initializeMods() they could map to
// different keycodes.
m_owner->ungrabKeys();
KKeyServer::initializeMods();
calculateGrabMasks();
m_owner->grabKeys();
}
bool KGlobalAccelImpl::x11KeyPress( const XEvent *pEvent )
{
if (QWidget::keyboardGrabber() || QApplication::activePopupWidget()) {
kWarning() << "kglobalacceld should be popup and keyboard grabbing free!";
}
// Keyboard needs to be ungrabed after XGrabKey() activates the grab,
// otherwise it becomes frozen.
XUngrabKeyboard(QX11Info::display(), CurrentTime);
XFlush(QX11Info::display()); // avoid X(?) bug
uchar keyCodeX = pEvent->xkey.keycode;
uint keyModX = pEvent->xkey.state & (g_keyModMaskXAccel | KKeyServer::MODE_SWITCH);
KeySym keySym;
XLookupString((XKeyEvent*)pEvent, 0, 0, &keySym, 0);
uint keySymX = (uint)keySym;
// If numlock is active and a keypad key is pressed, XOR the SHIFT state.
// e.g., KP_4 => Shift+KP_Left, and Shift+KP_4 => KP_Left.
if( pEvent->xkey.state & KKeyServer::modXNumLock() ) {
#ifdef HAVE_XKB
uint sym = XkbKeycodeToKeysym(QX11Info::display(), keyCodeX, 0, 0);
#else
uint sym = XKeycodeToKeysym(QX11Info::display(), keyCodeX, 0);
#endif
// If this is a keypad key,
if (sym >= XK_KP_Space && sym <= XK_KP_9) {
switch(sym) {
// Leave the following keys unaltered
// FIXME: The proper solution is to see which keysyms don't change when shifted.
case XK_KP_Multiply:
case XK_KP_Add:
case XK_KP_Subtract:
case XK_KP_Divide: {
break;
}
default: {
keyModX ^= KKeyServer::modXShift();
}
}
}
}
int keyCodeQt;
int keyModQt;
KKeyServer::symXToKeyQt(keySymX, &keyCodeQt);
KKeyServer::modXToQt(keyModX, &keyModQt);
if( keyModQt & Qt::SHIFT && !KKeyServer::isShiftAsModifierAllowed(keyCodeQt)) {
kDebug() << "removing shift modifier";
keyModQt &= ~Qt::SHIFT;
}
int keyQt = keyCodeQt | keyModQt;
// All that work for this hey... argh...
return m_owner->keyPressed(keyQt);
}
void KGlobalAccelImpl::setEnabled(bool enable)
{
if (enable) {
kapp->installX11EventFilter(this);
} else {
kapp->removeX11EventFilter(this);
}
}
#include "moc_kglobalaccel_x11.cpp"

View file

@ -1,72 +0,0 @@
/* This file is part of the KDE libraries
Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KGLOBALACCEL_X11_H
#define KGLOBALACCEL_X11_H
#include <QWidget>
class GlobalShortcutsRegistry;
/**
* @internal
*
* The KGlobalAccel private class handles grabbing of global keys,
* and notification of when these keys are pressed.
*/
class KGlobalAccelImpl : public QWidget
{
Q_OBJECT
public:
KGlobalAccelImpl(GlobalShortcutsRegistry *owner);
public:
/**
* This function registers or unregisters a certain key for global capture,
* depending on \b grab.
*
* Before destruction, every grabbed key will be released, so this
* object does not need to do any tracking.
*
* \param key the Qt keycode to grab or release.
* \param grab true to grab they key, false to release the key.
*
* \return true if successful, otherwise false.
*/
bool grabKey(int key, bool grab);
/// Enable/disable all shortcuts. There will not be any grabbed shortcuts at this point.
void setEnabled(bool);
private:
/**
* Filters X11 events ev for key bindings in the accelerator dictionary.
* If a match is found the activated activated is emitted and the function
* returns true. Return false if the event is not processed.
*
* This is public for compatibility only. You do not need to call it.
*/
virtual bool x11Event(XEvent*);
void x11MappingNotify();
bool x11KeyPress(const XEvent *pEvent);
GlobalShortcutsRegistry *m_owner;
};
#endif // KGLOBALACCEL_X11_H

View file

@ -1,559 +0,0 @@
/*
This file is part of the KDE libraries
Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
Copyright (c) 2007 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kglobalacceld.h"
#include "component.h"
#include "globalshortcut.h"
#include "globalshortcutcontext.h"
#include "globalshortcutsregistry.h"
#include <QtCore/QTimer>
#include <QtCore/qmetaobject.h>
#include <QtDBus/QDBusMetaType>
#include <QtDBus/qdbusextratypes.h>
#include "klocale.h"
#include "kglobalaccel.h"
#include "kglobalsettings.h"
#include "knotification.h"
#include "kdebug.h"
struct KGlobalAccelDPrivate
{
KGlobalAccelDPrivate(KGlobalAccelD *q)
: q(q)
{
}
GlobalShortcut *findAction(const QStringList &actionId) const;
/**
* Find the action @a shortcutUnique in @a componentUnique.
*
* @return the action or @c null if doesn't exist
*/
GlobalShortcut *findAction(const QString &componentUnique, const QString &shortcutUnique) const;
GlobalShortcut *addAction(const QStringList &actionId);
KdeDGlobalAccel::Component *component(const QStringList &actionId) const;
//! Use KNotification to inform the user new global shortcuts were
//! registered
void _k_newGlobalShortcutNotification();
void splitComponent(QString &component, QString &context) const
{
context = "default";
if (component.indexOf('|')!=-1) {
QStringList tmp = component.split('|');
Q_ASSERT(tmp.size()==2);
component= tmp.at(0);
context= tmp.at(1);
}
}
enum ChangeType {
NewShortcut
};
// List if changed components for _k_globalShortcutNotification
QMap<QString, ChangeType> changedComponents;
//! Timer for delayed popup on new shortcut registration
QTimer popupTimer;
//! Timer for delayed writing to kglobalshortcutsrc
QTimer writeoutTimer;
//! Our holder
KGlobalAccelD *q;
};
GlobalShortcut *KGlobalAccelDPrivate::findAction(const QStringList &actionId) const
{
// Check if actionId is valid
if (actionId.size() != 4) {
kDebug() << "Invalid! '" << actionId << "'";
return NULL;
}
return findAction(actionId.at(KGlobalAccel::ComponentUnique), actionId.at(KGlobalAccel::ActionUnique));
}
GlobalShortcut *KGlobalAccelDPrivate::findAction(const QString &_componentUnique, const QString &shortcutUnique) const
{
QString componentUnique = _componentUnique;
KdeDGlobalAccel::Component *component;
QString contextUnique;
if (componentUnique.indexOf('|')==-1) {
component = GlobalShortcutsRegistry::self()->getComponent( componentUnique);
if (component) {
contextUnique = component->currentContext()->uniqueName();
}
} else{
splitComponent(componentUnique, contextUnique);
component = GlobalShortcutsRegistry::self()->getComponent( componentUnique);
}
if (!component) {
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << componentUnique << "not found";
#endif
return NULL;
}
GlobalShortcut *shortcut = component ? component->getShortcutByName(shortcutUnique, contextUnique) : NULL;
#ifdef KDEDGLOBALACCEL_TRACE
if (shortcut) {
kDebug() << componentUnique
<< contextUnique
<< shortcut->uniqueName();
} else {
kDebug() << "No match for" << shortcutUnique;
}
#endif
return shortcut;
}
KdeDGlobalAccel::Component *KGlobalAccelDPrivate::component(const QStringList &actionId) const
{
// Get the component for the action. If we have none create a new one
KdeDGlobalAccel::Component *component = GlobalShortcutsRegistry::self()->getComponent(actionId.at(KGlobalAccel::ComponentUnique));
if (!component) {
component = new KdeDGlobalAccel::Component(
actionId.at(KGlobalAccel::ComponentUnique),
actionId.at(KGlobalAccel::ComponentFriendly),
GlobalShortcutsRegistry::self());
Q_ASSERT(component);
}
return component;
}
GlobalShortcut *KGlobalAccelDPrivate::addAction(const QStringList &actionId)
{
Q_ASSERT(actionId.size() >= 4);
QString componentUnique = actionId.at(KGlobalAccel::ComponentUnique);
QString contextUnique = "default";
if (componentUnique.indexOf("|")!=-1) {
QStringList tmp = componentUnique.split('|');
Q_ASSERT(tmp.size()==2);
componentUnique = tmp.at(0);
contextUnique = tmp.at(1);
}
QStringList actionIdTmp = actionId;
actionIdTmp.replace(KGlobalAccel::ComponentUnique, componentUnique);
// Create the component if necessary
KdeDGlobalAccel::Component *component = this->component(actionIdTmp);
Q_ASSERT(component);
// Create the context if necessary
if (component->getShortcutContexts().count(contextUnique)==0) {
component->createGlobalShortcutContext(contextUnique);
}
Q_ASSERT(!component->getShortcutByName(componentUnique, contextUnique));
changedComponents.insert(actionId.at(KGlobalAccel::ComponentUnique), NewShortcut);
if (!popupTimer.isActive()) {
popupTimer.start(500);
}
return new GlobalShortcut(
actionId.at(KGlobalAccel::ActionUnique),
actionId.at(KGlobalAccel::ActionFriendly),
component->shortcutContext(contextUnique));
}
void KGlobalAccelDPrivate::_k_newGlobalShortcutNotification()
{
Q_FOREACH(const QString &uniqueName, changedComponents.keys()) {
kDebug() << "Showing Notification for component" << uniqueName;
KdeDGlobalAccel::Component *component = GlobalShortcutsRegistry::self()->getComponent(uniqueName);
if (!component) {
// Can happen if a component is removed immediately after
// registering it. kdelibs/kdeui/tests/kglobalshortcuttests does
// it for example.
continue;
}
KNotification *notification = new KNotification(q->parent());
notification->setEventID("kglobalaccel/newshortcutregistered");
notification->setFlags(KNotification::Persistent);
notification->setText(i18n("The application %1 has registered a new global shortcut", component->friendlyName()));
notification->setActions(QStringList(i18n("Open Global Shortcuts Editor")));
QObject::connect(notification, SIGNAL(action1Activated()), component, SLOT(showKCM()));
notification->send();
}
changedComponents.clear();
}
Q_DECLARE_METATYPE(QStringList)
KGlobalAccelD::KGlobalAccelD(QObject* parent)
: QObject(parent),
d(new KGlobalAccelDPrivate(this))
{
}
bool KGlobalAccelD::init()
{
qDBusRegisterMetaType< QList<int> >();
qDBusRegisterMetaType< QList<QDBusObjectPath> >();
qDBusRegisterMetaType< QList<QStringList> >();
qDBusRegisterMetaType<QStringList>();
qDBusRegisterMetaType<KGlobalShortcutInfo>();
qDBusRegisterMetaType< QList<KGlobalShortcutInfo> >();
GlobalShortcutsRegistry *reg = GlobalShortcutsRegistry::self();
Q_ASSERT(reg);
d->writeoutTimer.setSingleShot(true);
connect(&d->writeoutTimer, SIGNAL(timeout()), reg, SLOT(writeSettings()));
d->popupTimer.setSingleShot(true);
connect(&d->popupTimer, SIGNAL(timeout()), this, SLOT(_k_newGlobalShortcutNotification()));
if (!QDBusConnection::sessionBus().registerService(QLatin1String("org.kde.kglobalaccel"))) {
kWarning() << "Failed to register service org.kde.kglobalaccel";
return false;
}
if (!QDBusConnection::sessionBus().registerObject(
QLatin1String("/kglobalaccel"),
this,
QDBusConnection::ExportScriptableContents)) {
kWarning() << "Failed to register object kglobalaccel in org.kde.kglobalaccel";
return false;
}
GlobalShortcutsRegistry::self()->setDBusPath(QDBusObjectPath("/"));
GlobalShortcutsRegistry::self()->loadSettings();
connect(KGlobalSettings::self(), SIGNAL(blockShortcuts(int)), SLOT(blockGlobalShortcuts(int)));
return true;
}
KGlobalAccelD::~KGlobalAccelD()
{
GlobalShortcutsRegistry::self()->deactivateShortcuts();
delete d;
}
QList<QStringList> KGlobalAccelD::allMainComponents() const
{
QList<QStringList> ret;
QStringList emptyList;
for (int i = 0; i < 4; i++) {
emptyList.append(QString());
}
foreach (const KdeDGlobalAccel::Component *component, GlobalShortcutsRegistry::self()->allMainComponents()) {
QStringList actionId(emptyList);
actionId[KGlobalAccel::ComponentUnique] = component->uniqueName();
actionId[KGlobalAccel::ComponentFriendly] = component->friendlyName();
ret.append(actionId);
}
return ret;
}
QList<QStringList> KGlobalAccelD::allActionsForComponent(const QStringList &actionId) const
{
//### Would it be advantageous to sort the actions by unique name?
QList<QStringList> ret;
KdeDGlobalAccel::Component *const component =
GlobalShortcutsRegistry::self()->getComponent(actionId[KGlobalAccel::ComponentUnique]);
if (!component) {
return ret;
}
QStringList partialId(actionId[KGlobalAccel::ComponentUnique]); //ComponentUnique
partialId.append(QString()); //ActionUnique
//Use our internal friendlyName, not the one passed in. We should have the latest data.
partialId.append(component->friendlyName()); //ComponentFriendly
partialId.append(QString()); //ActionFriendly
foreach (const GlobalShortcut *const shortcut, component->allShortcuts()) {
if (shortcut->isFresh()) {
// isFresh is only an intermediate state, not to be reported outside.
continue;
}
QStringList actionId(partialId);
actionId[KGlobalAccel::ActionUnique] = shortcut->uniqueName();
actionId[KGlobalAccel::ActionFriendly] = shortcut->friendlyName();
ret.append(actionId);
}
return ret;
}
QStringList KGlobalAccelD::action(int key) const
{
GlobalShortcut *shortcut = GlobalShortcutsRegistry::self()->getShortcutByKey(key);
QStringList ret;
if (shortcut) {
ret.append(shortcut->context()->component()->uniqueName());
ret.append(shortcut->uniqueName());
ret.append(shortcut->context()->component()->friendlyName());
ret.append(shortcut->friendlyName());
}
return ret;
}
void KGlobalAccelD::activateGlobalShortcutContext( const QString &component, const QString &uniqueName)
{
KdeDGlobalAccel::Component *const comp = GlobalShortcutsRegistry::self()->getComponent(component);
if (comp) {
comp->activateGlobalShortcutContext(uniqueName);
}
}
QList<QDBusObjectPath> KGlobalAccelD::allComponents() const
{
QList<QDBusObjectPath> allComp;
Q_FOREACH (const KdeDGlobalAccel::Component *component, GlobalShortcutsRegistry::self()->allMainComponents()) {
allComp.append(component->dbusPath());
}
return allComp;
}
void KGlobalAccelD::blockGlobalShortcuts(int block)
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << block;
#endif
block
? GlobalShortcutsRegistry::self()->deactivateShortcuts(true)
: GlobalShortcutsRegistry::self()->activateShortcuts();
}
QList<int> KGlobalAccelD::shortcut(const QStringList &action) const
{
GlobalShortcut *shortcut = d->findAction(action);
if (shortcut) {
return shortcut->keys();
}
return QList<int>();
}
QList<int> KGlobalAccelD::defaultShortcut(const QStringList &action) const
{
GlobalShortcut *shortcut = d->findAction(action);
if (shortcut) {
return shortcut->defaultKeys();
}
return QList<int>();
}
// This method just registers the action. Nothing else. Shortcut has to be set
// later.
void KGlobalAccelD::doRegister(const QStringList &actionId)
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << actionId;
#endif
// Check because we would not want to add a action for an invalid
// actionId. findAction returns NULL in that case.
if (actionId.size() < 4) {
return;
}
GlobalShortcut *shortcut = d->findAction(actionId);
if (!shortcut) {
shortcut = d->addAction(actionId);
} else {
//a switch of locales is one common reason for a changing friendlyName
if ((!actionId[KGlobalAccel::ActionFriendly].isEmpty()) && shortcut->friendlyName() != actionId[KGlobalAccel::ActionFriendly]) {
shortcut->setFriendlyName(actionId[KGlobalAccel::ActionFriendly]);
scheduleWriteSettings();
}
if ((!actionId[KGlobalAccel::ComponentFriendly].isEmpty())
&& shortcut->context()->component()->friendlyName() != actionId[KGlobalAccel::ComponentFriendly]) {
shortcut->context()->component()->setFriendlyName(actionId[KGlobalAccel::ComponentFriendly]);
scheduleWriteSettings();
}
}
}
QDBusObjectPath KGlobalAccelD::getComponent(const QString &componentUnique)
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << componentUnique;
#endif
KdeDGlobalAccel::Component *component = GlobalShortcutsRegistry::self()->getComponent(componentUnique);
if (component) {
return component->dbusPath();
} else {
sendErrorReply("org.kde.kglobalaccel.NoSuchComponent", QString("The component '%1' doesn't exist.").arg(componentUnique));
return QDBusObjectPath("/");
}
}
QList<KGlobalShortcutInfo> KGlobalAccelD::getGlobalShortcutsByKey(int key) const
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << key;
#endif
QList<GlobalShortcut*> shortcuts = GlobalShortcutsRegistry::self()->getShortcutsByKey(key);
QList<KGlobalShortcutInfo> rc;
Q_FOREACH(const GlobalShortcut *sc, shortcuts) {
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << sc->context()->uniqueName() << sc->uniqueName();
#endif
rc.append(static_cast<KGlobalShortcutInfo>(*sc));
}
return rc;
}
bool KGlobalAccelD::isGlobalShortcutAvailable(int shortcut, const QString &component) const
{
QString realComponent = component;
QString context;
d->splitComponent(realComponent, context);
return GlobalShortcutsRegistry::self()->isShortcutAvailable(shortcut, realComponent, context);
}
void KGlobalAccelD::setInactive(const QStringList &actionId)
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << actionId;
#endif
GlobalShortcut *shortcut = d->findAction(actionId);
if (shortcut) {
shortcut->setIsPresent(false);
}
}
bool KGlobalAccelD::unregister(const QString &componentUnique, const QString &shortcutUnique)
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << componentUnique << shortcutUnique;
#endif
// Stop grabbing the key
GlobalShortcut *shortcut = d->findAction(componentUnique, shortcutUnique);
if (shortcut) {
shortcut->unRegister();
scheduleWriteSettings();
}
return shortcut;
}
QList<int> KGlobalAccelD::setShortcut(const QStringList &actionId, const QList<int> &keys, uint flags)
{
//spare the DBus framework some work
const bool setPresent = (flags & SetPresent);
const bool isAutoloading = !(flags & NoAutoloading);
const bool isDefault = (flags & IsDefault);
GlobalShortcut *shortcut = d->findAction(actionId);
if (!shortcut) {
return QList<int>();
}
//default shortcuts cannot clash because they don't do anything
if (isDefault) {
if (shortcut->defaultKeys() != keys) {
shortcut->setDefaultKeys(keys);
scheduleWriteSettings();
}
return keys; //doesn't matter
}
if (isAutoloading && !shortcut->isFresh()) {
//the trivial and common case - synchronize the action from our data
//and exit.
if (!shortcut->isPresent() && setPresent) {
shortcut->setIsPresent(true);
}
// We are finished here. Return the list of current active keys.
return shortcut->keys();
}
//now we are actually changing the shortcut of the action
shortcut->setKeys(keys);
if (setPresent) {
shortcut->setIsPresent(true);
}
//maybe isFresh should really only be set if setPresent, but only two things should use !setPresent:
//- the global shortcuts KCM: very unlikely to catch KWin/etc.'s actions in isFresh state
//- KGlobalAccel::stealGlobalShortcutSystemwide(): only applies to actions with shortcuts
// which can never be fresh if created the usual way
shortcut->setIsFresh(false);
scheduleWriteSettings();
return shortcut->keys();
}
void KGlobalAccelD::setForeignShortcut(const QStringList &actionId, const QList<int> &keys)
{
#ifdef KDEDGLOBALACCEL_TRACE
kDebug() << actionId;
#endif
GlobalShortcut *shortcut = d->findAction(actionId);
if (!shortcut) {
return;
}
QList<int> newKeys = setShortcut(actionId, keys, NoAutoloading);
emit yourShortcutGotChanged(actionId, newKeys);
}
void KGlobalAccelD::scheduleWriteSettings() const
{
if (!d->writeoutTimer.isActive())
d->writeoutTimer.start(500);
}
#include "moc_kglobalacceld.cpp"

View file

@ -1,138 +0,0 @@
/*
This file is part of the KDE libraries
Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
Copyright (c) 2008 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KGLOBALACCELD_H
#define KGLOBALACCELD_H
#include <kglobalshortcutinfo.h>
#include <QtCore/QStringList>
#include <QtCore/QList>
#include <QtDBus/QtDBus>
struct KGlobalAccelDPrivate;
/**
* @todo get rid of all of those QStringList parameters.
*/
class KGlobalAccelD : public QObject, protected QDBusContext
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.KGlobalAccel")
Q_ENUMS(SetShortcutFlag)
public:
enum SetShortcutFlag {
SetPresent = 2,
NoAutoloading = 4,
IsDefault = 8
};
Q_FLAGS(SetShortcutFlags)
KGlobalAccelD(QObject* parent = NULL);
~KGlobalAccelD();
bool init();
public Q_SLOTS:
/**
* Get the dbus path for all known components.
*
* The returned path is absolute. No need to prepend anything.
*/
Q_SCRIPTABLE QList<QDBusObjectPath> allComponents() const;
Q_SCRIPTABLE QList<QStringList> allMainComponents() const;
Q_SCRIPTABLE QList<QStringList> allActionsForComponent(const QStringList &actionId) const;
Q_SCRIPTABLE QStringList action(int key) const;
//to be called by main components not owning the action
Q_SCRIPTABLE QList<int> shortcut(const QStringList &actionId) const;
//to be called by main components not owning the action
Q_SCRIPTABLE QList<int> defaultShortcut(const QStringList &actionId) const;
/**
* Get the dbus path for @ componentUnique
*
* @param componentUnique the components unique identifier
*
* @return the absolute dbus path
*/
Q_SCRIPTABLE QDBusObjectPath getComponent(const QString &componentUnique);
//to be called by main components owning the action
Q_SCRIPTABLE QList<int> setShortcut(const QStringList &actionId, const QList<int> &keys, uint flags);
//this is used if application A wants to change shortcuts of application B
Q_SCRIPTABLE void setForeignShortcut(const QStringList &actionId, const QList<int> &keys);
//to be called when a KAction is destroyed. The shortcut stays in the data structures for
//conflict resolution but won't trigger.
Q_SCRIPTABLE void setInactive(const QStringList &actionId);
Q_SCRIPTABLE void doRegister(const QStringList &actionId);
Q_SCRIPTABLE void activateGlobalShortcutContext(const QString &component, const QString &context);
/**
* Returns the shortcuts registered for @p key.
*
* If there is more than one shortcut they are guaranteed to be from the
* same component but different contexts. All shortcuts are searched.
*/
Q_SCRIPTABLE QList<KGlobalShortcutInfo> getGlobalShortcutsByKey(int key) const;
/**
* Return true if the @p shortcut is available for @p component.
*/
Q_SCRIPTABLE bool isGlobalShortcutAvailable(int key, const QString &component) const;
/**
* Delete the shortcut with @a component and @name.
*
* The shortcut is removed from the registry even if it is currently
* present. It is removed from all contexts.
*
* @param componentUnique the components unique identifier
* @param shortcutUnique the shortcut id
*
* @return @c true if the shortcuts was deleted, @c false if it didn't * exist.
*/
Q_SCRIPTABLE bool unregister(const QString &componentUnique, const QString &shortcutUnique);
Q_SIGNALS:
Q_SCRIPTABLE void yourShortcutGotChanged(const QStringList &actionId, const QList<int> &newKeys);
private Q_SLOTS:
void blockGlobalShortcuts(int);
private:
Q_PRIVATE_SLOT(d, void _k_newGlobalShortcutNotification() )
void scheduleWriteSettings() const;
KGlobalAccelDPrivate *const d;
};
#endif //KGLOBALACCELD_H

View file

@ -1,89 +0,0 @@
/*
This file is part of the KDE project
Copyright (c) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
Copyright (c) 2007 Michael Jansen <kde@michael-jansen.biz>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kglobalacceld.h"
#include <kapplication.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kdebug.h>
#include <klocale.h>
static bool isEnabled()
{
// TODO: Check if kglobalaccel can be disabled
return true;
}
int main(int argc, char **argv)
{
// Disable Session Management the right way (C)
//
// ksmserver has global shortcuts. disableSessionManagement() does not prevent Katie from
// registering the app with the session manager. We remove the address to make sure we do not
// get a hang on kglobalaccel restart (kglobalaccel tries to register with ksmserver,
// ksmserver tries to register with kglobalaccel).
::unsetenv("SESSION_MANAGER");
KAboutData aboutdata(
"kglobalaccel",
0,
ki18n("KDE Global Shortcuts Service"),
"0.2",
ki18n("KDE Global Shortcuts Service"),
KAboutData::License_LGPL,
ki18n("(C) 2007-2009 Andreas Hartmetz, Michael Jansen"));
aboutdata.addAuthor(ki18n("Andreas Hartmetz"),ki18n("Maintainer"),"ahartmetz@gmail.com");
aboutdata.addAuthor(ki18n("Michael Jansen"),ki18n("Maintainer"),"kde@michael-jansen.biz");
aboutdata.setProgramIconName("kglobalaccel");
KCmdLineArgs::init( argc, argv, &aboutdata );
// check if kglobalaccel is disabled
if (!isEnabled()) {
kDebug() << "kglobalaccel is disabled!";
return 0;
}
KApplication app;
// This app is started automatically, no need for session management
app.disableSessionManagement();
app.setQuitOnLastWindowClosed(false);
QDBusConnection session = QDBusConnection::sessionBus();
if (!session.isConnected()) {
kWarning() << "No DBUS session-bus found. Check if you have started the DBUS server.";
return 1;
}
QDBusReply<bool> sessionReply = session.interface()->isServiceRegistered("org.kde.kglobalaccel");
if (sessionReply.isValid() && sessionReply.value() == true) {
kWarning() << "Another instance of kglobalaccel is already running!";
return 2;
}
KGlobalAccelD globalaccel;
if (!globalaccel.init()) {
return 3;
}
return app.exec();
}

View file

@ -1,3 +0,0 @@
[D-BUS Service]
Name=org.kde.kglobalaccel
Exec=@KDE4_BIN_INSTALL_DIR@/kglobalaccel

View file

@ -751,13 +751,13 @@ void ShortcutDialog::keySequenceChanged(const QKeySequence &seq)
// Check if the key sequence is used currently // Check if the key sequence is used currently
QString sc = seq.toString(); QString sc = seq.toString();
// NOTICE - seq.toString() & the entries in "conflicting" randomly get invalidated after the next call (if no sc has been set & conflicting isn't empty?!) // NOTICE - seq.toString() & the entries in "conflicting" randomly get invalidated after the next call (if no sc has been set & conflicting isn't empty?!)
QList<KGlobalShortcutInfo> conflicting = KGlobalAccel::getGlobalShortcutsByKey(seq); QList<KGlobalShortcutInfo> conflicting = KGlobalAccel::self()->getGlobalShortcutsByKey(seq);
if (!conflicting.isEmpty()) { if (!conflicting.isEmpty()) {
const KGlobalShortcutInfo &conflict = conflicting.at(0); const KGlobalShortcutInfo &conflict = conflicting.at(0);
warning->setText(i18nc("'%1' is a keyboard shortcut like 'ctrl+w'", warning->setText(i18nc("'%1' is a keyboard shortcut like 'ctrl+w'",
"<b>%1</b> is already in use", sc)); "<b>%1</b> is already in use", sc));
warning->setToolTip(i18nc("keyboard shortcut '%1' is used by action '%2' in application '%3'", warning->setToolTip(i18nc("keyboard shortcut '%1' is used by action '%2' in application '%3'",
"<b>%1</b> is used by %2 in %3", sc, conflict.friendlyName(), conflict.componentFriendlyName())); "<b>%1</b> is used by %2 in %3", sc, conflict.friendlyName, conflict.componentFriendlyName));
warning->show(); warning->show();
widget->setKeySequence(shortcut()); widget->setKeySequence(shortcut());
} else if (seq != _shortcut) { } else if (seq != _shortcut) {
@ -816,8 +816,6 @@ void Workspace::initShortcuts()
// a separate KActionCollection is needed for the shortcut for disabling global shortcuts, // a separate KActionCollection is needed for the shortcut for disabling global shortcuts,
// otherwise it would also disable itself // otherwise it would also disable itself
disable_shortcuts_keys = new KActionCollection(this); disable_shortcuts_keys = new KActionCollection(this);
// TODO: PORT ME (KGlobalAccel related)
// FIXME KAccel port... needed?
//disable_shortcuts_keys->disableBlocking( true ); //disable_shortcuts_keys->disableBlocking( true );
#define IN_KWIN #define IN_KWIN
#include "kwinbindings.cpp" #include "kwinbindings.cpp"
@ -828,10 +826,6 @@ void Workspace::initShortcuts()
void Workspace::setupWindowShortcut(Client* c) void Workspace::setupWindowShortcut(Client* c)
{ {
assert(client_keys_dialog == NULL); assert(client_keys_dialog == NULL);
// TODO: PORT ME (KGlobalAccel related)
//keys->setEnabled( false );
//disable_shortcuts_keys->setEnabled( false );
//client_keys->setEnabled( false );
client_keys_dialog = new ShortcutDialog(c->shortcut().primary()); client_keys_dialog = new ShortcutDialog(c->shortcut().primary());
client_keys_client = c; client_keys_client = c;
connect(client_keys_dialog, SIGNAL(dialogDone(bool)), SLOT(setupWindowShortcutDone(bool))); connect(client_keys_dialog, SIGNAL(dialogDone(bool)), SLOT(setupWindowShortcutDone(bool)));
@ -1833,7 +1827,7 @@ bool Workspace::shortcutAvailable(const KShortcut& cut, Client* ignore) const
if (ignore && cut == ignore->shortcut()) if (ignore && cut == ignore->shortcut())
return true; return true;
foreach (const QKeySequence &seq, cut.toList()) { foreach (const QKeySequence &seq, cut.toList()) {
if (!KGlobalAccel::getGlobalShortcutsByKey(seq).isEmpty()) { if (!KGlobalAccel::self()->getGlobalShortcutsByKey(seq).isEmpty()) {
return false; return false;
} }
} }