window-license-agreement.cpp 652 B

12345678910111213141516171819202122232425
  1. #include <string>
  2. #include <util/util.hpp>
  3. #include <util/platform.h>
  4. #include <platform.hpp>
  5. #include "window-license-agreement.hpp"
  6. #include "qt-wrappers.hpp"
  7. using namespace std;
  8. OBSLicenseAgreement::OBSLicenseAgreement(QWidget *parent)
  9. : QDialog (parent),
  10. ui (new Ui::OBSLicenseAgreement)
  11. {
  12. ui->setupUi(this);
  13. string path;
  14. if (!GetDataFilePath("license/gplv2.txt", path))
  15. throw "Could not find license file";
  16. BPtr<char> licenseText = os_quick_read_utf8_file(path.c_str());
  17. if (!licenseText || !*licenseText || strlen(licenseText) < 1000)
  18. throw "Invalid license file data";
  19. ui->license->setPlainText(QT_UTF8(licenseText));
  20. }