[yast-commit] r66300 - in /branches/tmp/lslezak/sound/sound/src: Joystick.ycp joystick.ycp
Author: lslezak Date: Thu Oct 6 15:19:04 2011 New Revision: 66300 URL: http://svn.opensuse.org/viewcvs/yast?rev=66300&view=rev Log: revert the joystick config after pressing Abort Modified: branches/tmp/lslezak/sound/sound/src/Joystick.ycp branches/tmp/lslezak/sound/sound/src/joystick.ycp Modified: branches/tmp/lslezak/sound/sound/src/Joystick.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/sound/sound/src/Joystick.ycp?rev=66300&r1=66299&r2=66300&view=diff ============================================================================== --- branches/tmp/lslezak/sound/sound/src/Joystick.ycp (original) +++ branches/tmp/lslezak/sound/sound/src/Joystick.ycp Thu Oct 6 15:19:04 2011 @@ -51,6 +51,15 @@ detected_joysticks = (list<map>)SCR::Read(.probe.joystick); } + /* Reverts the internal joystick configuration to the original state + * read by Read() function + */ + global void Revert() + { + y2milestone("Reverting the joystick config back to: %1", joystick_backup); + joystick = joystick_backup; + } + /** * Get list of all required joystick kernel modules * @return list list of modules Modified: branches/tmp/lslezak/sound/sound/src/joystick.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/sound/sound/src/joystick.ycp?rev=66300&r1=66299&r2=66300&view=diff ============================================================================== --- branches/tmp/lslezak/sound/sound/src/joystick.ycp (original) +++ branches/tmp/lslezak/sound/sound/src/joystick.ycp Thu Oct 6 15:19:04 2011 @@ -70,28 +70,48 @@ return `next; } + // revert the joystick configuration back to the original state after pressing Abort + symbol revert_config() + { + if (Joystick::Changed()) + { + y2milestone("Reverting joystick configuration"); + Joystick::Revert(); + + saveconfig(); + } + + // the Abort button has been pressed, just pass it further + return `abort; + } + /********************** MAIN ************************/ symbol StartGUI() { // sequence of dialogs map sequence = $[ - "ws_start" : "detect", + "ws_start" : "config", - "detect" : $[ + "config" : $[ `next : "save", - `abort : `abort, + `abort : "revert", ], "save" : $[ `next : `ws_finish + ], + + "revert" : $[ + `abort : `abort ] ]; // aliases for dialogs map aliases = $[ - "detect" : ``(joystick_configuration()), - "save" : ``(saveconfig()) + "config" : ``(joystick_configuration()), + "save" : ``(saveconfig()), + "revert" : ``(revert_config()) ]; // create wizard dialog -- 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