[yast-commit] r66190 - /branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp
Author: lslezak Date: Fri Sep 30 14:29:10 2011 New Revision: 66190 URL: http://svn.opensuse.org/viewcvs/yast?rev=66190&view=rev Log: gameport joysticks - display the sound card to which it is connected 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=66190&r1=66189&r2=66190&view=diff ============================================================================== --- branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp (original) +++ branches/tmp/lslezak/sound/sound/src/joy_dialog.ycp Fri Sep 30 14:29:10 2011 @@ -492,9 +492,6 @@ // label above list of joystick types `SelectionBox(`id(`os), _("&Select your joystick type:"), boxitems), - `HSpacing(3), - // button label - `PushButton(`id(`test), `opt(`key_F6), _("&Test")), `HSpacing(3) ), `VSpacing(3) @@ -530,18 +527,6 @@ ")); s = `skip; } - - if (s == `test) - { - integer idx = (integer) UI::QueryWidget(`id(`os), `CurrentItem); - string joymod = joylist[idx,0]:""; - if (joymod == "") - // error message (no joystick selected) - Popup::Message(_("Select the joystick to test.")); - else if (Package::InstallAll(["input-utils"])) - joy_test_popup (card_id, idx, joymod); - } - } while (!contains([`next, `back, `abort, `cancel], s)); if (s == `next) @@ -597,6 +582,7 @@ list<map<string,any> > content = []; foreach(map js, Joystick::Detected(), { + y2milestone("Addind joystick: %1", js); string device = js["dev_name2"]:""; string model = js["model"]:""; list<string> descr = []; @@ -611,9 +597,25 @@ descr = add(descr, sformat(_("Number of buttons: %1"), js["detail","buttons"]:0)); } + string bus = js["bus"]:""; + + if (bus == "Gameport" && size(js["parent_unique_key"]:"") > 0) + { + list<map> soundcards = (list<map>)SCR::Read(.probe.sound); + string unique_id = js["parent_unique_key"]:""; + + map card = find(map c, soundcards, {return c["unique_key"]:"" == unique_id;}); + + if (card != nil) + { + // joystick details, %1 is the sound card name to which is the joystick connected + bus = sformat("%1 (%2)", bus, card["model"]:""); + } + } + map<string,any> j = $[ "id" : device, - "table_descr" : [ js["model"]:"", device, js["bus"]:"" ], + "table_descr" : [ js["model"]:"", device, bus ], "rich_descr" : WizardHW::CreateRichTextDescription(model, descr) ]; @@ -830,7 +832,7 @@ { list<list> extra_buttons = [ // menu item - [`test, _("&Test...")], + [`test, _("&Test selected joystick...")], ]; // dialog title @@ -924,7 +926,7 @@ } } - y2internal("Joystick overview result: %1", ret); + y2milestone("Joystick overview result: %1", ret); return ret; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn2.opensuse.org