[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-workspace/amourphiouskb] kcontrol/keyboard: changes made
From:       shivam makkar <amourphious1992 () gmail ! com>
Date:       2012-09-07 12:53:32
Message-ID: 20120907125332.C10C3A6094 () git ! kde ! org
[Download RAW message or body]

Git commit 06c0b5baafd041da7862a57181cf2da1c6a80bd9 by shivam makkar.
Committed on 07/09/2012 at 14:52.
Pushed by makkar into branch 'amourphiouskb'.

changes made

M  +1    -0    kcontrol/keyboard/CMakeLists.txt
M  +0    -0    kcontrol/keyboard/Messages.sh
M  +8    -47   kcontrol/keyboard/kcm_add_layout_dialog.cpp
M  +28   -28   kcontrol/keyboard/kcm_add_layout_dialog.ui
M  +30   -26   kcontrol/keyboard/kcm_keyboard.desktop
M  +10   -0    kcontrol/keyboard/kcm_keyboard.ui
M  +33   -0    kcontrol/keyboard/kcm_keyboard_widget.cpp
M  +3    -0    kcontrol/keyboard/kcm_keyboard_widget.h
A  +70   -0    kcontrol/keyboard/keyaliases.cpp     [License: UNKNOWN]  *
A  +16   -0    kcontrol/keyboard/keyaliases.h     [License: UNKNOWN]  *
M  +0    -1    kcontrol/keyboard/keyboard.desktop
M  +52   -66   kcontrol/keyboard/keyboardlayout.cpp
M  +5    -3    kcontrol/keyboard/keyboardlayout.h
M  +162  -115  kcontrol/keyboard/keyboardpainter.cpp
M  +1    -19   kcontrol/keyboard/keyboardpainter.h
M  +0    -19   kcontrol/keyboard/keys.cpp
M  +0    -19   kcontrol/keyboard/keys.h
M  +0    -19   kcontrol/keyboard/keysym.cpp
M  +0    -19   kcontrol/keyboard/keysym.h

The files marked with a * at the end have a non valid license. Please read: \
http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/kde-workspace/06c0b5baafd041da7862a57181cf2da1c6a80bd9

diff --git a/kcontrol/keyboard/CMakeLists.txt b/kcontrol/keyboard/CMakeLists.txt
index ce14749..800a903 100644
--- a/kcontrol/keyboard/CMakeLists.txt
+++ b/kcontrol/keyboard/CMakeLists.txt
@@ -112,6 +112,7 @@ set(kcm_keyboard_PART_SRCS
   iso_codes.cpp
   kcmmisc.cpp
   bindings.cpp
+  keyaliases.cpp
   keyboardlayout.cpp
   keyboardpainter.cpp
   keys.cpp
diff --git a/kcontrol/keyboard/Messages.sh b/kcontrol/keyboard/Messages.sh
old mode 100755
new mode 100644
diff --git a/kcontrol/keyboard/kcm_add_layout_dialog.cpp b/kcontrol/keyboard/kcm_add_layout_dialog.cpp
index d595a45..97e2208 100644
--- a/kcontrol/keyboard/kcm_add_layout_dialog.cpp
+++ b/kcontrol/keyboard/kcm_add_layout_dialog.cpp
@@ -144,7 +144,7 @@ void AddLayoutDialog::accept()
 {
 	selectedLayoutUnit.layout = \
layoutDialogUi->layoutComboBox->itemData(layoutDialogUi->layoutComboBox->currentIndex()).toString();  \
selectedLayoutUnit.variant = \
                layoutDialogUi->variantComboBox->itemData(layoutDialogUi->variantComboBox->currentIndex()).toString();
                
-	QString label = layoutDialogUi->labelEdit->text();
+    QString label = layoutDialogUi->labelEdit->text();
 	if( label == selectedLayoutUnit.layout ) {
 		label = "";
 	}
@@ -153,57 +153,18 @@ void AddLayoutDialog::accept()
 	QDialog::accept();
 }
 
-QString AddLayoutDialog::getvariant(QString variant){
-    if (variant==""){
-        variant="basic";
-        if(selectedLayout=="ma")
-            variant="arabic";
-        if(selectedLayout=="az")
-            variant="latin";
-        if(selectedLayout=="bg")
-            variant="bds";
-        if(selectedLayout=="fi")
-            variant="kotoistus";
-        if(selectedLayout=="ca")
-            variant="fr";
-        if(selectedLayout=="in")
-            variant="deva";
-        if(selectedLayout=="jp")
-            variant="106";
-        if(selectedLayout=="ir")
-            variant="pes";
-        if(selectedLayout=="kr")
-            variant="kr106";
-        if(selectedLayout=="ru")
-            variant="winkeys";
-        if(selectedLayout=="lk")
-            variant="sin_phonetic";
-        if(selectedLayout=="ke")
-            variant="swa";
-        if(selectedLayout=="tz")
-            variant="swa";
-        if(selectedLayout=="tw")
-            variant="tw";
-        if(selectedLayout=="bw")
-            variant="tswana";
-        if(selectedLayout=="ua")
-            variant="unicode";
-        if(selectedLayout=="pk")
-            variant="urd-phonetic";
-        if(selectedLayout=="uz")
-            variant="cyrillic";
-    }
-    return variant;
-}
 
 void AddLayoutDialog::preview(){
     QString variant=layoutDialogUi->variantComboBox->itemData(layoutDialogUi->variantComboBox->currentIndex()).toString();
  QMessageBox q;
-    variant=getvariant(variant);
-    /*a.append(selectedLayout);
-    q.setText(a);
-    q.exec();*/
+    //variant=getvariant(variant);
+    /*a.append(selectedLayout);*/
+    q.setText(variant);
+    q.exec();
+    q.setText(selectedLayout);
+    q.exec();
     layoutprev=new keyboardpainter();
+    variant=layoutprev->getvariant(variant,selectedLayout);
     layoutprev->getkeyboardlayout(selectedLayout,variant);
     layoutprev->exec();
     layoutprev->setModal(true);
diff --git a/kcontrol/keyboard/kcm_add_layout_dialog.ui b/kcontrol/keyboard/kcm_add_layout_dialog.ui
index 17f067e..cc073d7 100644
--- a/kcontrol/keyboard/kcm_add_layout_dialog.ui
+++ b/kcontrol/keyboard/kcm_add_layout_dialog.ui
@@ -14,13 +14,6 @@
    <string>Add Layout</string>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string>Limit selection by language:</string>
-     </property>
-    </widget>
-   </item>
    <item row="0" column="1">
     <widget class="QComboBox" name="languageComboBox">
      <property name="sizePolicy">
@@ -48,14 +41,38 @@
      </property>
     </widget>
    </item>
-   <item row="5" column="0">
+   <item row="6" column="0">
     <widget class="QLabel" name="labelLabel_2">
      <property name="text">
       <string>Shortcut:</string>
      </property>
     </widget>
    </item>
-   <item row="5" column="1">
+   <item row="2" column="0">
+    <widget class="QLabel" name="label_3">
+     <property name="text">
+      <string>Variant:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QComboBox" name="variantComboBox"/>
+   </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="labelLabel">
+     <property name="text">
+      <string>Label:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>Limit selection by language:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="6" column="1">
     <widget class="KKeySequenceWidget" name="kkeysequencewidget">
      <property name="sizePolicy">
       <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -65,7 +82,7 @@
      </property>
     </widget>
    </item>
-   <item row="6" column="1">
+   <item row="7" column="1">
     <widget class="QDialogButtonBox" name="buttonBox">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
@@ -78,24 +95,7 @@
    <item row="1" column="1">
     <widget class="QComboBox" name="layoutComboBox"/>
    </item>
-   <item row="2" column="0">
-    <widget class="QLabel" name="label_3">
-     <property name="text">
-      <string>Variant:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="1">
-    <widget class="QComboBox" name="variantComboBox"/>
-   </item>
-   <item row="4" column="0">
-    <widget class="QLabel" name="labelLabel">
-     <property name="text">
-      <string>Label:</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="1">
+   <item row="7" column="0">
     <widget class="QPushButton" name="prevbutton">
      <property name="text">
       <string>PREVIIEW</string>
diff --git a/kcontrol/keyboard/kcm_keyboard.desktop b/kcontrol/keyboard/kcm_keyboard.desktop
old mode 100644
new mode 100755
index 6000674..7ada2bd
--- a/kcontrol/keyboard/kcm_keyboard.desktop
+++ b/kcontrol/keyboard/kcm_keyboard.desktop
@@ -1,3 +1,4 @@
+#!/usr/bin/env xdg-open
 [Desktop Entry]
 Exec=kcmshell4 kcm_keyboard
 Icon=preferences-desktop-keyboard
@@ -198,30 +199,33 @@ Comment[x-test]=xxKeyboard settingsxx
 Comment[zh_CN]=键盘设置
 Comment[zh_TW]=鍵盤設定
 
-X-KDE-Keywords=Keyboard,Keyboard repeat,Click volume,Input Devices,repeat,volume,NumLock,NumPad,Keyboard \
type,Keyboard model,Keyboard layout,Key layout,Language,Alternate Keyboard,Keyboard switching,Ctrl \
                Key,Caps Lock,Esperanto,Circumflex,Kill X Server,LED Keyboard,Compose Key
-X-KDE-Keywords[ca]=Teclat,Repetició de teclat,Volum de clic,Dispositius \
d'entrada,repetició,volum,BloqNum,NumPad,Tipus de teclat,Model de teclat,Disposició de \
teclat,Idioma,Teclat alternatiu,Commutació de teclat,Tecla Ctrl,Bloq Maj,Esperanto,Circumflex,Matar \
                servidor X,LED de teclat,Tecla compose
-X-KDE-Keywords[da]=Tastatur,keyboard,tastaturgentagelse,klikvolume,inputenheder,gentag,lydstyrke,NumLock,numerisk \
tastatur,tastaturtype,tastaturmodel,tastaturlayout,tastelayout,sprog,alternativt tastatur,skift af \
                tastatur,Ctrl-tast,lås skift,caps lock,Esperanto,Circumflex,dræb X \
                Server,LED-tastatur,Compose-tast
-X-KDE-Keywords[es]=Teclado,Repetición del teclado,Volumen del clic,Dispositivos de \
entrada,repetición,volumen,Bloqueo numérico,Teclado numérico,Tipo de teclado,Modelo de \
teclado,Disposición del teclado,Disposición de las teclas,Idioma,Teclado alternativo,Cambiar de \
teclado,Tecla Ctrl,Bloqueo de mayúsculas,Esperanto,Circunflejo,Matar el servidor X,LED del teclado,Tecla \
                de composición
-X-KDE-Keywords[et]=Klaviatuur,Klaviatuurikordus,Klõpsu \
helitugevus,Sisendseadmed,kordus,helitugevus,NumLock,NumPad,numbriklahvistik,Klaviatuurimudel,Klaviatuuri \
mudel,Klaviatuuripaigutus,Klaviatuuri paigutus,Paigutus,Keel,Alternatiivne klaviatuur,Klaviatuuri \
                vahetamine,Ctrl,Caps Lock,Esperanto,Tsirkumfleks,Katus,X-serveri \
                tapmine,LDE-klaviatuur,Muuteklahv
-X-KDE-Keywords[fi]=näppäimistö,näppäimistön toisto,näppäilyäänen \
voimakkuus,syöttölaitteet,toisto,numlock,numerolukko,numpad,numeronäppäimistö,näppäimistön \
tyyppi,näppäimistön malli,näppäimistöasettelu,näppäinasettelu,kieli,vaihtoehtoinen \
näppäimistö,näppäimistön vaihto,näppäimistön vaihtaminen,Ctrl-näppäin,caps lock,Esperanto,tapa \
                X-palvelin,LED-näppäimistö,compose-näppäin
-X-KDE-Keywords[hu]=Billentyűzet,Billentyűzet ismétlés,Kattintási hangerő,Beviteli \
eszközök,ismétlés,hangerő,NumLock,Numerikus billentyűzet,Billentyűzet típus,Billentyűzet \
modell,Billentyűzetkiosztás,Nyelv,Alternatív billentyűzet,Billentyűzetváltó,Ctrl billentyű,Caps \
                Lock,Eszperantó,Ékezet,X kiszolgáló kilövése,LED billentyűzet,Levélírás \
                billentyű
-X-KDE-Keywords[ia]=Claviero,Repetition de claviero,Volumine de click,Dispositivos de ingresso,volumine, \
NumLock,Typo de claviero,modello de Claviero,disposition de claviero, Disposition de clave, \
Linguage,Claviero alternate,commutation de claviero,Clave Ctrl,Caps Lock,Esperanto, Circumflexe,Occide X \
                Server, Claviero LED, Clave composite
-X-KDE-Keywords[it]=tastiera,ripetizione tastiera,clic volume,dispositivi di \
ingresso,ripetizione,volume,bloc num,tastierino numerico,tipo tastiera, modello tastiera,layout \
tastiera,layout tasto,lingua,tastiera alternativa,cambio tastiera, tasto \
                ctrl,maiusc,esperanto,circonflesso,uccidi server x,led tastiera,tasto composizione
-X-KDE-Keywords[kk]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
                Server,LED Keyboard,Compose Key
-X-KDE-Keywords[km]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
                Server,LED Keyboard,Compose Key
-X-KDE-Keywords[nb]=Tastatur,Tasterepetisjon,Klikklydstyrke,Inndataenheter,repeter,lydstyrke,NumLock,NumPad.Tastaturtype,Tastaturmodell,Tastaturutforming,Tateutlegg,Språk,Alternativt \
tastatur,Tastaturbytte,CTRL-tast,Caps Lock,Esperanto,circumflex,Drep \
                X-tjener,LED-tastatur,Sammensett-tast
-X-KDE-Keywords[nl]=Toetsenbord,Toetsenbordherhaling,Klikvolume,Invoerapparaten,herhaling,volume,NumLock,NumPad,Type \
toetsenbord,Model toetsenbord,Toetsenbordindeling,Toetsenindeling,Taal,Toetsenbord alterneren,Toetsenbord \
omschakelen,Ctrl-toets,Caps Lock,Esperanto,Circumflex,Kill X Server,LED-toetsenbord,Compositietoets \
+X-KDE-Keywords=Keyboard,Keyboard repeat,Click volume,Input Devices,repeat,volume \
+X-KDE-Keywords[ar]=لوحة مفاتيح,تكرار,جهاز,أداة,أجهزة,إدخال,تكرار \
+X-KDE-Keywords[ca]=Teclat,Repetició de teclat,Volum del clic,Dispositius d'entrada,repetició,volum \
+X-KDE-Keywords[ca@valencia]=Teclat,Repetició de teclat,Volum del clic,Dispositius \
d'entrada,repetició,volum \
+X-KDE-Keywords[da]=tastatur,tastaturgentagelse,kliklydstyrke,input-enheder,gentagelse,lydstyrke \
+X-KDE-Keywords[de]=Tastatur,Tastenwiederholung,Klicklautstärke,Eingabegeräte,Wiederholung,Lautstärke \
+X-KDE-Keywords[es]=Teclado,Repetición del teclado,Volumen del clic,Dispositivos de \
entrada,repetición,volumen +X-KDE-Keywords[et]=klaviatuur,klahvikordus,klõpsu \
heli,sisendseadmed,kordamine,helitugevus \
+X-KDE-Keywords[fi]=Näppäimistö,Näppäintoisto,Näppäilyäänen \
voimakkuus,Syöttölaitteet,toisto,voimakkuus +X-KDE-Keywords[fr]=Clavier,Répétition de touches,Volume \
des clics,Périphérique d'entrée,répétition,volume \
+X-KDE-Keywords[hu]=Billentyűzet,Billentyűismétlés,Hangerőkattintés,Beviteli \
eszközök,ismétlés,hangerő +X-KDE-Keywords[ia]=Claviero,Repetition de claviero,Volumine de \
click,Dispositivo de ingresso,repetition,volumine +X-KDE-Keywords[it]=tastiera,ripetizione di \
tastiera,volume del clic,dispositivi di input,ripeti,volume +X-KDE-Keywords[kk]=Keyboard,Keyboard \
repeat,Click volume,Input Devices,repeat,volume +X-KDE-Keywords[nb]=Tastatur,Tasterepetisjon,Lydstyrke \
for tasteklikk,Inndataenheter,gjenta,lydstyrke \
+X-KDE-Keywords[nds]=Tastatuur,Tastwedderhalen,Klickluutstärk,Ingaavreedschappen,Wedderhalen,Luutstärk \
+X-KDE-Keywords[nl]=toetsenbord,toetsenbordherhaling,klikvolume,invoerapparaten,herhaling,volume  \
X-KDE-Keywords[pl]=Klawiatura,Powtórzenia klawiatury,Głośność kliknięcia,Urządzenia \
                wejścia,powtórzenie,głośność
-X-KDE-Keywords[pt]=Teclado,repetição do teclado,volume do 'click',dispositivos de \
entrada,repetição,volume,NumLock,NumPad,Tipo de teclado,Modelo de teclado,Disposição do \
teclado,Disposição das teclas,Língua,Teclado alternativo,Mudança de teclado,Ctrl,Caps \
                Lock,Esperanto,Circunflexo,Matar o Servidor X,LED do Teclado,Tecla Compose
-X-KDE-Keywords[pt_BR]=Teclado,repetição do teclado,volume do clique,dispositivos de \
entrada,repetição,volume,NumLock,NumPad,Tipo de teclado,Modelo de teclado,Leiaute do teclado,Leiaute \
das teclas,Idioma,Teclado alternativo,Mudança de teclado,Tecla Ctrl,Caps \
                Lock,Esperanto,Circunflexo,Finalizar o servidor X,LED do teclado,Tecla Compose
-X-KDE-Keywords[sl]=tipkovnica,ponavljanje tipkovnice,tipkovno ponavljanje,glasnost klika,vhodne \
naprave,ponavljanje,glasnost,numlock,številčnica,vrsta tipkovnice,model tipkovnice,razporeditev \
tipk,razporeditev tipkovnice,jezik,nadomestna tipkovnica,alternativna tipkovnica,preklapljanje \
tipkovnice,ctrl,tipka ctrl,capslock,esperanto,cirkumfleks,končaj strežnik x,led,lučke,tipka za \
                sestavljanje
-X-KDE-Keywords[sr]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
Server,LED Keyboard,Compose Key,тастатура,понављање тастатуре,јачина \
клика,улазни уређаји,понављање,јачина,NumLock,нумеричка \
тастатура,тип тастатуре,модел тастатуре,распоред \
тастатуре,распоред тастера,језик,алтернативна \
тастатура,мењач \
тастатуре,Ctrl,CapsLock,есперанто,циркумфлекс,ЛЕД \
                тастатура,укини икс сервер
-X-KDE-Keywords[sr@ijekavian]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
Server,LED Keyboard,Compose Key,тастатура,понављање тастатуре,јачина \
клика,улазни уређаји,понављање,јачина,NumLock,нумеричка \
тастатура,тип тастатуре,модел тастатуре,распоред \
тастатуре,распоред тастера,језик,алтернативна \
тастатура,мењач \
тастатуре,Ctrl,CapsLock,есперанто,циркумфлекс,ЛЕД \
                тастатура,укини икс сервер
-X-KDE-Keywords[sr@ijekavianlatin]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
Server,LED Keyboard,Compose Key,tastatura,ponavljanje tastature,jačina klika,ulazni \
uređaji,ponavljanje,jačina,NumLock,numerička tastatura,tip tastature,model tastature,raspored \
tastature,raspored tastera,jezik,alternativna tastatura,menjač \
                tastature,Ctrl,CapsLock,esperanto,cirkumfleks,LED tastatura,ukini X server
-X-KDE-Keywords[sr@latin]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
Server,LED Keyboard,Compose Key,tastatura,ponavljanje tastature,jačina klika,ulazni \
uređaji,ponavljanje,jačina,NumLock,numerička tastatura,tip tastature,model tastature,raspored \
tastature,raspored tastera,jezik,alternativna tastatura,menjač \
                tastature,Ctrl,CapsLock,esperanto,cirkumfleks,LED tastatura,ukini X server
-X-KDE-Keywords[sv]=Tangentbord,Tangentbordsupprepning,Klickvolym,Indataenheter,upprepa,volym,NumLock,Numeriskt \
tangentbord,Tangentbordstyp,Tangentbordsmodell,Tangentbordslayout,Språk,Alternativt \
tangentbord,Tangentbordsbyte,Ctrl-tangent,Caps Lock,Esperanto,Circumflex,Döda \
                X-server,LED-tangentbord,Compose-tangent
-X-KDE-Keywords[tr]=Klavye,Klavye tekrarlaması,Tıklama sesi,Girdi \
Aygıtları,tekrarla,ses,NumLock,Sayısal Tuşlar,Klavye tipi,Klavye modeli,Klavye düzeni,Tuş \
düzeni,Dil,Klavyeyi Değiştir,Klavye Seçimi,Ctrl Tuşu,Caps Lock,Esperanto,İnceltme İşareti,X \
                Sunucuyu Sonlandır,LED Klavye,Tuş Düzeni Oluştur
-X-KDE-Keywords[uk]=клавіатура,повторення натискань,гучність \
клацання,пристрої введення,повторення,гучність,тип \
клавіатури,розкладка клавіатури,мова,інша \
клавіатура,інша розкладка,перемикання розкладок,клавіша \
Ctrl,есперанто,циркумфлекс,лампочки на клавіатурі,клавіша \
перемикання,Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
                Server,LED Keyboard,Compose Key
-X-KDE-Keywords[vi]=B n phím, lặp b n phím, âm lượng nhấn nút,thiết bị nhập,lặp \
lại,âm lượng,NumLock,NumPad, kiểu b n phím,mẫu b n phím,loại b n phím, bố trí \
phím,ngôn ngữ,b n phím thay thế,chuyển đổi b n phím,phím Ctrl,Caps Lock, \
                Esperanto,Circumflex,tắt máy chủ X,b n phím LED,phím tổ hợp
-X-KDE-Keywords[x-test]=xxKeyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
                Server,LED Keyboard,Compose Keyxx
-X-KDE-Keywords[zh_TW]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,NumLock,NumPad,Keyboard type,Keyboard model,Keyboard layout,Key \
layout,Language,Alternate Keyboard,Keyboard switching,Ctrl Key,Caps Lock,Esperanto,Circumflex,Kill X \
Server,LED Keyboard,Compose Key +X-KDE-Keywords[pt]=teclado,repetição do teclado,volume das \
teclas,dispositivos de entrada,repetição,volume +X-KDE-Keywords[pt_BR]=Teclado,repetição do \
teclado,volume das teclas,dispositivos de entrada,repetição,volume \
+X-KDE-Keywords[sk]=Klávesnica,Opakovanie klávesnice,Hlasitosť kliknutia,Vstupné \
zariadenia,opakovanie,hlasitosť +X-KDE-Keywords[sr]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,тастатура,понављање тастатуре,јачина \
клика,улазни уређаји,понављање,јачина \
+X-KDE-Keywords[sr@ijekavian]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,тастатура,понављање тастатуре,јачина \
клика,улазни уређаји,понављање,јачина \
+X-KDE-Keywords[sr@ijekavianlatin]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,tastatura,ponavljanje tastature,jačina klika,ulazni uređaji,ponavljanje,jačina \
+X-KDE-Keywords[sr@latin]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,tastatura,ponavljanje tastature,jačina klika,ulazni uređaji,ponavljanje,jačina \
+X-KDE-Keywords[sv]=Tangentbord,Tangentbordsupprepning,Klickvolym,Indataenheter,upprepa,volym \
+X-KDE-Keywords[uk]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,клавіатура,гучність \
клацання,введення,повторення,гучність \
+X-KDE-Keywords[x-test]=xxKeyboard,Keyboard repeat,Click volume,Input Devices,repeat,volumexx \
+X-KDE-Keywords[zh_CN]=Keyboard,Keyboard repeat,Click volume,Input \
Devices,repeat,volume,键盘,键盘重复,点击量,输入设备,重复,量 \
                +X-KDE-Keywords[zh_TW]=Keyboard,Keyboard repeat,Click volume,Input Devices,repeat,volume
diff --git a/kcontrol/keyboard/kcm_keyboard.ui b/kcontrol/keyboard/kcm_keyboard.ui
index 22968e8..b3a810f 100644
--- a/kcontrol/keyboard/kcm_keyboard.ui
+++ b/kcontrol/keyboard/kcm_keyboard.ui
@@ -329,6 +329,16 @@
           </widget>
          </item>
          <item>
+          <widget class="QPushButton" name="previewbutton">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>PREVIEW</string>
+           </property>
+          </widget>
+         </item>
+         <item>
           <spacer name="horizontalSpacer">
            <property name="orientation">
             <enum>Qt::Horizontal</enum>
diff --git a/kcontrol/keyboard/kcm_keyboard_widget.cpp b/kcontrol/keyboard/kcm_keyboard_widget.cpp
index e1bd830..5fb4ee3 100644
--- a/kcontrol/keyboard/kcm_keyboard_widget.cpp
+++ b/kcontrol/keyboard/kcm_keyboard_widget.cpp
@@ -33,6 +33,7 @@
 #include <QtGui/QX11Info>
 
 #include "keyboard_config.h"
+#include "keyboardpainter.h"
 #include "xkb_rules.h"
 #include "flags.h"
 #include "x11_helper.h"
@@ -335,6 +336,8 @@ void KCMKeyboardWidget::initializeLayoutsUI()
 	connect(uiWidget->moveUpBtn, SIGNAL(clicked(bool)), this, SLOT(moveUp()));
 	connect(uiWidget->moveDownBtn, SIGNAL(clicked(bool)), this, SLOT(moveDown()));
 
+    connect(uiWidget->previewbutton,SIGNAL(clicked(bool)),this,SLOT(previewlayout()));
+
 	connect(uiWidget->xkbGrpClearBtn, SIGNAL(clicked(bool)), this, SLOT(clearGroupShortcuts()));
 	connect(uiWidget->xkb3rdLevelClearBtn, SIGNAL(clicked(bool)), this, SLOT(clear3rdLevelShortcuts()));
 
@@ -360,6 +363,35 @@ void KCMKeyboardWidget::initializeLayoutsUI()
 	connect(uiWidget->layoutLoopCountSpinBox, SIGNAL(valueChanged(int)), this, SLOT(uiChanged()));
 }
 
+void KCMKeyboardWidget::previewlayout(){
+    QModelIndex index = uiWidget->layoutsTableView->currentIndex() ;
+    QModelIndex idcountry = index.sibling(index.row(),0) ;
+    QString country=uiWidget->layoutsTableView->model()->data(idcountry).toString();
+    QModelIndex idvariant = index.sibling(index.row(),2) ;
+    QString variant=uiWidget->layoutsTableView->model()->data(idvariant).toString();
+    QMessageBox q;
+    q.setText(country);
+    q.exec();
+    layoutprev=new keyboardpainter();
+    if(variant=="")
+    variant=layoutprev->getvariant(variant,country);
+    else{
+        const LayoutInfo* layoutInfo = rules->getLayoutInfo(country);
+        foreach(const VariantInfo* variantInfo, layoutInfo->variantInfos) {
+            if(variant==variantInfo->description){
+                q.setText(variant);
+                q.exec();
+                variant=variantInfo->name;
+                break;
+            }
+        }
+    }
+    layoutprev->getkeyboardlayout(country,variant);
+    layoutprev->exec();
+    layoutprev->setModal(true);
+
+}
+
 void KCMKeyboardWidget::configureLayoutsChanged()
 {
 	if( uiWidget->layoutsGroupBox->isChecked()	&& keyboardConfig->layouts.isEmpty() ) {
@@ -388,6 +420,7 @@ void KCMKeyboardWidget::layoutSelectionChanged()
 	uiWidget->removeLayoutBtn->setEnabled( ! selected.isEmpty() );
 	QPair<int, int> rowsRange( getSelectedRowRange(selected) );
 	uiWidget->moveUpBtn->setEnabled( ! selected.isEmpty() && rowsRange.first > 0);
+    uiWidget->previewbutton->setEnabled(! selected.isEmpty());
 	uiWidget->moveDownBtn->setEnabled( ! selected.isEmpty() && rowsRange.second < \
keyboardConfig->layouts.size()-1 );  }
 
diff --git a/kcontrol/keyboard/kcm_keyboard_widget.h b/kcontrol/keyboard/kcm_keyboard_widget.h
index fa912c7..dae0721 100644
--- a/kcontrol/keyboard/kcm_keyboard_widget.h
+++ b/kcontrol/keyboard/kcm_keyboard_widget.h
@@ -21,6 +21,7 @@
 #define KCM_KEYBOARD_WIDGET_H_
 
 #include "ui_kcm_keyboard.h"
+#include "keyboardpainter.h"
 
 #include <kcomponentdata.h>
 #include <QtGui/QTabWidget>
@@ -68,6 +69,7 @@ private Q_SLOTS:
     void moveDown();
     void configureLayoutsChanged();
     void configureXkbOptionsChanged();
+    void previewlayout();
 
 private:
     Rules *rules;
@@ -79,6 +81,7 @@ private:
 	LayoutsTableModel* layoutsTableModel;
 	KCMiscKeyboardWidget* kcmMiscWidget;
 	bool uiUpdating;
+	keyboardpainter *layoutprev;
 
 	void initializeLayoutsUI();
 	void initializeXkbOptionsUI();
diff --git a/kcontrol/keyboard/keyaliases.cpp b/kcontrol/keyboard/keyaliases.cpp
new file mode 100644
index 0000000..d5f31e2
--- /dev/null
+++ b/kcontrol/keyboard/keyaliases.cpp
@@ -0,0 +1,70 @@
+#include "keyaliases.h"
+#include<QString>
+#include<QMap>
+#include<QMessageBox>
+#include<QFile>
+
+Aliases::Aliases()
+{
+    QString filename="/usr/share/X11/xkb/keycodes/aliases";
+    QFile file(filename);
+    file.open(QIODevice::ReadOnly | QIODevice::Text);
+    QString content = file.readAll();
+    file.close();
+    QList<QString>als;
+    als=content.split("xkb_keycodes");
+    for(int i=1;i<als.size();i++){
+        QString temp=als.at(i);
+        temp=temp.remove(" ");
+        temp=temp.remove("\n");
+        temp=temp.remove("\"");
+        temp=temp.remove(">");
+        temp=temp.remove("<");
+        temp=temp.remove(";");
+        temp=temp.remove("}");
+        temp=temp.remove("{");
+        QList<QString>alskeys;
+        alskeys=temp.split("alias");
+        if(temp.startsWith("qwerty")){
+            for(int k=1;k<alskeys.size();k++){
+                QString tmp=alskeys.at(k);
+                int inofeq=tmp.indexOf("=");
+                QString lat=tmp.left(inofeq);
+                QString key=tmp.mid(inofeq+1);
+                qwerty[lat]=key;
+            }
+        }
+        if(temp.startsWith("azerty")){
+            for(int k=1;k<alskeys.size();k++){
+                QString tmp=alskeys.at(k);
+                int inofeq=tmp.indexOf("=");
+                QString lat=tmp.left(inofeq);
+                QString key=tmp.mid(inofeq+1);
+                azerty[lat]=key;
+            }
+      }
+       if(temp.startsWith("qwertz")){
+            for(int k=1;k<alskeys.size();k++){
+                 QString tmp=alskeys.at(k);
+                 int inofeq=tmp.indexOf("=");
+                 QString lat=tmp.left(inofeq);
+                 QString key=tmp.mid(inofeq+1);
+                 qwertz[lat]=key;
+            }
+       }
+   }
+
+}
+
+QString Aliases::getAlias(QString cname, QString name){
+    QMessageBox q;
+    QString a=name;
+    if(cname=="ma"){
+        a=azerty.value(name);
+    }
+    else{
+        a=qwerty.value(name);
+    }
+    return a;
+}
+
diff --git a/kcontrol/keyboard/keyaliases.h b/kcontrol/keyboard/keyaliases.h
new file mode 100644
index 0000000..27ffafa
--- /dev/null
+++ b/kcontrol/keyboard/keyaliases.h
@@ -0,0 +1,16 @@
+#ifndef ALIASES_H
+#define ALIASES_H
+#include<QMap>
+
+class Aliases
+{
+public:
+    Aliases();
+    QMap<QString,QString>qwerty;
+    QMap<QString,QString>azerty;
+    QMap<QString,QString>qwertz;
+
+    QString getAlias(QString type,QString name);
+};
+
+#endif // ALIASES_H
diff --git a/kcontrol/keyboard/keyboard.desktop b/kcontrol/keyboard/keyboard.desktop
index 8854e7b..6dc440c 100644
--- a/kcontrol/keyboard/keyboard.desktop
+++ b/kcontrol/keyboard/keyboard.desktop
@@ -66,7 +66,6 @@ Name[th]=ดีมอนแป้นพิมพ์
 Name[tr]=Klavye Servisi
 Name[ug]=ھەرپتاختا نازارەتچى
 Name[uk]=Фонова служба клавіатури
-Name[vi]=Trình nền b n phím
 Name[wa]=Démon del taprece
 Name[x-test]=xxKeyboard Daemonxx
 Name[zh_CN]=键盘守护进程
diff --git a/kcontrol/keyboard/keyboardlayout.cpp b/kcontrol/keyboard/keyboardlayout.cpp
index 21d9dcf..897ef89 100644
--- a/kcontrol/keyboard/keyboardlayout.cpp
+++ b/kcontrol/keyboard/keyboardlayout.cpp
@@ -3,11 +3,22 @@
 #include"keys.h"
 #include<QMessageBox>
 #include<QFile>
+
+#include <QtGui/QX11Info>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/XKBlib.h>
+#include <X11/extensions/XKBrules.h>
+#include <fixx11h.h>
+#include <config-workspace.h>
+#include<QDir>
+
+
 Keyboardlayout::Keyboardlayout()
 {
 }
-void Keyboardlayout::getLayout(QString a){
-    includeSymbol(a);
+void Keyboardlayout::getLayout(QString a,QString cname){
+    includeSymbol(a,cname);
     int i=a.indexOf("name[Group1]=");
     i+=13;
     QString n=a.mid(i);
@@ -25,7 +36,7 @@ void Keyboardlayout::getLayout(QString a){
     for(int k=0;k<st.size();k++){
         dum.getKey(st.at(k));
         if(dum.keyname.startsWith("Lat"))
-            dum.keyname=latkeys(dum.keyname);
+            dum.keyname=alias.getAlias(cname,dum.keyname);
         if(dum.keyname.contains("AE")){
             QString ind=dum.keyname.right(2);
             int index=ind.toInt();
@@ -85,13 +96,17 @@ void Keyboardlayout::getLayout(QString a){
     q.setText(e);
     q.exec();*/
 }
-void Keyboardlayout::includeSymbol(QString a){
+void Keyboardlayout::includeSymbol(QString a,QString cname){
+    int k=a.indexOf("include");
+    a=a.mid(k);
+    /*QMessageBox x;
+    x.setText(a);
+    x.exec();*/
     QList<QString>tobeinclude;
     tobeinclude=a.split("include");
-    //int k=a.indexOf("include");
-    QMessageBox s;
+    //QMessageBox s;
     QString r;
-    for(int o=0;o<tobeinclude.size();o++){
+    for(int o=1;o<tobeinclude.size();o++){
         QString d=tobeinclude.at(o);
         d.simplified();
     //s.setText(d);
@@ -102,7 +117,7 @@ void Keyboardlayout::includeSymbol(QString a){
         QString incsym=d.left(k);
         incsym.remove(" ");
         incsym.remove("\"");
-        QMessageBox q;
+        //QMessageBox q;
         QList<QString> incfile;
         incfile=incsym.split("(");
         for(int i=0;i<incfile.size();i++){
@@ -121,7 +136,7 @@ void Keyboardlayout::includeSymbol(QString a){
         r.append(incfile.at(1));
     //q.setText(r);
     //q.exec();
-        QString filename="/usr/share/X11/xkb/symbols/";
+        QString filename=findSymbolbasedir();
         filename.append(incfile.at(0));
     //q.setText(filename);
     //q.exec();
@@ -130,71 +145,42 @@ void Keyboardlayout::includeSymbol(QString a){
         QString content = file.readAll();
         QList<QString> symstrlist;
         symstrlist=content.split("xkb_symbols ");
-        for(int u=0;u<symstrlist.size();u++){
+        for(int u=1;u<symstrlist.size();u++){
             QString cur=symstrlist.at(u);
             int pos = cur.indexOf("{");
             cur=cur.left(pos);
             if(cur.contains(incfile.at(1))){
-                getLayout(symstrlist.at(u));
+                getLayout(symstrlist.at(u),cname);
                 break;
             }
         }
     }
 }
-QString Keyboardlayout::latkeys(QString a){
-    if(a.startsWith("Lat")){
-    if(a=="LatQ")
-        return ("AD01");
-    if(a=="LatW")
-        return ("AD02");
-    if(a=="LatE")
-        return ("AD03");
-    if(a=="LatR")
-        return ("AD04");
-    if(a=="LatT")
-        return ("AD05");
-    if(a=="LatY")
-        return ("AD06");
-    if(a=="LatU")
-        return ("AD07");
-    if(a=="LatI")
-        return ("AD08");
-    if(a=="LatO")
-        return ("AD09");
-    if(a=="LatP")
-        return ("AD10");
-    if(a=="LatA")
-        return ("AC01");
-    if(a=="LatS")
-        return ("AC02");
-    if(a=="LatD")
-        return ("AC03");
-    if(a=="LatF")
-        return ("AC04");
-    if(a=="LatG")
-        return ("AC05");
-    if(a=="LatH")
-        return ("AC06");
-    if(a=="LatJ")
-        return ("AC07");
-    if(a=="LatK")
-        return ("AC08");
-    if(a=="LatL")
-        return ("AC09");
-    if(a=="LatZ")
-        return ("AB01");
-    if(a=="LatX")
-        return ("AB02");
-    if(a=="LatC")
-        return ("AB03");
-    if(a=="LatV")
-        return ("AB04");
-    if(a=="LatB")
-        return ("AB05");
-    if(a=="LatN")
-        return ("AB06");
-        return ("AB07");
+
+QString Keyboardlayout::findSymbolbasedir(){
+
+    QString symBasedir;
+    QString xkbParentDir;
+
+    QString base(XLIBDIR);
+    if( base.count('/') >= 3 ) {
+        // .../usr/lib/X11 -> /usr/share/X11/xkb vs .../usr/X11/lib -> /usr/X11/share/X11/xkb
+        QString delta = base.endsWith("X11") ? "/../../share/X11" : "/../share/X11";
+        QDir baseDir(base + delta);
+        if( baseDir.exists() ) {
+            xkbParentDir = baseDir.absolutePath();
+        }
+        else {
+            QDir baseDir(base + "/X11");	// .../usr/X11/lib/X11/xkb (old XFree)
+            if( baseDir.exists() ) {
+                xkbParentDir = baseDir.absolutePath();
+            }
+        }
+    }
+
+    if( xkbParentDir.isEmpty() ) {
+        xkbParentDir = "/usr/share/X11";
     }
-    else
-        return ("a");
+    symBasedir=QString("%1/xkb/symbols/").arg(xkbParentDir);
+    return(symBasedir);
 }
diff --git a/kcontrol/keyboard/keyboardlayout.h b/kcontrol/keyboard/keyboardlayout.h
index 84700dc..d0d56c7 100644
--- a/kcontrol/keyboard/keyboardlayout.h
+++ b/kcontrol/keyboard/keyboardlayout.h
@@ -1,18 +1,20 @@
 #ifndef KEYBOARDLAYOUT_H
 #define KEYBOARDLAYOUT_H
 #include"keys.h"
+#include"keyaliases.h"
 #include<QApplication>
 class Keyboardlayout
 {
 public:
     Keyboardlayout();
     QString Layoutname;
+    Aliases alias;
     Keys AE[12];
     Keys AD[12];
     Keys AC[11];
     Keys AB[11];
-    void getLayout(QString a);
-    void includeSymbol(QString a);
-    QString latkeys(QString a);
+    void getLayout(QString a,QString cname);
+    QString findSymbolbasedir();
+    void includeSymbol(QString a,QString cname);
 };
 #endif // KEYBOARDLAYOUT_H
diff --git a/kcontrol/keyboard/keyboardpainter.cpp b/kcontrol/keyboard/keyboardpainter.cpp
index 403c36a..ce875d0 100644
--- a/kcontrol/keyboard/keyboardpainter.cpp
+++ b/kcontrol/keyboard/keyboardpainter.cpp
@@ -1,25 +1,7 @@
-/*
- *  Copyright (C) 2012 Shivam Makkar (amourphious1992@gmail.com)
- *
- *  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 "keyboardpainter.h"
 #include "ui_keyboardpainter.h"
 
+
 keyboardpainter::keyboardpainter(QWidget *parent) :
     QDialog(parent),
     ui(new Ui::keyboardpainter)
@@ -31,180 +13,242 @@ keyboardpainter::~keyboardpainter()
 {
     delete ui;
 }
+QString keyboardpainter::getvariant(QString variant,QString selectedLayout){
+    if (variant==""){
+        variant="basic";
+        if(selectedLayout=="ma")
+            variant="arabic";
+        if(selectedLayout=="az")
+            variant="latin";
+        if(selectedLayout=="bg")
+            variant="bds";
+        if(selectedLayout=="fi")
+            variant="kotoistus";
+        if(selectedLayout=="ca")
+            variant="fr";
+        if(selectedLayout=="in")
+            variant="deva";
+        if(selectedLayout=="jp")
+            variant="106";
+        if(selectedLayout=="ir")
+            variant="pes";
+        if(selectedLayout=="kr")
+            variant="kr106";
+        if(selectedLayout=="ru")
+            variant="winkeys";
+        if(selectedLayout=="lk")
+            variant="sin_phonetic";
+        if(selectedLayout=="ke")
+            variant="swa";
+        if(selectedLayout=="tz")
+            variant="swa";
+        if(selectedLayout=="tw")
+            variant="tw";
+        if(selectedLayout=="bw")
+            variant="tswana";
+        if(selectedLayout=="ua")
+            variant="unicode";
+        if(selectedLayout=="pk")
+            variant="urd-phonetic";
+        if(selectedLayout=="uz")
+            variant="cyrillic";
+    }
+    return variant;
+}
+
 void keyboardpainter::paintEvent(QPaintEvent *){
 
     //getkeyboardlayout("am","Armenian (eastern)");
+    const QString lev12color="#d4d4d4",lev34color="#FF3300";
     setWindowTitle(kblayout.Layoutname);
     QPainter painter(this);
+    QFont kbfont("Ubuntu",12);
+    painter.setFont(kbfont);
     painter.setBrush(QBrush(Qt::darkGray));
     //painter.setPen(Qt::black);
     //painter.drawText(450,10,kblayout.Layoutname);
     painter.drawRect(0,20,1030,490);
-    painter.setPen(QColor("#d4d4d4"));
+    painter.setPen(QColor(lev12color));
     painter.setBrush(QBrush(Qt::black));
+    int x,y;
+    const int row1x=10,row1y=30;
+    x=row1x;
+    y=row1y;
+
+    const int escsz=50;
+    painter.drawRect(x,y,escsz,escsz);
+    painter.drawText(20,55,"ESC");
 
-    int x=10,y=30;
-    painter.drawRect(x,y,50,50);
-    QChar a=0xa4;
-    QString b=QString(a);
-    painter.drawText(20,55,b);
-    int spacex=50;
-    x+=50;
+    const int spacex=50;
+    x+=spacex;
+
+    const int fnkeyspace=60,fnkeysizex=50,fnkeysizey=50;
     int f=1;
     QString str;
     for(int i=0;i<3;i++){
         x+=spacex;
         for(int j=0;j<4;j++){
-            x+=60;
-            painter.drawRect(x,y,50,50);
+            x+=fnkeyspace;
+            painter.drawRect(x,y,fnkeysizex,fnkeysizey);
             painter.drawText(x+15,y+30,"F");
             painter.drawText(x+20,y+30,str.setNum(f));
             f++;
         }
     }
 
-    x=10;
-    y=90;
+    const int kszx=70,kszy=70;
+
+    const int row2x=10,row2y=90;
+    x=row2x;
+    y=row2y;
 
-    painter.drawRect(x,y,70,70);
+    painter.drawRect(x,y,kszx,kszy);
     painter.drawText(x+5,y+20,"~");
     painter.drawText(x+5,y+60,"`");
-    f=1;
     for(int i=0;i<12;i++){
-        x+=70;
-        painter.drawRect(x,y,70,70);
+        x+=kszx;
+        painter.drawRect(x,y,kszx,kszy);
         for(int j=0;j<kblayout.AE[i].klst.size();j++){
-            /*QMessageBox fg;
-            fg.setText("H!");
-            fg.exec();*/
-            if(j==1){
-                /*QMessageBox fg;*/
-
-                QString p;
-                p=kblayout.AE[i].klst.at(1);
-                painter.drawText(x+5,y+20,symbol.getkeyuni(p));
-            }
-            if(j==0){
-                //fg.setText("H2");
-
-                painter.drawText(x+5,y+60,symbol.getkeyuni(kblayout.AE[i].klst.at(0)));
-
-            }
+            if(j==1)
+                painter.drawText(x+15,y+10,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AE[i].klst.at(1)));
 +            if(j==0)
+                painter.drawText(x+15,y+40,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AE[i].klst.at(0)));
 +            painter.setPen(QColor(lev34color));
             if(j==2)
-                painter.drawText(x+60,y+60,symbol.getkeyuni(kblayout.AE[i].klst.at(2)));
+                painter.drawText(x+40,y+40,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AE[i].klst.at(2)));
  if(j==3)
-                painter.drawText(x+60,y+20,symbol.getkeyuni(kblayout.AE[i].klst.at(3)));
+                painter.drawText(x+40,y+25,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AE[i].klst.at(3)));
 +            painter.setPen(QColor(lev12color));
         }
-        f++;
     }
-    x+=70;
-    painter.drawRect(x,y,100,70);
+    x+=kszx;
+
+    const int bkspszx=100;
+
+    painter.drawRect(x,y,bkspszx,kszy);
     painter.drawText(x+10,y+20,"<--");
     painter.drawText(x+10,y+60,"Backspace");
 
-    x=10;
-    y=170;
+    const int row3x=10,row3y=170;
+    x=row3x;
+    y=row3y;
 
-    painter.drawRect(x,y,100,70);
-    painter.drawText(x+10,y+20,"<--");
-    painter.drawText(x+10,y+25,"-->");
+    const int tabszx=100;
+
+    painter.drawRect(x,y,tabszx,kszy);
+    painter.drawText(x+20,y+25,"<--");
+    painter.drawText(x+15,y+35,"-->");
     painter.drawText(x+10,y+60,"TAB");
-    x+=100;
+    x+=tabszx;
 
     for(int i=0;i<12;i++){
-        painter.drawRect(x,y,70,70);
+        painter.drawRect(x,y,kszx,kszy);
         for(int j=0;j<kblayout.AD[i].klst.size();j++){
-            /*QMessageBox fg;
-            fg.setText("H3");
-            fg.exec();*/
             if(j==1)
-                painter.drawText(x+5,y+20,symbol.getkeyuni(kblayout.AD[i].klst.at(1)));
+                painter.drawText(x+15,y+10,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AD[i].klst.at(1)));
  if(j==0)
-                painter.drawText(x+5,y+60,symbol.getkeyuni(kblayout.AD[i].klst.at(0)));
+                painter.drawText(x+15,y+40,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AD[i].klst.at(0)));
 +            painter.setPen(QColor(lev34color));
             if(j==2)
-                painter.drawText(x+60,y+60,symbol.getkeyuni(kblayout.AD[i].klst.at(2)));
+                painter.drawText(x+40,y+40,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AD[i].klst.at(2)));
  if(j==3)
-                painter.drawText(x+60,y+20,symbol.getkeyuni(kblayout.AD[i].klst.at(3)));
+                painter.drawText(x+40,y+25,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AD[i].klst.at(3)));
 +            painter.setPen(QColor(lev12color));
         }
-        x+=70;
+        x+=kszx;
     }
-    x+=100;
-    painter.drawRect(x,y,400,70);
 
-    painter.drawRect(x,y,70,70);
-    painter.drawText(x+10,y+20,"|");
-    painter.drawText(x+10,y+60,"\\");
+    painter.drawRect(x,y,kszx,kszy);
+    painter.drawText(x+20,y+20,"|");
+    painter.drawText(x+20,y+60,"\\");
 
-    x=10;
-    y=250;
-    painter.drawRect(x,y,100,70);
+    const int row4x=10,row4y=250;
+
+    x=row4x;
+    y=row4y;
+
+    const int capszx=100;
+
+    painter.drawRect(x,y,capszx,kszy);
     painter.drawText(x+10,y+20,"^");
     painter.drawText(x+10,y+60,"Caps Lock");
-    x+=100;
+    x+=capszx;
 
     for(int i=0;i<11;i++){
-        painter.drawRect(x,y,70,70);
+        painter.drawRect(x,y,kszx,kszy);
         for(int j=0;j<kblayout.AC[i].klst.size();j++){
-            /*QMessageBox fg;
-            fg.setText("H4");
-            fg.exec();*/
             if(j==1)
-                painter.drawText(x+5,y+20,symbol.getkeyuni(kblayout.AC[i].klst.at(1)));
+                painter.drawText(x+15,y+10,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AC[i].klst.at(1)));
  if(j==0)
-                painter.drawText(x+5,y+60,symbol.getkeyuni(kblayout.AC[i].klst.at(0)));
+                painter.drawText(x+15,y+40,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AC[i].klst.at(0)));
 +            painter.setPen(QColor(lev34color));
             if(j==2)
-                painter.drawText(x+60,y+60,symbol.getkeyuni(kblayout.AC[i].klst.at(2)));
+                painter.drawText(x+40,y+40,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AC[i].klst.at(2)));
  if(j==3)
-                painter.drawText(x+60,y+20,symbol.getkeyuni(kblayout.AC[i].klst.at(3)));
+                painter.drawText(x+40,y+25,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AC[i].klst.at(3)));
 +            painter.setPen(QColor(lev12color));
         }
-        x+=70;
+        x+=kszx;
     }
 
-    painter.drawRect(x,y,140,70);
+    const int retsz=140;
+
+    painter.drawRect(x,y,retsz,kszy);
     painter.drawText(x+90,y+20,"|");
     painter.drawText(x+75,y+25,"<--");
     painter.drawText(x+10,y+60,"Enter");
 
-    x=10;
-    y=330;
+    const int row5x=10,row5y=330;
 
-    painter.drawRect(x,y,155,70);
+    x=row5x;
+    y=row5y;
+
+    const int shiftsz=155;
+
+    painter.drawRect(x,y,shiftsz,kszy);
     painter.drawText(x+10,y+60,"SHIFT");
-    x+=155;
+    x+=shiftsz;
 
     for(int i=0;i<10;i++){
-        painter.drawRect(x,y,70,70);
+        painter.drawRect(x,y,kszx,kszy);
         for(int j=0;j<kblayout.AB[i].klst.size();j++){
             if(j==1)
-                painter.drawText(x+5,y+20,symbol.getkeyuni(kblayout.AB[i].klst.at(1)));
+                painter.drawText(x+15,y+10,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AB[i].klst.at(1)));
  if(j==0)
-                painter.drawText(x+5,y+60,symbol.getkeyuni(kblayout.AB[i].klst.at(0)));
+                painter.drawText(x+15,y+40,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AB[i].klst.at(0)));
 +            painter.setPen(QColor(lev34color));
             if(j==2)
-                painter.drawText(x+60,y+60,symbol.getkeyuni(kblayout.AB[i].klst.at(2)));
+                painter.drawText(x+40,y+40,20,20,Qt::AlignBottom,symbol.getkeyuni(kblayout.AB[i].klst.at(2)));
  if(j==3)
-                painter.drawText(x+60,y+20,symbol.getkeyuni(kblayout.AB[i].klst.at(3)));
+                painter.drawText(x+40,y+25,20,20,Qt::AlignTop,symbol.getkeyuni(kblayout.AB[i].klst.at(3)));
 +            painter.setPen(QColor(lev12color));
         }
-        x+=70;
+        x+=kszx;
     }
-    painter.drawRect(x,y,155,70);
+    painter.drawRect(x,y,shiftsz,kszy);
     painter.drawText(x+10,y+60,"SHIFT");
 
-    x=110;
-    y=410;
+    const int row6x=110,row6y=410;
+    const int ctrlsz=100,altsz=100,spsz=400;
 
-    painter.drawRect(x,y,100,70);
+    x=row6x;
+    y=row6y;
+
+    painter.drawRect(x,y,ctrlsz,kszy);
     painter.drawText(x+30,y+35,"Ctrl");
-    x+=100;
-    painter.drawRect(x,y,100,70);
+    x+=ctrlsz;
+    painter.drawRect(x,y,altsz,kszy);
     painter.drawText(x+30,y+35,"Alt");
-    x+=100;
-    painter.drawRect(x,y,400,70);
-    x+=400;
-    painter.drawRect(x,y,100,70);
+    x+=altsz;
+    painter.drawRect(x,y,spsz,kszy);
+    x+=spsz;
+    painter.drawRect(x,y,ctrlsz,kszy);
     painter.drawText(x+30,y+35,"Ctrl");
-    x+=100;
-    painter.drawRect(x,y,100,70);
-    painter.drawText(x+30,y+35,"Alt");
+    x+=ctrlsz;
+    painter.drawRect(x,y,altsz,kszy);
+    painter.setPen(QColor("#FF3300"));
+    painter.drawText(x+30,y+35,"AltGr");
+    painter.setPen(QColor("#d4d4d4"));
 
     if(symbol.nill>=120){
         painter.drawRect(0,0,1030,490);
@@ -213,8 +257,11 @@ void keyboardpainter::paintEvent(QPaintEvent *){
 
 
 }
+
+
+
 void keyboardpainter::getkeyboardlayout(QString country, QString layoutvariant){
-    QString filename="/usr/share/X11/xkb/symbols/";
+    QString filename=kblayout.findSymbolbasedir();
     filename.append(country);
     QFile file(filename);
     file.open(QIODevice::ReadOnly | QIODevice::Text);
@@ -234,7 +281,7 @@ void keyboardpainter::getkeyboardlayout(QString country, QString layoutvariant){
         f.append("\"");
         f=f.remove(" ");
         if(h==f){
-            kblayout.getLayout(symstr.at(i));
+            kblayout.getLayout(symstr.at(i),country);
             /*QString e;
             e=kblayout.Layoutname;
             for(int l=0;l<12;l++){
diff --git a/kcontrol/keyboard/keyboardpainter.h b/kcontrol/keyboard/keyboardpainter.h
index 9c09bf2..27886e0 100644
--- a/kcontrol/keyboard/keyboardpainter.h
+++ b/kcontrol/keyboard/keyboardpainter.h
@@ -1,22 +1,3 @@
-/*
- *  Copyright (C) 2012 Shivam Makkar (amourphious1992@gmail.com)
- *
- *  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 KEYBOARDPAINTER_H
 #define KEYBOARDPAINTER_H
 
@@ -37,6 +18,7 @@ public:
     void paintEvent(QPaintEvent *);
     Keyboardlayout kblayout;
     Keysym symbol;
+    QString getvariant(QString variant,QString selectedLayout);
     void getkeyboardlayout(QString County,QString layoutvariant);
     ~keyboardpainter();
     
diff --git a/kcontrol/keyboard/keys.cpp b/kcontrol/keyboard/keys.cpp
index 504aaa5..83fa6ba 100644
--- a/kcontrol/keyboard/keys.cpp
+++ b/kcontrol/keyboard/keys.cpp
@@ -1,22 +1,3 @@
-/*
- *  Copyright (C) 2012 Shivam Makkar (amourphious1992@gmail.com)
- *
- *  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 "keys.h"
 #include<QApplication>
 #include<QStringList>
diff --git a/kcontrol/keyboard/keys.h b/kcontrol/keyboard/keys.h
index e5aa301..d7f58d6 100644
--- a/kcontrol/keyboard/keys.h
+++ b/kcontrol/keyboard/keys.h
@@ -1,22 +1,3 @@
-/*
- *  Copyright (C) 2012 Shivam Makkar (amourphious1992@gmail.com)
- *
- *  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 KEYS_H
 #define KEYS_H
 #include<QApplication>
diff --git a/kcontrol/keyboard/keysym.cpp b/kcontrol/keyboard/keysym.cpp
index 4f98b56..12b6830 100644
--- a/kcontrol/keyboard/keysym.cpp
+++ b/kcontrol/keyboard/keysym.cpp
@@ -1,22 +1,3 @@
-/*
- *  Copyright (C) 2012 Shivam Makkar (amourphious1992@gmail.com)
- *
- *  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 "keysym.h"
 #include<QMessageBox>
 #include<QChar>
diff --git a/kcontrol/keyboard/keysym.h b/kcontrol/keyboard/keysym.h
index 19f7862..4ac4a23 100644
--- a/kcontrol/keyboard/keysym.h
+++ b/kcontrol/keyboard/keysym.h
@@ -1,22 +1,3 @@
-/*
- *  Copyright (C) 2012 Shivam Makkar (amourphious1992@gmail.com)
- *
- *  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 KEYSYM_H
 #define KEYSYM_H
 #include<QtGui>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic