Class: Yast::PopupClass
- Inherits:
-
Module
- Object
- Module
- Yast::PopupClass
- Defined in:
- library/general/src/modules/Popup.rb
Instance Method Summary collapse
-
#AnyMessage(headline, message) ⇒ Object
Generic message popup.
-
#anyMessageDetailsInternal(headline, message, details) ⇒ Object
Internal function - wrapper for anyMessageDetailsInternalType call.
-
#anyMessageDetailsInternalType(headline, message, details, richtext, width, height) ⇒ Object
Generic message popup with Details button - internal.
-
#anyMessageInternal(headline, message) ⇒ Object
Internal function - wrapper for anyMessageInternal call.
-
#anyMessageInternalRich(headline, message, width, height) ⇒ Object
Internal function - wrapper for anyMessageInternal call.
-
#anyMessageInternalType(headline, message, richtext, width, height) ⇒ Object
Generic message popup - internal.
-
#AnyQuestion(headline, message, yes_button_message, no_button_message, focus) ⇒ Object
Generic question popup with two buttons.
-
#AnyQuestion3(headline, message, yes_button_message, no_button_message, retry_button_message, focus) ⇒ Object
Generic question popup with three buttons.
-
#AnyQuestionButtonBox(yes_button_message, no_button_message, focus) ⇒ Yast::Term
Button box for the AnyQuestion Dialog (internal function).
-
#AnyQuestionRichText(headline, richtext, hdim, vdim, yes_button_message, no_button_message, focus) ⇒ Object
Show a question that might need scrolling.
-
#anyRichMessageInternal(headline, message, width, height) ⇒ Object
Generic message popup - internal.
-
#AnyTimedMessage(headline, message, timeout) ⇒ void
Generic message popup.
-
#anyTimedMessageInternal(headline, message, timeout) ⇒ Object
Internal function - wrapper for anyTimedMessageTypeInternal call.
-
#anyTimedMessageTypeInternal(headline, message, timeout, richtext, width, height) ⇒ void
Internal version of AnyTimedMessage.
- #AnyTimedRichMessage(headline, message, timeout) ⇒ Object
-
#anyTimedRichMessageInternal(headline, message, timeout, width, height) ⇒ Object
Internal function - wrapper for anyTimedMessageTypeInternal call.
-
#ClearFeedback ⇒ void
Clear feedback message.
-
#ConfirmAbort(severity) ⇒ Boolean
Confirmation for "Abort" button during installation.
-
#ContinueCancel(message) ⇒ Boolean
Dialog which displays the "message" and has a Continue and a Cancel button.
-
#ContinueCancelHeadline(headline, message) ⇒ Boolean
Dialog which displays the "message" and has a Continue and a Cancel button.
-
#Error(message) ⇒ Object
Show an error message and wait until user clicked "OK".
-
#ErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus) ⇒ Object
Generic error question popup with two buttons.
-
#ErrorDetails(message, details) ⇒ Object
Show an error message with Details button and wait until user clicked "OK".
-
#Feedback(headline, message, &block) ⇒ Object
Run the block with a feeback popup The popup is automatically closed at the end (even when an exception is raised) To suppress temporary feedback see #SuppressFeedback.
-
#LongError(message) ⇒ Object
Show a long error and wait until user clicked "OK".
-
#LongErrorGeometry(message, width, height) ⇒ Object
Show a long error message and wait until user clicked "OK".
-
#LongMessage(message) ⇒ Object
Show a long message and wait until user clicked "OK".
-
#LongMessageGeometry(message, width, height) ⇒ Object
Show a long message and wait until user clicked "OK".
-
#LongNotify(message) ⇒ Object
Show a long notify message and wait until user clicked "OK".
-
#LongNotifyGeometry(message, width, height) ⇒ Object
Show a long notify message and wait until user clicked "OK".
-
#LongText(headline, richtext, hdim, vdim) ⇒ Object
Show a long text that might need scrolling.
-
#LongWarning(message) ⇒ Object
Show a long warning and wait until user clicked "OK".
-
#LongWarningGeometry(message, width, height) ⇒ Object
Show a long warning and wait until user clicked "OK".
- #main ⇒ Object
-
#Message(message) ⇒ Object
Show a simple message and wait until user clicked "OK".
-
#MessageDetails(message, details) ⇒ Object
Show a message with Details button and wait until user clicked "OK".
-
#ModuleError(text) ⇒ Symbol
Special error popup for YCP modules that don't work.
-
#NoHeadline ⇒ Object
Indicator for empty headline for popups that can optionally have one.
-
#Notify(message) ⇒ Object
Show a notification message and wait until user clicked "OK".
-
#NotifyDetails(message, details) ⇒ Object
Show a notify message with Details button and wait until user clicked "OK".
-
#popupLayoutInternal(headline, message, button_box) ⇒ Object
Internal function - wrapper for popupLayoutInternalTypeWithLabel call.
-
#popupLayoutInternalRich(headline, message, button_box, width, height) ⇒ Object
Internal function - wrapper for popupLayoutInternalTypeWithLabel call.
-
#popupLayoutInternalTypeWithLabel(headline, message, button_box, label, richtext, width, height) ⇒ Yast::Term
Internal function that returns a popup dialog with an additional label.
-
#ReallyAbort(have_changes) ⇒ Object
Confirmation popup when user clicked "Abort".
-
#ShowFeedback(headline, message) ⇒ void
Show popup with a headline and a message for feedback.
-
#ShowFile(headline, filename) ⇒ Object
Show the contents of an entire file in a popup.
-
#ShowText(headline, text) ⇒ Object
Show the contents of an entire file in a popup.
-
#ShowTextTimed(headline, text, timeout) ⇒ Object
Show the contents of an entire file in a popup.
-
#SuppressFeedback(&block) ⇒ Object
Hides feedback during block execution.
-
#TimedAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds) ⇒ Boolean
Timed question popup with two buttons and time display.
-
#TimedError(message, timeout_seconds) ⇒ void
Show an error message and wait specified amount of time or until user clicked "OK".
-
#TimedErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds) ⇒ Boolean
Timed error question popup with two buttons and time display.
-
#TimedLongError(message, timeout_seconds) ⇒ Object
Show a long error message and wait until user clicked "OK" or time is out.
-
#TimedLongErrorGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long error message and wait until user clicked "OK" or time is out.
-
#TimedLongMessage(message, timeout_seconds) ⇒ Object
Show a long message and wait until user clicked "OK" or time is out.
-
#TimedLongMessageGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long message and wait until user clicked "OK" or time is out.
-
#TimedLongNotify(message, timeout_seconds) ⇒ Object
Show a long error message and wait until user clicked "OK" or time is out.
-
#TimedLongNotifyGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long notify message and wait until user clicked "OK" or time is out.
-
#TimedLongWarning(message, timeout_seconds) ⇒ Object
Show a long warning message and wait until user clicked "OK" or time is out.
-
#TimedLongWarningGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long warning and wait until user clicked "OK" or time is out.
-
#TimedMessage(message, timeout_seconds) ⇒ Object
Show a message and wait until user clicked "OK" or time is out.
-
#TimedNotify(message, timeout_seconds) ⇒ Object
Show a long notify message and wait until user clicked "OK" or the time is out.
-
#TimedOKCancel(message, timeout_seconds) ⇒ Object
Display a message with a timeout.
-
#TimedWarning(message, timeout_seconds) ⇒ void
Show a warning message and wait specified amount of time or until user clicked "OK".
-
#Warning(message) ⇒ Object
Show a warning message and wait until user clicked "OK".
-
#WarningDetails(message, details) ⇒ Object
Show a warning with Details button and wait until user clicked "OK".
-
#YesNo(message) ⇒ Boolean
Display a yes/no question and wait for answer.
-
#YesNoHeadline(headline, message) ⇒ Boolean
This dialog displays "message" (a question) and has a Yes and a No button.
Instance Method Details
#AnyMessage(headline, message) ⇒ Object
Generic message popup
Show a message with optional headline above and wait until user clicked "OK".
968 969 970 971 972 |
# File 'library/general/src/modules/Popup.rb', line 968 def AnyMessage(headline, ) anyMessageInternal(headline, ) nil end |
#anyMessageDetailsInternal(headline, message, details) ⇒ Object
Internal function - wrapper for anyMessageDetailsInternalType call
916 917 918 919 920 921 922 923 924 925 926 927 |
# File 'library/general/src/modules/Popup.rb', line 916 def anyMessageDetailsInternal(headline, , details) anyMessageDetailsInternalType( headline, , details, false, 0, 0 ) nil end |
#anyMessageDetailsInternalType(headline, message, details, richtext, width, height) ⇒ Object
Generic message popup with Details button - internal
Show a message with optional headline above and wait until user clicked "OK" or "Details". On "Details", show window with detailed information.
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 |
# File 'library/general/src/modules/Popup.rb', line 797 def anyMessageDetailsInternalType(headline, , details, richtext, width, height) = ButtonBox( PushButton(Id(:ok_msg), Opt(:default, :okButton), Label.OKButton), # FIXME: BNC #422612, Use `opt(`noSanityCheck) later # button label PushButton(Id(:details), Opt(:cancelButton), _("&Details...")) ) success = UI.OpenDialog( Opt(:decorated), if richtext popupLayoutInternalRich( headline, , , width, height ) else popupLayoutInternal(headline, , ) end ) UI.SetFocus(Id(:ok_msg)) loop do ret = UI.UserInput break if ret != :details success2 = UI.OpenDialog( Opt(:decorated), HBox( VSpacing(@default_height), VBox( HSpacing(@default_width), VSpacing(0.5), RichText( Builtins.mergestring( Builtins.splitstring(ERB::Util.html_escape(details), "\n"), "<br>" ) ), VSpacing(), ButtonBox( PushButton( Id(:ok), Opt(:default, :key_F10, :okButton), Label.OKButton ) ) ) ) ) if success2 == true UI.UserInput UI.CloseDialog end end UI.CloseDialog if success == true nil end |
#anyMessageInternal(headline, message) ⇒ Object
Internal function - wrapper for anyMessageInternal call
902 903 904 905 906 |
# File 'library/general/src/modules/Popup.rb', line 902 def anyMessageInternal(headline, ) anyMessageInternalType(headline, , false, 0, 0) nil end |
#anyMessageInternalRich(headline, message, width, height) ⇒ Object
Internal function - wrapper for anyMessageInternal call
909 910 911 912 913 |
# File 'library/general/src/modules/Popup.rb', line 909 def anyMessageInternalRich(headline, , width, height) anyMessageInternalType(headline, , true, width, height) nil end |
#anyMessageInternalType(headline, message, richtext, width, height) ⇒ Object
Generic message popup - internal
Show a message with optional headline above and wait until user clicked "OK".
868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'library/general/src/modules/Popup.rb', line 868 def anyMessageInternalType(headline, , richtext, width, height) = ButtonBox( PushButton( Id(:ok_msg), Opt(:default, :key_F10, :okButton), Label.OKButton ) ) success = UI.OpenDialog( Opt(:decorated), if richtext popupLayoutInternalRich( headline, , , width, height ) else popupLayoutInternal(headline, , ) end ) if success == true UI.SetFocus(Id(:ok_msg)) UI.UserInput UI.CloseDialog end nil end |
#AnyQuestion(headline, message, yes_button_message, no_button_message, focus) ⇒ Object
Generic question popup with two buttons.
Style guide hint: The first button has to have the semantics of "yes", "OK", "continue" etc., the second its opposite ("no", "cancel", ...). NEVER use this generic question popup to simply exchange the order of yes/no, continue/cancel or ok/cancel buttons!
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'library/general/src/modules/Popup.rb', line 289 def AnyQuestion(headline, , , , focus) = AnyQuestionButtonBox( , , focus ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternal( headline, , ) ) ret = nil if success == true ret = UI.UserInput UI.CloseDialog end ret == :yes end |
#AnyQuestion3(headline, message, yes_button_message, no_button_message, retry_button_message, focus) ⇒ Object
Generic question popup with three buttons.
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, , , , , focus) = Empty() = Empty() = Empty() case focus when :focus_no = PushButton( Id(:yes), Opt(:key_F10, :okButton), ) = PushButton( Id(:no), Opt(:default, :key_F9, :cancelButton), ) = PushButton( Id(:retry), Opt(:key_F6, :customButton), ) when :focus_yes = PushButton( Id(:yes), Opt(:default, :key_F10, :okButton), ) = PushButton( Id(:no), Opt(:key_F9, :cancelButton), ) = PushButton( Id(:retry), Opt(:key_F6, :customButton), ) else = PushButton( Id(:yes), Opt(:key_F10, :okButton), ) = PushButton( Id(:no), Opt(:key_F9, :cancelButton), ) = PushButton( Id(:retry), Opt(:default, :key_F6, :customButton), ) end = ButtonBox(, , ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternal( headline, , ) ) ret = nil if success == true ret = Convert.to_symbol(UI.UserInput) UI.CloseDialog end ret end |
#AnyQuestionButtonBox(yes_button_message, no_button_message, focus) ⇒ Yast::Term
Button box for the AnyQuestion Dialog (internal function).
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'library/general/src/modules/Popup.rb', line 252 def AnyQuestionButtonBox(, , focus) yes_opts = [:okButton] no_opts = [:cancelButton] if focus == :focus_no no_opts << :default else yes_opts << :default end = PushButton(Id(:yes), Opt(*yes_opts), ) = PushButton(Id(:no), Opt(*no_opts), ) ButtonBox(, ) end |
#AnyQuestionRichText(headline, richtext, hdim, vdim, yes_button_message, no_button_message, focus) ⇒ Object
Show a question that might need scrolling.
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 |
# File 'library/general/src/modules/Popup.rb', line 615 def AnyQuestionRichText(headline, richtext, hdim, vdim, , , focus) = PushButton( Id(:ok), if focus == :focus_yes Opt(:default, :key_F10, :okButton) else Opt(:key_F10, :okButton) end, ) = PushButton( Id(:cancel), (focus == :focus_no) ? Opt(:default, :key_F9) : Opt(:key_F9), ) d = HBox( VSpacing(vdim), VBox( HSpacing(hdim), if Ops.greater_than(Builtins.size(headline), 0) Left(Heading(headline)) else Empty() end, VSpacing(0.2), RichText(richtext), ButtonBox(, ) ) ) success = UI.OpenDialog(Opt(:decorated), d) ui = nil if success == true ui = UI.UserInput UI.CloseDialog end ui == :ok end |
#anyRichMessageInternal(headline, message, width, height) ⇒ Object
Generic message popup - internal
Show a message with optional headline above and wait until user clicked "OK".
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 |
# File 'library/general/src/modules/Popup.rb', line 936 def anyRichMessageInternal(headline, , width, height) = ButtonBox( PushButton(Id(:ok_msg), Opt(:default, :key_F10), Label.OKButton) ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternalRich( headline, , , width, height ) ) if success == true UI.SetFocus(Id(:ok_msg)) UI.UserInput UI.CloseDialog end nil end |
#AnyTimedMessage(headline, message, timeout) ⇒ void
This method returns an undefined value.
Generic message popup
Show a message with optional headline above and wait until user clicked "OK" or until a timeout runs out.
1735 1736 1737 1738 1739 |
# File 'library/general/src/modules/Popup.rb', line 1735 def AnyTimedMessage(headline, , timeout) anyTimedMessageInternal(headline, , timeout) nil end |
#anyTimedMessageInternal(headline, message, timeout) ⇒ Object
Internal function - wrapper for anyTimedMessageTypeInternal call
208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'library/general/src/modules/Popup.rb', line 208 def anyTimedMessageInternal(headline, , timeout) anyTimedMessageTypeInternal( headline, , timeout, false, 0, 0 ) nil end |
#anyTimedMessageTypeInternal(headline, message, timeout, richtext, width, height) ⇒ void
This method returns an undefined value.
Internal version of AnyTimedMessage
Show a message with optional headline above and wait until user clicked "OK" or until a timeout runs out.
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'library/general/src/modules/Popup.rb', line 163 def anyTimedMessageTypeInternal(headline, , timeout, richtext, width, height) = ButtonBox( # FIXME: BNC #422612, Use `opt(`noSanityCheck) later PushButton(Id(:stop), Opt(:cancelButton), Label.StopButton), PushButton(Id(:ok_msg), Opt(:default, :okButton), Label.OKButton) ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternalTypeWithLabel( headline, , , Builtins.sformat("%1", timeout), richtext, width, height ) ) UI.SetFocus(Id(:ok_msg)) if success == true = nil while Ops.greater_than(timeout, 0) && != :ok_msg = Convert.to_symbol(UI.TimeoutUserInput(1000)) if == :stop while UI.UserInput != :ok_msg end break end timeout = Ops.subtract(timeout, 1) UI.ChangeWidget(Id(:label), :Value, Builtins.sformat("%1", timeout)) if success == true end UI.CloseDialog if success == true nil end |
#AnyTimedRichMessage(headline, message, timeout) ⇒ Object
1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 |
# File 'library/general/src/modules/Popup.rb', line 1741 def AnyTimedRichMessage(headline, , timeout) anyTimedRichMessageInternal( headline, , timeout, @default_width, @default_height ) nil end |
#anyTimedRichMessageInternal(headline, message, timeout, width, height) ⇒ Object
Internal function - wrapper for anyTimedMessageTypeInternal call
222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'library/general/src/modules/Popup.rb', line 222 def anyTimedRichMessageInternal(headline, , timeout, width, height) anyTimedMessageTypeInternal( headline, , timeout, true, width, height ) nil end |
#ClearFeedback ⇒ void
This method returns an undefined value.
Clear feedback message
976 977 978 979 980 981 |
# File 'library/general/src/modules/Popup.rb', line 976 def ClearFeedback UI.CloseDialog if @feedback_open @feedback_open = false nil end |
#ConfirmAbort(severity) ⇒ Boolean
Confirmation for "Abort" button during installation.
According to the "severity" parameter an appropriate text will be displayed indicating what the user has to expect when he really aborts now.
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 |
# File 'library/general/src/modules/Popup.rb', line 670 def ConfirmAbort(severity) what_will_happen = "" # Confirm user request to abort installation abort_label = _("Really abort the installation?") # Button that will really abort the installation = _("&Abort Installation") # Button that will continue with the installation = _("&Continue Installation") case severity when :painless if Mode.repair # Confirm user request to abort System Repair abort_label = _("Really abort YaST System Repair?") # Button that will really abort the repair = _("Abort System Repair") # Button that will continue with the repair = _("&Continue System Repair") else # Warning text for aborting an installation before anything is installed what_will_happen = _( "If you abort the installation now,\n" \ "Linux will not be installed.\n" \ "Your hard disk will remain untouched." ) end when :incomplete # Warning text for aborting an installation during the install process # - After some installation steps have been performed - e.g. # disks formatted / some packages already installed what_will_happen = _( "If you abort the installation now, you will\n" \ "have an incomplete Linux system\n" \ "that might or might not be usable.\n" \ "You might need to reinstall.\n" ) when :unusable # Warning text for aborting an installation during the install process # right in the middle of some critical process (e.g. formatting) what_will_happen = _( "If you abort the installation now,\n" \ "Linux will be unusable.\n" \ "You will need to reinstall." ) else Builtins.y2error("Unknown symbol for ConfirmAbort") end = Ops.add(Ops.add(abort_label, "\n\n"), what_will_happen) = AnyQuestionButtonBox( , , :focus_no ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternal( NoHeadline(), , ) ) user_ret = nil if success == true user_ret = UI.UserInput UI.CloseDialog end ret = user_ret == :yes Builtins.y2debug("ConfirmAbort returned: %1", ret) ret end |
#ContinueCancel(message) ⇒ Boolean
Dialog which displays the "message" and has a Continue and a Cancel button.
This popup should be used to confirm possibly dangerous actions. The default button is Continue. Returns true if Continue is clicked.
493 494 495 496 497 498 |
# File 'library/general/src/modules/Popup.rb', line 493 def ContinueCancel() ret = ContinueCancelHeadline(NoHeadline(), ) Builtins.y2debug("ContinueCancel returned: %1", ret) ret end |
#ContinueCancelHeadline(headline, message) ⇒ Boolean
Dialog which displays the "message" and has a Continue and a Cancel button.
This popup should be used to confirm possibly dangerous actions and if it's useful to display a short headline (without headline Popup::ContinueCancel() can be used). The default button is Continue.
Returns true if Continue is clicked.
464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'library/general/src/modules/Popup.rb', line 464 def ContinueCancelHeadline(headline, ) ret = AnyQuestion( headline, , Label.ContinueButton, Label.CancelButton, :focus_yes ) Builtins.y2debug("ContinueCancelHeadline returned: %1", ret) ret end |
#Error(message) ⇒ Object
Show an error message and wait until user clicked "OK".
1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 |
# File 'library/general/src/modules/Popup.rb', line 1283 def Error() lines = Builtins.splitstring(, "\n") if @switch_to_richtext && Ops.greater_than(Builtins.size(lines), @too_many_lines) anyMessageInternalRich( Label.ErrorMsg, ERB::Util.html_escape(), @default_width, @default_height ) else anyMessageInternal(Label.ErrorMsg, ) end nil end |
#ErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus) ⇒ Object
Generic error question popup with two buttons.
Style guide hint: The first button has to have the semantics of "yes", "OK", "continue" etc., the second its opposite ("no", "cancel", ...). NEVER use this generic question popup to simply exchange the order of yes/no, continue/cancel or ok/cancel buttons!
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'library/general/src/modules/Popup.rb', line 335 def ErrorAnyQuestion(headline, , , , focus) = AnyQuestionButtonBox( , , focus ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternal( headline, , ) ) ret = nil if success == true ret = UI.UserInput UI.CloseDialog end ret == :yes end |
#ErrorDetails(message, details) ⇒ Object
Show an error message with Details button and wait until user clicked "OK".
1391 1392 1393 1394 1395 1396 1397 1398 1399 |
# File 'library/general/src/modules/Popup.rb', line 1391 def ErrorDetails(, details) anyMessageDetailsInternal( Label.ErrorMsg, , details ) nil end |
#Feedback(headline, message, &block) ⇒ Object
Run the block with a feeback popup The popup is automatically closed at the end (even when an exception is raised) To suppress temporary feedback see #SuppressFeedback
1016 1017 1018 1019 1020 1021 1022 1023 |
# File 'library/general/src/modules/Popup.rb', line 1016 def Feedback(headline, , &block) raise ArgumentError, "block must be supplied" unless block ShowFeedback(headline, ) block.call ensure ClearFeedback() end |
#LongError(message) ⇒ Object
Show a long error and wait until user clicked "OK".
1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 |
# File 'library/general/src/modules/Popup.rb', line 1303 def LongError() anyMessageInternalRich( Label.ErrorMsg, , @default_width, @default_height ) nil end |
#LongErrorGeometry(message, width, height) ⇒ Object
Show a long error message and wait until user clicked "OK". Size of the popup window is adjustable.
1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 |
# File 'library/general/src/modules/Popup.rb', line 1319 def LongErrorGeometry(, width, height) anyMessageInternalRich( Label.ErrorMsg, , width, height ) nil end |
#LongMessage(message) ⇒ Object
Show a long message and wait until user clicked "OK".
1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 |
# File 'library/general/src/modules/Popup.rb', line 1061 def LongMessage() anyMessageInternalRich( NoHeadline(), , @default_width, @default_height ) nil end |
#LongMessageGeometry(message, width, height) ⇒ Object
Show a long message and wait until user clicked "OK". Size of the popup window is adjustable.
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 |
# File 'library/general/src/modules/Popup.rb', line 1077 def LongMessageGeometry(, width, height) anyMessageInternalRich( NoHeadline(), , width, height ) nil end |
#LongNotify(message) ⇒ Object
Show a long notify message and wait until user clicked "OK".
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 |
# File 'library/general/src/modules/Popup.rb', line 1420 def LongNotify() anyMessageInternalRich( NoHeadline(), , @default_width, @default_height ) nil end |
#LongNotifyGeometry(message, width, height) ⇒ Object
Show a long notify message and wait until user clicked "OK". Size of the popup window is adjustable.
1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 |
# File 'library/general/src/modules/Popup.rb', line 1436 def LongNotifyGeometry(, width, height) anyMessageInternalRich( NoHeadline(), , width, height ) nil end |
#LongText(headline, richtext, hdim, vdim) ⇒ Object
Show a long text that might need scrolling.
Pass a RichText widget with the parameters appropriate for your text -
i.e. without special parameters for HTML-like text or with
opt(
plainText) for plain ASCII text without HTML tags.
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
# File 'library/general/src/modules/Popup.rb', line 574 def LongText(headline, richtext, hdim, vdim) richtext = deep_copy(richtext) success = UI.OpenDialog( Opt(:decorated), HBox( VSpacing(vdim), VBox( HSpacing(hdim), Left(Heading(headline)), VSpacing(0.2), richtext, # scrolled text ButtonBox( PushButton( Id(:ok), Opt(:default, :key_F10, :okButton), Label.OKButton ) ) ) ) ) if success == true UI.SetFocus(Id(:ok)) UI.UserInput UI.CloseDialog end nil end |
#LongWarning(message) ⇒ Object
Show a long warning and wait until user clicked "OK".
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 |
# File 'library/general/src/modules/Popup.rb', line 1174 def LongWarning() anyMessageInternalRich( Label.WarningMsg, , @default_width, @default_height ) nil end |
#LongWarningGeometry(message, width, height) ⇒ Object
Show a long warning and wait until user clicked "OK". Size of the popup window is adjustable
1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 |
# File 'library/general/src/modules/Popup.rb', line 1190 def LongWarningGeometry(, width, height) anyMessageInternalRich( Label.WarningMsg, , width, height ) nil end |
#main ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'library/general/src/modules/Popup.rb', line 43 def main Yast.import "UI" textdomain "base" Yast.import "Label" Yast.import "Mode" Yast.import "Directory" @feedback_open = false # default size of the richtext widget in richtext popups @default_width = 60 @default_height = 10 # if error message is too long, show LongError instead of Error Popup @switch_to_richtext = true # lines of message text which force usage of RichText @too_many_lines = 20 end |
#Message(message) ⇒ Object
Show a simple message and wait until user clicked "OK".
1052 1053 1054 1055 1056 |
# File 'library/general/src/modules/Popup.rb', line 1052 def Message() anyMessageInternal(NoHeadline(), ) nil end |
#MessageDetails(message, details) ⇒ Object
Show a message with Details button and wait until user clicked "OK".
1143 1144 1145 1146 1147 1148 1149 1150 1151 |
# File 'library/general/src/modules/Popup.rb', line 1143 def MessageDetails(, details) anyMessageDetailsInternal( NoHeadline(), , details ) nil end |
#ModuleError(text) ⇒ Symbol
Special error popup for YCP modules that don't work.
The user can choose one of:
- "back" - go back to the previous module
- "next" - skip this faulty module and directly go to the next one
- "again" - try it again (after fixing something in the code, of course)
- "cancel" - exit program
1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 |
# File 'library/general/src/modules/Popup.rb', line 1683 def ModuleError(text) success = UI.OpenDialog( Opt(:decorated, :warncolor), HBox( HSpacing(1), VBox( VSpacing(0.2), Heading(text), ButtonBox( PushButton( Id(:back), Opt(:key_F8, :customButton), Label.BackButton ), PushButton( Id(:again), Opt(:key_F6, :customButton), Label.RetryButton ), PushButton( Id(:cancel), Opt(:key_F9, :cancelButton), Label.QuitButton ), PushButton(Id(:next), Opt(:key_F10, :okButton), Label.NextButton) ), VSpacing(0.2) ), HSpacing(1) ) ) ret = nil if success == true ret = Convert.to_symbol(UI.UserInput) UI.CloseDialog end ret end |
#NoHeadline ⇒ Object
Indicator for empty headline for popups that can optionally have one
This is really just an alias for the empty string "", but it is slightly better readable.
241 242 243 |
# File 'library/general/src/modules/Popup.rb', line 241 def NoHeadline "" end |
#Notify(message) ⇒ Object
Show a notification message and wait until user clicked "OK".
1411 1412 1413 1414 1415 |
# File 'library/general/src/modules/Popup.rb', line 1411 def Notify() anyMessageInternal("", ) nil end |
#NotifyDetails(message, details) ⇒ Object
Show a notify message with Details button and wait until user clicked "OK".
1501 1502 1503 1504 1505 1506 1507 1508 1509 |
# File 'library/general/src/modules/Popup.rb', line 1501 def NotifyDetails(, details) anyMessageDetailsInternal( NoHeadline(), , details ) nil end |
#popupLayoutInternal(headline, message, button_box) ⇒ Object
Internal function - wrapper for popupLayoutInternalTypeWithLabel call
125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'library/general/src/modules/Popup.rb', line 125 def popupLayoutInternal(headline, , ) = deep_copy() popupLayoutInternalTypeWithLabel( headline, , , nil, false, 0, 0 ) end |
#popupLayoutInternalRich(headline, message, button_box, width, height) ⇒ Object
Internal function - wrapper for popupLayoutInternalTypeWithLabel call
139 140 141 142 143 144 145 146 147 148 149 150 |
# File 'library/general/src/modules/Popup.rb', line 139 def popupLayoutInternalRich(headline, , , width, height) = deep_copy() popupLayoutInternalTypeWithLabel( headline, , , nil, true, width, height ) end |
#popupLayoutInternalTypeWithLabel(headline, message, button_box, label, richtext, width, height) ⇒ Yast::Term
Internal function that returns a popup dialog with an additional label.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'library/general/src/modules/Popup.rb', line 73 def popupLayoutInternalTypeWithLabel(headline, , , label, richtext, width, height) = deep_copy() rt = VWeight( 1, VBox( HSpacing(width), HBox( VSpacing(height), RichText() ) ) ) content = if Ops.greater_than(Builtins.size(headline), 0) VBox( VSpacing(0.4), VBox( Left(Heading(headline)), VSpacing(0.2), richtext ? rt : Left(Label()), VSpacing(0.2), (!label.nil? && label != "") ? Label(Id(:label), label) : Empty() ) ) # no headline else VBox( VSpacing(0.4), VBox( richtext ? rt : VCenter(Label()), VSpacing(0.2), (!label.nil? && label != "") ? Label(Id(:label), label) : Empty() ) ) end dialog = HBox( HSpacing(1), VBox( VSpacing(0.2), content, richtext ? Empty() : VStretch(), , richtext ? Empty() : VStretch(), VSpacing(0.2) ), HSpacing(1) ) deep_copy(dialog) end |
#ReallyAbort(have_changes) ⇒ Object
Confirmation popup when user clicked "Abort".
Set "have changes" to "true" when there are changes that will be lost. Note: If there are none, it is good policy to ask for confirmation anyway, but of course with "have_changes" set to "false" so the user isn't warned about changes that might be lost.
760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 |
# File 'library/general/src/modules/Popup.rb', line 760 def ReallyAbort(have_changes) focus = :focus_yes # Confirm aborting the program = _("Really abort?") if have_changes focus = :focus_no # Additional hint when trying to abort program in spite of changes = Ops.add( Ops.add(, "\n"), _("All changes will be lost!") ) end ret = AnyQuestion( NoHeadline(), , Label.YesButton, Label.NoButton, focus ) Builtins.y2debug("ReallyAbort returned: %1", ret) ret end |
#ShowFeedback(headline, message) ⇒ void
This method returns an undefined value.
Show popup with a headline and a message for feedback
987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 |
# File 'library/general/src/modules/Popup.rb', line 987 def ShowFeedback(headline, ) UI.CloseDialog if @feedback_open = Empty() UI.BusyCursor UI.OpenDialog( Opt(:decorated), popupLayoutInternal( headline, , ) ) @feedback_open = true @feedback_headline = headline @feedback_message = nil end |
#ShowFile(headline, filename) ⇒ Object
Show the contents of an entire file in a popup.
Notice: This is a WFM function, NOT an UI function!
1862 1863 1864 1865 1866 1867 1868 |
# File 'library/general/src/modules/Popup.rb', line 1862 def ShowFile(headline, filename) text = Convert.to_string(SCR.Read(path(".target.string"), filename)) ShowText(headline, text) nil end |
#ShowText(headline, text) ⇒ Object
Show the contents of an entire file in a popup.
1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 |
# File 'library/general/src/modules/Popup.rb', line 1817 def ShowText(headline, text) heading = if Builtins.size(headline) == 0 VSpacing(0.2) else Heading(headline) end success = UI.OpenDialog( Opt(:decorated), VBox( HSpacing(70), # force width heading, VWeight( 1, HBox( VSpacing(18), # force height HSpacing(0.7), RichText(Id(:text), Opt(:plainText), text), HSpacing(0.7) ) ), VSpacing(0.3), ButtonBox( PushButton(Opt(:default, :key_F10, :okButton), Label.OKButton) ), VSpacing(0.3) ) ) if success == true UI.UserInput UI.CloseDialog end nil end |
#ShowTextTimed(headline, text, timeout) ⇒ Object
Show the contents of an entire file in a popup.
1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 |
# File 'library/general/src/modules/Popup.rb', line 1762 def ShowTextTimed(headline, text, timeout) heading = if Builtins.size(headline) == 0 VSpacing(0.2) else Heading(headline) end success = UI.OpenDialog( Opt(:decorated), VBox( HSpacing(70), # force width heading, VWeight( 1, HBox( VSpacing(18), # force height HSpacing(0.7), RichText(Id(:text), Opt(:plainText), text), HSpacing(0.7) ) ), VSpacing(0.3), Label(Id(:label), Builtins.sformat("%1", timeout)), VSpacing(0.2), ButtonBox( PushButton( Id(:ok_msg), Opt(:default, :key_F10, :okButton), Label.OKButton ) ), VSpacing(0.3) ) ) = nil while Ops.greater_than(timeout, 0) && != :ok_msg = Convert.to_symbol(UI.TimeoutUserInput(1000)) timeout = Ops.subtract(timeout, 1) UI.ChangeWidget(Id(:label), :Value, Builtins.sformat("%1", timeout)) end UI.CloseDialog if success == true nil end |
#SuppressFeedback(&block) ⇒ Object
Hides feedback during block execution. After block it is shown again. When exception is raised, then it is NOT shown again.
1030 1031 1032 1033 1034 1035 1036 1037 1038 |
# File 'library/general/src/modules/Popup.rb', line 1030 def SuppressFeedback(&block) raise ArgumentError, "block must be supplied" unless block return block.call unless @feedback_open # just call block if feedback is not open ClearFeedback() block.call ShowFeedback(@feedback_headline, @feedback_message) end |
#TimedAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds) ⇒ Boolean
Timed question popup with two buttons and time display
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'library/general/src/modules/Popup.rb', line 370 def TimedAnyQuestion(headline, , , , focus, timeout_seconds) = AnyQuestionButtonBox( , , focus ) timed = ReplacePoint( Id(:replace_buttons), VBox( HCenter(Label(Id(:remaining_time), Ops.add("", timeout_seconds))), ButtonBox( # FIXME: BNC #422612, Use `opt(`noSanityCheck) later PushButton(Id(:timed_stop), Opt(:cancelButton), Label.StopButton), PushButton( Id(:timed_ok), Opt(:default, :key_F10, :okButton), Label.OKButton ) ), VSpacing(0.2) ) ) success = UI.OpenDialog( Opt(:decorated), popupLayoutInternal(headline, , timed) ) while Ops.greater_than(timeout_seconds, 0) which_input = UI.TimeoutUserInput(1000) break if which_input == :timed_ok if which_input == :timed_stop UI.ReplaceWidget(Id(:replace_buttons), ) which_input = UI.UserInput while which_input == :timed_stop break end timeout_seconds = Ops.subtract(timeout_seconds, 1) next unless success UI.ChangeWidget( Id(:remaining_time), :Value, Ops.add("", timeout_seconds) ) end UI.CloseDialog if success == true which_input == :yes end |
#TimedError(message, timeout_seconds) ⇒ void
This method returns an undefined value.
Show an error message and wait specified amount of time or until user clicked "OK".
1340 1341 1342 1343 1344 1345 1346 1347 1348 |
# File 'library/general/src/modules/Popup.rb', line 1340 def TimedError(, timeout_seconds) anyTimedMessageInternal( Label.ErrorMsg, , timeout_seconds ) nil end |
#TimedErrorAnyQuestion(headline, message, yes_button_message, no_button_message, focus, timeout_seconds) ⇒ Boolean
Timed error question popup with two buttons and time display
434 435 436 437 438 439 440 441 |
# File 'library/general/src/modules/Popup.rb', line 434 def TimedErrorAnyQuestion(headline, , , , focus, timeout_seconds) = { yes: , no: } focus_symbol = (focus == :focus_no) ? :no : :yes ret = Yast2::Popup.show(, headline: headline, buttons: , focus: focus_symbol, timeout: timeout_seconds) ret == :yes end |
#TimedLongError(message, timeout_seconds) ⇒ Object
Show a long error message and wait until user clicked "OK" or time is out.
1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 |
# File 'library/general/src/modules/Popup.rb', line 1354 def TimedLongError(, timeout_seconds) anyTimedRichMessageInternal( Label.ErrorMsg, , timeout_seconds, @default_width, @default_height ) nil end |
#TimedLongErrorGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long error message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 |
# File 'library/general/src/modules/Popup.rb', line 1372 def TimedLongErrorGeometry(, timeout_seconds, width, height) anyTimedRichMessageInternal( Label.ErrorMsg, , timeout_seconds, width, height ) nil end |
#TimedLongMessage(message, timeout_seconds) ⇒ Object
Show a long message and wait until user clicked "OK" or time is out.
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 |
# File 'library/general/src/modules/Popup.rb', line 1106 def TimedLongMessage(, timeout_seconds) anyTimedRichMessageInternal( NoHeadline(), , timeout_seconds, @default_width, @default_height ) nil end |
#TimedLongMessageGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 |
# File 'library/general/src/modules/Popup.rb', line 1124 def TimedLongMessageGeometry(, timeout_seconds, width, height) anyTimedRichMessageInternal( NoHeadline(), , timeout_seconds, width, height ) nil end |
#TimedLongNotify(message, timeout_seconds) ⇒ Object
Show a long error message and wait until user clicked "OK" or time is out.
1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 |
# File 'library/general/src/modules/Popup.rb', line 1465 def TimedLongNotify(, timeout_seconds) anyTimedRichMessageInternal( NoHeadline(), , timeout_seconds, @default_width, @default_height ) nil end |
#TimedLongNotifyGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long notify message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 |
# File 'library/general/src/modules/Popup.rb', line 1483 def TimedLongNotifyGeometry(, timeout_seconds, width, height) anyTimedRichMessageInternal( NoHeadline(), , timeout_seconds, width, height ) nil end |
#TimedLongWarning(message, timeout_seconds) ⇒ Object
Show a long warning message and wait until user clicked "OK" or time is out.
1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 |
# File 'library/general/src/modules/Popup.rb', line 1225 def TimedLongWarning(, timeout_seconds) anyTimedRichMessageInternal( Label.WarningMsg, , timeout_seconds, @default_width, @default_height ) nil end |
#TimedLongWarningGeometry(message, timeout_seconds, width, height) ⇒ Object
Show a long warning and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 |
# File 'library/general/src/modules/Popup.rb', line 1243 def TimedLongWarningGeometry(, timeout_seconds, width, height) anyTimedRichMessageInternal( Label.WarningMsg, , timeout_seconds, width, height ) nil end |
#TimedMessage(message, timeout_seconds) ⇒ Object
Show a message and wait until user clicked "OK" or time is out
1092 1093 1094 1095 1096 1097 1098 1099 1100 |
# File 'library/general/src/modules/Popup.rb', line 1092 def TimedMessage(, timeout_seconds) anyTimedMessageInternal( NoHeadline(), , timeout_seconds ) nil end |
#TimedNotify(message, timeout_seconds) ⇒ Object
Show a long notify message and wait until user clicked "OK" or the time is out.
1451 1452 1453 1454 1455 1456 1457 1458 1459 |
# File 'library/general/src/modules/Popup.rb', line 1451 def TimedNotify(, timeout_seconds) anyTimedMessageInternal( NoHeadline(), , timeout_seconds ) nil end |
#TimedOKCancel(message, timeout_seconds) ⇒ Object
Display a message with a timeout
Display a message with a timeout and return when the user clicks "OK", "Cancel" or when the timeout expires ("OK" is assumed then).
There is also a "stop" button that will stop the countdown. If the user clicks that, the popup will wait forever (or until "OK" or "Cancel" is clicked, of course).
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 |
# File 'library/general/src/modules/Popup.rb', line 1527 def TimedOKCancel(, timeout_seconds) success = UI.OpenDialog( Opt(:decorated), HBox( HSpacing(1), VBox( VSpacing(0.2), Label(), HCenter(Label(Id(:remaining_time), Ops.add("", timeout_seconds))), ButtonBox( PushButton(Id(:timed_stop), Opt(:customButton), Label.StopButton), PushButton( Id(:timed_ok), Opt(:default, :key_F10, :okButton), Label.OKButton ), PushButton( Id(:timed_cancel), Opt(:key_F9, :cancelButton), Label.CancelButton ) ), VSpacing(0.2) ) ) ) while Ops.greater_than(timeout_seconds, 0) which_input = UI.TimeoutUserInput(1000) break if which_input == :timed_ok break if which_input == :timed_cancel if which_input == :timed_stop which_input = UI.UserInput while which_input == :timed_stop break end timeout_seconds = Ops.subtract(timeout_seconds, 1) UI.ChangeWidget( Id(:remaining_time), :Value, Ops.add("", timeout_seconds) ) end UI.CloseDialog if success == true which_input != :timed_cancel end |
#TimedWarning(message, timeout_seconds) ⇒ void
This method returns an undefined value.
Show a warning message and wait specified amount of time or until user clicked "OK".
1211 1212 1213 1214 1215 1216 1217 1218 1219 |
# File 'library/general/src/modules/Popup.rb', line 1211 def TimedWarning(, timeout_seconds) anyTimedMessageInternal( Label.WarningMsg, , timeout_seconds ) nil end |
#Warning(message) ⇒ Object
Show a warning message and wait until user clicked "OK".
1165 1166 1167 1168 1169 |
# File 'library/general/src/modules/Popup.rb', line 1165 def Warning() anyMessageInternal(Label.WarningMsg, ) nil end |
#WarningDetails(message, details) ⇒ Object
Show a warning with Details button and wait until user clicked "OK".
1262 1263 1264 1265 1266 1267 1268 1269 1270 |
# File 'library/general/src/modules/Popup.rb', line 1262 def WarningDetails(, details) anyMessageDetailsInternal( Label.WarningMsg, , details ) nil end |
#YesNo(message) ⇒ Boolean
Display a yes/no question and wait for answer.
Should be used for decisions about two about equivalent paths, not for simple confirmation - use "Popup::ContinueCancel()" for those. The default button is Yes. Returns true if Yes is clicked.
552 553 554 555 556 557 558 |
# File 'library/general/src/modules/Popup.rb', line 552 def YesNo() ret = YesNoHeadline(NoHeadline(), ) Builtins.y2debug("YesNo returned: %1", ret) ret end |
#YesNoHeadline(headline, message) ⇒ Boolean
This dialog displays "message" (a question) and has a Yes and a No button.
It should be used for decisions about two about equivalent paths, not for simple confirmation - use "Popup::ContinueCancel()" for those. A short headline can be displayed (without headline you can use Popup::YesNo()).
The default button is Yes.
Returns true if Yes is clicked.
521 522 523 524 525 526 527 528 529 530 531 532 533 |
# File 'library/general/src/modules/Popup.rb', line 521 def YesNoHeadline(headline, ) ret = AnyQuestion( headline, , Label.YesButton, Label.NoButton, :focus_yes ) Builtins.y2debug("YesNoHeadline returned: %1", ret) ret end |