203. Popup

Commonly used popup dialogs

203.1. Authors

  • Gabriele Strattner <gs@suse.de>

  • Stefan Hundhammer <sh@suse.de>

  • Arvin Schnell <arvin@suse.de>

203.2. 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

    203.3. Global Functions

    203.3.1. AnyMessage

    Generic message popup

    Function parameters

    • string headline

    • string message

    Return value

    • void

    203.3.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 58. 

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


    See also:

    • YesNo

    • ContinueCancel

    203.3.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 59. 

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


    See also:

    • AnyQuestion

    203.3.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?

    203.3.5. AnyTimedMessage

    Generic message popup

    Function parameters

    • string headline

    • string message

    • integer timeout

    Return value

    • void -

    203.3.6. ClearFeedback

    Clear feedback message

    Return value

    • void

    203.3.7. ConfirmAbort

    Confirmation for "Abort" button during installation.

    Function parameters

    • symbol severity

    Return value

    • boolean -

    Example 60. 

     Popup::ConfirmAbort ( `painless );


    203.3.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 61. 

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


    See also:

    • AnyQuestion

    203.3.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 62. 

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


    See also:

    • ContinueCancel

    • YesNo

    • AnyQuestion

    203.3.10. Error

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

    Function parameters

    • string message

    Return value

    • void

    Example 63. 

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


    See also:

    • Message

    • Notify

    • Warning

    • AnyMessage

    203.3.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 64. 

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


    See also:

    • Message

    203.3.12. LongError

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

    Function parameters

    • string message

    Return value

    • void

    203.3.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

    203.3.14. LongMessage

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

    Function parameters

    • string message

    Return value

    • void

    203.3.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

    203.3.16. LongNotify

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

    Function parameters

    • string message

    Return value

    • void

    203.3.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

    203.3.18. LongText

    Show a long text that might need scrolling.

    Function parameters

    • string headline

    • term richtext

    • integer hdim

    • integer vdim

    Return value

    • void

    Example 65. 

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


    203.3.19. LongWarning

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

    Function parameters

    • string message

    Return value

    • void

    203.3.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

    203.3.21. Message

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

    Function parameters

    • string message

    Return value

    • void

    Example 66. 

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


    See also:

    • AnyMessage

    • Notify

    • Warning

    • Error

    203.3.22. MessageDetails

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

    Function parameters

    • string message

    • string details

    Return value

    • void

    Example 67. 

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


    See also:

    • Message

    203.3.23. ModuleError

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

    Function parameters

    • string text

    Return value

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

    Example 68. 

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


    203.3.24. NoHeadline

    Indicator for empty headline for popups that can optionally have one

    Return value

    • string - empty string ("")

    203.3.25. NoIcon

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

    Return value

    • string

    203.3.26. Notify

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

    Function parameters

    • string message

    Return value

    • void

    Example 69. 

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


    See also:

    • Message

    • AnyMessage

    203.3.27. NotifyDetails

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

    Function parameters

    • string message

    • string details

    Return value

    • void

    See also:

    • Message

    203.3.28. ReallyAbort

    Confirmation popup when user clicked "Abort".

    Function parameters

    • boolean have_changes

    Return value

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

    203.3.29. ShowFeedback

    Show popup with a headline and a message for feedback

    Function parameters

    • string headline

    • string message

    Return value

    • void

    203.3.30. ShowFile

    Show the contents of an entire file in a popup.

    Function parameters

    • string headline

    • string filename

    Return value

    • void

    Example 70. 

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


    203.3.31. ShowText

    Show the contents of an entire file in a popup.

    Function parameters

    • string headline

    • string text

    Return value

    • void

    Example 71. 

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


    203.3.32. ShowTextTimed

    Show the contents of an entire file in a popup.

    Function parameters

    • string headline

    • string text

    • integer timeout

    Return value

    • void

    Example 72. 

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


    203.3.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

    See also:

    • AnyQuestion

    203.3.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 -

    See also:

    • Error

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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

    203.3.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 73. 

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


    203.3.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 -

    See also:

    • Warning

    203.3.47. Warning

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

    Function parameters

    • string message

    Return value

    • void

    Example 74. 

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


    See also:

    • Message

    • Notify

    • Error

    • AnyMessage

    203.3.48. WarningDetails

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

    Function parameters

    • string message

    • string details

    Return value

    • void

    Example 75. 

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


    See also:

    • Message

    203.3.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 76. 

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


    See also:

    • YesNoHeadline

    • ContinueCancel

    • AnyQuestion

    203.3.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 77. 

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


    See also:

    • YesNo

    • AnyQuestion

    203.4. Global Variables

    203.5. Module Requirements

    203.5.1. Module Imports

    • Directory
    • Icon
    • Label
    • Mode
    • String

    203.5.2. Module Includes