UI: Remove license agreement dialog

This commit is contained in:
cg2121 2018-09-02 04:35:12 -05:00
parent 36b0ef5b7e
commit 8882cfc484
6 changed files with 25 additions and 197 deletions

View file

@ -146,7 +146,6 @@ set(obs_SOURCES
window-basic-main-transitions.cpp
window-basic-main-dropfiles.cpp
window-basic-main-profiles.cpp
window-license-agreement.cpp
window-basic-status-bar.cpp
window-basic-adv-audio.cpp
window-basic-transform.cpp
@ -196,7 +195,6 @@ set(obs_HEADERS
window-basic-main-outputs.hpp
window-basic-source-select.hpp
window-basic-about.hpp
window-license-agreement.hpp
window-basic-status-bar.hpp
window-basic-adv-audio.hpp
window-basic-transform.hpp
@ -240,7 +238,6 @@ set(obs_UI
forms/AutoConfigStreamPage.ui
forms/AutoConfigTestPage.ui
forms/ColorSelect.ui
forms/OBSLicenseAgreement.ui
forms/OBSLogReply.ui
forms/OBSBasic.ui
forms/OBSBasicTransform.ui

View file

@ -267,13 +267,6 @@ LogReturnDialog="Log Upload Successful"
LogReturnDialog.CopyURL="Copy URL"
LogReturnDialog.ErrorUploadingLog="Error uploading log file"
# license agreement dialog
LicenseAgreement="License Agreement"
LicenseAgreement.PleaseReview="Please review the license terms before using OBS. By using this program, you acknowledge that you have read and agree to the terms of the <a href='http://www.gnu.org/licenses/gpl-2.0.html'>GNU General Public License v2.0</a>. Please scroll down to see the rest of the agreement."
LicenseAgreement.ClickIAgreeToContinue="If you accept the terms of the agreement, click I Agree to continue. You must accept the agreement to use OBS."
LicenseAgreement.IAgree="I Agree"
LicenseAgreement.Exit="Exit"
# remux dialog
Remux.SourceFile="OBS Recording"
Remux.TargetFile="Target File"

View file

@ -1,108 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OBSLicenseAgreement</class>
<widget class="QDialog" name="OBSLicenseAgreement">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>457</width>
<height>430</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>300</height>
</size>
</property>
<property name="windowTitle">
<string>LicenseAgreement</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="agreement">
<property name="text">
<string>LicenseAgreement.PleaseReview</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="license">
<property name="documentTitle">
<string/>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="plainText">
<string/>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item alignment="Qt::AlignHCenter|Qt::AlignVCenter">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="agree">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>agree</sender>
<signal>clicked()</signal>
<receiver>OBSLicenseAgreement</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>138</x>
<y>419</y>
</hint>
<hint type="destinationlabel">
<x>40</x>
<y>424</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View file

@ -39,7 +39,6 @@
#include "obs-app.hpp"
#include "window-basic-main.hpp"
#include "window-basic-settings.hpp"
#include "window-license-agreement.hpp"
#include "crash-report.hpp"
#include "platform.hpp"
@ -1218,56 +1217,42 @@ bool OBSApp::OBSInit()
setAttribute(Qt::AA_UseHighDpiPixmaps);
bool licenseAccepted = config_get_bool(globalConfig, "General",
"LicenseAccepted");
OBSLicenseAgreement agreement(nullptr);
if (licenseAccepted || agreement.exec() == QDialog::Accepted) {
if (!licenseAccepted) {
config_set_bool(globalConfig, "General",
"LicenseAccepted", true);
config_save(globalConfig);
}
if (!StartupOBS(locale.c_str(), GetProfilerNameStore()))
return false;
if (!StartupOBS(locale.c_str(), GetProfilerNameStore()))
return false;
#ifdef _WIN32
bool browserHWAccel = config_get_bool(globalConfig, "General",
"BrowserHWAccel");
bool browserHWAccel = config_get_bool(globalConfig, "General",
"BrowserHWAccel");
obs_data_t *settings = obs_data_create();
obs_data_set_bool(settings, "BrowserHWAccel", browserHWAccel);
obs_apply_private_data(settings);
obs_data_release(settings);
obs_data_t *settings = obs_data_create();
obs_data_set_bool(settings, "BrowserHWAccel", browserHWAccel);
obs_apply_private_data(settings);
obs_data_release(settings);
blog(LOG_INFO, "Browser Hardware Acceleration: %s",
browserHWAccel ? "true" : "false");
blog(LOG_INFO, "Browser Hardware Acceleration: %s",
browserHWAccel ? "true" : "false");
#endif
blog(LOG_INFO, "Portable mode: %s",
portable_mode ? "true" : "false");
blog(LOG_INFO, "Portable mode: %s",
portable_mode ? "true" : "false");
setQuitOnLastWindowClosed(false);
setQuitOnLastWindowClosed(false);
mainWindow = new OBSBasic();
mainWindow = new OBSBasic();
mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);
connect(mainWindow, SIGNAL(destroyed()), this, SLOT(quit()));
mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);
connect(mainWindow, SIGNAL(destroyed()), this, SLOT(quit()));
mainWindow->OBSInit();
mainWindow->OBSInit();
connect(this, &QGuiApplication::applicationStateChanged,
[this](Qt::ApplicationState state)
{
ResetHotkeyState(
state != Qt::ApplicationActive);
});
ResetHotkeyState(applicationState() != Qt::ApplicationActive);
return true;
} else {
return false;
}
connect(this, &QGuiApplication::applicationStateChanged,
[this](Qt::ApplicationState state)
{
ResetHotkeyState(
state != Qt::ApplicationActive);
});
ResetHotkeyState(applicationState() != Qt::ApplicationActive);
return true;
}
string OBSApp::GetVersionString() const

View file

@ -1,25 +0,0 @@
#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));
}

View file

@ -1,14 +0,0 @@
#pragma once
#include <memory>
#include "ui_OBSLicenseAgreement.h"
class OBSLicenseAgreement : public QDialog {
Q_OBJECT
private:
std::unique_ptr<Ui::OBSLicenseAgreement> ui;
public:
OBSLicenseAgreement(QWidget *parent);
};