OpenCPN Partial API docs
Loading...
Searching...
No Matches
welcome.cpp
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2010 by David S. Register *
3 * Copyright (C) 2026 Alec Leamas *
4 *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, see <https://www.gnu.org/licenses/>. *
18 **************************************************************************/
19
26#include "welcome.h"
27
28#include "config.h"
29
30#include <wx/msgdlg.h>
31#include <wx/string.h>
32
33#ifdef __ANDROID__
34#include "androidUTIL.h"
35#endif
36
37static const char *const kMessage = _(R"(
38OpenCPN is distributed in the hope that it will be useful,
39but WITHOUT ANY WARRANTY; without even the implied
40warranty of MERCHANTABILITY or FITNESS FOR A
41PARTICULAR PURPOSE.
42
43See the GNU General Public License for more details.
44
45OpenCPN must only be used in conjunction with approved
46paper charts and traditional methods of navigation.
47
48DO NOT rely upon OpenCPN for safety of life or property.
49
50Please click "Agree" and proceed, or "Cancel" to quit.)");
51
52class WelcomeDlg : public wxMessageDialog {
53public:
54 WelcomeDlg(wxWindow *parent)
55 : wxMessageDialog(parent, kMessage, _("Welcome to OpenCPN"),
56 wxOK | wxCANCEL) {
57 SetOKCancelLabels(_("Agree"), _("Cancel"));
58 }
59};
60
61#ifdef __ANDROID__
62bool ShowNavWarning(wxWindow *parent) {
63 wxString vs = wxString::Format(" .. Version %s", VERSION_FULL);
64 androidShowDisclaimer(_("OpenCPN for Android") + vs, kMessage);
65 return true;
66}
67#else
68bool ShowNavWarning(wxWindow *parent) {
69 WelcomeDlg dlg(parent);
70 int agreed = dlg.ShowModal();
71 return agreed == wxID_OK;
72}
73#endif
bool ShowNavWarning(wxWindow *parent)
Show the "Welcome to OpenCPN" dialog.
Definition welcome.cpp:68
Welcome to OpenCPN stuff.