2017-12-29 12:21:40 +01:00
|
|
|
import QtQuick 2.9
|
2017-03-27 15:38:25 +02:00
|
|
|
import QtQuick.Window 2.2
|
2017-12-29 12:21:40 +01:00
|
|
|
import QtQuick.Controls 2.3
|
2017-03-27 15:38:25 +02:00
|
|
|
import QtQuick.Layouts 1.3
|
2017-10-24 20:38:17 +02:00
|
|
|
import QtGraphicalEffects 1.0
|
2017-10-26 14:26:27 +02:00
|
|
|
import Qt.labs.platform 1.0
|
2017-12-19 15:43:31 +01:00
|
|
|
|
|
|
|
import "qml/"
|
|
|
|
import "qml/Installed"
|
2017-03-27 15:38:25 +02:00
|
|
|
|
2017-06-06 12:51:53 +02:00
|
|
|
ApplicationWindow {
|
2017-04-04 17:40:21 +02:00
|
|
|
id: window
|
2017-03-27 15:38:25 +02:00
|
|
|
color: "#eeeeee"
|
2017-12-30 11:57:08 +01:00
|
|
|
// Set visible if the -silent parameter was not set
|
|
|
|
visible: false
|
2017-11-16 15:04:45 +01:00
|
|
|
width: 1400
|
2017-04-23 11:31:05 +02:00
|
|
|
minimumHeight: 768
|
|
|
|
minimumWidth: 1050
|
2017-04-03 18:48:34 +02:00
|
|
|
|
2018-01-14 20:10:02 +01:00
|
|
|
Connections {
|
2017-12-30 11:57:08 +01:00
|
|
|
target: screenPlaySettings
|
2018-01-14 20:10:02 +01:00
|
|
|
onSetMainWindowVisible: {
|
2017-12-30 11:57:08 +01:00
|
|
|
window.visible = visible
|
|
|
|
setX(Screen.width / 2 - width / 2)
|
|
|
|
setY(Screen.height / 2 - height / 2)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-02 18:54:32 +01:00
|
|
|
LinearGradient {
|
|
|
|
id: tabShadow
|
2017-12-30 14:14:33 +01:00
|
|
|
height: 6
|
|
|
|
z: 500
|
2017-11-25 14:45:09 +01:00
|
|
|
cached: true
|
2017-11-02 18:54:32 +01:00
|
|
|
|
2017-11-25 14:45:09 +01:00
|
|
|
anchors {
|
2017-11-02 18:54:32 +01:00
|
|
|
top: nav.bottom
|
|
|
|
right: parent.right
|
|
|
|
left: parent.left
|
|
|
|
}
|
|
|
|
start: Qt.point(0, 0)
|
2017-12-30 14:14:33 +01:00
|
|
|
end: Qt.point(0, 6)
|
2017-11-02 18:54:32 +01:00
|
|
|
gradient: Gradient {
|
2017-11-25 14:45:09 +01:00
|
|
|
GradientStop {
|
|
|
|
position: 0.0
|
2017-12-30 14:14:33 +01:00
|
|
|
color: "#33000000"
|
2017-11-25 14:45:09 +01:00
|
|
|
}
|
|
|
|
GradientStop {
|
|
|
|
position: 1.0
|
|
|
|
color: "#00000000"
|
|
|
|
}
|
2017-11-02 18:54:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-26 14:26:27 +02:00
|
|
|
SystemTrayIcon {
|
2017-11-25 14:45:09 +01:00
|
|
|
id: sti
|
2017-10-26 14:26:27 +02:00
|
|
|
visible: true
|
|
|
|
iconSource: "qrc:/assets/icons/favicon.ico"
|
|
|
|
|
|
|
|
menu: Menu {
|
2017-10-29 12:33:37 +01:00
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Open ScreenPlay")
|
2017-10-26 14:26:27 +02:00
|
|
|
onTriggered: {
|
|
|
|
window.show()
|
|
|
|
}
|
|
|
|
}
|
2017-11-21 10:13:12 +01:00
|
|
|
MenuItem {
|
2017-11-25 14:45:09 +01:00
|
|
|
id: miMuteAll
|
2017-11-21 10:13:12 +01:00
|
|
|
property bool isMuted: false
|
|
|
|
text: qsTr("Mute all")
|
|
|
|
onTriggered: {
|
2017-11-25 14:45:09 +01:00
|
|
|
if (miMuteAll.isMuted) {
|
2017-11-21 10:13:12 +01:00
|
|
|
isMuted = false
|
|
|
|
miMuteAll.text = qsTr("Mute all")
|
|
|
|
screenPlaySettings.setMuteAll(false)
|
2017-11-25 14:45:09 +01:00
|
|
|
} else {
|
2017-11-21 10:13:12 +01:00
|
|
|
isMuted = true
|
|
|
|
miMuteAll.text = qsTr("Unmute all")
|
|
|
|
screenPlaySettings.setMuteAll(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MenuItem {
|
2017-11-25 14:45:09 +01:00
|
|
|
id: miStopAll
|
2017-11-21 10:13:12 +01:00
|
|
|
property bool isPlaying: false
|
2018-01-16 15:57:11 +01:00
|
|
|
text: qsTr("Pause all")
|
2017-11-21 10:13:12 +01:00
|
|
|
onTriggered: {
|
2017-11-25 14:45:09 +01:00
|
|
|
if (miStopAll.isPlaying) {
|
2017-11-21 10:13:12 +01:00
|
|
|
isPlaying = false
|
2018-01-14 20:10:02 +01:00
|
|
|
miStopAll.text = qsTr("Pause all")
|
2017-11-21 10:13:12 +01:00
|
|
|
screenPlaySettings.setPlayAll(true)
|
2017-11-25 14:45:09 +01:00
|
|
|
} else {
|
2017-11-21 10:13:12 +01:00
|
|
|
isPlaying = true
|
|
|
|
miStopAll.text = qsTr("Play all")
|
|
|
|
screenPlaySettings.setPlayAll(false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-10-26 14:26:27 +02:00
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Quit")
|
|
|
|
onTriggered: Qt.quit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-03 18:48:34 +02:00
|
|
|
Loader {
|
2017-07-13 10:49:12 +02:00
|
|
|
id: pageLoader
|
2017-10-24 19:57:39 +02:00
|
|
|
asynchronous: true
|
2017-12-19 15:43:31 +01:00
|
|
|
source: "qrc:/qml/Installed/Installed.qml"
|
2017-03-27 15:38:25 +02:00
|
|
|
anchors {
|
2017-04-03 18:48:34 +02:00
|
|
|
top: nav.bottom
|
2017-03-27 15:38:25 +02:00
|
|
|
right: parent.right
|
2017-04-03 18:48:34 +02:00
|
|
|
bottom: parent.bottom
|
2017-03-27 15:38:25 +02:00
|
|
|
left: parent.left
|
|
|
|
}
|
2017-12-29 12:21:40 +01:00
|
|
|
onStatusChanged: {
|
2018-01-14 20:10:02 +01:00
|
|
|
if (status == Loader.Ready) {
|
|
|
|
if (pageLoaderCreate.source != "qrc:/qml/Create/Create.qml")
|
|
|
|
timerLoader.start()
|
2017-12-29 12:21:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-12-30 14:14:33 +01:00
|
|
|
|
2017-12-29 12:21:40 +01:00
|
|
|
Timer {
|
2018-01-14 20:10:02 +01:00
|
|
|
id: timerLoader
|
2017-12-29 12:21:40 +01:00
|
|
|
interval: 500
|
|
|
|
onTriggered: {
|
|
|
|
pageLoaderCreate.source = "qrc:/qml/Create/Create.qml"
|
|
|
|
}
|
|
|
|
}
|
2017-11-25 14:45:09 +01:00
|
|
|
|
2017-12-29 12:21:40 +01:00
|
|
|
Loader {
|
|
|
|
id: pageLoaderCreate
|
|
|
|
visible: false
|
|
|
|
asynchronous: true
|
|
|
|
anchors {
|
|
|
|
top: nav.bottom
|
|
|
|
right: parent.right
|
|
|
|
bottom: parent.bottom
|
|
|
|
left: parent.left
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Loader {
|
|
|
|
id: pageLoaderWorkshop
|
|
|
|
visible: false
|
|
|
|
asynchronous: true
|
|
|
|
anchors {
|
|
|
|
top: nav.bottom
|
|
|
|
right: parent.right
|
|
|
|
bottom: parent.bottom
|
|
|
|
left: parent.left
|
|
|
|
}
|
2017-12-30 14:16:37 +01:00
|
|
|
onStatusChanged: {
|
2018-01-14 20:10:02 +01:00
|
|
|
if (status == Loader.Ready) {
|
2017-12-30 14:16:37 +01:00
|
|
|
connectionsPageLoaderWorkshop.target = pageLoaderWorkshop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-01-14 20:10:02 +01:00
|
|
|
Connections {
|
|
|
|
id: connectionsPageLoaderWorkshop
|
2017-12-30 14:16:37 +01:00
|
|
|
ignoreUnknownSignals: true
|
|
|
|
onOpenCreate: {
|
|
|
|
print("lellele")
|
|
|
|
if (!ignoreWorkshopBanner) {
|
|
|
|
switchPage("Workshop")
|
|
|
|
ignoreWorkshopBanner = true
|
|
|
|
}
|
|
|
|
}
|
2017-12-29 12:21:40 +01:00
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: pageLoader.item
|
|
|
|
ignoreUnknownSignals: true
|
|
|
|
|
|
|
|
property bool ignoreWorkshopBanner: false
|
|
|
|
|
|
|
|
onSetSidebaractiveItem: {
|
|
|
|
|
2018-01-14 20:10:02 +01:00
|
|
|
if (type === "video") {
|
|
|
|
if (sidebar.activeScreen == screenId
|
|
|
|
&& sidebar.state == "active") {
|
|
|
|
sidebar.state = "inactive"
|
|
|
|
} else {
|
|
|
|
sidebar.state = "active"
|
|
|
|
}
|
|
|
|
} else if (type === "widget") {
|
|
|
|
if (sidebar.activeScreen == screenId
|
|
|
|
&& sidebar.state == "activeWidget") {
|
|
|
|
sidebar.state = "inactive"
|
|
|
|
} else {
|
|
|
|
sidebar.state = "activeWidget"
|
|
|
|
}
|
|
|
|
}
|
2017-12-29 12:21:40 +01:00
|
|
|
sidebar.activeScreen = screenId
|
2018-01-14 20:10:02 +01:00
|
|
|
sidebar.type = type
|
2017-12-29 12:21:40 +01:00
|
|
|
}
|
|
|
|
onSetNavigationItem: {
|
|
|
|
if (pos === 0) {
|
|
|
|
nav.onPageChanged("Create")
|
|
|
|
} else {
|
|
|
|
nav.onPageChanged("Workshop")
|
|
|
|
}
|
|
|
|
}
|
2017-03-27 15:38:25 +02:00
|
|
|
}
|
|
|
|
|
2017-04-03 18:48:34 +02:00
|
|
|
Sidebar {
|
|
|
|
id: sidebar
|
2017-10-29 12:33:37 +01:00
|
|
|
width: 400
|
2017-11-16 15:04:45 +01:00
|
|
|
navHeight: nav.height
|
2017-03-27 15:38:25 +02:00
|
|
|
anchors {
|
2017-11-16 15:04:45 +01:00
|
|
|
top: parent.top
|
2017-10-29 12:33:37 +01:00
|
|
|
right: parent.right
|
|
|
|
bottom: parent.bottom
|
2017-04-03 18:48:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Navigation {
|
|
|
|
id: nav
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
2017-03-27 15:38:25 +02:00
|
|
|
right: parent.right
|
|
|
|
left: parent.left
|
|
|
|
}
|
2017-07-13 10:49:12 +02:00
|
|
|
onChangePage: {
|
2017-12-30 14:16:37 +01:00
|
|
|
switchPage(name)
|
2017-04-05 13:52:38 +02:00
|
|
|
}
|
2017-04-13 08:24:11 +02:00
|
|
|
|
|
|
|
onToggleMonitors: {
|
|
|
|
monitors.state = monitors.state == "active" ? "inactive" : "active"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-14 20:10:02 +01:00
|
|
|
function switchPage(name) {
|
|
|
|
if (name === "Create") {
|
2017-12-30 14:16:37 +01:00
|
|
|
pageLoader.visible = false
|
|
|
|
pageLoaderCreate.setSource("qrc:/qml/Create/Create.qml")
|
|
|
|
pageLoaderCreate.visible = true
|
|
|
|
pageLoaderWorkshop.visible = false
|
|
|
|
sidebar.state = "inactive"
|
2018-01-14 20:10:02 +01:00
|
|
|
} else if (name === "Workshop") {
|
2017-12-30 14:16:37 +01:00
|
|
|
pageLoader.visible = false
|
|
|
|
pageLoaderCreate.visible = false
|
|
|
|
pageLoaderWorkshop.setSource("qrc:/qml/Workshop/Workshop.qml")
|
|
|
|
pageLoaderWorkshop.visible = true
|
|
|
|
sidebar.state = "inactive"
|
|
|
|
} else {
|
|
|
|
pageLoader.visible = true
|
|
|
|
pageLoaderCreate.visible = false
|
|
|
|
pageLoaderWorkshop.visible = false
|
|
|
|
pageLoader.setSource("qrc:/qml/" + name + "/" + name + ".qml")
|
|
|
|
sidebar.state = "inactive"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-13 08:24:11 +02:00
|
|
|
Monitors {
|
|
|
|
id: monitors
|
|
|
|
state: "inactive"
|
2017-07-13 10:49:12 +02:00
|
|
|
anchors.fill: pageLoader
|
2017-10-29 12:33:37 +01:00
|
|
|
z: 98
|
2017-03-27 15:38:25 +02:00
|
|
|
}
|
|
|
|
}
|