1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-10 04:52:41 +01:00
ScreenPlay/qml/Components/Create.qml

213 lines
5.5 KiB
QML
Raw Normal View History

import QtQuick 2.7
import QtQuick.Controls 2.2
2017-07-13 15:34:35 +02:00
import QtQuick.Dialogs 1.2
2017-07-14 13:34:55 +02:00
import QtQuick.Controls.Material 2.2
import Qt.labs.platform 1.0
CustomPage {
id: page
pageName: ""
2017-09-30 17:36:11 +02:00
2017-07-13 15:34:35 +02:00
Connections {
target: steamWorkshop
onWorkshopItemCreated: {
2017-09-30 17:36:11 +02:00
print("created")
2017-07-13 15:34:35 +02:00
if (userNeedsToAcceptWorkshopLegalAgreement) {
checkDelegate.opacity = 1
} else {
checkDelegate.opacity = 0
busyIndicator.running = false
page.state = "StartItemUpdate"
}
}
2017-09-30 17:36:11 +02:00
}
2017-07-13 15:34:35 +02:00
CheckDelegate {
id: checkDelegate
x: 35
y: 398
opacity: 0
text: qsTr("By submitting this item, you agree to the workshop terms of service")
onCheckedChanged: Qt.openUrlExternally( "http://steamcommunity.com/sharedfiles/workshoplegalagreement")
}
Button {
2017-07-13 15:34:35 +02:00
id: btnCreateWallpaper
text: qsTr("Create New Wallpaper")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
onClicked: {
steamWorkshop.createWorkshopItem()
busyIndicator.running = true
}
}
BusyIndicator {
id: busyIndicator
anchors.bottom: btnCreateWallpaper.bottom
anchors.bottomMargin: 80
anchors.horizontalCenter: parent.horizontalCenter
running: false
2017-07-14 13:34:55 +02:00
Material.accent: Material.Orange
2017-07-13 15:34:35 +02:00
}
Column {
id: column
anchors.fill: parent
anchors.margins: 30
Row {
id: row
width: parent.width
height: 60
spacing: 30
Text {
2017-07-14 13:34:55 +02:00
id: txtHeadlineTitle
2017-07-13 15:34:35 +02:00
text: qsTr("Title")
verticalAlignment: Text.AlignVCenter
font.pixelSize: 12
height: parent.height
}
TextField {
2017-07-14 13:34:55 +02:00
id: txtTitle
2017-07-13 15:34:35 +02:00
width: 240
text: qsTr("")
height: parent.height
}
}
Row {
id: row1
width: parent.width
height: 120
Text {
2017-07-14 13:34:55 +02:00
id: txtDescriptionHeadline
2017-07-13 15:34:35 +02:00
height: parent.height
text: qsTr("Description")
font.pixelSize: 12
verticalAlignment: Text.AlignVCenter
}
TextArea {
2017-07-14 13:34:55 +02:00
id: txtDescription
2017-07-13 15:34:35 +02:00
height: 120
text: qsTr("")
wrapMode: Text.WrapAnywhere
2017-07-14 13:34:55 +02:00
width: parent.width - txtDescriptionHeadline.width - 30
2017-07-13 15:34:35 +02:00
}
spacing: 30
}
Row {
id: row2
width: parent.width
height: 120
Text {
2017-07-14 13:34:55 +02:00
id: txtVisibleDescription
2017-07-13 15:34:35 +02:00
height: parent.height
2017-07-14 13:34:55 +02:00
text: qsTr("Visible")
2017-07-13 15:34:35 +02:00
font.pixelSize: 12
verticalAlignment: Text.AlignVCenter
}
2017-07-14 13:34:55 +02:00
ComboBox {
id:cbVisibility
2017-07-14 18:59:23 +02:00
model: ["Public", "Friends only", "Private"]
2017-07-13 15:34:35 +02:00
}
2017-07-14 13:34:55 +02:00
2017-07-13 15:34:35 +02:00
spacing: 30
}
Row {
id: row4
width: parent.width
height: 120
Text {
2017-07-14 13:34:55 +02:00
id: txtVideoFileDescription
2017-07-13 15:34:35 +02:00
height: parent.height
text: qsTr("Video File")
font.pixelSize: 12
verticalAlignment: Text.AlignVCenter
}
Button {
id: btnOpenVideo
text: qsTr("Open Video ")
onClicked: {
2017-07-14 18:59:23 +02:00
fileDialogOpenVideo.open()
2017-07-13 15:34:35 +02:00
}
}
FileDialog {
2017-07-14 13:34:55 +02:00
id: fileDialogOpenVideo
2017-07-13 15:34:35 +02:00
nameFilters: ["Videos (*.mp4)"]
onAccepted: {
2017-07-14 13:34:55 +02:00
}
}
spacing: 30
}
Row {
width: parent.width
height: 120
Text {
id: txtPreviewFileDescription
height: parent.height
text: qsTr("Video File preview")
font.pixelSize: 12
verticalAlignment: Text.AlignVCenter
}
Button {
id: btnOpenPreview
2017-07-14 18:59:23 +02:00
text: qsTr("Open Preview Image")
2017-07-14 13:34:55 +02:00
onClicked: {
2017-07-14 18:59:23 +02:00
fileDialogOpenPreview.open()
2017-07-14 13:34:55 +02:00
}
}
FileDialog {
id: fileDialogOpenPreview
2017-07-14 18:59:23 +02:00
nameFilters: ["*.png *.jpg *.gif","PNG (*.png)","JPG (*.jpg)","GIF (*.gif)"]
2017-07-14 13:34:55 +02:00
onAccepted: {
2017-07-13 15:34:35 +02:00
}
}
spacing: 30
}
2017-07-14 18:59:23 +02:00
2017-07-14 13:34:55 +02:00
Button {
id: btnSubmit
text: "Submit"
onClicked: {
steamWorkshop.submitWorkshopItem(txtTitle.text.toString(),
txtDescription.text.toString(),
2017-07-14 18:59:23 +02:00
"english",
2017-07-14 13:34:55 +02:00
cbVisibility.currentIndex,
fileDialogOpenVideo.currentFile,
fileDialogOpenPreview.currentFile);
2017-07-14 18:59:23 +02:00
tiItemUpdate.start()
}
}
Timer {
id: tiItemUpdate
interval: 500
running: false
repeat: true
onTriggered: {
print(steamWorkshop.getItemUpdateProcess())
2017-07-14 13:34:55 +02:00
}
}
}
2017-07-06 14:00:43 +02:00
}