home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / YaST2 / clients / keyboard_proposal.ycp < prev    next >
Text File  |  2006-11-29  |  2KB  |  93 lines

  1. /**
  2.  * File:        keyboard_proposal.ycp
  3.  *
  4.  * $Id: keyboard_proposal.ycp 25808 2005-10-05 15:13:41Z jsuchome $
  5.  *
  6.  * Author:              Klaus Kaempf <kkaempf@suse.de>
  7.  *
  8.  * Purpose:        Proposal function dispatcher - keyboard.
  9.  *
  10.  *            See also file proposal-API.txt for details.
  11.  */
  12. {
  13.     textdomain "country";
  14.  
  15.     import "Arch";
  16.     import "Keyboard";
  17.     import "Wizard";
  18.  
  19.     include "keyboard/dialogs.ycp";
  20.  
  21.     string func  = (string)WFM::Args(0);
  22.     map    param = (map)WFM::Args(1);
  23.     map    ret   = $[];
  24.  
  25.     if ( func == "MakeProposal" )
  26.     {
  27.     boolean force_reset      = param["force_reset"     ]:false;
  28.     boolean language_changed = param["language_changed"]:false;
  29.  
  30.     // call some function that makes a proposal here:
  31.     //
  32.     // DummyMod::MakeProposal( force_reset );
  33.  
  34.     // Fill return map
  35.  
  36.     ret =
  37.         $[
  38.           "raw_proposal"    : [ Keyboard::MakeProposal( force_reset, language_changed ) ],
  39.           "language_changed": false
  40.         ];
  41.     }
  42.     else if ( func == "AskUser" )
  43.     {
  44.     if (Arch::s390 ())
  45.     {
  46.         ret = $[
  47.         "workflow_sequence" : `next,
  48.         "language_changed"  : false
  49.         ];
  50.         return ret;
  51.     }
  52.  
  53.     if (!Keyboard::CalledRestore())
  54.     {
  55.         Keyboard::Restore();
  56.     }
  57.  
  58.     Keyboard::Read (); // save the inital values
  59.  
  60.     map argmap = $[
  61.         "enable_back"    : true,
  62.         "enable_next"    : param["has_next"]:false
  63.     ];
  64.  
  65.     Wizard::OpenAcceptDialog();
  66.     symbol result = KeyboardDialog (argmap);
  67.     Wizard::CloseDialog ();
  68.  
  69.     // Fill return map
  70.     ret = $[
  71.         "workflow_sequence" : result,
  72.         "language_changed"  : false
  73.            ];
  74.     }
  75.     else if ( func == "Description" )
  76.     {
  77.     // Fill return map.
  78.     //
  79.     // Static values do just nicely here, no need to call a function.
  80.  
  81.     ret =
  82.         $[
  83.           // summary item
  84.           "rich_text_title"    :    _("Keyboard Layout"),
  85.           // menue label text
  86.           "menu_title"    :    _("&Keyboard Layout"),
  87.           "id"        :    "keyboard_stuff"
  88.         ];
  89.     }
  90.  
  91.     return ret;
  92. }
  93.