1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00
This commit is contained in:
Elias Steurer 2021-05-24 14:26:06 +02:00
commit c4812402f8
20 changed files with 139 additions and 223 deletions

View File

@ -13,8 +13,8 @@ check:
script: script:
- cd Tools - cd Tools
- pip install cmakelang - pip install cmakelang
- python format-cmake.py - python format_cmake.py
- python format-cpp.py - python format_cpp.py
build:windows_debug: build:windows_debug:
stage: build stage: build

View File

@ -35,7 +35,6 @@ else()
endif() endif()
set(VCPKG_INSTALLED_PATH "${VCPKG_PATH}/installed/${VCPKG_ARCH}") set(VCPKG_INSTALLED_PATH "${VCPKG_PATH}/installed/${VCPKG_ARCH}")
set(QT_TELEMTRY_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/Common/qt-google-analytics/)
find_package(Git REQUIRED) find_package(Git REQUIRED)
if(WIN32) if(WIN32)

View File

@ -126,9 +126,9 @@ target_link_libraries(
benchmark::benchmark_main benchmark::benchmark_main
doctest::doctest) doctest::doctest)
if(WIN32)
target_include_directories(${PROJECT_NAME} PRIVATE ${QT_TELEMTRY_INCLUDE}) target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry)
endif()
if(APPLE) if(APPLE)

View File

@ -58,7 +58,7 @@ App::App()
QGuiApplication::setOrganizationName("ScreenPlay"); QGuiApplication::setOrganizationName("ScreenPlay");
QGuiApplication::setOrganizationDomain("https://screen-play.app"); QGuiApplication::setOrganizationDomain("https://screen-play.app");
QGuiApplication::setApplicationName("ScreenPlay"); QGuiApplication::setApplicationName("ScreenPlay");
QGuiApplication::setApplicationVersion("0.13.2"); QGuiApplication::setApplicationVersion("0.13.3");
QGuiApplication::setQuitOnLastWindowClosed(false); QGuiApplication::setQuitOnLastWindowClosed(false);
QFontDatabase::addApplicationFont(":/assets/fonts/LibreBaskerville-Italic.ttf"); QFontDatabase::addApplicationFont(":/assets/fonts/LibreBaskerville-Italic.ttf");
@ -214,46 +214,4 @@ void App::exit()
QApplication::instance()->quit(); QApplication::instance()->quit();
} }
/*!
\brief Loads the Steam plugin when needed. This enables to start ScreenPlay
via OS autostart without waiting for Steam first.
*/
bool App::loadSteamPlugin()
{
bool isDebug = true;
#ifdef QT_NO_DEBUG
isDebug = false;
#endif
#ifdef Q_OS_MACOS
const QString fileSuffix = isDebug ? "d.dylib" : ".dylib";
m_workshopPlugin.setFileName(QApplication::applicationDirPath() + "/libScreenPlayWorkshop" + fileSuffix);
#endif
#ifdef Q_OS_WIN
const QString fileSuffix = isDebug ? "d.dll" : ".dll";
m_workshopPlugin.setFileName(QApplication::applicationDirPath() + "/ScreenPlayWorkshop" + fileSuffix);
#endif
#ifdef Q_OS_LINUX
const QString fileSuffix = ".so";
#endif
if (!m_workshopPlugin.load()) {
qWarning() << "Steam plugin not provided!" << QApplication::applicationDirPath() + "/ScreenPlayWorkshop" + fileSuffix;
qWarning() << m_workshopPlugin.fileName() << " - With error: " << m_workshopPlugin.errorString() << " debug: " << isDebug;
return false;
}
const ScreenPlayWorkshopPlugin* workshopPlugin = reinterpret_cast<ScreenPlayWorkshopPlugin*>(m_workshopPlugin.instance());
Q_UNUSED(workshopPlugin)
settings()->setSteamVersion(true);
return true;
}
bool App::unloadSteamPlugin()
{
return m_workshopPlugin.unload();
}
} }

View File

@ -36,6 +36,7 @@
#include <QDir> #include <QDir>
#include <QElapsedTimer> #include <QElapsedTimer>
#include <QGuiApplication>
#include <QIcon> #include <QIcon>
#include <QObject> #include <QObject>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
@ -120,8 +121,6 @@ signals:
public slots: public slots:
QString version() const; QString version() const;
void exit(); void exit();
bool loadSteamPlugin();
bool unloadSteamPlugin();
void setGlobalVariables(GlobalVariables* globalVariables) void setGlobalVariables(GlobalVariables* globalVariables)
{ {

View File

@ -128,5 +128,6 @@
<file>assets/icons/icon_sort-up-solid.svg</file> <file>assets/icons/icon_sort-up-solid.svg</file>
<file>assets/icons/icon_sort-down-solid.svg</file> <file>assets/icons/icon_sort-down-solid.svg</file>
<file>assets/icons/brand_reddit.svg</file> <file>assets/icons/brand_reddit.svg</file>
<file>assets/icons/steam_default_avatar.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -32,27 +32,12 @@ ApplicationWindow {
} }
function switchPage(name) { function switchPage(name) {
const unloadSteamPlugin = nav.currentNavigationName === "Workshop";
if (nav.currentNavigationName === name) { if (nav.currentNavigationName === name) {
if (name === "Installed") if (name === "Installed")
ScreenPlay.installedListModel.reset(); ScreenPlay.installedListModel.reset();
return ;
}
if (name === "Workshop") {
if (!ScreenPlay.settings.steamVersion) {
const steamAvialable = ScreenPlay.loadSteamPlugin();
if (!steamAvialable) {
dialogSteam.open();
switchPage("Installed");
return ;
}
}
} }
stackView.replace("qrc:/qml/" + name + "/" + name + ".qml"); stackView.replace("qrc:/qml/" + name + "/" + name + ".qml");
if (unloadSteamPlugin)
ScreenPlay.unloadSteamPlugin();
sidebar.state = "inactive"; sidebar.state = "inactive";
} }

View File

@ -1,6 +1,6 @@
import QtQuick 2.13 import QtQuick 2.13
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import ScreenPlay.Workshop 1.0 import Workshop 1.0
Rectangle { Rectangle {
id: root id: root

View File

@ -3,16 +3,15 @@ import QtQuick.Controls 2.13
import QtQuick.Controls.Material 2.13 import QtQuick.Controls.Material 2.13
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls.Material.impl 2.12 import QtQuick.Controls.Material.impl 2.12
import ScreenPlay.Workshop 1.0 import Workshop 1.0
import SteamQMLImageProvider 1.0
import ScreenPlay 1.0 import ScreenPlay 1.0
Rectangle { Rectangle {
id: root id: root
property SteamWorkshop steamWorkshop property SteamWorkshop steam
signal uploadPressed() signal uploadPressed
implicitWidth: 800 implicitWidth: 800
height: 50 height: 50
@ -39,7 +38,8 @@ Rectangle {
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: { text: {
return steamWorkshop.steamAccount.username + qsTr(" Subscribed items: ") + steamWorkshop.steamAccount.amountSubscribedItems; return steam.steamAccount.username + qsTr(
" Subscribed items: ") + steam.steamAccount.amountSubscribedItems
} }
anchors { anchors {
@ -50,7 +50,6 @@ Rectangle {
right: btnUplaod.left right: btnUplaod.left
rightMargin: 10 rightMargin: 10
} }
} }
SteamImage { SteamImage {
@ -59,7 +58,7 @@ Rectangle {
width: 30 width: 30
height: 30 height: 30
Component.onCompleted: { Component.onCompleted: {
steamWorkshop.steamAccount.loadAvatar(); steam.steamAccount.loadAvatar()
} }
anchors { anchors {
@ -70,12 +69,18 @@ Rectangle {
Connections { Connections {
function onAvatarChanged(_avatar) { function onAvatarChanged(_avatar) {
avatar.setImage(_avatar); avatar.setImage(_avatar)
avatarPlaceholder.opacity = 0
} }
target: steamWorkshop.steamAccount target: steam.steamAccount
} }
}
Image {
id: avatarPlaceholder
anchors.fill: avatar
source: "qrc:/assets/icons/steam_default_avatar.png"
} }
Button { Button {
@ -93,9 +98,7 @@ Rectangle {
right: parent.right right: parent.right
rightMargin: 10 rightMargin: 10
} }
} }
} }
states: [ states: [
@ -106,7 +109,6 @@ Rectangle {
target: bg target: bg
radius: 3 radius: 3
} }
}, },
State { State {
name: "scrolling" name: "scrolling"
@ -115,7 +117,6 @@ Rectangle {
target: bg target: bg
radius: 0 radius: 0
} }
} }
] ]
} }

View File

@ -2,7 +2,7 @@ import QtQuick 2.0
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import QtQuick.Controls.Material 2.13 import QtQuick.Controls.Material 2.13
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import ScreenPlay.Workshop 1.0 import Workshop 1.0
import ScreenPlay 1.0 import ScreenPlay 1.0
Popup { Popup {

View File

@ -4,7 +4,7 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtWebEngine 1.8 import QtWebEngine 1.8
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.2
import ScreenPlay.Workshop 1.0 import Workshop 1.0
import ScreenPlay 1.0 import ScreenPlay 1.0
Drawer { Drawer {

View File

@ -3,8 +3,7 @@ import QtQuick.Controls 2.13
import QtQuick.Controls.Material 2.13 import QtQuick.Controls.Material 2.13
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import ScreenPlay.Workshop 1.0 import Workshop 1.0
import ScreenPlay.Workshop.SteamEnums 1.0
import ScreenPlay 1.0 import ScreenPlay 1.0
import "upload/" import "upload/"
import "../Common" as Common import "../Common" as Common
@ -12,19 +11,21 @@ import "../Common" as Common
Item { Item {
id: root id: root
property alias steamWorkshop: screenPlayWorkshop.steamWorkshop ScreenPlayWorkshop {
id: workshop
property alias steam: workshop.steamWorkshop
}
state: "base"
onVisibleChanged: { onVisibleChanged: {
if (!visible) if (!visible)
sidebar.close(); sidebar.close()
} }
Component.onCompleted: { Component.onCompleted: {
if (steamWorkshop.online) if (workshop.steam.online)
steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend); workshop.steam.searchWorkshop(
SteamEnums.K_EUGCQuery_RankedByTrend)
else else
popupOffline.open(); popupOffline.open()
} }
MouseArea { MouseArea {
@ -37,19 +38,16 @@ Item {
preventStealing: true preventStealing: true
} }
ScreenPlayWorkshop {
id: screenPlayWorkshop
}
Connections { Connections {
function onWorkshopSearched() { function onWorkshopSearched() {
bannerTxt.text = steamWorkshop.workshopListModel.getBannerText(); bannerTxt.text = workshop.steam.workshopListModel.getBannerText()
background.backgroundImage = steamWorkshop.workshopListModel.getBannerUrl(); background.backgroundImage = workshop.steam.workshopListModel.getBannerUrl()
banner.bannerPublishedFileID = steamWorkshop.workshopListModel.getBannerID(); banner.bannerPublishedFileID = workshop.steam.workshopListModel.getBannerID()
bannerTxtUnderline.numberSubscriber = steamWorkshop.workshopListModel.getBannerAmountSubscriber(); bannerTxtUnderline.numberSubscriber
= workshop.steam.workshopListModel.getBannerAmountSubscriber()
} }
target: steamWorkshop target: workshop.steam
} }
Background { Background {
@ -65,8 +63,7 @@ Item {
UploadProject { UploadProject {
id: popupUploadProject id: popupUploadProject
steamWorkshop: steamWorkshop screenPlayWorkshop: workshop
workshop: screenPlayWorkshop
} }
PopupSteamWorkshopAgreement { PopupSteamWorkshopAgreement {
@ -75,16 +72,16 @@ Item {
Connections { Connections {
function onUserNeedsToAcceptWorkshopLegalAgreement() { function onUserNeedsToAcceptWorkshopLegalAgreement() {
popupSteamWorkshopAgreement.open(); popupSteamWorkshopAgreement.open()
} }
target: steamWorkshop.uploadListModel target: workshop.steam.uploadListModel
} }
Navigation { Navigation {
id: nav id: nav
steamWorkshop: steamWorkshop steam: workshop.steam
z: 3 z: 3
onUploadPressed: popupUploadProject.open() onUploadPressed: popupUploadProject.open()
@ -93,7 +90,6 @@ Item {
right: parent.right right: parent.right
left: parent.left left: parent.left
} }
} }
Flickable { Flickable {
@ -105,13 +101,9 @@ Item {
onContentYChanged: { onContentYChanged: {
// Calculate parallax scrolling // Calculate parallax scrolling
if (contentY >= 0) if (contentY >= 0)
background.imageOffsetTop = (contentY * -0.4); background.imageOffsetTop = (contentY * -0.4)
else else
background.imageOffsetTop = 0; background.imageOffsetTop = 0
if (contentY >= (header.height))
root.state = "scrolling";
else
root.state = "base";
} }
Item { Item {
@ -150,7 +142,6 @@ Item {
left: parent.left left: parent.left
bottom: parent.bottom bottom: parent.bottom
} }
} }
ColumnLayout { ColumnLayout {
@ -194,8 +185,10 @@ Item {
Material.foreground: "white" Material.foreground: "white"
icon.source: "qrc:/assets/icons/icon_download.svg" icon.source: "qrc:/assets/icons/icon_download.svg"
onClicked: { onClicked: {
text = qsTr("Downloading..."); text = qsTr("Downloading...")
steamWorkshop.subscribeItem(steamWorkshop.workshopListModel.getBannerID()); workshop.steam.subscribeItem(
workshop.steam.workshopListModel.getBannerID(
))
} }
} }
@ -206,14 +199,18 @@ Item {
icon.source: "qrc:/assets/icons/icon_info.svg" icon.source: "qrc:/assets/icons/icon_info.svg"
visible: false visible: false
onClicked: { onClicked: {
sidebar.setWorkshopItem(publishedFileID, imgUrl, additionalPreviewUrl, subscriptionCount); sidebar.setWorkshopItem(publishedFileID,
imgUrl,
additionalPreviewUrl,
subscriptionCount)
} }
} }
} }
MouseArea { MouseArea {
onClicked: Qt.openUrlExternally("steam://url/CommunityFilePage/" + banner.bannerPublishedFileID) onClicked: Qt.openUrlExternally(
"steam://url/CommunityFilePage/"
+ banner.bannerPublishedFileID)
height: 30 height: 30
width: bannerTxtOpenInSteam.paintedWidth width: bannerTxtOpenInSteam.paintedWidth
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
@ -229,13 +226,9 @@ Item {
font.family: ScreenPlay.settings.font font.family: ScreenPlay.settings.font
font.weight: Font.Thin font.weight: Font.Thin
} }
} }
} }
} }
} }
GridView { GridView {
@ -247,7 +240,7 @@ Item {
cellHeight: 190 cellHeight: 190
height: contentHeight height: contentHeight
interactive: false interactive: false
model: steamWorkshop.workshopListModel model: workshop.steam.workshopListModel
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
anchors { anchors {
@ -285,9 +278,6 @@ Item {
TextField { TextField {
id: tiSearch id: tiSearch
leftPadding: 25
selectByMouse: true
placeholderText: qsTr("Search for Wallpaper and Widgets...") placeholderText: qsTr("Search for Wallpaper and Widgets...")
onTextChanged: timerSearch.restart() onTextChanged: timerSearch.restart()
@ -303,9 +293,9 @@ Item {
id: timerSearch id: timerSearch
interval: 500 interval: 500
onTriggered: steamWorkshop.searchWorkshopByText(tiSearch.text) onTriggered: workshop.steam.searchWorkshopByText(
tiSearch.text)
} }
} }
Image { Image {
@ -320,7 +310,6 @@ Item {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 22 bottomMargin: 22
} }
} }
ToolButton { ToolButton {
@ -335,9 +324,7 @@ Item {
bottom: parent.bottom bottom: parent.bottom
bottomMargin: 10 bottomMargin: 10
} }
} }
} }
RowLayout { RowLayout {
@ -360,7 +347,8 @@ Item {
text: qsTr("Open Workshop in Steam") text: qsTr("Open Workshop in Steam")
font.capitalization: Font.Capitalize font.capitalization: Font.Capitalize
font.family: ScreenPlay.settings.font font.family: ScreenPlay.settings.font
onClicked: Qt.openUrlExternally("steam://url/SteamWorkshopPage/672870") onClicked: Qt.openUrlExternally(
"steam://url/SteamWorkshopPage/672870")
icon.source: "qrc:/assets/icons/icon_steam.svg" icon.source: "qrc:/assets/icons/icon_steam.svg"
icon.width: 18 icon.width: 18
icon.height: 18 icon.height: 18
@ -371,13 +359,13 @@ Item {
text: qsTr("Open GameHub in Steam") text: qsTr("Open GameHub in Steam")
font.capitalization: Font.Capitalize font.capitalization: Font.Capitalize
font.family: ScreenPlay.settings.font font.family: ScreenPlay.settings.font
onClicked: Qt.openUrlExternally("steam://url/GameHub/672870") onClicked: Qt.openUrlExternally(
"steam://url/GameHub/672870")
icon.source: "qrc:/assets/icons/icon_steam.svg" icon.source: "qrc:/assets/icons/icon_steam.svg"
icon.width: 18 icon.width: 18
icon.height: 18 icon.height: 18
height: cbQuerySort.height height: cbQuerySort.height
} }
} }
ComboBox { ComboBox {
@ -391,38 +379,39 @@ Item {
Layout.preferredHeight: searchWrapper.height Layout.preferredHeight: searchWrapper.height
font.family: ScreenPlay.settings.font font.family: ScreenPlay.settings.font
model: [{ model: [{
"value": SteamEnums.k_EUGCQuery_RankedByVote, "value": SteamEnums.k_EUGCQuery_RankedByVote,
"text": qsTr("Ranked By Vote") "text": qsTr("Ranked By Vote")
}, { }, {
"value": SteamEnums.K_EUGCQuery_RankedByPublicationDate, "value": SteamEnums.K_EUGCQuery_RankedByPublicationDate,
"text": qsTr("Publication Date") "text": qsTr("Publication Date")
}, { }, {
"value": SteamEnums.K_EUGCQuery_RankedByTrend, "value": SteamEnums.K_EUGCQuery_RankedByTrend,
"text": qsTr("Ranked By Trend") "text": qsTr("Ranked By Trend")
}, { }, {
"value": SteamEnums.K_EUGCQuery_FavoritedByFriendsRankedByPublicationDate, "value": SteamEnums.K_EUGCQuery_FavoritedByFriendsRankedByPublicationDate,
"text": qsTr("Favorited By Friends") "text": qsTr("Favorited By Friends")
}, { }, {
"value": SteamEnums.K_EUGCQuery_CreatedByFriendsRankedByPublicationDate, "value": SteamEnums.K_EUGCQuery_CreatedByFriendsRankedByPublicationDate,
"text": qsTr("Created By Friends") "text": qsTr("Created By Friends")
}, { }, {
"value": SteamEnums.K_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate, "value": SteamEnums.K_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate,
"text": qsTr("Created By Followed Users") "text": qsTr("Created By Followed Users")
}, { }, {
"value": SteamEnums.K_EUGCQuery_NotYetRated, "value": SteamEnums.K_EUGCQuery_NotYetRated,
"text": qsTr("Not Yet Rated") "text": qsTr("Not Yet Rated")
}, { }, {
"value": SteamEnums.K_EUGCQuery_RankedByTotalVotesAsc, "value": SteamEnums.K_EUGCQuery_RankedByTotalVotesAsc,
"text": qsTr("Total VotesAsc") "text": qsTr("Total VotesAsc")
}, { }, {
"value": SteamEnums.K_EUGCQuery_RankedByVotesUp, "value": SteamEnums.K_EUGCQuery_RankedByVotesUp,
"text": qsTr("Votes Up") "text": qsTr("Votes Up")
}, { }, {
"value": SteamEnums.K_EUGCQuery_RankedByTotalUniqueSubscriptions, "value": SteamEnums.K_EUGCQuery_RankedByTotalUniqueSubscriptions,
"text": qsTr("Total Unique Subscriptions") "text": qsTr("Total Unique Subscriptions")
}] }]
onActivated: { onActivated: {
steamWorkshop.searchWorkshop(cbQuerySort.currentValue); workshop.steam.searchWorkshop(
cbQuerySort.currentValue)
} }
anchors { anchors {
@ -430,11 +419,8 @@ Item {
right: parent.right right: parent.right
rightMargin: 10 rightMargin: 10
} }
} }
} }
} }
delegate: WorkshopItem { delegate: WorkshopItem {
@ -444,9 +430,11 @@ Item {
additionalPreviewUrl: m_additionalPreviewUrl additionalPreviewUrl: m_additionalPreviewUrl
subscriptionCount: m_subscriptionCount subscriptionCount: m_subscriptionCount
itemIndex: index itemIndex: index
steamWorkshop: root.steamWorkshop steamWorkshop: workshop.steamWorkshop
onClicked: { onClicked: {
sidebar.setWorkshopItem(publishedFileID, imgUrl, additionalPreviewUrl, subscriptionCount); sidebar.setWorkshopItem(publishedFileID, imgUrl,
additionalPreviewUrl,
subscriptionCount)
} }
} }
@ -470,10 +458,12 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: qsTr("Back") text: qsTr("Back")
enabled: steamWorkshop.workshopListModel.currentPage > 1 enabled: workshop.steam.workshopListModel.currentPage > 1
onClicked: { onClicked: {
steamWorkshop.workshopListModel.setCurrentPage(steamWorkshop.workshopListModel.currentPage - 1); workshop.steam.workshopListModel.setCurrentPage(
steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend); workshop.steam.workshopListModel.currentPage - 1)
workshop.steam.searchWorkshop(
SteamEnums.K_EUGCQuery_RankedByTrend)
} }
} }
@ -481,7 +471,8 @@ Item {
id: txtPage id: txtPage
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: steamWorkshop.workshopListModel.currentPage + "/" + steamWorkshop.workshopListModel.pages text: workshop.steam.workshopListModel.currentPage
+ "/" + workshop.steam.workshopListModel.pages
font.family: ScreenPlay.settings.font font.family: ScreenPlay.settings.font
color: Material.primaryTextColor color: Material.primaryTextColor
} }
@ -491,19 +482,20 @@ Item {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
text: qsTr("Forward") text: qsTr("Forward")
enabled: steamWorkshop.workshopListModel.currentPage <= steamWorkshop.workshopListModel.pages - 1 enabled: workshop.steam.workshopListModel.currentPage
<= workshop.steam.workshopListModel.pages - 1
onClicked: { onClicked: {
steamWorkshop.workshopListModel.setCurrentPage(steamWorkshop.workshopListModel.currentPage + 1); workshop.steam.workshopListModel.setCurrentPage(
steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend); workshop.steam.workshopListModel.currentPage + 1)
workshop.steam.searchWorkshop(
SteamEnums.K_EUGCQuery_RankedByTrend)
} }
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
} }
Behavior on contentHeight { Behavior on contentHeight {
@ -512,24 +504,21 @@ Item {
property: "contentHeight" property: "contentHeight"
easing.type: Easing.InOutQuart easing.type: Easing.InOutQuart
} }
} }
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
} }
} }
Sidebar { Sidebar {
id: sidebar id: sidebar
topMargin: 60 topMargin: 60
steamWorkshop: root.steamWorkshop steamWorkshop: workshop.steamWorkshop
onTagClicked: { onTagClicked: {
gridView.headerItem.searchField.text = tag; gridView.headerItem.searchField.text = tag
sidebar.close(); sidebar.close()
} }
} }
} }

View File

@ -2,7 +2,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import ScreenPlay.Workshop 1.0 as SP import Workshop 1.0 as SP
Item { Item {
id: pageInstalled id: pageInstalled

View File

@ -2,7 +2,7 @@ import QtQuick 2.12
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.2 import QtQuick.Controls.Material 2.2
import ScreenPlay.Workshop 1.0 import Workshop 1.0
import ScreenPlay 1.0 import ScreenPlay 1.0
Item { Item {

View File

@ -2,7 +2,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import ScreenPlay.Workshop 1.0 as SP import Workshop 1.0 as SP
import ScreenPlay 1.0 import ScreenPlay 1.0
import "../../Common" import "../../Common"

View File

@ -2,14 +2,14 @@ import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import ScreenPlay.Workshop 1.0 import Workshop 1.0
import ScreenPlay 1.0 import ScreenPlay 1.0
Popup { Popup {
id: root id: root
property SteamWorkshop steamWorkshop property ScreenPlayWorkshop screenPlayWorkshop
property ScreenPlayWorkshop workshop property SteamWorkshop steam: screenPlayWorkshop.steamWorkshop
width: 1200 width: 1200
height: 700 height: 700
@ -28,7 +28,7 @@ Popup {
Connections { Connections {
function onRequestClosePopup() { function onRequestClosePopup() {
root.close(); root.close()
} }
target: uploadLoader.item target: uploadLoader.item
@ -40,7 +40,7 @@ Popup {
Item { Item {
id: wrapper id: wrapper
signal requestClosePopup() signal requestClosePopup
Item { Item {
id: headerWrapper id: headerWrapper
@ -67,9 +67,7 @@ Popup {
top: parent.top top: parent.top
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
} }
} }
SwipeView { SwipeView {
@ -99,7 +97,7 @@ Popup {
cellWidth: parent.width cellWidth: parent.width
cellHeight: 250 cellHeight: 250
clip: true clip: true
model: workshop.installedListModel model: screenPlayWorkshop.installedListModel
anchors { anchors {
top: parent.top top: parent.top
@ -124,11 +122,11 @@ Popup {
onItemClicked: { onItemClicked: {
for (let childItem in gridView.contentItem.children) { for (let childItem in gridView.contentItem.children) {
if (gridView.contentItem.children[childItem].isSelected) { if (gridView.contentItem.children[childItem].isSelected) {
btnUploadProjects.enabled = true; btnUploadProjects.enabled = true
return ; return
} }
} }
btnUploadProjects.enabled = false; btnUploadProjects.enabled = false
} }
} }
@ -136,7 +134,6 @@ Popup {
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
policy: ScrollBar.AlwaysOn policy: ScrollBar.AlwaysOn
} }
} }
Button { Button {
@ -144,7 +141,7 @@ Popup {
text: qsTr("Abort") text: qsTr("Abort")
onClicked: { onClicked: {
wrapper.requestClosePopup(); wrapper.requestClosePopup()
} }
anchors { anchors {
@ -152,7 +149,6 @@ Popup {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
Button { Button {
@ -162,14 +158,14 @@ Popup {
highlighted: true highlighted: true
enabled: false enabled: false
onClicked: { onClicked: {
var uploadListArray = []; var uploadListArray = []
for (let childItem in gridView.contentItem.children) { for (let childItem in gridView.contentItem.children) {
if (gridView.contentItem.children[childItem].isSelected) if (gridView.contentItem.children[childItem].isSelected)
uploadListArray.push(gridView.contentItem.children[childItem].absoluteStoragePath); uploadListArray.push(
gridView.contentItem.children[childItem].absoluteStoragePath)
} }
view.currentIndex = 1; view.currentIndex = 1
steamWorkshop.bulkUploadToWorkshop(uploadListArray); steam.bulkUploadToWorkshop(uploadListArray)
} }
anchors { anchors {
@ -177,9 +173,7 @@ Popup {
bottom: parent.bottom bottom: parent.bottom
margins: 10 margins: 10
} }
} }
} }
Item { Item {
@ -193,7 +187,7 @@ Popup {
flickDeceleration: 5000 flickDeceleration: 5000
cacheBuffer: 1000 cacheBuffer: 1000
clip: true clip: true
model: steamWorkshop.uploadListModel model: steam.uploadListModel
width: parent.width - 50 width: parent.width - 50
spacing: 25 spacing: 25
@ -214,7 +208,6 @@ Popup {
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
snapMode: ScrollBar.SnapOnRelease snapMode: ScrollBar.SnapOnRelease
} }
} }
Button { Button {
@ -224,7 +217,7 @@ Popup {
highlighted: true highlighted: true
enabled: false enabled: false
onClicked: { onClicked: {
root.close(); root.close()
} }
anchors { anchors {
@ -235,16 +228,13 @@ Popup {
Connections { Connections {
function onUploadCompleted() { function onUploadCompleted() {
btnFinish.enabled = true; btnFinish.enabled = true
} }
target: steamWorkshop.uploadListModel target: steam.uploadListModel
} }
} }
} }
} }
PageIndicator { PageIndicator {
@ -255,13 +245,10 @@ Popup {
anchors.bottom: view.bottom anchors.bottom: view.bottom
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
} }
} }
background: Rectangle { background: Rectangle {
color: Material.theme === Material.Light ? "white" : Material.background color: Material.theme === Material.Light ? "white" : Material.background
} }
} }

View File

@ -2,7 +2,6 @@ import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material 2.12
import ScreenPlay.Workshop.SteamEnums 1.0
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import QtQuick.Controls.Material.impl 2.12 import QtQuick.Controls.Material.impl 2.12

View File

@ -85,7 +85,6 @@ void ScreenPlayWidget::setSDKConnection(std::unique_ptr<SDKConnection> connectio
{ {
m_connection = std::move(connection); m_connection = std::move(connection);
qInfo() << "[3/3] SDKConnected (Widged) saved!"; qInfo() << "[3/3] SDKConnected (Widged) saved!";
QObject::connect(m_connection.get(), &SDKConnection::requestDecreaseWidgetCount, this, [this]() { emit requestClose(appID()); });
QObject::connect(m_connection.get(), &SDKConnection::jsonMessageReceived, this, [this](const QJsonObject obj) { QObject::connect(m_connection.get(), &SDKConnection::jsonMessageReceived, this, [this](const QJsonObject obj) {
if (obj.value("messageType") == "positionUpdate") { if (obj.value("messageType") == "positionUpdate") {
setPosition({ obj.value("positionX").toInt(0), obj.value("positionY").toInt(0) }); setPosition({ obj.value("positionX").toInt(0), obj.value("positionY").toInt(0) });

View File

@ -82,7 +82,6 @@ signals:
void appIDChanged(QString appID); void appIDChanged(QString appID);
void monitorChanged(QVector<int> monitor); void monitorChanged(QVector<int> monitor);
void typeChanged(QString type); void typeChanged(QString type);
void requestDecreaseWidgetCount();
void requestRaise(); void requestRaise();
void appConnected(const ScreenPlay::SDKConnection* connection); void appConnected(const ScreenPlay::SDKConnection* connection);
void jsonMessageReceived(const QJsonObject obj); void jsonMessageReceived(const QJsonObject obj);