yast2 |
modules/Popup.ycp |
Commonly used popup dialogs | |
|
|
This module has an unstable interface. |
Internal function that returns a popup dialog with an additional label.
- Parameters:
-
headline headline to show or Popup::NoHeadline() message message text to show icon_name icon name (with full path) or Popup::NoIcon() button_box term with one or more buttons label second label with id `label which can be used e.g. for time out value displaying richtext width height
- Return value:
-
the layout contents as a term
Internal function - wrapper for popupLayoutInternalTypeWithLabel call
- Parameters:
-
headline message icon_name button_box
Internal function - wrapper for popupLayoutInternalTypeWithLabel call
- Parameters:
-
headline message icon_name button_box width height
Internal version of AnyTimedMessage
Show a message with optional headline above and wait until user clicked "OK" or until a timeout runs out.
- Parameters:
-
headline optional headline or Popup::NoHeadline() message the message (maybe multi-line) to display. icon_name icon name (with full path) or Popup::NoIcon() timeout After timeout seconds dialog will be automatically closed richtext width height
Internal function - wrapper for anyTimedMessageTypeInternal call
- Parameters:
-
headline message icon_name timeout
Internal function - wrapper for anyTimedMessageTypeInternal call
- Parameters:
-
headline message icon_name timeout width height
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.
- Return value:
-
empty string ("")
Indicator for empty icon for popups that can have one - for code readability.
Button box for the AnyQuestion Dialog (internal function).
- Parameters:
-
yes_button_message label on affirmative buttons (on left side) no_button_message label on negating button (on right side) focus `focus_yes (first button) or `focus_no (second button)
- Return value:
-
button box
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!
- Parameters:
-
headline headline or Popup::NoHeadline() message message string yes_button_message label on affirmative buttons (on left side) no_button_message label on negating button (on right side) focus `focus_yes (first button) or `focus_no (second button)
- Return value:
-
true: first button has been clicked false: second button has been clicked
- Example
-
Popup::AnyQuestion( Label::WarningMsg(), "Do really want to ...?", "Install", "Don't do it", `focus_no );
- See
-
YesNo ContinueCancel
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!
- Parameters:
-
headline headline or Popup::NoHeadline() message message string yes_button_message label on affirmative buttons (on left side) no_button_message label on negating button (on right side) focus `focus_yes (first button) or `focus_no (second button)
- Return value:
-
true: first button has been clicked false: second button has been clicked
- Example
-
Popup::ErrorAnyQuestion( Label::WarningMsg(), "Do really want to ...?", "Install", "Don't do it", `focus_no );
- See
-
YesNo ContinueCancel
Timed question popup with two buttons and time display
- Parameters:
-
headline headline or Popup::NoHeadline() message message string yes_button_message label on affirmative buttons (on left side) no_button_message label on negating button (on right side) focus `focus_yes (first button) or `focus_no (second button) timeout_seconds timeout, if 0, normal behaviour
- Return value:
-
True if Yes, False if no
- See
-
AnyQuestion
Timed error question popup with two buttons and time display
- Parameters:
-
headline headline or Popup::NoHeadline() message message string yes_button_message label on affirmative buttons (on left side) no_button_message label on negating button (on right side) focus `focus_yes (first button) or `focus_no (second button) timeout_seconds timeout, if 0, normal behaviour
- Return value:
-
True if Yes, False if no
- See
-
AnyQuestion
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.
- Parameters:
-
headline short headline or Popup::NoHeadline() message message string
- Return value:
-
- Example
-
Popup::ContinueCancelHeadline ( "Short Header", "Going on with action....?" );
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.
- Parameters:
-
message message string
- Return value:
-
- Example
-
Popup::ContinueCancel ( "Please insert required CD-ROM." );
- See
-
AnyQuestion
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.
- Parameters:
-
headline short headline or Popup::NoHeadline() message message string
- Return value:
-
true if [Yes] has been pressed
- Example
-
Popup::YesNoHeadline ( "Resize Windows Partition?", "... explanation of dangers ..." );
- See
-
YesNo AnyQuestion
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.
- Parameters:
-
message message string
- Return value:
-
true if [Yes] has been pressed
- Example
-
Popup::YesNo ( "Create a backup of the config files?" );
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.
- Parameters:
-
headline short headline richtext text input is `Richtext() hdim initial horizontal dimension of the popup vdim initial vertical dimension of the popup
- Example
-
Popup::LongText ( "Package description", `Richtext("
Hello, this is a long description .....
"), 50, 20 );
Show a question that might need scrolling.
- Parameters:
-
headline short headline richtext text input as a rich text hdim initial horizontal dimension of the popup vdim initial vertical dimension of the popup yes_button_message message on the left/true button no_button_message message on the right/false button focus `focus_yes, `focus_no, `focus_none
- Return value:
-
left button pressed?
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.
- Parameters:
-
severity `painless, `incomplete, `unusable
- Return value:
-
- Example
-
Popup::ConfirmAbort ( `painless );
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.
- Parameters:
-
have_changes true: There are changes that will be lost false: No changes
- Return value:
-
true: "abort" confirmed; false: don't abort
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.
- Parameters:
-
headline optional headline or Popup::NoHeadline() message the message (maybe multi-line) to display. details the detailed information text icon_name richtext width height
Generic message popup - internal
Show a message with optional headline above and wait until user clicked "OK".
- Parameters:
-
headline optional headline or Popup::NoHeadline() message the message (maybe multi-line) to display. icon_name richtext width height
Internal function - wrapper for anyMessageInternal call
- Parameters:
-
headline message icon_name
Internal function - wrapper for anyMessageInternal call
- Parameters:
-
headline message icon_name width height
Internal function - wrapper for anyMessageDetailsInternalType call
- Parameters:
-
headline message details icon_name
Generic message popup - internal
Show a message with optional headline above and wait until user clicked "OK".
- Parameters:
-
headline optional headline or Popup::NoHeadline() message the message (maybe multi-line) to display. icon_name width height
Generic message popup
Show a message with optional headline above and wait until user clicked "OK".
- Parameters:
-
headline optional headline or Popup::NoHeadline() message the message (maybe multi-line) to display.
Clear feedback message
Show popup with a headline and a message for feedback
- Parameters:
-
headline headline of Feedback popup message the feedback message
Show a simple message and wait until user clicked "OK".
- Parameters:
-
message message string
- Example
-
Popup::Message("This is an information about ... ." );
- See
-
AnyMessage Notify Warning Error
Show a long message and wait until user clicked "OK".
- Parameters:
-
message message string (may contain rich text tags)
Show a long message and wait until user clicked "OK". Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) width width of the popup window height height of the popup window
Show a message and wait until user clicked "OK" or time is out
- Parameters:
-
message message string timeout_seconds time out in seconds
Show a long message and wait until user clicked "OK" or time is out.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds
Show a long message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds width width of the popup window height height of the popup window
Show a message with Details button and wait until user clicked "OK".
- Parameters:
-
message message string details detailed information string
- Example
-
Popup::MessageDetails("This is an information about ... .", "This service is intended to...");
- See
-
Message
Show a warning message and wait until user clicked "OK".
- Parameters:
-
message warning message string
- Example
-
Popup::Warning("Something is wrong. Please check your configuration." );
- See
-
Message Notify Error AnyMessage
Show a long warning and wait until user clicked "OK".
- Parameters:
-
message message string (may contain rich text tags)
Show a long warning and wait until user clicked "OK". Size of the popup window is adjustable
- Parameters:
-
message message string (may contain rich text tags) width width of the popup window height height of the popup window
Show a warning message and wait specified amount of time or until user clicked "OK".
- Parameters:
-
message warning message string timeout_seconds time out in seconds
- Return value:
-
- See
-
Warning
Show a long warning message and wait until user clicked "OK" or time is out.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds
Show a long warning and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds width width of the popup window height height of the popup window
Show a warning with Details button and wait until user clicked "OK".
- Parameters:
-
message warning message string details detailed information string
- Example
-
Popup::WarningDetails("Something is wrong. Please check your configuration.", "possible problem is in..." );
- See
-
Message
Show an error message and wait until user clicked "OK".
- Parameters:
-
message error message string
- Example
-
Popup::Error("The configuration was not succesful." );
Show a long error and wait until user clicked "OK".
- Parameters:
-
message message string (may contain rich text tags)
Show a long error message and wait until user clicked "OK". Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) width width of the popup window height height of the popup window
Show an error message and wait specified amount of time or until user clicked "OK".
- Parameters:
-
message error message string timeout_seconds time out in seconds
- Return value:
-
- See
-
Error
Show a long error message and wait until user clicked "OK" or time is out.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds
Show a long error message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds width width of the popup window height height of the popup window
Show an error message with Details button and wait until user clicked "OK".
- Parameters:
-
message error message string details detailed information string
- Example
-
Popup::ErrorDetails("The configuration was not succesful.", "Service failed to start");
- See
-
Message
Show a notification message and wait until user clicked "OK".
- Parameters:
-
message notify message string
- Example
-
Popup::Notify("Your printer is ready for use." );
- See
-
Message AnyMessage
Show a long notify message and wait until user clicked "OK".
- Parameters:
-
message message string (may contain rich text tags)
Show a long notify message and wait until user clicked "OK". Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) width width of the popup window height height of the popup window
Show a long notify message and wait until user clicked "OK" or the time is out.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds
Show a long error message and wait until user clicked "OK" or time is out.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds
Show a long notify message and wait until user clicked "OK" or time is out. Size of the popup window is adjustable.
- Parameters:
-
message message string (may contain rich text tags) timeout_seconds time out in seconds width width of the popup window height height of the popup window
Show a notify message with Details button and wait until user clicked "OK".
- Parameters:
-
message error message string details detailed information string
- See
-
Message
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).
- Parameters:
-
message message to display timeout_seconds the timeout in seconds
- Return value:
-
true --> "OK" or timer expired
false --> "Cancel"
- Example
-
boolean ret = Popup::TimedOKCancel("This is a timed message", 2 );
Generic question popup with three buttons.
- Parameters:
-
headline headline or Popup::NoHeadline() message message string yes_button_message label on affirmative button (on left side) no_button_message label on negating button (middle) retry_button_message label on retry button (on right side) focus `focus_yes (first button), `focus_no (second button) or `focus_retry (third button)
- Return value:
-
- `yes: first button has been clicked - `no: second button has been clicked - `retry: third button has been clicked
- Example
-
Popup::AnyQuestion3( Label::WarningMsg(), _("... failed"), _("Continue"), _("Cancel"), _("Retry"), `focus_yes );
- See
-
AnyQuestion
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
- Parameters:
-
text string
- Return value:
-
`back, `again, `cancel, `next
- Example
-
Popup::ModuleError( "The module " + symbolof(argterm) + " does not work." );
Generic message popup
Show a message with optional headline above and wait until user clicked "OK" or until a timeout runs out.
- Parameters:
-
headline optional headline or Popup::NoHeadline() message the message (maybe multi-line) to display. timeout After timeout seconds dialog will be automatically closed
- Return value:
-
Show the contents of an entire file in a popup.
- Parameters:
-
headline headline text text text to show timeout text to show
- Example
-
Popup::ShowText ("Boot Messages", "kernel panic", 10);
Show the contents of an entire file in a popup.
- Parameters:
-
headline headline text text text to show
- Example
-
Popup::ShowText ("Boot Messages", "kernel panic");
Show the contents of an entire file in a popup.
Notice: This is a WFM function, NOT an UI function!
- Parameters:
-
headline headline text filename filename with path of the file to show
- Example
-
Popup::ShowFile ("Boot Messages", "/var/log/boot.msg");