| 88 | } |
| 89 | |
| 90 | int ShowWarningDialog(wxWindow *parent, |
| 91 | const wxString &internalDialogName, |
| 92 | const TranslatableString &message, |
| 93 | bool showCancelButton, |
| 94 | const TranslatableString &footer) |
| 95 | { |
| 96 | auto key = WarningDialogKey(internalDialogName); |
| 97 | if (!gPrefs->Read(key, (long) true)) { |
| 98 | return wxID_OK; |
| 99 | } |
| 100 | |
| 101 | WarningDialog dlog(parent, message, footer, showCancelButton); |
| 102 | |
| 103 | int retCode = dlog.ShowModal(); |
| 104 | if (retCode == wxID_CANCEL) |
| 105 | return retCode; |
| 106 | |
| 107 | gPrefs->Write(key, (retCode == wxID_YES)); |
| 108 | gPrefs->Flush(); |
| 109 | return wxID_OK; |
| 110 | } |
no test coverage detected