diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 913e0714..d9c499cc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,8 +13,8 @@ check: script: - cd Tools - pip install cmakelang - - python format-cmake.py - - python format-cpp.py + - python format_cmake.py + - python format_cpp.py build:windows_debug: stage: build diff --git a/CMakeLists.txt b/CMakeLists.txt index ed5483aa..99c3ae62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,6 @@ else() endif() 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) if(WIN32) diff --git a/ScreenPlay/CMakeLists.txt b/ScreenPlay/CMakeLists.txt index c41ff9b5..01c4b82e 100644 --- a/ScreenPlay/CMakeLists.txt +++ b/ScreenPlay/CMakeLists.txt @@ -126,9 +126,9 @@ target_link_libraries( benchmark::benchmark_main doctest::doctest) - -target_include_directories(${PROJECT_NAME} PRIVATE ${QT_TELEMTRY_INCLUDE}) - +if(WIN32) + target_link_libraries(${PROJECT_NAME} PRIVATE sentry::sentry) +endif() if(APPLE) diff --git a/ScreenPlay/app.cpp b/ScreenPlay/app.cpp index e3b12b3d..4b486c64 100644 --- a/ScreenPlay/app.cpp +++ b/ScreenPlay/app.cpp @@ -58,7 +58,7 @@ App::App() QGuiApplication::setOrganizationName("ScreenPlay"); QGuiApplication::setOrganizationDomain("https://screen-play.app"); QGuiApplication::setApplicationName("ScreenPlay"); - QGuiApplication::setApplicationVersion("0.13.2"); + QGuiApplication::setApplicationVersion("0.13.3"); QGuiApplication::setQuitOnLastWindowClosed(false); QFontDatabase::addApplicationFont(":/assets/fonts/LibreBaskerville-Italic.ttf"); @@ -214,46 +214,4 @@ void App::exit() 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(m_workshopPlugin.instance()); - Q_UNUSED(workshopPlugin) - settings()->setSteamVersion(true); - return true; -} - -bool App::unloadSteamPlugin() -{ - return m_workshopPlugin.unload(); -} } diff --git a/ScreenPlay/app.h b/ScreenPlay/app.h index 6ee17fe1..b0b8c465 100644 --- a/ScreenPlay/app.h +++ b/ScreenPlay/app.h @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -120,8 +121,6 @@ signals: public slots: QString version() const; void exit(); - bool loadSteamPlugin(); - bool unloadSteamPlugin(); void setGlobalVariables(GlobalVariables* globalVariables) { diff --git a/ScreenPlay/assets.qrc b/ScreenPlay/assets.qrc index 0165efc9..9f5594df 100644 --- a/ScreenPlay/assets.qrc +++ b/ScreenPlay/assets.qrc @@ -128,5 +128,6 @@ assets/icons/icon_sort-up-solid.svg assets/icons/icon_sort-down-solid.svg assets/icons/brand_reddit.svg + assets/icons/steam_default_avatar.png diff --git a/ScreenPlay/assets/icons/steam_default_avatar.png b/ScreenPlay/assets/icons/steam_default_avatar.png new file mode 100644 index 00000000..8c45c9c1 Binary files /dev/null and b/ScreenPlay/assets/icons/steam_default_avatar.png differ diff --git a/ScreenPlay/main.qml b/ScreenPlay/main.qml index d6597b38..e47ac1ca 100644 --- a/ScreenPlay/main.qml +++ b/ScreenPlay/main.qml @@ -32,27 +32,12 @@ ApplicationWindow { } function switchPage(name) { - const unloadSteamPlugin = nav.currentNavigationName === "Workshop"; if (nav.currentNavigationName === name) { if (name === "Installed") 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"); - if (unloadSteamPlugin) - ScreenPlay.unloadSteamPlugin(); - sidebar.state = "inactive"; } diff --git a/ScreenPlay/qml/Workshop/Background.qml b/ScreenPlay/qml/Workshop/Background.qml index 12beaafb..6c23240c 100644 --- a/ScreenPlay/qml/Workshop/Background.qml +++ b/ScreenPlay/qml/Workshop/Background.qml @@ -1,6 +1,6 @@ import QtQuick 2.13 import QtGraphicalEffects 1.0 -import ScreenPlay.Workshop 1.0 +import Workshop 1.0 Rectangle { id: root diff --git a/ScreenPlay/qml/Workshop/Navigation.qml b/ScreenPlay/qml/Workshop/Navigation.qml index e1925bda..ac19f25e 100644 --- a/ScreenPlay/qml/Workshop/Navigation.qml +++ b/ScreenPlay/qml/Workshop/Navigation.qml @@ -3,16 +3,15 @@ import QtQuick.Controls 2.13 import QtQuick.Controls.Material 2.13 import QtGraphicalEffects 1.0 import QtQuick.Controls.Material.impl 2.12 -import ScreenPlay.Workshop 1.0 -import SteamQMLImageProvider 1.0 +import Workshop 1.0 import ScreenPlay 1.0 Rectangle { id: root - property SteamWorkshop steamWorkshop + property SteamWorkshop steam - signal uploadPressed() + signal uploadPressed implicitWidth: 800 height: 50 @@ -39,7 +38,8 @@ Rectangle { verticalAlignment: Qt.AlignVCenter wrapMode: Text.WrapAtWordBoundaryOrAnywhere text: { - return steamWorkshop.steamAccount.username + qsTr(" Subscribed items: ") + steamWorkshop.steamAccount.amountSubscribedItems; + return steam.steamAccount.username + qsTr( + " Subscribed items: ") + steam.steamAccount.amountSubscribedItems } anchors { @@ -50,7 +50,6 @@ Rectangle { right: btnUplaod.left rightMargin: 10 } - } SteamImage { @@ -59,7 +58,7 @@ Rectangle { width: 30 height: 30 Component.onCompleted: { - steamWorkshop.steamAccount.loadAvatar(); + steam.steamAccount.loadAvatar() } anchors { @@ -70,12 +69,18 @@ Rectangle { Connections { 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 { @@ -93,9 +98,7 @@ Rectangle { right: parent.right rightMargin: 10 } - } - } states: [ @@ -106,7 +109,6 @@ Rectangle { target: bg radius: 3 } - }, State { name: "scrolling" @@ -115,7 +117,6 @@ Rectangle { target: bg radius: 0 } - } ] } diff --git a/ScreenPlay/qml/Workshop/PopupOffline.qml b/ScreenPlay/qml/Workshop/PopupOffline.qml index 899c73fe..f6c0167c 100644 --- a/ScreenPlay/qml/Workshop/PopupOffline.qml +++ b/ScreenPlay/qml/Workshop/PopupOffline.qml @@ -2,7 +2,7 @@ import QtQuick 2.0 import QtQuick.Controls 2.13 import QtQuick.Controls.Material 2.13 import QtGraphicalEffects 1.0 -import ScreenPlay.Workshop 1.0 +import Workshop 1.0 import ScreenPlay 1.0 Popup { diff --git a/ScreenPlay/qml/Workshop/Sidebar.qml b/ScreenPlay/qml/Workshop/Sidebar.qml index 596990e6..e970dba4 100644 --- a/ScreenPlay/qml/Workshop/Sidebar.qml +++ b/ScreenPlay/qml/Workshop/Sidebar.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.3 import QtQuick.Layouts 1.11 import QtWebEngine 1.8 import QtQuick.Controls.Material 2.2 -import ScreenPlay.Workshop 1.0 +import Workshop 1.0 import ScreenPlay 1.0 Drawer { diff --git a/ScreenPlay/qml/Workshop/Workshop.qml b/ScreenPlay/qml/Workshop/Workshop.qml index 2ad6c0c8..9d22d842 100644 --- a/ScreenPlay/qml/Workshop/Workshop.qml +++ b/ScreenPlay/qml/Workshop/Workshop.qml @@ -3,8 +3,7 @@ import QtQuick.Controls 2.13 import QtQuick.Controls.Material 2.13 import QtGraphicalEffects 1.0 import QtQuick.Layouts 1.12 -import ScreenPlay.Workshop 1.0 -import ScreenPlay.Workshop.SteamEnums 1.0 +import Workshop 1.0 import ScreenPlay 1.0 import "upload/" import "../Common" as Common @@ -12,19 +11,21 @@ import "../Common" as Common Item { id: root - property alias steamWorkshop: screenPlayWorkshop.steamWorkshop + ScreenPlayWorkshop { + id: workshop + property alias steam: workshop.steamWorkshop + } - state: "base" onVisibleChanged: { if (!visible) - sidebar.close(); - + sidebar.close() } Component.onCompleted: { - if (steamWorkshop.online) - steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend); + if (workshop.steam.online) + workshop.steam.searchWorkshop( + SteamEnums.K_EUGCQuery_RankedByTrend) else - popupOffline.open(); + popupOffline.open() } MouseArea { @@ -37,19 +38,16 @@ Item { preventStealing: true } - ScreenPlayWorkshop { - id: screenPlayWorkshop - } - Connections { function onWorkshopSearched() { - bannerTxt.text = steamWorkshop.workshopListModel.getBannerText(); - background.backgroundImage = steamWorkshop.workshopListModel.getBannerUrl(); - banner.bannerPublishedFileID = steamWorkshop.workshopListModel.getBannerID(); - bannerTxtUnderline.numberSubscriber = steamWorkshop.workshopListModel.getBannerAmountSubscriber(); + bannerTxt.text = workshop.steam.workshopListModel.getBannerText() + background.backgroundImage = workshop.steam.workshopListModel.getBannerUrl() + banner.bannerPublishedFileID = workshop.steam.workshopListModel.getBannerID() + bannerTxtUnderline.numberSubscriber + = workshop.steam.workshopListModel.getBannerAmountSubscriber() } - target: steamWorkshop + target: workshop.steam } Background { @@ -65,8 +63,7 @@ Item { UploadProject { id: popupUploadProject - steamWorkshop: steamWorkshop - workshop: screenPlayWorkshop + screenPlayWorkshop: workshop } PopupSteamWorkshopAgreement { @@ -75,16 +72,16 @@ Item { Connections { function onUserNeedsToAcceptWorkshopLegalAgreement() { - popupSteamWorkshopAgreement.open(); + popupSteamWorkshopAgreement.open() } - target: steamWorkshop.uploadListModel + target: workshop.steam.uploadListModel } Navigation { id: nav - steamWorkshop: steamWorkshop + steam: workshop.steam z: 3 onUploadPressed: popupUploadProject.open() @@ -93,7 +90,6 @@ Item { right: parent.right left: parent.left } - } Flickable { @@ -105,13 +101,9 @@ Item { onContentYChanged: { // Calculate parallax scrolling if (contentY >= 0) - background.imageOffsetTop = (contentY * -0.4); + background.imageOffsetTop = (contentY * -0.4) else - background.imageOffsetTop = 0; - if (contentY >= (header.height)) - root.state = "scrolling"; - else - root.state = "base"; + background.imageOffsetTop = 0 } Item { @@ -150,7 +142,6 @@ Item { left: parent.left bottom: parent.bottom } - } ColumnLayout { @@ -194,8 +185,10 @@ Item { Material.foreground: "white" icon.source: "qrc:/assets/icons/icon_download.svg" onClicked: { - text = qsTr("Downloading..."); - steamWorkshop.subscribeItem(steamWorkshop.workshopListModel.getBannerID()); + text = qsTr("Downloading...") + workshop.steam.subscribeItem( + workshop.steam.workshopListModel.getBannerID( + )) } } @@ -206,14 +199,18 @@ Item { icon.source: "qrc:/assets/icons/icon_info.svg" visible: false onClicked: { - sidebar.setWorkshopItem(publishedFileID, imgUrl, additionalPreviewUrl, subscriptionCount); + sidebar.setWorkshopItem(publishedFileID, + imgUrl, + additionalPreviewUrl, + subscriptionCount) } } - } MouseArea { - onClicked: Qt.openUrlExternally("steam://url/CommunityFilePage/" + banner.bannerPublishedFileID) + onClicked: Qt.openUrlExternally( + "steam://url/CommunityFilePage/" + + banner.bannerPublishedFileID) height: 30 width: bannerTxtOpenInSteam.paintedWidth cursorShape: Qt.PointingHandCursor @@ -229,13 +226,9 @@ Item { font.family: ScreenPlay.settings.font font.weight: Font.Thin } - } - } - } - } GridView { @@ -247,7 +240,7 @@ Item { cellHeight: 190 height: contentHeight interactive: false - model: steamWorkshop.workshopListModel + model: workshop.steam.workshopListModel boundsBehavior: Flickable.StopAtBounds anchors { @@ -285,9 +278,6 @@ Item { TextField { id: tiSearch - - leftPadding: 25 - selectByMouse: true placeholderText: qsTr("Search for Wallpaper and Widgets...") onTextChanged: timerSearch.restart() @@ -303,9 +293,9 @@ Item { id: timerSearch interval: 500 - onTriggered: steamWorkshop.searchWorkshopByText(tiSearch.text) + onTriggered: workshop.steam.searchWorkshopByText( + tiSearch.text) } - } Image { @@ -320,7 +310,6 @@ Item { bottom: parent.bottom bottomMargin: 22 } - } ToolButton { @@ -335,9 +324,7 @@ Item { bottom: parent.bottom bottomMargin: 10 } - } - } RowLayout { @@ -360,7 +347,8 @@ Item { text: qsTr("Open Workshop in Steam") font.capitalization: Font.Capitalize 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.width: 18 icon.height: 18 @@ -371,13 +359,13 @@ Item { text: qsTr("Open GameHub in Steam") font.capitalization: Font.Capitalize 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.width: 18 icon.height: 18 height: cbQuerySort.height } - } ComboBox { @@ -391,38 +379,39 @@ Item { Layout.preferredHeight: searchWrapper.height font.family: ScreenPlay.settings.font model: [{ - "value": SteamEnums.k_EUGCQuery_RankedByVote, - "text": qsTr("Ranked By Vote") - }, { - "value": SteamEnums.K_EUGCQuery_RankedByPublicationDate, - "text": qsTr("Publication Date") - }, { - "value": SteamEnums.K_EUGCQuery_RankedByTrend, - "text": qsTr("Ranked By Trend") - }, { - "value": SteamEnums.K_EUGCQuery_FavoritedByFriendsRankedByPublicationDate, - "text": qsTr("Favorited By Friends") - }, { - "value": SteamEnums.K_EUGCQuery_CreatedByFriendsRankedByPublicationDate, - "text": qsTr("Created By Friends") - }, { - "value": SteamEnums.K_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate, - "text": qsTr("Created By Followed Users") - }, { - "value": SteamEnums.K_EUGCQuery_NotYetRated, - "text": qsTr("Not Yet Rated") - }, { - "value": SteamEnums.K_EUGCQuery_RankedByTotalVotesAsc, - "text": qsTr("Total VotesAsc") - }, { - "value": SteamEnums.K_EUGCQuery_RankedByVotesUp, - "text": qsTr("Votes Up") - }, { - "value": SteamEnums.K_EUGCQuery_RankedByTotalUniqueSubscriptions, - "text": qsTr("Total Unique Subscriptions") - }] + "value": SteamEnums.k_EUGCQuery_RankedByVote, + "text": qsTr("Ranked By Vote") + }, { + "value": SteamEnums.K_EUGCQuery_RankedByPublicationDate, + "text": qsTr("Publication Date") + }, { + "value": SteamEnums.K_EUGCQuery_RankedByTrend, + "text": qsTr("Ranked By Trend") + }, { + "value": SteamEnums.K_EUGCQuery_FavoritedByFriendsRankedByPublicationDate, + "text": qsTr("Favorited By Friends") + }, { + "value": SteamEnums.K_EUGCQuery_CreatedByFriendsRankedByPublicationDate, + "text": qsTr("Created By Friends") + }, { + "value": SteamEnums.K_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate, + "text": qsTr("Created By Followed Users") + }, { + "value": SteamEnums.K_EUGCQuery_NotYetRated, + "text": qsTr("Not Yet Rated") + }, { + "value": SteamEnums.K_EUGCQuery_RankedByTotalVotesAsc, + "text": qsTr("Total VotesAsc") + }, { + "value": SteamEnums.K_EUGCQuery_RankedByVotesUp, + "text": qsTr("Votes Up") + }, { + "value": SteamEnums.K_EUGCQuery_RankedByTotalUniqueSubscriptions, + "text": qsTr("Total Unique Subscriptions") + }] onActivated: { - steamWorkshop.searchWorkshop(cbQuerySort.currentValue); + workshop.steam.searchWorkshop( + cbQuerySort.currentValue) } anchors { @@ -430,11 +419,8 @@ Item { right: parent.right rightMargin: 10 } - } - } - } delegate: WorkshopItem { @@ -444,9 +430,11 @@ Item { additionalPreviewUrl: m_additionalPreviewUrl subscriptionCount: m_subscriptionCount itemIndex: index - steamWorkshop: root.steamWorkshop + steamWorkshop: workshop.steamWorkshop onClicked: { - sidebar.setWorkshopItem(publishedFileID, imgUrl, additionalPreviewUrl, subscriptionCount); + sidebar.setWorkshopItem(publishedFileID, imgUrl, + additionalPreviewUrl, + subscriptionCount) } } @@ -470,10 +458,12 @@ Item { Layout.alignment: Qt.AlignVCenter text: qsTr("Back") - enabled: steamWorkshop.workshopListModel.currentPage > 1 + enabled: workshop.steam.workshopListModel.currentPage > 1 onClicked: { - steamWorkshop.workshopListModel.setCurrentPage(steamWorkshop.workshopListModel.currentPage - 1); - steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend); + workshop.steam.workshopListModel.setCurrentPage( + workshop.steam.workshopListModel.currentPage - 1) + workshop.steam.searchWorkshop( + SteamEnums.K_EUGCQuery_RankedByTrend) } } @@ -481,7 +471,8 @@ Item { id: txtPage 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 color: Material.primaryTextColor } @@ -491,19 +482,20 @@ Item { Layout.alignment: Qt.AlignVCenter text: qsTr("Forward") - enabled: steamWorkshop.workshopListModel.currentPage <= steamWorkshop.workshopListModel.pages - 1 + enabled: workshop.steam.workshopListModel.currentPage + <= workshop.steam.workshopListModel.pages - 1 onClicked: { - steamWorkshop.workshopListModel.setCurrentPage(steamWorkshop.workshopListModel.currentPage + 1); - steamWorkshop.searchWorkshop(SteamEnums.K_EUGCQuery_RankedByTrend); + workshop.steam.workshopListModel.setCurrentPage( + workshop.steam.workshopListModel.currentPage + 1) + workshop.steam.searchWorkshop( + SteamEnums.K_EUGCQuery_RankedByTrend) } } Item { Layout.fillWidth: true } - } - } Behavior on contentHeight { @@ -512,24 +504,21 @@ Item { property: "contentHeight" easing.type: Easing.InOutQuart } - } ScrollBar.vertical: ScrollBar { snapMode: ScrollBar.SnapOnRelease } - } Sidebar { id: sidebar topMargin: 60 - steamWorkshop: root.steamWorkshop + steamWorkshop: workshop.steamWorkshop onTagClicked: { - gridView.headerItem.searchField.text = tag; - sidebar.close(); + gridView.headerItem.searchField.text = tag + sidebar.close() } } - } diff --git a/ScreenPlay/qml/Workshop/WorkshopInstalled.qml b/ScreenPlay/qml/Workshop/WorkshopInstalled.qml index 0354a435..a77318a1 100644 --- a/ScreenPlay/qml/Workshop/WorkshopInstalled.qml +++ b/ScreenPlay/qml/Workshop/WorkshopInstalled.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.3 import QtQuick.Controls.Styles 1.4 import QtGraphicalEffects 1.0 -import ScreenPlay.Workshop 1.0 as SP +import Workshop 1.0 as SP Item { id: pageInstalled diff --git a/ScreenPlay/qml/Workshop/WorkshopItem.qml b/ScreenPlay/qml/Workshop/WorkshopItem.qml index 183ec942..2aa85e82 100644 --- a/ScreenPlay/qml/Workshop/WorkshopItem.qml +++ b/ScreenPlay/qml/Workshop/WorkshopItem.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtGraphicalEffects 1.0 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.2 -import ScreenPlay.Workshop 1.0 +import Workshop 1.0 import ScreenPlay 1.0 Item { diff --git a/ScreenPlay/qml/Workshop/upload/PopupSteamWorkshopAgreement.qml b/ScreenPlay/qml/Workshop/upload/PopupSteamWorkshopAgreement.qml index 6759d1ab..e48eb754 100644 --- a/ScreenPlay/qml/Workshop/upload/PopupSteamWorkshopAgreement.qml +++ b/ScreenPlay/qml/Workshop/upload/PopupSteamWorkshopAgreement.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.12 -import ScreenPlay.Workshop 1.0 as SP +import Workshop 1.0 as SP import ScreenPlay 1.0 import "../../Common" diff --git a/ScreenPlay/qml/Workshop/upload/UploadProject.qml b/ScreenPlay/qml/Workshop/upload/UploadProject.qml index 2593c64c..888caabd 100644 --- a/ScreenPlay/qml/Workshop/upload/UploadProject.qml +++ b/ScreenPlay/qml/Workshop/upload/UploadProject.qml @@ -2,14 +2,14 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.12 -import ScreenPlay.Workshop 1.0 +import Workshop 1.0 import ScreenPlay 1.0 Popup { id: root - property SteamWorkshop steamWorkshop - property ScreenPlayWorkshop workshop + property ScreenPlayWorkshop screenPlayWorkshop + property SteamWorkshop steam: screenPlayWorkshop.steamWorkshop width: 1200 height: 700 @@ -28,7 +28,7 @@ Popup { Connections { function onRequestClosePopup() { - root.close(); + root.close() } target: uploadLoader.item @@ -40,7 +40,7 @@ Popup { Item { id: wrapper - signal requestClosePopup() + signal requestClosePopup Item { id: headerWrapper @@ -67,9 +67,7 @@ Popup { top: parent.top horizontalCenter: parent.horizontalCenter } - } - } SwipeView { @@ -99,7 +97,7 @@ Popup { cellWidth: parent.width cellHeight: 250 clip: true - model: workshop.installedListModel + model: screenPlayWorkshop.installedListModel anchors { top: parent.top @@ -124,11 +122,11 @@ Popup { onItemClicked: { for (let childItem in gridView.contentItem.children) { if (gridView.contentItem.children[childItem].isSelected) { - btnUploadProjects.enabled = true; - return ; + btnUploadProjects.enabled = true + return } } - btnUploadProjects.enabled = false; + btnUploadProjects.enabled = false } } @@ -136,7 +134,6 @@ Popup { snapMode: ScrollBar.SnapOnRelease policy: ScrollBar.AlwaysOn } - } Button { @@ -144,7 +141,7 @@ Popup { text: qsTr("Abort") onClicked: { - wrapper.requestClosePopup(); + wrapper.requestClosePopup() } anchors { @@ -152,7 +149,6 @@ Popup { bottom: parent.bottom margins: 10 } - } Button { @@ -162,14 +158,14 @@ Popup { highlighted: true enabled: false onClicked: { - var uploadListArray = []; + var uploadListArray = [] for (let childItem in gridView.contentItem.children) { if (gridView.contentItem.children[childItem].isSelected) - uploadListArray.push(gridView.contentItem.children[childItem].absoluteStoragePath); - + uploadListArray.push( + gridView.contentItem.children[childItem].absoluteStoragePath) } - view.currentIndex = 1; - steamWorkshop.bulkUploadToWorkshop(uploadListArray); + view.currentIndex = 1 + steam.bulkUploadToWorkshop(uploadListArray) } anchors { @@ -177,9 +173,7 @@ Popup { bottom: parent.bottom margins: 10 } - } - } Item { @@ -193,7 +187,7 @@ Popup { flickDeceleration: 5000 cacheBuffer: 1000 clip: true - model: steamWorkshop.uploadListModel + model: steam.uploadListModel width: parent.width - 50 spacing: 25 @@ -214,7 +208,6 @@ Popup { ScrollBar.vertical: ScrollBar { snapMode: ScrollBar.SnapOnRelease } - } Button { @@ -224,7 +217,7 @@ Popup { highlighted: true enabled: false onClicked: { - root.close(); + root.close() } anchors { @@ -235,16 +228,13 @@ Popup { Connections { function onUploadCompleted() { - btnFinish.enabled = true; + btnFinish.enabled = true } - target: steamWorkshop.uploadListModel + target: steam.uploadListModel } - } - } - } PageIndicator { @@ -255,13 +245,10 @@ Popup { anchors.bottom: view.bottom anchors.horizontalCenter: parent.horizontalCenter } - } - } background: Rectangle { color: Material.theme === Material.Light ? "white" : Material.background } - } diff --git a/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml b/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml index cdfb53f3..cf92aa55 100644 --- a/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml +++ b/ScreenPlay/qml/Workshop/upload/UploadProjectItem.qml @@ -2,7 +2,6 @@ import QtQuick 2.13 import QtQuick.Controls 2.13 import QtGraphicalEffects 1.0 import QtQuick.Controls.Material 2.12 -import ScreenPlay.Workshop.SteamEnums 1.0 import QtQuick.Layouts 1.12 import QtQuick.Controls.Material.impl 2.12 diff --git a/ScreenPlay/src/screenplaywidget.cpp b/ScreenPlay/src/screenplaywidget.cpp index a79b74e4..a27620c8 100644 --- a/ScreenPlay/src/screenplaywidget.cpp +++ b/ScreenPlay/src/screenplaywidget.cpp @@ -85,7 +85,6 @@ void ScreenPlayWidget::setSDKConnection(std::unique_ptr connectio { m_connection = std::move(connection); 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) { if (obj.value("messageType") == "positionUpdate") { setPosition({ obj.value("positionX").toInt(0), obj.value("positionY").toInt(0) }); diff --git a/ScreenPlay/src/sdkconnection.h b/ScreenPlay/src/sdkconnection.h index 3f4817da..74fbb572 100644 --- a/ScreenPlay/src/sdkconnection.h +++ b/ScreenPlay/src/sdkconnection.h @@ -82,7 +82,6 @@ signals: void appIDChanged(QString appID); void monitorChanged(QVector monitor); void typeChanged(QString type); - void requestDecreaseWidgetCount(); void requestRaise(); void appConnected(const ScreenPlay::SDKConnection* connection); void jsonMessageReceived(const QJsonObject obj);