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

List:       kde-commits
Subject:    [plasma-desktop/andriy/keyboard] kcms/keyboard: port UI code to kf5
From:       Andriy Rysin <arysin () gmail ! com>
Date:       2014-10-06 16:26:16
Message-ID: E1XbB72-0004ji-5o () scm ! kde ! org
[Download RAW message or body]

Git commit 1ff960d271a0fd6ab091ecc1506ee2413859ca80 by Andriy Rysin.
Committed on 06/10/2014 at 15:09.
Pushed by rysin into branch 'andriy/keyboard'.

port UI code to kf5

M  +2    -1    kcms/keyboard/kcm_keyboard_widget.cpp
M  +6    -4    kcms/keyboard/kcmmisc.cpp
M  +6    -18   kcms/keyboard/kcmmiscwidget.ui
M  +0    -1    kcms/keyboard/layouts_menu.cpp

http://commits.kde.org/plasma-desktop/1ff960d271a0fd6ab091ecc1506ee2413859ca80

diff --git a/kcms/keyboard/kcm_keyboard_widget.cpp b/kcms/keyboard/kcm_keyboard_widget.cpp
index 0f55173..c3f344b 100644
--- a/kcms/keyboard/kcm_keyboard_widget.cpp
+++ b/kcms/keyboard/kcm_keyboard_widget.cpp
@@ -641,7 +641,8 @@ void KCMKeyboardWidget::updateShortcutsUI()
 
 	delete actionCollection;
 	actionCollection = new KeyboardLayoutActionCollection(this, true);
-	QAction* toggleAction = actionCollection->getToggeAction();
+	//QAction* toggleAction = 
+	actionCollection->getToggeAction();
 //    const auto shortcuts = KGlobalAccel::self()->shortcut(toggleAction);
 //    uiWidget->kdeKeySequence->setKeySequence(shortcuts.isEmpty() ? QKeySequence() : \
shortcuts.first());  //    actionCollection->loadLayoutShortcuts(keyboardConfig->layouts, rules);
diff --git a/kcms/keyboard/kcmmisc.cpp b/kcms/keyboard/kcmmisc.cpp
index c63d06b..c13946e 100644
--- a/kcms/keyboard/kcmmisc.cpp
+++ b/kcms/keyboard/kcmmisc.cpp
@@ -30,11 +30,12 @@
 #include <QCheckBox>
 #include <QWhatsThis>
 #include <QX11Info>
+#include <QSpinBox>
+#include <QDoubleSpinBox>
 
 #include <klocale.h>
 #include <kconfig.h>
 #include <KConfigGroup>
-#include <knuminput.h>
 
 #include <X11/Xlib.h>
 
@@ -45,9 +46,10 @@ KCMiscKeyboardWidget::KCMiscKeyboardWidget(QWidget *parent)
 {
   ui.setupUi(this);
 
-  ui.delay->setRange(100, 5000, 50);
-  ui.delay->setSliderEnabled(false);
-  ui.rate->setRange(0.2, 50, 5, false);
+  ui.delay->setRange(100, 5000);
+  ui.delay->setSingleStep(50);
+  ui.rate->setRange(0.2, 50);
+  ui.rate->setSingleStep(5);
 
   sliderMax = (int)floor (0.5 + 2*(log(5000.0L)-log(100.0L)) / (log(5000.0L)-log(4999.0L)));
   ui.delaySlider->setRange(0, sliderMax);
diff --git a/kcms/keyboard/kcmmiscwidget.ui b/kcms/keyboard/kcmmiscwidget.ui
index 37fbaf4..eefe235 100644
--- a/kcms/keyboard/kcmmiscwidget.ui
+++ b/kcms/keyboard/kcmmiscwidget.ui
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>577</width>
-    <height>361</height>
+    <height>401</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout">
@@ -36,7 +36,7 @@
          <item row="1" column="0">
           <widget class="QRadioButton" name="RadioButton1_2">
            <property name="text">
-            <string>Turn o&amp;ff</string>
+            <string>&amp;Turn off</string>
            </property>
           </widget>
          </item>
@@ -82,7 +82,7 @@
          <item row="2" column="0">
           <widget class="QRadioButton" name="keyboardRepeatUnchangedRadioButton">
            <property name="text">
-            <string>Leave unchan&amp;ged</string>
+            <string>&amp;Leave unchanged</string>
            </property>
           </widget>
          </item>
@@ -156,7 +156,7 @@
           </widget>
          </item>
          <item row="0" column="2">
-          <widget class="KIntNumInput" name="delay">
+          <widget class="QSpinBox" name="delay">
            <property name="whatsThis">
             <string>If supported, this option allows you to set the delay after which a pressed key will \
start generating keycodes. The 'Repeat rate' option controls the frequency of these keycodes.</string>  \
</property> @@ -210,7 +210,7 @@
           </widget>
          </item>
          <item row="1" column="2">
-          <widget class="KDoubleNumInput" name="rate">
+          <widget class="QDoubleSpinBox" name="rate">
            <property name="whatsThis">
             <string>If supported, this option allows you to set the rate at which keycodes are generated \
while a key is pressed.</string>  </property>
@@ -260,7 +260,7 @@
            <string>If supported, this option allows you to hear audible clicks from your computer's \
speakers when you press the keys on your keyboard. This might be useful if your keyboard does not have \
mechanical keys, or if the sound that the keys make is very soft.&lt;p&gt;You can change the loudness of \
the key click feedback by dragging the slider button or by clicking the up/down arrows on the spin box. \
Setting the volume to 0% turns off the key click.</string>  </property>
           <property name="text">
-           <string>Key click &amp;volume:</string>
+           <string>&amp;Key click volume:</string>
           </property>
           <property name="buddy">
            <cstring>click</cstring>
@@ -312,23 +312,11 @@
  </widget>
  <customwidgets>
   <customwidget>
-   <class>KDoubleNumInput</class>
-   <extends>QWidget</extends>
-   <header>knuminput.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
    <class>KButtonGroup</class>
    <extends>QGroupBox</extends>
    <header>kbuttongroup.h</header>
    <container>1</container>
   </customwidget>
-  <customwidget>
-   <class>KIntNumInput</class>
-   <extends>QWidget</extends>
-   <header>knuminput.h</header>
-   <container>1</container>
-  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
diff --git a/kcms/keyboard/layouts_menu.cpp b/kcms/keyboard/layouts_menu.cpp
index 82c3e2c..fefa0e4 100644
--- a/kcms/keyboard/layouts_menu.cpp
+++ b/kcms/keyboard/layouts_menu.cpp
@@ -18,7 +18,6 @@
 
 #include "layouts_menu.h"
 
-#include <kmenu.h>
 #include <ktoolinvocation.h>
 #include <klocalizedstring.h>
 


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

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