1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-07-05 12:29:05 +02:00

Formatting

This commit is contained in:
Elias Steurer 2023-12-03 11:45:20 +01:00
parent e17e2abd9d
commit 716397ce3a
38 changed files with 2310 additions and 2385 deletions

View File

@ -85,7 +85,7 @@ endif()
option(SCREENPLAY_STEAM "For FOSS distribution so we do not bundle proprietary code." ON)
option(SCREENPLAY_DEPLOY "Marks this version as an official deploy version. This version uses different import paths and other settings."
OFF)
OFF)
option(SCREENPLAY_TESTS "Enables UI tests." ON)
option(SCREENPLAY_INSTALLER "Indicates whether an installer via the Qt Installer Framework is created." OFF)
option(SCREENPLAY_GODOT "Compiles ScreenPlayGodotWallpaper." ON)

View File

@ -49,11 +49,11 @@ set(HEADER
set(QML
# cmake-format: sort
main.qml
qml/Community/CommunityView.qml
qml/Community/CommunityNavItem.qml
qml/Community/CommunityView.qml
qml/Community/XMLNewsfeed.qml
qml/Create/CreateView.qml
qml/Create/CreateSidebar.qml
qml/Create/CreateView.qml
qml/Create/StartInfo.qml
qml/Create/StartInfoLinkImage.qml
qml/Create/Wizard.qml
@ -75,28 +75,28 @@ set(QML
qml/Create/Wizards/QMLWidget.qml
qml/Create/Wizards/WebsiteWallpaper.qml
qml/Create/Wizards/WizardPage.qml
qml/Installed/InstalledView.qml
qml/Installed/InstalledNavigation.qml
qml/Installed/InstalledView.qml
qml/Installed/InstalledWelcomeScreen.qml
qml/Installed/ScreenPlayItem.qml
qml/Installed/ScreenPlayItemImage.qml
qml/Installed/Sidebar.qml
qml/Monitors/DefaultVideoControls.qml
qml/Monitors/MonitorsView.qml
qml/Monitors/MonitorSelection.qml
qml/Monitors/MonitorSelectionItem.qml
qml/Monitors/MonitorsProjectSettingItem.qml
qml/Monitors/MonitorsView.qml
qml/Monitors/SaveNotification.qml
qml/Navigation/ExitPopup.qml
qml/Navigation/Navigation.qml
qml/Settings/SettingBool.qml
qml/Settings/SettingsView.qml
qml/Settings/SettingsButton.qml
qml/Settings/SettingsComboBox.qml
qml/Settings/SettingsExpander.qml
qml/Settings/SettingsHeader.qml
qml/Settings/SettingsHorizontalSeperator.qml
qml/Settings/SettingsPage.qml
qml/Settings/SettingsView.qml
qml/TrayIcon.qml
qml/Workshop/WorkshopView.qml)
@ -280,14 +280,11 @@ target_include_directories(
PUBLIC inc/public/
PRIVATE src/)
# Note making this public is so that *_qmltyperegistrations.cpp
# can find the needed include
# Note making this public is so that *_qmltyperegistrations.cpp can find the needed include
target_include_directories(ScreenPlayApp PUBLIC src/ inc/public/ScreenPlay)
# ScreenPlayApp is our qml module needed for compiling
# of all classes and most importanly for QML_ELEMENT.
# So our app is mostly a module that then link to
# ScreenPlay executable.
# ScreenPlayApp is our qml module needed for compiling of all classes and most importanly for QML_ELEMENT. So our app is mostly a module
# that then link to ScreenPlay executable.
qt_add_qml_module(
ScreenPlayApp
URI
@ -401,15 +398,14 @@ if(APPLE)
set_target_properties(
${PROJECT_NAME}
PROPERTIES OUTPUT_NAME ${PROJECT_NAME}
MACOSX_BUNDLE TRUE
MACOSX_RPATH TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
MACOSX_FRAMEWORK_IDENTIFIER app.screenplay
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@loader_path/Libraries"
RESOURCE "${RESOURCE_FILES};${APP_ICON_MACOSX}" # Include the icon in the resources
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE
XCODE_ATTRIBUTE_EXECUTABLE_NAME ${PROJECT_NAME})
MACOSX_BUNDLE TRUE
MACOSX_RPATH TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist
MACOSX_FRAMEWORK_IDENTIFIER app.screenplay
XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@loader_path/Libraries"
RESOURCE "${RESOURCE_FILES};${APP_ICON_MACOSX}" # Include the icon in the resources
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME TRUE
XCODE_ATTRIBUTE_EXECUTABLE_NAME ${PROJECT_NAME})
add_custom_command(
TARGET ${PROJECT_NAME}
@ -437,9 +433,8 @@ if(APPLE)
endif()
# Must be called here, because we need to change the
# OUTPUT_LOCATION for macos
qt_add_lrelease(${PROJECT_NAME} TS_FILES ${TS_FILES} )
# Must be called here, because we need to change the OUTPUT_LOCATION for macos
qt_add_lrelease(${PROJECT_NAME} TS_FILES ${TS_FILES})
# Note: We need the variables in the lib and exe!
generate_cmake_variable_header(${PROJECT_NAME})

View File

@ -25,8 +25,8 @@
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlay/profilelistmodel.h"
#include "ScreenPlay/settings.h"
#include "ScreenPlayUtil/util.h"
#include "ScreenPlayUtil/projectfile.h"
#include "ScreenPlayUtil/util.h"
#include <memory>

View File

@ -15,7 +15,6 @@
#include "ScreenPlay/globalvariables.h"
#include "ScreenPlayUtil/util.h"
#include "ScreenPlayUtil/util.h"
#include <memory>

View File

@ -104,8 +104,8 @@ ApplicationWindow {
}
Component.onCompleted: {
print("Settings.Language.Pl_PL",Settings.Language.Pl_PL)
print(App.settings.theme,Settings.Theme.Light);
print("Settings.Language.Pl_PL", Settings.Language.Pl_PL);
print(App.settings.theme, Settings.Theme.Light);
setTheme(App.settings.theme);
stackView.push("qrc:/qml/ScreenPlayApp/qml/Installed/InstalledView.qml", {
"sidebar": sidebar

View File

@ -6,7 +6,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil
Rectangle {

View File

@ -6,7 +6,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil
Item {

View File

@ -6,7 +6,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
Item {

View File

@ -6,7 +6,6 @@ import Qt5Compat.GraphicalEffects
import QtQuick.Controls.Material.impl
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil
Item {

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil
Item {

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
WizardPage {

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
WizardPage {

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
Item {
id: root

View File

@ -6,7 +6,6 @@ import Qt5Compat.GraphicalEffects
import ScreenPlayApp
import ScreenPlay
Item {
id: wrapperError

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
Item {

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
Item {
id: root

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
import "../../"

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
Item {
id: root

View File

@ -5,8 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
Item {

View File

@ -6,7 +6,6 @@ import QtQuick.Layouts
import QtQuick.Dialogs
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
import "../../"

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
WizardPage {

View File

@ -5,7 +5,6 @@ import QtQuick.Controls.Material
import QtQuick.Layouts
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil as Util
WizardPage {

View File

@ -7,7 +7,6 @@ import QtQuick.Window
import ScreenPlayApp
import ScreenPlay
FocusScope {
id: root

View File

@ -7,7 +7,6 @@ import QtQuick.Controls.Material.impl
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil
import "../Monitors"
Item {

View File

@ -4,6 +4,7 @@ import QtQuick.Controls.Material
import ScreenPlayApp
import ScreenPlay
import ScreenPlayUtil
Item {
id: root

View File

@ -14,7 +14,6 @@ Item {
property Item modalSource
Flickable {
id: flickableWrapper
@ -147,23 +146,62 @@ Item {
Component.onCompleted: comboBox.currentIndex = comboBox.indexOfValue(App.settings.language)
model: ListModel {
id: lmLangauge
ListElement { value: Settings.Language.En_US; text: "English" }
ListElement { value: Settings.Language.De_DE; text: "German" }
ListElement { value: Settings.Language.Pl_PL; text: "Polish" }
ListElement { value: Settings.Language.It_IT; text: "Italian" }
ListElement { value: Settings.Language.Zh_CN; text: "Chinese - Simplified" }
ListElement { value: Settings.Language.Ru_RU; text: "Russian" }
ListElement { value: Settings.Language.Fr_FR; text: "French" }
ListElement { value: Settings.Language.Es_ES; text: "Spanish" }
ListElement { value: Settings.Language.Ko_KR; text: "Korean" }
ListElement { value: Settings.Language.Vi_VN; text: "Vietnamese" }
ListElement { value: Settings.Language.Pt_BR; text: "Portuguese (Brazil)" }
ListElement { value: Settings.Language.Tr_TR; text: "Turkish" }
ListElement { value: Settings.Language.Nl_NL; text: "Dutch" }
}
ListElement {
value: Settings.Language.En_US
text: "English"
}
ListElement {
value: Settings.Language.De_DE
text: "German"
}
ListElement {
value: Settings.Language.Pl_PL
text: "Polish"
}
ListElement {
value: Settings.Language.It_IT
text: "Italian"
}
ListElement {
value: Settings.Language.Zh_CN
text: "Chinese - Simplified"
}
ListElement {
value: Settings.Language.Ru_RU
text: "Russian"
}
ListElement {
value: Settings.Language.Fr_FR
text: "French"
}
ListElement {
value: Settings.Language.Es_ES
text: "Spanish"
}
ListElement {
value: Settings.Language.Ko_KR
text: "Korean"
}
ListElement {
value: Settings.Language.Vi_VN
text: "Vietnamese"
}
ListElement {
value: Settings.Language.Pt_BR
text: "Portuguese (Brazil)"
}
ListElement {
value: Settings.Language.Tr_TR
text: "Turkish"
}
ListElement {
value: Settings.Language.Nl_NL
text: "Dutch"
}
}
onActivated: {
App.settings.setLanguage(settingsLanguage.comboBox.currentValue);
App.settings.retranslateUI();
App.settings.setLanguage(settingsLanguage.comboBox.currentValue);
App.settings.retranslateUI();
}
}
}
@ -179,10 +217,19 @@ Item {
comboBox {
Component.onCompleted: comboBox.currentIndex = comboBox.indexOfValue(App.settings.theme)
model: ListModel {
ListElement { value: Settings.Theme.System; text: qsTr("System Default") }
ListElement { value: Settings.Theme.Dark; text: qsTr("Dark") }
ListElement { value: Settings.Theme.Light; text: qsTr("Light") }
ListElement {
value: Settings.Theme.System
text: qsTr("System Default")
}
ListElement {
value: Settings.Theme.Dark
text: qsTr("Dark")
}
ListElement {
value: Settings.Theme.Light
text: qsTr("Light")
}
}
onActivated: {
App.settings.setTheme(settingsTheme.comboBox.currentValue);
}
@ -225,16 +272,30 @@ Item {
comboBox {
Component.onCompleted: comboBox.currentIndex = comboBox.indexOfValue(App.settings.videoFillMode)
model: ListModel {
ListElement { value: Video.FillMode.Stretch; text: qsTr("Stretch") }
ListElement { value: Video.FillMode.Fill; text: qsTr("Fill") }
ListElement { value: Video.FillMode.Contain; text: qsTr("Contain") }
ListElement { value: Video.FillMode.Cover; text: qsTr("Cover") }
ListElement { value: Video.FillMode.Scale_Down; text: qsTr("Scale-Down") }
ListElement {
value: Video.FillMode.Stretch
text: qsTr("Stretch")
}
ListElement {
value: Video.FillMode.Fill
text: qsTr("Fill")
}
ListElement {
value: Video.FillMode.Contain
text: qsTr("Contain")
}
ListElement {
value: Video.FillMode.Cover
text: qsTr("Cover")
}
ListElement {
value: Video.FillMode.Scale_Down
text: qsTr("Scale-Down")
}
onActivated: {
App.settings.setVideoFillMode(cbVideoFillMode.comboBox.currentValue)
}
onActivated: {
App.settings.setVideoFillMode(cbVideoFillMode.comboBox.currentValue);
}
}
}
}
@ -321,7 +382,7 @@ Item {
color: "#333333"
}
GrowIconLink {
GrowIconLink {
iconSource: "qrc:/qml/ScreenPlayApp/assets/icons/brand_gitlab.svg"
url: "https://gitlab.com/kelteseth"
color: "#FC6D26"
@ -333,7 +394,7 @@ Item {
color: "#1DA1F2"
}
GrowIconLink {
GrowIconLink {
iconSource: "qrc:/qml/ScreenPlayApp/assets/icons/brand_twitch.svg"
url: "https://www.twitch.tv/kelteseth/"
color: "#6441A5"
@ -462,7 +523,4 @@ Item {
}
}
}
}

View File

@ -168,7 +168,7 @@ void Settings::setupWidgetAndWindowPaths()
}
} else if (osType == "macos") {
m_globalVariables->setWidgetExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWidget").toLocalFile());
m_globalVariables->setWallpaperExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWallpaper").toLocalFile());
m_globalVariables->setWallpaperExecutablePath(QUrl::fromUserInput(workingDir.path() + "/ScreenPlayWallpaper").toLocalFile());
m_globalVariables->setGodotWallpaperExecutablePath(QUrl(workingDir.path() + "/ScreenPlayWallpaperGodot").toLocalFile());
const auto godotEditorName = "Godot_" + godotVersion + "-stable_osx.universal";
m_globalVariables->setGodotEditorExecutablePath(QUrl(workingDir.path() + "/" + godotEditorName));

View File

@ -72,6 +72,7 @@ if(${SCREENPLAY_TESTS})
qt_add_executable(tst_ScreenPlayShader src/TestMain.cpp)
target_link_libraries(tst_ScreenPlayShader PRIVATE Qt::Quick ${PROJECT_NAME}plugin)
if(APPLE)
set_target_properties(tst_ScreenPlayShader PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
set_target_properties(tst_ScreenPlayShader PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()
endif()

View File

@ -42,27 +42,27 @@ set(QML
set(SOURCES
# cmake-format: sort
src/httpfileserver.cpp
src/archive.cpp
src/contenttypes.cpp
src/exitcodes.cpp
src/httpfileserver.cpp
src/logginghandler.cpp
src/projectfile.cpp
src/exitcodes.cpp
src/steamenumsgenerated.cpp
src/util.cpp
src/archive.cpp)
src/util.cpp)
set(HEADER
# cmake-format: sort
inc/public/ScreenPlayUtil/archive.h
inc/public/ScreenPlayUtil/contenttypes.h
inc/public/ScreenPlayUtil/steamenumsgenerated.h
inc/public/ScreenPlayUtil/exitcodes.h
inc/public/ScreenPlayUtil/HelpersCommon.h
inc/public/ScreenPlayUtil/httpfileserver.h
inc/public/ScreenPlayUtil/ListPropertyHelper.h
inc/public/ScreenPlayUtil/logginghandler.h
inc/public/ScreenPlayUtil/projectfile.h
inc/public/ScreenPlayUtil/PropertyHelpers.h
inc/public/ScreenPlayUtil/ListPropertyHelper.h
inc/public/ScreenPlayUtil/HelpersCommon.h
inc/public/ScreenPlayUtil/archive.h
inc/public/ScreenPlayUtil/steamenumsgenerated.h
inc/public/ScreenPlayUtil/util.h)
if(APPLE)
@ -77,8 +77,7 @@ qt_add_library(
${PROJECT_NAME}
STATIC
${SOURCES}
${HEADER}
)
${HEADER})
qt_add_qml_module(
${PROJECT_NAME}
@ -103,20 +102,18 @@ target_include_directories(
PUBLIC inc/public/
PRIVATE src/)
# Note making this public is so thatscreenplayutil_qmltyperegistrations.cpp
# can find the #include <contenttypes.h> include
# Note making this public is so thatscreenplayutil_qmltyperegistrations.cpp can find the #include <contenttypes.h> include
target_include_directories(${PROJECT_NAME} PUBLIC inc/public/ScreenPlayUtil)
target_include_directories(${PROJECT_NAME}plugin PUBLIC inc/public/ScreenPlayUtil)
target_link_libraries(
${PROJECT_NAME}
PUBLIC
Qt6::Core
Qt6::Quick
Qt6::Gui
fmt::fmt-header-only
LibArchive::LibArchive
QArchive)
PUBLIC Qt6::Core
Qt6::Quick
Qt6::Gui
fmt::fmt-header-only
LibArchive::LibArchive
QArchive)
if(WIN32)
# Used for query windows monitor data

File diff suppressed because it is too large Load Diff

View File

@ -5,4 +5,3 @@ Steam::Steam()
{
}
}

View File

@ -80,7 +80,7 @@ qt_add_qml_module(
target_link_libraries(
${PROJECT_NAME}
PRIVATE ScreenPlaySDK
ScreenPlayUtil
ScreenPlayUtil
ScreenPlayUtilplugin
ScreenPlayWeatherplugin
Qt6::Quick
@ -113,12 +113,12 @@ endif()
if(APPLE)
target_link_libraries(${PROJECT_NAME} PRIVATE "-framework Cocoa")
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/index.html
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/index.html
${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/)
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()

View File

@ -20,7 +20,7 @@ Rectangle {
// macOS only supports h264 via the native Qt MM
if (Qt.platform.os === "osx") {
print(ContentTypes.InstalledType.VideoWallpaper )
print(ContentTypes.InstalledType.VideoWallpaper);
if ((Wallpaper.videoCodec === Video.VideoCodec.VP8 || Wallpaper.videoCodec === Video.VideoCodec.VP9)) {
loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaWebView.qml";
} else {

View File

@ -269,6 +269,7 @@ if(${SCREENPLAY_TESTS})
target_link_libraries(tst_ScreenPlayWeather PRIVATE Qt6::Quick ${PROJECT_NAME}plugin)
if(APPLE)
set_target_properties(tst_ScreenPlayWeather PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
set_target_properties(tst_ScreenPlayWeather PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()
endif()

View File

@ -40,8 +40,8 @@ qt_add_executable(
target_link_libraries(
${PROJECT_NAME}
PRIVATE ScreenPlaySDK
ScreenPlayUtil
ScreenPlayUtilplugin
ScreenPlayUtil
ScreenPlayUtilplugin
ScreenPlayWeatherplugin
Qt6::Quick
Qt6::Gui

View File

@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls
import QtWebEngine
import ScreenPlayWidget
import ScreenPlayUtil as Util
Item {

View File

@ -139,8 +139,9 @@ if(${SCREENPLAY_STEAM})
ScreenPlayUtilplugin
SteamSDK)
if(APPLE)
set_target_properties(tst_ScreenPlayWorkshop PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()
if(APPLE)
set_target_properties(tst_ScreenPlayWorkshop PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/bin/ScreenPlay.app/Contents/MacOS/")
endif()
endif()
endif()

View File

@ -11,10 +11,10 @@
#include "workshopitem.h"
// Steam
#include "ScreenPlayUtil/steamenumsgenerated.h"
#include "cstring"
#include "stdlib.h"
#include "steam/steam_api.h"
#include "ScreenPlayUtil/steamenumsgenerated.h"
/*!
\class Steam Workshop List Model