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

List:       kde-core-devel
Subject:    keyboard2 moved to kdereview
From:       Andriy Rysin <arysin () gmail ! com>
Date:       2010-04-26 2:18:11
Message-ID: o2t3e02eb611004251918ob5ccd8f4v8fe6930fc8e4fb79 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all

I've moved new keyboard control module in kdereview under keyboard2 name.

keyboard2 is new project to replace keyboard (kcmmisc) and kxkb modules to
manage keyboard hardware configuration and layouts.

The project provides: kded daemon, plasma applet, layout widget for
embedding and new kcm configuration module.

Keyboard daemon:
* configures keyboard layouts on start
* provides DBUS API "org.kde.KXKB/kxkb"
* listens to window/desktop switching if layout switch mode is not global
* listens to new keyboard devices and reinitializes keyboard layouts
* listens to Global KDE Shortcut to switch layouts (and listens to their
change)
* listens to keyboard configuration change
* provides systray icon to show layout

Keyboard applet:
* displays current layout with text and (optionally flag)

Layout widget:
* displays current layout with text (currently no flag or tooltip) embedded
in another widget
* dynamically loaded as a plugin

KCM Module:
* allows to configure keyboard hardware, layouts and xkb options (advanced)
in one module

Advantages (over old code):
* One UI module to configure keyboard layouts and hardware
* Allows to configure keyboard model/xkb options without configuring layouts
* Less cluttered layout configuration control (add layout is separate)
* Layout control/DBus interface is separate from the indicator
* Does not require libxklavier (parses rules xml directly with QtXml)
* Takes country/language names/translations from iso-codes project
* Information about current layouts is always taken from X server, so should
be more robust
* Cleaner code (rewritten from scratch)
* Due to many points above should start faster (though no benchmarks
performed)

New features:
* Allow selection of keyboard layout by language

More info is in the README and TODO.


The UI is a bit rough around the edges (need to work on UI layout in KCM,
possibly merge text with flag in the layouts table, some better drawing of
text in the icon etc) and code could be a bit improved (some optimization
like text-drawn pixmap caching and smarter library linking) but all features
should be working.

I did not like the way the text was drawn over the flag before but could not
find a better way yet, so in the systray icon for now it's either flag or
text. This is a bit different and I am not sure I like it yet :) so if
people like the old way better it'll be fairly easy to revert it back (and
of course people who don't want flags would not care :) ). Also for drawing
the text I need to find a way to leave the taskbar background (but this was
also the problem before).

If you're willing to try, you'll have to check out keyboard2 into
kdebase/workspace/kcontrol and apply the cmake patch attached
(keyboard2_cmakefile.patch). You may need to remove old kxkb and kcmmisc
kcms so they don't interfere though. Also the second patch is for krunner's
lockdlg if you want to try that one too.

I tried to preserve the translation messages from the old modules as much as
I could and even provided Messages.sh but did not do much testing in this
area. Not sure what the best way to decrease the amount translators have to
redo so any help is appreciated.

Also I ran it via krazy so should be fairly clean in this regards.

I was carving out some time by bits and pieces and was doing this rewrite
for half a year now so I am hoping to get some (hopefully positive) feedback
:), so comments and suggestions are very welcome

Thanks,
Andriy

[Attachment #5 (text/html)]

Hi all<br><br>I&#39;ve moved new keyboard control module in kdereview under=
 keyboard2 name.<br><br>keyboard2 is new project to replace keyboard (kcmmi=
sc) and kxkb modules to manage keyboard hardware configuration and layouts.=
<br>
<br>The project provides: kded daemon, plasma applet, layout widget for emb=
edding and new kcm configuration module.<br><br>Keyboard daemon:<br>* confi=
gures keyboard layouts on start<br>* provides DBUS API &quot;org.kde.KXKB/k=
xkb&quot;<br>
* listens to window/desktop switching if layout switch mode is not global<b=
r>* listens to new keyboard devices and reinitializes keyboard layouts<br>*=
 listens to Global KDE Shortcut to switch layouts (and listens to their cha=
nge)<br>
* listens to keyboard configuration change<br>* provides systray icon to sh=
ow layout<br><br>Keyboard applet:<br>* displays current layout with text an=
d (optionally flag)<br><br>Layout widget:<br>* displays current layout with=
 text (currently no flag or tooltip) embedded in another widget<br>
* dynamically loaded as a plugin<br><br>KCM Module:<br>* allows to configur=
e keyboard hardware, layouts and xkb options (advanced) in one module<br><b=
r>Advantages (over old code):<br>* One UI module to configure keyboard layo=
uts and hardware<br>
* Allows to configure keyboard model/xkb options without configuring layout=
s<br>* Less cluttered layout configuration control (add layout is separate)=
<br>* Layout control/DBus interface is separate from the indicator<br>* Doe=
s not require libxklavier (parses rules xml directly with QtXml)<br>
* Takes country/language names/translations from iso-codes project<br>* Inf=
ormation about current layouts is always taken from X server, so should be =
more robust<br>* Cleaner code (rewritten from scratch)<br>* Due to many poi=
nts above should start faster (though no benchmarks performed)<br>
<br>New features:<br>* Allow selection of keyboard layout by language<br><b=
r>More info is in the README and TODO.<br><br><br>The UI is a bit rough aro=
und the edges (need to work on UI layout in KCM, possibly merge text with f=
lag in the layouts table, some better drawing of text in the icon etc) and =
code could be a bit improved (some optimization like text-drawn pixmap cach=
ing and smarter library linking) but all features should be working.<br>
<br>I did not like the way the text was drawn over the flag before but coul=
d not find a better way yet, so in the systray icon for now it&#39;s either=
 flag or text. This is a bit different and I am not sure I like it yet :) s=
o if people like the old way better it&#39;ll be fairly easy to revert it b=
ack (and of course people who don&#39;t want flags would not care :) ). Als=
o for drawing the text I need to find a way to leave the taskbar background=
 (but this was also the problem before).<br>
<br>If you&#39;re willing to try, you&#39;ll have to check out keyboard2 in=
to kdebase/workspace/kcontrol and apply the cmake patch attached (keyboard2=
_cmakefile.patch). You may need to remove old kxkb and kcmmisc kcms so they=
 don&#39;t interfere though. Also the second patch is for krunner&#39;s loc=
kdlg if you want to try that one too.<br>
<br>I tried to preserve the translation messages from the old modules as mu=
ch as I could and even provided Messages.sh but did not do much testing in =
this area. Not sure what the best way to decrease the amount translators ha=
ve to redo so any help is appreciated.<br>
<br>Also I ran it via krazy so should be fairly clean in this regards.<br><=
br>I was carving out some time by bits and pieces and was doing this rewrit=
e for half a year now so I am hoping to get some (hopefully positive) feedb=
ack :), so comments and suggestions are very welcome <br>
<br>Thanks,<br>Andriy<br><br>

--001636284370b8d59904851a632e--
["keyboard2_cmakefile.patch" (text/x-patch)]

Index: workspace/kcontrol/CMakeLists.txt
===================================================================
--- workspace/kcontrol/CMakeLists.txt	(revision 1111059)
+++ workspace/kcontrol/CMakeLists.txt	(working copy)
@@ -11,8 +11,9 @@
 endif(X11_Xrandr_FOUND )
 
 if(X11_Xkb_FOUND)
-    add_subdirectory( kxkb )
-    add_subdirectory( keyboard )
+#    add_subdirectory( kxkb )
+#    add_subdirectory( keyboard )
+    add_subdirectory( keyboard2 )
 endif(X11_Xkb_FOUND)
 
 if(NOT WIN32)

["lockdlg_kxkb_to_keyboard2.patch" (text/x-patch)]

Index: lockdlg.cc
===================================================================
--- lockdlg.cc	(revision 1111059)
+++ lockdlg.cc	(working copy)
@@ -115,14 +115,14 @@
     cancel = new KPushButton( KStandardGuiItem::cancel(), w );
     mNewSessButton = new KPushButton( KGuiItem(i18n("Sw&itch User..."), "fork"), w );
 
-    // Using KXKB component
-    KPluginFactory *kxkbFactory = KPluginLoader("libkdeinit4_kxkb").factory();
+    // Using keyboard layout component
+    KPluginFactory *kxkbFactory = KPluginLoader("keyboard_layout_widget").factory();
     QWidget *kxkbComponent = NULL;
     if (kxkbFactory) {
         kxkbComponent = kxkbFactory->create<QWidget>(this);
     }
     else {
-        kDebug() << "can't load kxkb component library";
+        kDebug() << "can't load keyboard layout widget library";
     }
 
     QHBoxLayout *layStatus = new QHBoxLayout();
@@ -130,8 +130,11 @@
     layStatus->addWidget( mStatusLabel );
     layStatus->addStretch();
 
-    if( kxkbComponent )
+    if( kxkbComponent ) {
+	//TODO: without this the widget is off the parent area, but we need something better here
+        kxkbComponent->setFixedSize(48, 24);
         layStatus->addWidget( kxkbComponent, 0, Qt::AlignRight );
+    }
 
     QHBoxLayout *layButtons = new QHBoxLayout();
     layButtons->addWidget( mNewSessButton );
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1111059)
+++ CMakeLists.txt	(working copy)
@@ -27,15 +27,8 @@
 set(kscreensaver_xml  ${KDEBASE_WORKSPACE_SOURCE_DIR}/krunner/dbus/org.kde.screensaver.xml)
 QT4_ADD_DBUS_INTERFACE(kscreenlocker_SRCS ${kscreensaver_xml} kscreensaver_interface)
 
-set(kxkb_adaptor ${KDEBASE_WORKSPACE_SOURCE_DIR}/kcontrol/kxkb/kxkb_adaptor.h)
-set(kxkb_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KXKB.xml)
-ADD_CUSTOM_COMMAND(OUTPUT ${kxkb_xml}
-       COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${kxkb_adaptor} > ${kxkb_xml}
-       DEPENDS ${kxkb_adaptor})
-QT4_ADD_DBUS_INTERFACE( kscreenlocker_SRCS ${kxkb_xml} kxkb_interface )
 
 
-
 kde4_add_kcfg_files(kscreenlocker_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../kcfg/kscreensaversettings.kcfgc)
 
 


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

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