Author: lslezak
Date: Fri Oct 7 14:08:34 2011
New Revision: 66327
URL: http://svn.opensuse.org/viewcvs/yast?rev=66327&view=rev
Log:
added USB joystick hotplug support - refresh the joystick list in the
overview table when an USB joystick is connected/disconnected
(checks mtime change of /dev/input every 2 seconds, joystick detection is
started again on a change)
Modified:
branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp
Modified: branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp?rev=66327&r1=66326&r2=66327&view=diff
==============================================================================
--- branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp (original)
+++ branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp Fri Oct 7 14:08:34 2011
@@ -672,6 +672,11 @@
return sound_cards;
}
+ integer input_mtime()
+ {
+ return ((map)SCR::Read(.target.stat, "/dev/input"))["mtime"]:0;
+ }
+
define symbol joystick_overview()
{
list<list> extra_buttons = [
@@ -700,13 +705,27 @@
Wizard::SetNextButton(`next, Label::FinishButton());
symbol ret = `dummy;
+ integer mtime = input_mtime();
while (!contains([`abort, `back, `next],ret))
{
- map