1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Add LICENSE inside of the settings

This commit is contained in:
Elias Steurer 2018-08-30 12:59:09 +02:00
parent 05ecc78534
commit d32047557c
5 changed files with 129 additions and 2 deletions

View File

@ -108,5 +108,12 @@
<file>assets/icons/icon_open_in_new.svg</file> <file>assets/icons/icon_open_in_new.svg</file>
<file>translations/ScreenPlay_de.qm</file> <file>translations/ScreenPlay_de.qm</file>
<file>translations/ScreenPlay_en.qm</file> <file>translations/ScreenPlay_en.qm</file>
<file>qml/Settings/SettingsExpander.qml</file>
<file>legal/Font Awesome Free License.txt</file>
<file>legal/gpl-3.0.txt</file>
<file>legal/lgpl-2.1.txt</file>
<file>legal/OFL.txt</file>
<file>legal/OpenSSL.txt</file>
<file>legal/Qt LGPLv3.txt</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -245,7 +245,7 @@ Item {
Item { Item {
id: settingsAboutrapper id: settingsAboutrapper
height: 350 height: settingsAboutrapperWrapper.childrenRect.height + 100
width: parent.width width: parent.width
RectangularGlow { RectangularGlow {
@ -265,6 +265,7 @@ Item {
} }
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: 4 radius: 4
clip: true clip: true
@ -281,6 +282,7 @@ Item {
} }
Column { Column {
id:settingsAboutrapperWrapper
width: parent.width width: parent.width
spacing: 10 spacing: 10
anchors { anchors {
@ -350,7 +352,14 @@ Item {
description: qsTr("ScreenPlay would not be possible without the work of others. A big thank you to: ") description: qsTr("ScreenPlay would not be possible without the work of others. A big thank you to: ")
buttonText: qsTr("Licenses") buttonText: qsTr("Licenses")
onButtonPressed: { onButtonPressed: {
utility.openLicenceFolder() expander.toggle()
}
}
SettingsExpander {
id:expander
anchors {
left: parent.left
right: parent.right
} }
} }
} }

View File

@ -0,0 +1,70 @@
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.3
Rectangle {
id: root
state: "off"
clip: true
Flickable {
anchors.fill: parent
contentHeight: txtLegal.paintedHeight
z: 999
focus: true
contentWidth: parent.width
ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn
}
Text {
id: txtLegal
anchors {
top: parent.top
right: parent.right
left: parent.left
margins: 20
}
color: "#626262"
renderType: Text.NativeRendering
height: txtLegal.paintedHeight
onHeightChanged: print(height)
text: screenPlaySettings.getAllLicenes()
}
}
function toggle() {
root.state = root.state == "on" ? "off" : "on"
}
states: [
State {
name: "on"
PropertyChanges {
target: root
height: 500
}
},
State {
name: "off"
PropertyChanges {
target: root
height: 0
}
}
]
transitions: [
Transition {
from: "off"
to: "on"
reversible: true
PropertyAnimation {
target: root
property: "height"
duration: 250
}
}
]
}

View File

@ -175,6 +175,46 @@ void Settings::writeSingleSettingConfig(QString name, QVariant value)
configTmp.close(); configTmp.close();
} }
QString Settings::getAllLicenes()
{
QString tmp;
QFile file;
QTextStream out(&file);
file.setFileName(":/legal/Font Awesome Free License.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/gpl-3.0.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/gpl-3.0.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/OFL.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/OpenSSL.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
file.setFileName(":/legal/Qt LGPLv3.txt");
file.open(QIODevice::ReadOnly | QIODevice::Text);
tmp += out.readAll();
file.close();
return tmp;
}
void Settings::setMuteAll(bool isMuted) void Settings::setMuteAll(bool isMuted)
{ {

View File

@ -144,6 +144,7 @@ public slots:
void setGlobalVolume(float volume); void setGlobalVolume(float volume);
void setGlobalFillMode(QString fillMode); void setGlobalFillMode(QString fillMode);
void writeSingleSettingConfig(QString name, QVariant value); void writeSingleSettingConfig(QString name, QVariant value);
QString getAllLicenes();
bool autostart() const bool autostart() const
{ {