How to create a suppressible message dialog

This page will describe the suppressible message dialog and how to use it.

A suppressible message dialog is a pop-up dialog box that can be used to display a message to the user. Unlike the DesktopServices::showMessageBox method that displays simple messages boxes, the suppressible message dialog contains a check box that the user can click to prevent the dialog from ever displaying again in all future sessions. Each of these dialogs will have their own specifed ID. This ID will be used to get the dialog check box state from the user's configuration settings. The dialogs can also be used directly by plug-in developers, which allows them to control where and how the dialog state can be stored.

There are three different types of messages that can be displayed in a suppressible message dialog: information message, warning, and error. Depending on the message type, there will be an icon displayed to the left of the message telling the user its type.

If a plug-in developer wanted to give the user more control on whether the message dialog is displayed, an option can be added to a custom Option plug-in. For an example on how this would be done, take a look at the OptionsSuppressibleMsgDlg class located in PlugInSamplerQt.

To use this suppressible message dialog in Opticks, you can just call the DesktopServices::showSuppressibleMsgDlg method.

Here's an example on creating a suppressible message dialog:

 Service<DesktopServices> pDesktop;
 pDesktop->showSuppressibleMsgDlg("Test Dialog", "This is a test.", MESSAGE_INFO, "{CD378586-534C-4fdc-9AC5-325241C688E0}", this);

Software Development Kit - Opticks 4.9.0 Build 16218