| 39 | // Implementation of the "help about" dialog |
| 40 | |
| 41 | HelpAboutDialog::HelpAboutDialog (QWidget *parent) |
| 42 | : QDialog (parent) |
| 43 | { |
| 44 | mp_ui = new Ui::HelpAboutDialog (); |
| 45 | mp_ui->setupUi (this); |
| 46 | |
| 47 | std::vector<std::string> build_options; |
| 48 | if (lay::ApplicationBase::instance ()->ruby_interpreter ().available ()) { |
| 49 | build_options.push_back (tl::to_string (tr ("Ruby interpreter ")) + lay::ApplicationBase::instance ()->ruby_interpreter ().version ()); |
| 50 | } |
| 51 | if (lay::ApplicationBase::instance ()->python_interpreter ().available ()) { |
| 52 | build_options.push_back (tl::to_string (tr ("Python interpreter ")) + lay::ApplicationBase::instance ()->python_interpreter ().version ()); |
| 53 | } |
| 54 | #if defined(HAVE_QTBINDINGS) |
| 55 | build_options.push_back (tl::to_string (tr ("Qt bindings for scripts"))); |
| 56 | #endif |
| 57 | #if defined(HAVE_64BIT_COORD) |
| 58 | build_options.push_back (tl::to_string (tr ("Wide coordinates (64 bit)"))); |
| 59 | #endif |
| 60 | |
| 61 | std::string s; |
| 62 | |
| 63 | s = "<html><body>"; |
| 64 | |
| 65 | s += "<h1>"; |
| 66 | s += escape_xml (std::string (lay::Version::name ()) + " " + lay::Version::version ()); |
| 67 | s += "</h1>"; |
| 68 | |
| 69 | std::vector<std::string> about_paras = tl::split (lay::Version::about_text (), "\n\n"); |
| 70 | for (std::vector<std::string>::const_iterator p = about_paras.begin (); p != about_paras.end (); ++p) { |
| 71 | s += std::string ("<p>") + escape_xml (*p) + "</p>"; |
| 72 | } |
| 73 | |
| 74 | if (! build_options.empty ()) { |
| 75 | s += "<p>"; |
| 76 | s += "<h4>"; |
| 77 | s += escape_xml (tl::to_string (QObject::tr ("Build options:"))); |
| 78 | s += "</h4><ul>"; |
| 79 | for (std::vector<std::string>::const_iterator bo = build_options.begin (); bo != build_options.end (); ++bo) { |
| 80 | s += "<li>"; |
| 81 | s += escape_xml (*bo); |
| 82 | s += "</li>"; |
| 83 | } |
| 84 | s += "</ul>"; |
| 85 | } |
| 86 | |
| 87 | if (! lay::plugins ().empty () || ! db::plugins ().empty ()) { |
| 88 | |
| 89 | s += "<p>"; |
| 90 | s += "<h4>"; |
| 91 | s += escape_xml (tl::to_string (QObject::tr ("Binary extensions:"))); |
| 92 | s += "</h4><ul>"; |
| 93 | |
| 94 | for (std::list<lay::PluginDescriptor>::const_iterator pd = lay::plugins ().begin (); pd != lay::plugins ().end (); ++pd) { |
| 95 | s += "<li>"; |
| 96 | if (! pd->description.empty ()) { |
| 97 | s += escape_xml (pd->description); |
| 98 | } else { |
nothing calls this directly
no test coverage detected