mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 16:32:33 +02:00
Refactor project wizard. Now we have ether import content or create new based on a template
This commit is contained in:
parent
c7329c1adf
commit
9931f77a9f
@ -78,11 +78,9 @@
|
||||
<file>qml/Community/Community.qml</file>
|
||||
<file>qml/Community/Feedback.qml</file>
|
||||
<file>qml/Create/Create.qml</file>
|
||||
<file>qml/Create/CreateNew.qml</file>
|
||||
<file>qml/Create/CreateUpload.qml</file>
|
||||
<file>qml/Create/CreateWallpaper.qml</file>
|
||||
<file>qml/Create/CreateWidget.qml</file>
|
||||
<file>qml/Create/CreateWidgetButton.qml</file>
|
||||
<file>qml/Create/ImportContent.qml</file>
|
||||
<file>qml/Create/CreateContent.qml</file>
|
||||
<file>qml/Create/CreateContentButton.qml</file>
|
||||
<file>qml/Create/Wizards/CreateWallpaper/CreateWallpaperWizard.qml</file>
|
||||
<file>qml/Installed/Installed.qml</file>
|
||||
<file>qml/Installed/InstalledNavigation.qml</file>
|
||||
@ -137,6 +135,8 @@
|
||||
<file>assets/icons/brand_gitlab.svg</file>
|
||||
<file>assets/icons/brand_twitter.svg</file>
|
||||
<file>assets/icons/icon_done.svg</file>
|
||||
<file>qml/Create/Wizards/Wizard.qml</file>
|
||||
<file>qml/Common/CloseIcon.qml</file>
|
||||
<file>qml/Create/Wizard.qml</file>
|
||||
<file>qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
83
ScreenPlay/qml/Common/CloseIcon.qml
Normal file
83
ScreenPlay/qml/Common/CloseIcon.qml
Normal file
@ -0,0 +1,83 @@
|
||||
import QtQuick 2.14
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls.Material 2.3
|
||||
|
||||
|
||||
/*!
|
||||
\qmltype Close Icon
|
||||
\brief A image selector with popup preview.
|
||||
|
||||
*/
|
||||
MouseArea {
|
||||
id: root
|
||||
width: 32
|
||||
height: width
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onEntered: root.state = "hover"
|
||||
onExited: root.state = ""
|
||||
hoverEnabled: true
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
margins: 10
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\qmlproperty color BackButtonIcon::color
|
||||
|
||||
Color if the icon.
|
||||
*/
|
||||
property color color: Material.color(Material.Grey)
|
||||
|
||||
|
||||
/*!
|
||||
\qmlproperty string BackButtonIcon::icon
|
||||
|
||||
Icon image if the icon.
|
||||
*/
|
||||
property string icon: "qrc:/assets/icons/icon_close.svg"
|
||||
|
||||
Image {
|
||||
id: imgClose
|
||||
source: root.icon
|
||||
visible: false
|
||||
width: 14
|
||||
height: 14
|
||||
smooth: true
|
||||
anchors.centerIn: parent
|
||||
sourceSize: Qt.size(width, width)
|
||||
}
|
||||
|
||||
ColorOverlay {
|
||||
id: iconColorOverlay
|
||||
anchors.fill: imgClose
|
||||
source: imgClose
|
||||
color: root.color
|
||||
}
|
||||
states: [
|
||||
State {
|
||||
name: "hover"
|
||||
|
||||
PropertyChanges {
|
||||
target: iconColorOverlay
|
||||
color: Material.color(Material.Orange)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: ""
|
||||
to: "hover"
|
||||
reversible: true
|
||||
|
||||
ColorAnimation {
|
||||
target: iconColorOverlay
|
||||
duration: 200
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -10,20 +10,18 @@ import ScreenPlay.QMLUtilities 1.0
|
||||
|
||||
import "Wizards/CreateWallpaper"
|
||||
|
||||
|
||||
Item {
|
||||
id: create
|
||||
anchors.fill: parent
|
||||
state: "out"
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
create.state = "in"
|
||||
|
||||
|
||||
}
|
||||
|
||||
function checkFFMPEG(){
|
||||
if(!ScreenPlay.util.ffmpegAvailable){
|
||||
function checkFFMPEG() {
|
||||
if (!ScreenPlay.util.ffmpegAvailable) {
|
||||
ffmpegPopup.open()
|
||||
}
|
||||
}
|
||||
@ -37,47 +35,18 @@ Item {
|
||||
parent: create
|
||||
}
|
||||
|
||||
property url activeVideoFile: ""
|
||||
property url activeFolder: ""
|
||||
|
||||
Connections {
|
||||
target: createWallpaper
|
||||
onVideoImportConvertFileSelected: {
|
||||
create.state = "import"
|
||||
|
||||
activeVideoFile = videoFile
|
||||
loader.setSource(
|
||||
"Wizards/CreateWallpaper/CreateWallpaperWizard.qml", {
|
||||
"filePath": activeVideoFile
|
||||
})
|
||||
}
|
||||
|
||||
onProjectFileSelected: {
|
||||
create.state = "import"
|
||||
// TODO
|
||||
// activeFolder = projectFile
|
||||
// loader.setSource("CreateNew.qml", { })
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: loader.item
|
||||
ignoreUnknownSignals: true
|
||||
onBackToCreate: {
|
||||
create.state = "in"
|
||||
loader.active = false
|
||||
activeVideoFile = ""
|
||||
}
|
||||
onUploadToSteamWorkshop: {
|
||||
loader.setSource("CreateUpload.qml", {
|
||||
"file": activeVideoFile
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id:particleSystemWrapper
|
||||
anchors.fill: parent
|
||||
|
||||
Image {
|
||||
id: backgroundNoisePattern
|
||||
source: "qrc:/assets/images/noisy-texture-3.png"
|
||||
anchors.fill: parent
|
||||
fillMode: Image.Tile
|
||||
opacity: .3
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: ma
|
||||
anchors.fill: parent
|
||||
@ -155,22 +124,34 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
|
||||
Wizard {
|
||||
id:wizard
|
||||
anchors.fill: parent
|
||||
z: 11
|
||||
|
||||
}
|
||||
|
||||
Image {
|
||||
id: name
|
||||
source: "qrc:/assets/images/noisy-texture-3.png"
|
||||
anchors.fill: parent
|
||||
fillMode: Image.Tile
|
||||
opacity: .3
|
||||
CreateContent {
|
||||
id: createContent
|
||||
width: 500
|
||||
height: 400
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 80
|
||||
right: verticalSeperator.left
|
||||
rightMargin: 50
|
||||
}
|
||||
onCreateContent: {
|
||||
create.state = "wizard"
|
||||
ScreenPlay.util.setNavigationActive(false)
|
||||
if(type === "emptyWidget") {
|
||||
wizard.setSource("qrc:/qml/Create/Wizards/CreateEmptyWidget/CreateEmptyWidget.qml",{})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: spaceBar
|
||||
id: verticalSeperator
|
||||
width: 2
|
||||
height: 400
|
||||
opacity: .4
|
||||
@ -181,35 +162,23 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
CreateWallpaper {
|
||||
id: createWallpaper
|
||||
ImportContent {
|
||||
id: importContent
|
||||
width: 500
|
||||
height: 400
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 84
|
||||
left: spaceBar.right
|
||||
left: verticalSeperator.right
|
||||
leftMargin: 50
|
||||
}
|
||||
}
|
||||
|
||||
CreateWidget {
|
||||
id: createWidget
|
||||
width: 500
|
||||
height: 400
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 80
|
||||
right: spaceBar.left
|
||||
rightMargin: 50
|
||||
}
|
||||
onButtonPressed: {
|
||||
create.state = "new"
|
||||
loader.setSource("CreateNew.qml", {
|
||||
"project": type,
|
||||
"projectTitle": title,
|
||||
"icon": iconSource
|
||||
})
|
||||
onVideoImportConvertFileSelected: {
|
||||
create.state = "wizard"
|
||||
ScreenPlay.util.setNavigationActive(false)
|
||||
wizard.setSource(
|
||||
"Wizards/CreateWallpaper/CreateWallpaperVideoImportConvert.qml", {
|
||||
"filePath": videoFile
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,7 +260,7 @@ Item {
|
||||
State {
|
||||
name: "out"
|
||||
PropertyChanges {
|
||||
target: spaceBar
|
||||
target: verticalSeperator
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
@ -303,7 +272,7 @@ Item {
|
||||
State {
|
||||
name: "in"
|
||||
PropertyChanges {
|
||||
target: spaceBar
|
||||
target: verticalSeperator
|
||||
opacity: .4
|
||||
}
|
||||
PropertyChanges {
|
||||
@ -312,46 +281,22 @@ Item {
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "import"
|
||||
|
||||
PropertyChanges {
|
||||
target: createWallpaper
|
||||
state: "out"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: createWidget
|
||||
state: "out"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: spaceBar
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: txtDescriptionBottom
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: footer
|
||||
anchors.bottomMargin: -80
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "new"
|
||||
name: "wizard"
|
||||
|
||||
PropertyChanges {
|
||||
target: footer
|
||||
anchors.bottomMargin: -80
|
||||
}
|
||||
PropertyChanges {
|
||||
target: createWallpaper
|
||||
target: importContent
|
||||
state: "out"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: createWidget
|
||||
target: createContent
|
||||
state: "out"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: spaceBar
|
||||
target: verticalSeperator
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
@ -360,6 +305,7 @@ Item {
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "out"
|
||||
@ -379,7 +325,7 @@ Item {
|
||||
}
|
||||
|
||||
NumberAnimation {
|
||||
target: spaceBar
|
||||
target: verticalSeperator
|
||||
property: "opacity"
|
||||
duration: 250
|
||||
easing.type: Easing.InOutQuart
|
||||
@ -395,7 +341,7 @@ Item {
|
||||
},
|
||||
Transition {
|
||||
from: "in"
|
||||
to: "new"
|
||||
to: "wizard"
|
||||
reversible: true
|
||||
|
||||
PropertyAnimation {
|
||||
|
@ -8,7 +8,7 @@ Item {
|
||||
state: "out"
|
||||
Component.onCompleted: state = "in"
|
||||
|
||||
signal buttonPressed(var type, var title, var iconSource)
|
||||
signal createContent(var type)
|
||||
|
||||
Text {
|
||||
id: txtCreate
|
||||
@ -25,7 +25,7 @@ Item {
|
||||
font.weight: Font.Thin
|
||||
}
|
||||
|
||||
CreateWidgetButton {
|
||||
CreateContentButton {
|
||||
id: btnCreateEmptyWidget
|
||||
text: qsTr("Create Emtpy Widget")
|
||||
anchors.top: txtCreate.bottom
|
||||
@ -34,17 +34,7 @@ Item {
|
||||
state: createWidget.state
|
||||
imgSource: "qrc:/assets/icons/icon_emptyWidget.svg"
|
||||
onClicked: {
|
||||
|
||||
buttonPressed("empty", btnCreateEmptyWidget.text,
|
||||
btnCreateEmptyWidget.imgSource)
|
||||
//folderDialog.open()
|
||||
}
|
||||
FolderDialog {
|
||||
id: folderDialog
|
||||
onAccepted: {
|
||||
ScreenPlay.create.copyProject("/examples/scenes/empty",
|
||||
folderDialog.currentFolder)
|
||||
}
|
||||
createContent("emptyWidget")
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +62,7 @@ Item {
|
||||
topMargin: 200
|
||||
bottom: parent.bottom
|
||||
}
|
||||
CreateWidgetButton {
|
||||
CreateContentButton {
|
||||
id: btnEmpty1
|
||||
text: qsTr("Simple clock widget")
|
||||
|
||||
@ -80,10 +70,10 @@ Item {
|
||||
state: createWidget.state
|
||||
imgSource: "qrc:/assets/icons/icon_time.svg"
|
||||
onClicked: {
|
||||
buttonPressed("clock", btnEmpty1.text, btnEmpty1.imgSource)
|
||||
createContent("clockWidget")
|
||||
}
|
||||
}
|
||||
CreateWidgetButton {
|
||||
CreateContentButton {
|
||||
id: btnEmpty2
|
||||
text: qsTr("Musik scene wallpaper visualizer")
|
||||
|
||||
@ -91,10 +81,10 @@ Item {
|
||||
state: createWidget.state
|
||||
imgSource: "qrc:/assets/icons/icon_library_music.svg"
|
||||
onClicked: {
|
||||
buttonPressed("music", btnEmpty2.text, btnEmpty2.imgSource)
|
||||
createContent("musicVisualizer")
|
||||
}
|
||||
}
|
||||
CreateWidgetButton {
|
||||
CreateContentButton {
|
||||
id: btnEmpty3
|
||||
text: qsTr("Changing scene wallpaper via unsplash.com")
|
||||
imgSource: "qrc:/assets/icons/icon_scene.svg"
|
||||
@ -102,7 +92,7 @@ Item {
|
||||
animOffset: 250
|
||||
state: createWidget.state
|
||||
onClicked: {
|
||||
buttonPressed("slideshow", btnEmpty3.text, btnEmpty3.imgSource)
|
||||
createContent("unsplashSlideshow")
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ Item {
|
||||
Component.onCompleted: btnEmpty.state = "in"
|
||||
property int animOffset: 0
|
||||
property string text
|
||||
property bool buttonActive: false
|
||||
property bool buttonActive: true
|
||||
property string imgSource: "qrc:/assets/icons/icon_library_music.svg"
|
||||
|
||||
signal clicked
|
@ -1,178 +0,0 @@
|
||||
import QtQuick 2.12
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import Qt.labs.platform 1.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
|
||||
Item {
|
||||
id: createNew
|
||||
anchors.fill: parent
|
||||
state: "out"
|
||||
|
||||
RectangularGlow {
|
||||
id: effect
|
||||
anchors {
|
||||
top: wrapper.top
|
||||
left: wrapper.left
|
||||
right: wrapper.right
|
||||
topMargin: 3
|
||||
}
|
||||
|
||||
height: wrapper.height
|
||||
width: wrapper.width
|
||||
cached: true
|
||||
glowRadius: 3
|
||||
spread: 0.2
|
||||
color: "black"
|
||||
opacity: 0.4
|
||||
cornerRadius: 15
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: wrapper
|
||||
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
width: 910
|
||||
radius: 4
|
||||
height: 560
|
||||
|
||||
MouseArea {
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
margins: 5
|
||||
}
|
||||
width: 32
|
||||
height: width
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
createNew.state = "out"
|
||||
timerBack.start()
|
||||
}
|
||||
|
||||
Image {
|
||||
id: imgClose
|
||||
source: "qrc:/assets/icons/font-awsome/close.svg"
|
||||
width: 16
|
||||
height: 16
|
||||
anchors.centerIn: parent
|
||||
sourceSize: Qt.size(width, width)
|
||||
}
|
||||
ColorOverlay {
|
||||
id: iconColorOverlay
|
||||
anchors.fill: imgClose
|
||||
source: imgClose
|
||||
color: "gray"
|
||||
}
|
||||
Timer {
|
||||
id: timerBack
|
||||
interval: 800
|
||||
onTriggered: ScreenPlay.util.setNavigation("Create")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "out"
|
||||
PropertyChanges {
|
||||
target: wrapper
|
||||
anchors.topMargin: 800
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "in"
|
||||
PropertyChanges {
|
||||
target: wrapper
|
||||
anchors.topMargin: 40
|
||||
opacity: 1
|
||||
}
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: .4
|
||||
}
|
||||
}
|
||||
]
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "out"
|
||||
to: "in"
|
||||
SequentialAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 400
|
||||
}
|
||||
ParallelAnimation {
|
||||
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "anchors.topMargin"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "opacity"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
SequentialAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 1000
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: effect
|
||||
duration: 300
|
||||
property: "opacity"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Transition {
|
||||
from: "in"
|
||||
to: "out"
|
||||
|
||||
ParallelAnimation {
|
||||
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "anchors.topMargin"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: wrapper
|
||||
duration: 600
|
||||
property: "opacity"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
SequentialAnimation {
|
||||
|
||||
PauseAnimation {
|
||||
duration: 500
|
||||
}
|
||||
PropertyAnimation {
|
||||
target: effect
|
||||
duration: 300
|
||||
property: "opacity"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,536 +0,0 @@
|
||||
import QtQuick 2.12
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick.Controls 2.3
|
||||
import Qt.labs.platform 1.0
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import ScreenPlay 1.0
|
||||
|
||||
|
||||
|
||||
Item {
|
||||
id: createUpload
|
||||
anchors.fill: parent
|
||||
state: "out"
|
||||
Component.onCompleted: state = "in"
|
||||
|
||||
property bool isVideoPlaying: true
|
||||
property url videoFile: ""
|
||||
property string projectFile
|
||||
property var jsonProjectFile
|
||||
|
||||
|
||||
|
||||
// First we parse the content of the project file
|
||||
// TODO: Implement parse error
|
||||
onProjectFileChanged: {
|
||||
jsonProjectFile = JSON.parse(ScreenPlay.settings.loadProject(
|
||||
projectFile))
|
||||
}
|
||||
|
||||
// Now we add the content
|
||||
onJsonProjectFileChanged: {
|
||||
txtTitle.text = jsonProjectFile.title
|
||||
txtDescription.text = jsonProjectFile.description
|
||||
|
||||
var newStr = projectFile.substring(0, projectFile.length - 12)
|
||||
|
||||
imgPreview.source = Qt.resolvedUrl(newStr + jsonProjectFile.preview)
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: steamWorkshop
|
||||
ignoreUnknownSignals: true
|
||||
onWorkshopItemCreated: {
|
||||
print(userNeedsToAcceptWorkshopLegalAgreement,
|
||||
publishedFileId + "" + projectFile)
|
||||
steamWorkshop.submitWorkshopItem(txtTitle.text.toString(),
|
||||
txtDescription.text.toString(),
|
||||
"english", 0, projectFile,
|
||||
videoFile, publishedFileId)
|
||||
}
|
||||
onRemoteWorkshopCreationStatusChanged: {
|
||||
switch (status) {
|
||||
case RemoteWorkshopCreationStatus.Started:
|
||||
timerUpload.start()
|
||||
break
|
||||
case RemoteWorkshopCreationStatus.ErrorUnknown:
|
||||
timerUpload.stop()
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timerUpload
|
||||
running: false
|
||||
repeat: true
|
||||
interval: 100
|
||||
onTriggered: {
|
||||
var status = steamWorkshop.getItemUpdateProcess()
|
||||
print(status + " - " + steamWorkshop.itemProcessed + " / " + steamWorkshop.bytesTotal)
|
||||
switch (status) {
|
||||
case 0:
|
||||
txtUploadStatus.text = "0. The item update handle was invalid, the job might be finished. Who knows..."
|
||||
break
|
||||
case 1:
|
||||
txtUploadStatus.text = "1. The item update is processing configuration data."
|
||||
pbUpload.indeterminate = true
|
||||
break
|
||||
case 2:
|
||||
txtUploadStatus.text = "2. The item update is reading and processing content files."
|
||||
pbUpload.indeterminate = false
|
||||
txtUploadSize.text = steamWorkshop.itemProcessed + "/" + steamWorkshop.bytesTotal
|
||||
pbUpload.value = steamWorkshop.itemProcessed / steamWorkshop.bytesTotal
|
||||
break
|
||||
case 3:
|
||||
txtUploadStatus.text = "3. The item update is uploading content changes to Steam."
|
||||
if (steamWorkshop.itemProcessed === 0) {
|
||||
if (!pbUpload.indeterminate)
|
||||
pbUpload.indeterminate = true
|
||||
} else {
|
||||
if (pbUpload.indeterminate)
|
||||
pbUpload.indeterminate = false
|
||||
|
||||
txtUploadSize.text = steamWorkshop.itemProcessed + "/"
|
||||
+ steamWorkshop.bytesTotal
|
||||
pbUpload.value = steamWorkshop.itemProcessed / steamWorkshop.bytesTotal
|
||||
}
|
||||
break
|
||||
case 4:
|
||||
txtUploadStatus.text = "4. The item update is uploading new preview file image."
|
||||
pbUpload.indeterminate = true
|
||||
pbUpload.value = 1
|
||||
txtUploadSize.text = ""
|
||||
break
|
||||
case 5:
|
||||
txtUploadStatus.text = "5. Done!"
|
||||
createUpload.state = "uploadComplete"
|
||||
//globalNavigationHelper.setNavigation("Create")
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RectangularGlow {
|
||||
id: effect
|
||||
anchors {
|
||||
top: videoOutWrapper.top
|
||||
left: videoOutWrapper.left
|
||||
right: videoOutWrapper.right
|
||||
topMargin: 3
|
||||
}
|
||||
|
||||
height: videoOutWrapper.height
|
||||
width: videoOutWrapper.width
|
||||
cached: true
|
||||
z: 9
|
||||
glowRadius: 3
|
||||
spread: 0.2
|
||||
color: "black"
|
||||
opacity: 0.4
|
||||
cornerRadius: 15
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: videoOutWrapper
|
||||
width: 450
|
||||
height: 263
|
||||
z: 12
|
||||
color: "gray"
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 30
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Image {
|
||||
id: imgPreview
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: rectProgressBar
|
||||
height: 5
|
||||
color: "orange"
|
||||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: videoOutWrapper.width
|
||||
left: parent.left
|
||||
leftMargin: 0
|
||||
bottom: parent.bottom
|
||||
bottomMargin: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RectangularGlow {
|
||||
id: effect2
|
||||
anchors {
|
||||
top: contentWrapper.top
|
||||
left: contentWrapper.left
|
||||
right: contentWrapper.right
|
||||
topMargin: 3
|
||||
}
|
||||
|
||||
height: contentWrapper.height
|
||||
width: contentWrapper.width
|
||||
cached: true
|
||||
z: 9
|
||||
glowRadius: 3
|
||||
spread: 0.2
|
||||
color: "black"
|
||||
opacity: 0.4
|
||||
cornerRadius: 15
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: contentWrapper
|
||||
width: 800
|
||||
height: 350
|
||||
z: 10
|
||||
radius: 4
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 250
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
topMargin: 55
|
||||
right: parent.right
|
||||
rightMargin: 78
|
||||
bottom: parent.bottom
|
||||
bottomMargin: 71
|
||||
left: parent.left
|
||||
leftMargin: 78
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: txtTitle
|
||||
height: 60
|
||||
Layout.preferredWidth: parent.width
|
||||
selectByMouse: true
|
||||
placeholderText: "Title"
|
||||
}
|
||||
TextField {
|
||||
id: txtDescription
|
||||
height: 60
|
||||
Layout.preferredWidth: parent.width
|
||||
selectByMouse: true
|
||||
placeholderText: "Description"
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: txtYoutube
|
||||
height: 60
|
||||
Layout.preferredWidth: parent.width
|
||||
selectByMouse: true
|
||||
placeholderText: "Youtube Preview URL"
|
||||
}
|
||||
Row {
|
||||
height: 50
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Item {
|
||||
width: 100
|
||||
height: 50
|
||||
CheckBox {
|
||||
text: qsTr("Videos")
|
||||
}
|
||||
}
|
||||
Item {
|
||||
width: 100
|
||||
height: 50
|
||||
CheckBox {
|
||||
text: qsTr("Scenes")
|
||||
}
|
||||
}
|
||||
Item {
|
||||
width: 100
|
||||
height: 50
|
||||
CheckBox {
|
||||
text: qsTr("Widgets")
|
||||
}
|
||||
}
|
||||
Item {
|
||||
width: 100
|
||||
height: 50
|
||||
CheckBox {
|
||||
text: qsTr("AppDrawer")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: qsTr("Upload to Steam")
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
bottomMargin: 10
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
Material.background: Material.Orange
|
||||
Material.foreground: "white"
|
||||
icon.source: "qrc:/assets/icons/icon_upload.svg"
|
||||
icon.color: "white"
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
onClicked: {
|
||||
createUpload.state = "upload"
|
||||
// We need to first create a workshop item
|
||||
// after we received the new item handle
|
||||
// from steam we can upload the content
|
||||
steamWorkshop.createWorkshopItem()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: uploadWrapper
|
||||
opacity: 0
|
||||
width: 600
|
||||
height: 120
|
||||
radius: 4
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: videoOutWrapper.bottom
|
||||
topMargin: 30
|
||||
}
|
||||
|
||||
Text {
|
||||
id: txtUploadSize
|
||||
color: "gray"
|
||||
font.pointSize: 14
|
||||
height: 30
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: parent.top
|
||||
topMargin: 20
|
||||
}
|
||||
font.family: "Roboto"
|
||||
|
||||
}
|
||||
Text {
|
||||
id: txtUploadStatus
|
||||
text: qsTr("Creating Workshop Item")
|
||||
color: "gray"
|
||||
font.pointSize: 12
|
||||
height: 30
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: txtUploadSize.bottom
|
||||
topMargin: 20
|
||||
}
|
||||
font.family: "Roboto"
|
||||
|
||||
}
|
||||
|
||||
ProgressBar {
|
||||
id: pbUpload
|
||||
value: .1
|
||||
anchors {
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: txtUploadStatus.bottom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "out"
|
||||
PropertyChanges {
|
||||
target: createUpload
|
||||
opacity: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: videoOutWrapper
|
||||
z: 0
|
||||
opacity: 0
|
||||
anchors.topMargin: 50
|
||||
}
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: 0
|
||||
color: "transparent"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: contentWrapper
|
||||
anchors.topMargin: -500
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "in"
|
||||
PropertyChanges {
|
||||
target: createUpload
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: .4
|
||||
color: "black"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: contentWrapper
|
||||
opacity: 1
|
||||
anchors.topMargin: 250
|
||||
}
|
||||
PropertyChanges {
|
||||
target: videoOutWrapper
|
||||
z: 12
|
||||
opacity: 1
|
||||
anchors.topMargin: 20
|
||||
}
|
||||
PropertyChanges {
|
||||
target: uploadWrapper
|
||||
opacity: 0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "upload"
|
||||
PropertyChanges {
|
||||
target: createUpload
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: 0
|
||||
color: "transparent"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: contentWrapper
|
||||
opacity: 1
|
||||
anchors.topMargin: -500
|
||||
}
|
||||
PropertyChanges {
|
||||
target: videoOutWrapper
|
||||
z: 12
|
||||
opacity: 1
|
||||
anchors.topMargin: 150
|
||||
}
|
||||
PropertyChanges {
|
||||
target: uploadWrapper
|
||||
opacity: 1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "uploadComplete"
|
||||
PropertyChanges {
|
||||
target: createUpload
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: effect
|
||||
opacity: 0
|
||||
color: "transparent"
|
||||
}
|
||||
PropertyChanges {
|
||||
target: contentWrapper
|
||||
opacity: 1
|
||||
anchors.topMargin: -500
|
||||
}
|
||||
PropertyChanges {
|
||||
target: videoOutWrapper
|
||||
z: 12
|
||||
opacity: 1
|
||||
anchors.topMargin: 150
|
||||
}
|
||||
PropertyChanges {
|
||||
target: uploadWrapper
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "out"
|
||||
to: "in"
|
||||
reversible: true
|
||||
|
||||
SequentialAnimation {
|
||||
PauseAnimation {
|
||||
duration: 500
|
||||
}
|
||||
ParallelAnimation {
|
||||
PropertyAnimation {
|
||||
duration: 300
|
||||
target: contentWrapper
|
||||
property: "opacity"
|
||||
}
|
||||
PropertyAnimation {
|
||||
duration: 300
|
||||
target: contentWrapper
|
||||
property: "anchors.topMargin"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
}
|
||||
ParallelAnimation {
|
||||
PropertyAnimation {
|
||||
duration: 250
|
||||
target: videoOutWrapper
|
||||
property: "opacity"
|
||||
}
|
||||
PropertyAnimation {
|
||||
duration: 250
|
||||
target: effect
|
||||
properties: "color, opacity"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Transition {
|
||||
from: "in"
|
||||
to: "upload"
|
||||
reversible: true
|
||||
|
||||
SequentialAnimation {
|
||||
ParallelAnimation {
|
||||
PropertyAnimation {
|
||||
duration: 300
|
||||
target: contentWrapper
|
||||
property: "opacity"
|
||||
}
|
||||
PropertyAnimation {
|
||||
duration: 300
|
||||
target: contentWrapper
|
||||
property: "anchors.topMargin"
|
||||
easing.type: Easing.OutQuart
|
||||
}
|
||||
}
|
||||
ParallelAnimation {
|
||||
PropertyAnimation {
|
||||
duration: 250
|
||||
target: videoOutWrapper
|
||||
property: "topMargin"
|
||||
}
|
||||
PropertyAnimation {
|
||||
duration: 250
|
||||
target: effect
|
||||
properties: "color, opacity"
|
||||
}
|
||||
PropertyAnimation {
|
||||
duration: 250
|
||||
target: uploadWrapper
|
||||
property: "opacity"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/*##^## Designer {
|
||||
D{i:0;autoSize:true;height:480;width:640}
|
||||
}
|
||||
##^##*/
|
@ -22,7 +22,7 @@ Item {
|
||||
}
|
||||
Text {
|
||||
id: txtHeadline
|
||||
text: qsTr("Import Wallpaper")
|
||||
text: qsTr("Import Content")
|
||||
opacity: 0
|
||||
anchors {
|
||||
top: parent.top
|
@ -8,28 +8,27 @@ import QtQuick.Layouts 1.3
|
||||
import ScreenPlay 1.0
|
||||
import ScreenPlay.Create 1.0
|
||||
|
||||
import "../Common"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
state: "out"
|
||||
|
||||
function setSource(path, arguments){
|
||||
function setSource(path, arguments) {
|
||||
loader_wrapperContent.setSource(
|
||||
"qrc:/qml/Create/Wizards/CreateWallpaper/CreateWallpaperVideoImportConvert.qml",
|
||||
path,
|
||||
arguments)
|
||||
root.state = "in"
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
state = "in"
|
||||
}
|
||||
|
||||
|
||||
//Blocks some MouseArea from create page
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
|
||||
RectangularGlow {
|
||||
id: effect
|
||||
anchors {
|
||||
@ -66,34 +65,10 @@ Item {
|
||||
z: 10
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors {
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
margins: 5
|
||||
}
|
||||
width: 32
|
||||
height: width
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
CloseIcon {
|
||||
onClicked: {
|
||||
createNew.state = "out"
|
||||
timerBack.start()
|
||||
}
|
||||
|
||||
Image {
|
||||
id: imgClose
|
||||
source: "qrc:/assets/icons/font-awsome/close.svg"
|
||||
width: 16
|
||||
height: 16
|
||||
anchors.centerIn: parent
|
||||
sourceSize: Qt.size(width, width)
|
||||
}
|
||||
ColorOverlay {
|
||||
id: iconColorOverlay
|
||||
anchors.fill: imgClose
|
||||
source: imgClose
|
||||
color: "gray"
|
||||
}
|
||||
Timer {
|
||||
id: timerBack
|
||||
interval: 800
|
||||
@ -106,8 +81,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "out"
|
||||
@ -166,7 +139,6 @@ Item {
|
||||
target: loader_wrapperContent
|
||||
opacity: 0
|
||||
z: 0
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
@ -256,5 +228,4 @@ Item {
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user