7#include <wx/filename.h>
10#include "dialog_alert.h"
15#include "model/safe_mode.h"
19static const char* LAST_RUN_ERROR_MSG =
20 _(
"<p>The last opencpn run seems to have failed. Do you want to run\n"
21 "in safe mode without plugins and other possibly problematic\n"
22 "features?\n</p><br/></br><p>You may consider visiting the <a "
23 "href=\"https://github.com/OpenCPN/OpenCPN/wiki/"
24 "OpenCPN-5.10-known-issues\">list of known issues</a>.</p>");
31 std::string path = check_file_path();
33 std::ofstream dest(path, std::ios::binary);
34 dest <<
"Internal opencpn use" << std::endl;
39 std::string title = _(
"Safe Restart").ToStdString();
40 std::string action = _(
"Safe mode start").ToStdString();
47 std::stringstream html;
48 html <<
"<html><body>";
49 html << LAST_RUN_ERROR_MSG;
50 html <<
"</body></html>";
A modal message dialog with confirmation button and cancel button.
int ShowModal() override
Show dialog and return response.
void SetDefaultButton(int id)
Set default button (for enter).
void SetTimer(int seconds)
Activate timer.
void SetCancelLabel(const std::string &label)
Overwrite cancel button label.
void AddHtmlContent(const std::stringstream &html)
Display HTML content.
void SetInitialSize()
Initialize by display geometry.
Global variables reflecting command line options and arguments.
General purpose GUI support.
bool exists(const std::string &name)
void check_last_start()
Check if the last start failed, possibly invoke user dialog and set safe mode state.
Miscellaneous utilities, many of which string related.