def message_dialog(self, msg, on_cancel):
    self.clear_dialog()
    title = (_('Please check your %s device') % self.device)
    self.dialog = dialog = WindowModalDialog(self.top_level_window(), title)
    l = QLabel(msg)
    vbox = QVBoxLayout(dialog)
    vbox.addWidget(l)
    if on_cancel:
        dialog.rejected.connect(on_cancel)
        vbox.addLayout(Buttons(CancelButton(dialog)))
    dialog.show()
def message_dialog(self, msg, on_cancel):
    self.clear_dialog()
    title = (_('Please check your %s device') % self.device)
    self.dialog = dialog = WindowModalDialog(self.top_level_window(), title)
    l = QLabel(msg)
    vbox = QVBoxLayout(dialog)
    vbox.addWidget(l)
    if on_cancel:
        dialog.rejected.connect(on_cancel)
        vbox.addLayout(Buttons(CancelButton(dialog)))
    dialog.show()