Add parameter for QgsMessageViewer to disable deleteOnClose, allows retrieving checkBoxState after dialog has closed