1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-20 01:11:47 +02:00
ScreenPlay/qml/Components/Create.qml

227 lines
6.0 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-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"
}
}
}
Item {
id: left
width: parent.width * .5
anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
2017-07-13 15:34:35 +02:00
}
Column {
id: column
anchors.fill: parent
anchors.margins: 30
2017-07-13 15:34:35 +02:00
spacing: 30
TextField {
2017-07-14 13:34:55 +02:00
id: txtTitle
width: parent.width
height: 60
2017-07-13 15:34:35 +02:00
text: qsTr("")
placeholderText: "Title"
2017-07-13 15:34:35 +02:00
}
TextField {
id: txtDescription
width: parent.width
height: 60
text: qsTr("")
placeholderText: "Description"
}
TextField {
id: txtTags
width: parent.width
height: 60
text: qsTr("")
placeholderText: "Tags"
}
TextField {
id: txtYouTube
width: parent.width
height: 60
text: qsTr("")
placeholderText: "YouTube Preview"
2017-07-13 15:34:35 +02:00
}
Row {
id: rowVisible
width: parent.width
2017-07-13 15:34:35 +02:00
height: 120
Text {
id: txtVisibleDescription
height: parent.height
text: qsTr("Visible")
font.pixelSize: 12
verticalAlignment: Text.AlignVCenter
}
ComboBox {
id: cbVisibility
model: ["Public", "Friends only", "Private"]
}
2017-07-13 15:34:35 +02:00
spacing: 30
2017-07-13 15:34:35 +02:00
}
Button {
id: btnSubmit
text: qsTr("Create New Wallpaper")
onClicked: {
//TODO wait for callback
steamWorkshop.createWorkshopItem()
steamWorkshop.submitWorkshopItem(
txtTitle.text.toString(),
txtDescription.text.toString(), "english",
cbVisibility.currentIndex,
fileDialogOpenVideo.currentFile,
fileDialogOpenPreview.currentFile)
tiItemUpdate.start()
}
}
}
CheckDelegate {
id: checkDelegate
opacity: 0
text: qsTr("By submitting this item, you agree to the workshop terms of service")
onCheckedChanged: Qt.openUrlExternally(
"http://steamcommunity.com/sharedfiles/workshoplegalagreement")
}
}
Item {
id: right
width: parent.width * .5
anchors {
top: parent.top
right: parent.right
bottom: parent.bottom
margins: 30
2017-07-13 15:34:35 +02:00
}
Row {
id: rightTop
height: 200
anchors {
top: parent.top
right: parent.right
left: parent.left
}
spacing: 30
Rectangle {
color: "orange"
width: parent.width * .4
2017-07-13 15:34:35 +02:00
height: parent.height
}
Rectangle {
color: "steelblue"
width: parent.width * .4
height: parent.height
}
}
Rectangle {
id: rightBottom
height: 400
color: "gray"
anchors {
top: rightTop.bottom
right: parent.right
left:parent.left
bottom: parent.bottom
2017-07-13 15:34:35 +02:00
}
}
}
2017-07-13 15:34:35 +02:00
/*
2017-07-13 15:34:35 +02:00
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
}*/
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
}