obs-studio/UI/window-license-agreement.cpp
jp9000 01b274f1da UI: Rename 'obs' dir to 'UI'
This is to prevent confusion both when prefixing commits and when
reading the directory structure for the first time.
2016-08-27 20:19:45 -07:00

26 lines
652 B
C++

#include <string>
#include <util/util.hpp>
#include <util/platform.h>
#include <platform.hpp>
#include "window-license-agreement.hpp"
#include "qt-wrappers.hpp"
using namespace std;
OBSLicenseAgreement::OBSLicenseAgreement(QWidget *parent)
: QDialog (parent),
ui (new Ui::OBSLicenseAgreement)
{
ui->setupUi(this);
string path;
if (!GetDataFilePath("license/gplv2.txt", path))
throw "Could not find license file";
BPtr<char> licenseText = os_quick_read_utf8_file(path.c_str());
if (!licenseText || !*licenseText || strlen(licenseText) < 1000)
throw "Invalid license file data";
ui->license->setPlainText(QT_UTF8(licenseText));
}