Method: Yast::PopupClass#AnyQuestion3

Defined in:
library/general/src/modules/Popup.rb

#AnyQuestion3(headline, message, yes_button_message, no_button_message, retry_button_message, focus) ⇒ Object

Generic question popup with three buttons.

Examples:

Popup::AnyQuestion3( Label::WarningMsg(), _("... failed"), _("Continue"), _("Cancel"), _("Retry"), `focus_yes );

Parameters:

  • headline (String)

    headline or Popup::NoHeadline()

  • message (String)

    message string

  • yes_button_message (String)

    label on affirmative button (on left side)

  • no_button_message (String)

    label on negating button (middle)

  • retry_button_message (String)

    label on retry button (on right side)

  • focus (Symbol)

    focus_yes (first button),focus_no (second button) or `focus_retry (third button)

Returns:

    • `yes: first button has been clicked
    • `no: second button has been clicked
    • `retry: third button has been clicked

See Also:



1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
# File 'library/general/src/modules/Popup.rb', line 1592

def AnyQuestion3(headline, message, yes_button_message, no_button_message, retry_button_message, focus)
  yes_button = Empty()
  no_button = Empty()
  retry_button = Empty()

  case focus
  when :focus_no
    yes_button = PushButton(
      Id(:yes),
      Opt(:key_F10, :okButton),
      yes_button_message
    )
    no_button = PushButton(
      Id(:no),
      Opt(:default, :key_F9, :cancelButton),
      no_button_message
    )
    retry_button = PushButton(
      Id(:retry),
      Opt(:key_F6, :customButton),
      retry_button_message
    )
  when :focus_yes
    yes_button = PushButton(
      Id(:yes),
      Opt(:default, :key_F10, :okButton),
      yes_button_message
    )
    no_button = PushButton(
      Id(:no),
      Opt(:key_F9, :cancelButton),
      no_button_message
    )
    retry_button = PushButton(
      Id(:retry),
      Opt(:key_F6, :customButton),
      retry_button_message
    )
  else
    yes_button = PushButton(
      Id(:yes),
      Opt(:key_F10, :okButton),
      yes_button_message
    )
    no_button = PushButton(
      Id(:no),
      Opt(:key_F9, :cancelButton),
      no_button_message
    )
    retry_button = PushButton(
      Id(:retry),
      Opt(:default, :key_F6, :customButton),
      retry_button_message
    )
  end

  button_box = ButtonBox(yes_button, no_button, retry_button)

  success = UI.OpenDialog(
    Opt(:decorated),
    popupLayoutInternal(
      headline,
      message,
      button_box
    )
  )

  ret = nil

  if success == true
    ret = Convert.to_symbol(UI.UserInput)
    UI.CloseDialog
  end

  ret
end