mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-10-07 09:47:07 +02:00
Add basic and not working check if user is ingame
This commit is contained in:
parent
c906fd3009
commit
6e1a26c55e
@ -38,7 +38,7 @@ Item {
|
|||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: 20
|
topMargin: 20
|
||||||
bottom:parent.bottom
|
bottom: parent.bottom
|
||||||
bottomMargin: 20
|
bottomMargin: 20
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
@ -124,6 +124,19 @@ Item {
|
|||||||
}
|
}
|
||||||
SettingsHorizontalSeperator {
|
SettingsHorizontalSeperator {
|
||||||
}
|
}
|
||||||
|
SettingBool {
|
||||||
|
headline: qsTr("Send anonymous crash reports and statistics")
|
||||||
|
description: qsTr("Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes!")
|
||||||
|
isChecked: screenPlaySettings.sendStatistics
|
||||||
|
onCheckboxChanged: {
|
||||||
|
screenPlaySettings.setSendStatistics(checked)
|
||||||
|
screenPlaySettings.writeSingleSettingConfig(
|
||||||
|
"sendStatistics", checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SettingsHorizontalSeperator {
|
||||||
|
}
|
||||||
|
|
||||||
SettingsButton {
|
SettingsButton {
|
||||||
headline: qsTr("Set save location")
|
headline: qsTr("Set save location")
|
||||||
description: screenPlaySettings.localStoragePath //qsTr("Choose where to find you content. The default save location is you steam installation")
|
description: screenPlaySettings.localStoragePath //qsTr("Choose where to find you content. The default save location is you steam installation")
|
||||||
@ -139,24 +152,13 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SettingsHorizontalSeperator {
|
|
||||||
}
|
|
||||||
SettingBool {
|
|
||||||
headline: qsTr("Send anonymous crash reports and statistics")
|
|
||||||
description: qsTr("Help us make ScreenPlay faster and more stable. All collected data is purely anonymous and only used for development purposes!")
|
|
||||||
isChecked: screenPlaySettings.sendStatistics
|
|
||||||
onCheckboxChanged: {
|
|
||||||
screenPlaySettings.setSendStatistics(checked)
|
|
||||||
screenPlaySettings.writeSingleSettingConfig("sendStatistics",checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: settingsPerformanceWrapper
|
id: settingsPerformanceWrapper
|
||||||
height: 220
|
height: 300
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
RectangularGlow {
|
RectangularGlow {
|
||||||
@ -201,6 +203,18 @@ Item {
|
|||||||
}
|
}
|
||||||
spacing: 10
|
spacing: 10
|
||||||
|
|
||||||
|
|
||||||
|
SettingBool {
|
||||||
|
headline: qsTr("Pause wallpaper when ingame")
|
||||||
|
description: qsTr("To maximise your framerates ingame, you can enable this setting to pause all active wallpapers!")
|
||||||
|
isChecked: screenPlaySettings.pauseWallpaperWhenIngame
|
||||||
|
onCheckboxChanged: {
|
||||||
|
screenPlaySettings.setPauseWallpaperWhenIngame(checked)
|
||||||
|
screenPlaySettings.writeSingleSettingConfig("setPauseWallpaperWhenIngame",checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SettingsHorizontalSeperator {
|
||||||
|
}
|
||||||
SettingsComboBox {
|
SettingsComboBox {
|
||||||
id: settingsComboBox
|
id: settingsComboBox
|
||||||
headline: qsTr("Default decoder")
|
headline: qsTr("Default decoder")
|
||||||
@ -330,13 +344,13 @@ Item {
|
|||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
font.pixelSize: 14
|
font.pixelSize: 14
|
||||||
font.family: "Roboto"
|
font.family: "Roboto"
|
||||||
width: parent.width *.6
|
width: parent.width * .6
|
||||||
anchors{
|
anchors {
|
||||||
top:txtHeadline.bottom
|
top: txtHeadline.bottom
|
||||||
topMargin: 6
|
topMargin: 6
|
||||||
left:parent.left
|
left: parent.left
|
||||||
leftMargin: 20
|
leftMargin: 20
|
||||||
right:imgLogoHead.left
|
right: imgLogoHead.left
|
||||||
rightMargin: 20
|
rightMargin: 20
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
@ -346,13 +360,12 @@ Item {
|
|||||||
source: "qrc:/assets/icons/icon_logo_head.svg"
|
source: "qrc:/assets/icons/icon_logo_head.svg"
|
||||||
width: 150
|
width: 150
|
||||||
height: 150
|
height: 150
|
||||||
sourceSize: Qt.size(150,150)
|
sourceSize: Qt.size(150, 150)
|
||||||
anchors{
|
anchors {
|
||||||
top:txtHeadline.bottom
|
top: txtHeadline.bottom
|
||||||
topMargin: -10
|
topMargin: -10
|
||||||
right:parent.right
|
right: parent.right
|
||||||
rightMargin: 20
|
rightMargin: 20
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,7 +379,6 @@ Item {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,11 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
|
|||||||
m_highPriorityStart = configObj.value("highPriorityStart").toBool();
|
m_highPriorityStart = configObj.value("highPriorityStart").toBool();
|
||||||
m_sendStatistics = configObj.value("sendStatistics").toBool();
|
m_sendStatistics = configObj.value("sendStatistics").toBool();
|
||||||
int renderer = static_cast<int>(configObj.value("renderer-value").toInt());
|
int renderer = static_cast<int>(configObj.value("renderer-value").toInt());
|
||||||
|
|
||||||
|
m_checkForOtherFullscreenApplicationTimer = new QTimer(this);
|
||||||
|
QObject::connect(&m_checkForOtherFullscreenApplicationTimer, &QTimer::timeout, this, &Settings::checkForOtherFullscreenApplication);
|
||||||
|
timer.start(1500);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Settings::~Settings()
|
Settings::~Settings()
|
||||||
@ -323,6 +328,20 @@ void Settings::setScreenPlayWindowPath(const QUrl& screenPlayWindowPath)
|
|||||||
m_screenPlayWindowPath = screenPlayWindowPath;
|
m_screenPlayWindowPath = screenPlayWindowPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Settings::checkForOtherFullscreenApplication()
|
||||||
|
{
|
||||||
|
Wnd = GetForegroundWindow();
|
||||||
|
RECT appBounds;
|
||||||
|
RECT rc;
|
||||||
|
GetWindowRect(GetDesktopWindow(), &rc);
|
||||||
|
if(hWnd =! GetDesktopWindow() && hWnd != GetShellWindow())
|
||||||
|
{
|
||||||
|
GetWindowRect(hWnd, &appBounds);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ActiveProfiles::ActiveProfiles()
|
ActiveProfiles::ActiveProfiles()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ public:
|
|||||||
Q_PROPERTY(bool autostart READ autostart WRITE setAutostart NOTIFY autostartChanged)
|
Q_PROPERTY(bool autostart READ autostart WRITE setAutostart NOTIFY autostartChanged)
|
||||||
Q_PROPERTY(bool highPriorityStart READ highPriorityStart WRITE setHighPriorityStart NOTIFY highPriorityStartChanged)
|
Q_PROPERTY(bool highPriorityStart READ highPriorityStart WRITE setHighPriorityStart NOTIFY highPriorityStartChanged)
|
||||||
Q_PROPERTY(bool sendStatistics READ sendStatistics WRITE setSendStatistics NOTIFY sendStatisticsChanged)
|
Q_PROPERTY(bool sendStatistics READ sendStatistics WRITE setSendStatistics NOTIFY sendStatisticsChanged)
|
||||||
|
Q_PROPERTY(bool pauseWallpaperWhenIngame READ pauseWallpaperWhenIngame WRITE setPauseWallpaperWhenIngame NOTIFY pauseWallpaperWhenIngameChanged)
|
||||||
Q_PROPERTY(QUrl localStoragePath READ localStoragePath WRITE setLocalStoragePath NOTIFY localStoragePathChanged)
|
Q_PROPERTY(QUrl localStoragePath READ localStoragePath WRITE setLocalStoragePath NOTIFY localStoragePathChanged)
|
||||||
Q_PROPERTY(QString decoder READ decoder WRITE setDecoder NOTIFY decoderChanged)
|
Q_PROPERTY(QString decoder READ decoder WRITE setDecoder NOTIFY decoderChanged)
|
||||||
Q_PROPERTY(int activeWallpaperCounter READ activeWallpaperCounter WRITE setActiveWallpaperCounter NOTIFY activeWallpaperCounterChanged)
|
Q_PROPERTY(int activeWallpaperCounter READ activeWallpaperCounter WRITE setActiveWallpaperCounter NOTIFY activeWallpaperCounterChanged)
|
||||||
@ -113,6 +114,11 @@ public:
|
|||||||
QUrl getScreenPlayWindowPath() const;
|
QUrl getScreenPlayWindowPath() const;
|
||||||
void setScreenPlayWindowPath(const QUrl &screenPlayWindowPath);
|
void setScreenPlayWindowPath(const QUrl &screenPlayWindowPath);
|
||||||
|
|
||||||
|
bool pauseWallpaperWhenIngame() const
|
||||||
|
{
|
||||||
|
return m_pauseWallpaperWhenIngame;
|
||||||
|
}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void autostartChanged(bool autostart);
|
void autostartChanged(bool autostart);
|
||||||
void highPriorityStartChanged(bool highPriorityStart);
|
void highPriorityStartChanged(bool highPriorityStart);
|
||||||
@ -123,8 +129,12 @@ signals:
|
|||||||
void setMainWindowVisible(bool visible);
|
void setMainWindowVisible(bool visible);
|
||||||
void activeWallpaperCounterChanged(int activeWallpaperCounter);
|
void activeWallpaperCounterChanged(int activeWallpaperCounter);
|
||||||
|
|
||||||
|
void pauseWallpaperWhenIngameChanged(bool pauseWallpaperWhenIngame);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
|
void checkForOtherFullscreenApplication();
|
||||||
|
|
||||||
void destroyWallpaper(QObject *ref);
|
void destroyWallpaper(QObject *ref);
|
||||||
|
|
||||||
//Global settings
|
//Global settings
|
||||||
@ -256,6 +266,15 @@ public slots:
|
|||||||
emit activeWallpaperCounterChanged(m_activeWallpaperCounter);
|
emit activeWallpaperCounterChanged(m_activeWallpaperCounter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setPauseWallpaperWhenIngame(bool pauseWallpaperWhenIngame)
|
||||||
|
{
|
||||||
|
if (m_pauseWallpaperWhenIngame == pauseWallpaperWhenIngame)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_pauseWallpaperWhenIngame = pauseWallpaperWhenIngame;
|
||||||
|
emit pauseWallpaperWhenIngameChanged(m_pauseWallpaperWhenIngame);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createDefaultConfig();
|
void createDefaultConfig();
|
||||||
void createProfileConfig();
|
void createProfileConfig();
|
||||||
@ -272,7 +291,7 @@ private:
|
|||||||
MonitorListModel* m_mlm;
|
MonitorListModel* m_mlm;
|
||||||
SDKConnector* m_sdkc;
|
SDKConnector* m_sdkc;
|
||||||
|
|
||||||
QThread m_thread;
|
QTimer* m_checkForOtherFullscreenApplicationTimer;
|
||||||
|
|
||||||
QVector<QSharedPointer<Wallpaper>> m_wallpapers;
|
QVector<QSharedPointer<Wallpaper>> m_wallpapers;
|
||||||
QVector<QProcess*> m_widgets;
|
QVector<QProcess*> m_widgets;
|
||||||
@ -285,6 +304,7 @@ private:
|
|||||||
bool m_hasWorkshopBannerSeen = false;
|
bool m_hasWorkshopBannerSeen = false;
|
||||||
QString m_decoder;
|
QString m_decoder;
|
||||||
int m_activeWallpaperCounter = 0;
|
int m_activeWallpaperCounter = 0;
|
||||||
|
bool m_pauseWallpaperWhenIngame = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ActiveProfiles {
|
class ActiveProfiles {
|
||||||
|
Loading…
Reference in New Issue
Block a user