6#include <wx/filename.h>
9#include "base_platform.h"
10#include "ocpn_utils.h"
16extern bool g_bdisable_opengl;
20static const char* LAST_RUN_ERROR_MSG =
21 _(
"The last opencpn run seems to have failed. Do you want to run\n"
22 "in safe mode without plugins and other possibly problematic\n"
26static std::string SEP(
"\\");
28static std::string SEP(
"/");
31static const int TIMEOUT_SECONDS = 15;
35static std::string check_file_path() {
36 std::string path = g_BasePlatform->GetPrivateDataDir().ToStdString();
38 path +=
"startcheck.dat";
42void set_mode(
bool mode) {
44 g_bdisable_opengl = g_bdisable_opengl || mode;
54 std::string path = check_file_path();
55 if (!ocpn::exists(path)) {
56 std::ofstream dest(path, std::ios::binary);
57 dest <<
"Internal opencpn use" << std::endl;
61 long style = wxYES | wxNO | wxNO_DEFAULT | wxICON_QUESTION;
63 _(
"Safe restart"), TIMEOUT_SECONDS,
64 style,
false, wxDefaultPosition);
65 int reply = dlg->ShowModal();
void check_last_start()
Check if the last start failed, possibly invoke user dialog and set safe mode state.
void clear_check()
Mark last run as successful.