205. Popup

Commonly used popup dialogs

205.1. Summary of Module Globals

List of Global Functions

  • AnyMessage - Generic message popup

  • AnyQuestion - Generic question popup with two buttons.

  • AnyQuestion3 - Generic question popup with three buttons.

  • AnyQuestionRichText - Show a question that might need scrolling.

  • AnyTimedMessage - Generic message popup

  • ClearFeedback - Clear feedback message

  • ConfirmAbort - Confirmation for "Abort" button during installation.

  • ContinueCancel - Dialog which displays the "message" and has a <b>Continue</b> and a <b>Cancel</b> button.

  • ContinueCancelHeadline - Dialog which displays the "message" and has a <b>Continue</b> and a <b>Cancel</b> button.

  • Error - Show an error message and wait until user clicked "OK".

  • ErrorDetails - Show an error message with Details button and wait until user clicked "OK".

  • LongError - Show a long error and wait until user clicked "OK".

  • LongErrorGeometry - Show a long error message and wait until user clicked "OK". Size of the popup window is adjustable.

  • LongMessage - Show a long message and wait until user clicked "OK".

  • LongMessageGeometry - Show a long message and wait until user clicked "OK". Size of the popup window is adjustable.

  • LongNotify - Show a long notify message and wait until user clicked "OK".

  • LongNotifyGeometry - Show a long notify message and wait until user clicked "OK". Size of the popup window is adjustable.

  • LongText - Show a long text that might need scrolling.

  • LongWarning - Show a long warning and wait until user clicked "OK".

  • LongWarningGeometry - Show a long warning and wait until user clicked "OK". Size of the popup window is adjustable

  • Message - Show a simple message and wait until user clicked "OK".

  • MessageDetails - Show a message with Details button and wait until user clicked "OK".

  • ModuleError - Special error popup for YCP modules that don't work.

  • NoHeadline - Indicator for empty headline for popups that can optionally have one

  • NoIcon - Indicator for empty icon for popups that can have one - for code readability.

  • Notify - Show a notification message and wait until user clicked "OK".

  • NotifyDetails - Show a notify message with Details button and wait until user clicked "OK".

  • ReallyAbort - Confirmation popup when user clicked "Abort".

  • ShowFeedback - Show popup with a headline and a message for feedback

  • ShowFile - Show the contents of an entire file in a popup.

  • ShowText - Show the contents of an entire file in a popup.

  • ShowTextTimed - Show the contents of an entire file in a popup.

  • TimedAnyQuestion - Timed question popup with two buttons and time display

  • TimedError - Show an error message and wait specified amount of time or until user clicked "OK".

  • TimedLongError - Show a long error message and wait until user clicked "OK" or time is out.

  • TimedLongErrorGeometry - Show a long error message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

  • TimedLongMessage - Show a long message and wait until user clicked "OK" or time is out.

  • TimedLongMessageGeometry - Show a long message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

  • TimedLongNotify - Show a long error message and wait until user clicked "OK" or time is out.

  • TimedLongNotifyGeometry - Show a long notify message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

  • TimedLongWarning - Show a long warning message and wait until user clicked "OK" or time is out.

  • TimedLongWarningGeometry - Show a long warning and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

  • TimedMessage - Show a message and wait until user clicked "OK" or time is out

  • TimedNotify - Show a long notify message and wait until user clicked "OK" or the time is out.

  • TimedOKCancel - Display a message with a timeout

  • TimedWarning - Show a warning message and wait specified amount of time or until user clicked "OK".

  • Warning - Show a warning message and wait until user clicked "OK".

  • WarningDetails - Show a warning with Details button and wait until user clicked "OK".

  • YesNo - Display a yes/no question and wait for answer.

  • YesNoHeadline - This dialog displays "message" (a question) and has a <b>Yes</b> and a <b>No</b> button.

List of Global Variables

    205.2. Global Functions

    205.2.1. AnyMessage

    Generic message popup

    Function parameters

    • string headline

    • string message

    Return value

    • void

    205.2.2. AnyQuestion

    Generic question popup with two buttons.

    Function parameters

    • string headline

    • string message

    • string yes_button_message

    • string no_button_message

    • symbol focus

    Return value

    • boolean - true: first button has been clicked false: second button has been clicked

    Example 54. 

     Popup::AnyQuestion( Label::WarningMsg(), "Do really want to ...?", "Install", "Don't do it", `focus_no );


    205.2.3. AnyQuestion3

    Generic question popup with three buttons.

    Function parameters

    • string headline

    • string message

    • string yes_button_message

    • string no_button_message

    • string retry_button_message

    • symbol focus

    Return value

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

    Example 55. 

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


    205.2.4. AnyQuestionRichText

    Show a question that might need scrolling.

    Function parameters

    • string headline

    • string richtext

    • integer hdim

    • integer vdim

    • string yes_button_message

    • string no_button_message

    • symbol focus

    Return value

    • boolean - left button pressed?

    205.2.5. AnyTimedMessage

    Generic message popup

    Function parameters

    • string headline

    • string message

    • integer timeout

    Return value

    • void -

    205.2.6. ClearFeedback

    Clear feedback message

    Return value

    • void

    205.2.7. ConfirmAbort

    Confirmation for "Abort" button during installation.

    Function parameters

    • symbol severity

    Return value

    • boolean -

    Example 56. 

     Popup::ConfirmAbort ( `painless );


    205.2.8. ContinueCancel

    Dialog which displays the "message" and has a <b>Continue</b> and a <b>Cancel</b> button.

    Function parameters

    • string message

    Return value

    • boolean -

    Example 57. 

     Popup::ContinueCancel ( "Please insert required CD-ROM." );
    


    205.2.9. ContinueCancelHeadline

    Dialog which displays the "message" and has a <b>Continue</b> and a <b>Cancel</b> button.

    Function parameters

    • string headline

    • string message

    Return value

    • boolean -

    Example 58. 

     Popup::ContinueCancelHeadline ( "Short Header", "Going on with action....?" );
    


    205.2.10. Error

    Show an error message and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    Example 59. 

      Popup::Error("The configuration was not succesful." );


    205.2.11. ErrorDetails

    Show an error message with Details button and wait until user clicked "OK".

    Function parameters

    • string message

    • string details

    Return value

    • void

    Example 60. 

      Popup::ErrorDetails("The configuration was not succesful.", "Service failed to start");
    


    205.2.12. LongError

    Show a long error and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    205.2.13. LongErrorGeometry

    Show a long error message and wait until user clicked "OK". Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer width

    • integer height

    Return value

    • void

    205.2.14. LongMessage

    Show a long message and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    205.2.15. LongMessageGeometry

    Show a long message and wait until user clicked "OK". Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer width

    • integer height

    Return value

    • void

    205.2.16. LongNotify

    Show a long notify message and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    205.2.17. LongNotifyGeometry

    Show a long notify message and wait until user clicked "OK". Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer width

    • integer height

    Return value

    • void

    205.2.18. LongText

    Show a long text that might need scrolling.

    Function parameters

    • string headline

    • term richtext

    • integer hdim

    • integer vdim

    Return value

    • void

    Example 61. 

     Popup::LongText ( "Package description", `Richtext("<p>Hello, this is a long description .....</p>"), 50, 20 );


    205.2.19. LongWarning

    Show a long warning and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    205.2.20. LongWarningGeometry

    Show a long warning and wait until user clicked "OK". Size of the popup window is adjustable

    Function parameters

    • string message

    • integer width

    • integer height

    Return value

    • void

    205.2.21. Message

    Show a simple message and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    Example 62. 

      Popup::Message("This is an information about ... ." );
    


    205.2.22. MessageDetails

    Show a message with Details button and wait until user clicked "OK".

    Function parameters

    • string message

    • string details

    Return value

    • void

    Example 63. 

      Popup::MessageDetails("This is an information about ... .", "This service is intended to...");
    


    205.2.23. ModuleError

    Special error popup for YCP modules that don't work.

    Function parameters

    • string text

    Return value

    • symbol - `back, `again, `cancel, `next

    Example 64. 

     Popup::ModuleError( "The module " + symbolof(argterm) + " does not work." );


    205.2.24. NoHeadline

    Indicator for empty headline for popups that can optionally have one

    Return value

    • string - empty string ("")

    205.2.25. NoIcon

    Indicator for empty icon for popups that can have one - for code readability.

    Return value

    • string

    205.2.26. Notify

    Show a notification message and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    Example 65. 

      Popup::Notify("Your printer is ready for use." );
    


    205.2.27. NotifyDetails

    Show a notify message with Details button and wait until user clicked "OK".

    Function parameters

    • string message

    • string details

    Return value

    • void

    205.2.28. ReallyAbort

    Confirmation popup when user clicked "Abort".

    Function parameters

    • boolean have_changes

    Return value

    • boolean - true: "abort" confirmed; false: don't abort

    205.2.29. ShowFeedback

    Show popup with a headline and a message for feedback

    Function parameters

    • string headline

    • string message

    Return value

    • void

    205.2.30. ShowFile

    Show the contents of an entire file in a popup.

    Function parameters

    • string headline

    • string filename

    Return value

    • void

    Example 66. 

     Popup::ShowFile ("Boot Messages", "/var/log/boot.msg");


    205.2.31. ShowText

    Show the contents of an entire file in a popup.

    Function parameters

    • string headline

    • string text

    Return value

    • void

    Example 67. 

     Popup::ShowText ("Boot Messages", "kernel panic");


    205.2.32. ShowTextTimed

    Show the contents of an entire file in a popup.

    Function parameters

    • string headline

    • string text

    • integer timeout

    Return value

    • void

    Example 68. 

     Popup::ShowText ("Boot Messages", "kernel panic");


    205.2.33. TimedAnyQuestion

    Timed question popup with two buttons and time display

    Function parameters

    • string headline

    • string message

    • string yes_button_message

    • string no_button_message

    • symbol focus

    • integer timeout_seconds

    Return value

    • boolean - True if Yes, False if no

    205.2.34. TimedError

    Show an error message and wait specified amount of time or until user clicked "OK".

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void -

    205.2.35. TimedLongError

    Show a long error message and wait until user clicked "OK" or time is out.

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void

    205.2.36. TimedLongErrorGeometry

    Show a long error message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer timeout_seconds

    • integer width

    • integer height

    Return value

    • void

    205.2.37. TimedLongMessage

    Show a long message and wait until user clicked "OK" or time is out.

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void

    205.2.38. TimedLongMessageGeometry

    Show a long message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer timeout_seconds

    • integer width

    • integer height

    Return value

    • void

    205.2.39. TimedLongNotify

    Show a long error message and wait until user clicked "OK" or time is out.

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void

    205.2.40. TimedLongNotifyGeometry

    Show a long notify message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer timeout_seconds

    • integer width

    • integer height

    Return value

    • void

    205.2.41. TimedLongWarning

    Show a long warning message and wait until user clicked "OK" or time is out.

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void

    205.2.42. TimedLongWarningGeometry

    Show a long warning and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.

    Function parameters

    • string message

    • integer timeout_seconds

    • integer width

    • integer height

    Return value

    • void

    205.2.43. TimedMessage

    Show a message and wait until user clicked "OK" or time is out

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void

    205.2.44. TimedNotify

    Show a long notify message and wait until user clicked "OK" or the time is out.

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void

    205.2.45. TimedOKCancel

    Display a message with a timeout

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • boolean - true --> "OK" or timer expired<br> false --> "Cancel"

    Example 69. 

     boolean ret = Popup::TimedOKCancel("This is a timed message", 2 );


    205.2.46. TimedWarning

    Show a warning message and wait specified amount of time or until user clicked "OK".

    Function parameters

    • string message

    • integer timeout_seconds

    Return value

    • void -

    205.2.47. Warning

    Show a warning message and wait until user clicked "OK".

    Function parameters

    • string message

    Return value

    • void

    Example 70. 

     Popup::Warning("Something is wrong. Please check your configuration." );
    


    205.2.48. WarningDetails

    Show a warning with Details button and wait until user clicked "OK".

    Function parameters

    • string message

    • string details

    Return value

    • void

    Example 71. 

     Popup::WarningDetails("Something is wrong. Please check your configuration.", "possible problem is in..." );
    


    205.2.49. YesNo

    Display a yes/no question and wait for answer.

    Function parameters

    • string message

    Return value

    • boolean - true if [Yes] has been pressed

    Example 72. 

      Popup::YesNo ( "Create a backup of the config files?" );
    


    205.2.50. YesNoHeadline

    This dialog displays "message" (a question) and has a <b>Yes</b> and a <b>No</b> button.

    Function parameters

    • string headline

    • string message

    Return value

    • boolean - true if [Yes] has been pressed

    Example 73. 

      Popup::YesNoHeadline ( "Resize Windows Partition?", "... explanation of dangers ..." );
    


    205.3. Global Variables

    205.4. Module Requirements

    205.4.1. Module Imports

    • Directory
    • Icon
    • Label
    • Mode
    • String

    205.4.2. Module Includes