mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 11:32:42 +01:00
131 lines
13 KiB
HTML
131 lines
13 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<!-- settings.cpp -->
|
|
<title>Settings Class | ScreenPlay</title>
|
|
<link rel="stylesheet" type="text/css" href="../css/style.css"/> <link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css"/>
|
|
</head>
|
|
<body>
|
|
<div class="container-fullwidth nav"><div class="container navWrapper"><a href="../index.html"><span class="logo">ScreenPlay Generated Docs </span></a><span class="navHome"><a href="../index.html">Home</a></span></div></div> <div id= mainWrapper class="wrapper container ">
|
|
<li>Settings</li>
|
|
<div class="sidebar">
|
|
<div class="toc">
|
|
<h3><a name="toc">Contents</a></h3>
|
|
<ul>
|
|
<li class="level1"><a href="#public-functions">Public Functions</a></li>
|
|
<li class="level1"><a href="#public-slots">Public Slots</a></li>
|
|
<li class="level1"><a href="#signals">Signals</a></li>
|
|
<li class="level1"><a href="#details">Detailed Description</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="sidebar-content" id="sidebar-content"></div></div>
|
|
<h1 class="title">Settings Class</h1>
|
|
<span class="small-subtitle">(<a href="screenplay-settings.html">ScreenPlay::Settings</a>)<br/></span>
|
|
<!-- $$$Settings-brief -->
|
|
<p>Global settings class for reading and writing settings. <a href="#details">More...</a></p>
|
|
<!-- @@@Settings -->
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <Settings></span>
|
|
</td></tr></table></div><ul>
|
|
<li><a href="screenplay-settings-members.html">List of all members, including inherited members</a></li>
|
|
</ul>
|
|
<a name="public-functions"></a>
|
|
<h2 id="public-functions">Public Functions</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#Settings">Settings</a></b>(const shared_ptr<ScreenPlay::GlobalVariables> &<i>globalVariables</i>, QObject *<i>parent</i> = nullptr)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#anonymousTelemetry-prop">anonymousTelemetry</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#autostart-prop">autostart</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#decoder-prop">decoder</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#gitBuildHash-prop">gitBuildHash</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#highPriorityStart-prop">highPriorityStart</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#language-prop">language</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#offlineMode-prop">offlineMode</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#pauseWallpaperWhenIngame-prop">pauseWallpaperWhenIngame</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#silentStart-prop">silentStart</a></b>() const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QVersionNumber </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#version-prop">version</a></b>() const</td></tr>
|
|
</table></div>
|
|
<a name="public-slots"></a>
|
|
<h2 id="public-slots">Public Slots</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#anonymousTelemetry-prop">setAnonymousTelemetry</a></b>(bool <i>anonymousTelemetry</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#autostart-prop">setAutostart</a></b>(bool <i>autostart</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#decoder-prop">setDecoder</a></b>(QString <i>decoder</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#gitBuildHash-prop">setGitBuildHash</a></b>(QString <i>gitBuildHash</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#highPriorityStart-prop">setHighPriorityStart</a></b>(bool <i>highPriorityStart</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#language-prop">setLanguage</a></b>(QString <i>language</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#offlineMode-prop">setOfflineMode</a></b>(bool <i>offlineMode</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#pauseWallpaperWhenIngame-prop">setPauseWallpaperWhenIngame</a></b>(bool <i>pauseWallpaperWhenIngame</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#silentStart-prop">setSilentStart</a></b>(bool <i>silentStart</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#setupWidgetAndWindowPaths">setupWidgetAndWindowPaths</a></b>()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#writeJsonFileFromResource">writeJsonFileFromResource</a></b>(const QString &<i>filename</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#writeSingleSettingConfig">writeSingleSettingConfig</a></b>(QString <i>name</i>, QVariant <i>value</i>)</td></tr>
|
|
</table></div>
|
|
<a name="signals"></a>
|
|
<h2 id="signals">Signals</h2>
|
|
<div class="table"><table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#anonymousTelemetry-prop">anonymousTelemetryChanged</a></b>(bool <i>anonymousTelemetry</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#autostart-prop">autostartChanged</a></b>(bool <i>autostart</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#decoder-prop">decoderChanged</a></b>(QString <i>decoder</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#gitBuildHash-prop">gitBuildHashChanged</a></b>(QString <i>gitBuildHash</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#highPriorityStart-prop">highPriorityStartChanged</a></b>(bool <i>highPriorityStart</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#language-prop">languageChanged</a></b>(QString <i>language</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#offlineMode-prop">offlineModeChanged</a></b>(bool <i>offlineMode</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#pauseWallpaperWhenIngame-prop">pauseWallpaperWhenIngameChanged</a></b>(bool <i>pauseWallpaperWhenIngame</i>)</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="screenplay-settings.html#silentStart-prop">silentStartChanged</a></b>(bool <i>silentStart</i>)</td></tr>
|
|
</table></div>
|
|
<a name="details"></a>
|
|
<!-- $$$Settings-description -->
|
|
<div class="descr">
|
|
<h2 id="details">Detailed Description</h2>
|
|
<p>Used for:</p>
|
|
<ul>
|
|
<li>User configuration via AppDataLocalScreenPlayScreenPlay<ul>
|
|
<li>profiles.json - saved wallpaper and widgets config</li>
|
|
<li>settings.json - saved settings like autostart and installedContentPath</li>
|
|
<li>Computer\HKEY_CURRENT_USER\Software\<a href="screenplay.html">ScreenPlay</a>\<a href="screenplay.html">ScreenPlay</a> - ScreenPlayContentPath for steam plugin</li>
|
|
</ul>
|
|
</li>
|
|
<li>Communication via the SDK Connector</li>
|
|
</ul>
|
|
<p>Currently we save the regular settings (not the setup of the wallpaper and widgets) in two different locations. This can change in the future!</p>
|
|
</div>
|
|
<!-- @@@Settings -->
|
|
<div class="func">
|
|
<h2>Member Function Documentation</h2>
|
|
<!-- $$$Settings[overload1]$$$Settingsconstshared_ptr<ScreenPlay::GlobalVariables>&QObject* -->
|
|
<h3 class="fn" id="Settings"><a name="Settings"></a>Settings::<span class="name">Settings</span>(const <span class="type">shared_ptr</span><<span class="type">ScreenPlay::GlobalVariables</span>> &<i>globalVariables</i>, <span class="type">QObject</span> *<i>parent</i> = nullptr)</h3>
|
|
<p>Constructor and sets up:</p>
|
|
<ol class="1" type="1"><li>Sets the git build hash via <a href="screenplay.html">ScreenPlay</a>.pro c++ define</li>
|
|
<li>Checks the langauge via settings or system and available ones and installes a translator.</li>
|
|
<li>Checks the paths for config folders in appdata</li>
|
|
<li>Checks if settings.json and profiles.json are available. If first run it creates the default settings and profiles json.</li>
|
|
<li>Parses the version and checks with the compiled one.</li>
|
|
<li>Checks the absoluteStoragePath.</li>
|
|
<li>Checks regisitry for steam plugin settings</li>
|
|
<li>Parses autostart, <a href="screenplay-settings.html#anonymousTelemetry-prop">anonymousTelemetry</a>, <a href="screenplay-settings.html#highPriorityStart-prop">highPriorityStart</a></li>
|
|
<li>Checks <a href="screenplay-screenplaywallpaper.html">ScreenPlayWallpaper</a> and ScreenPlayWidgets executable paths.</li>
|
|
</ol>
|
|
<p>More errorchecking is needed here. For example when the proile or settings json cannot to parsed, use the default settings.</p>
|
|
<!-- @@@Settings -->
|
|
<!-- $$$setupWidgetAndWindowPaths[overload1]$$$setupWidgetAndWindowPaths -->
|
|
<h3 class="fn" id="setupWidgetAndWindowPaths"><a name="setupWidgetAndWindowPaths"></a><code>[slot] </code><span class="type">void</span> Settings::<span class="name">setupWidgetAndWindowPaths</span>()</h3>
|
|
<p>To have a better developer experience we check if we use a debug version. Then we assume That the paths are the default QtCreator paths and set the widgets and wallpaper executable paths accordingly.</p>
|
|
<!-- @@@setupWidgetAndWindowPaths -->
|
|
<!-- $$$writeJsonFileFromResource[overload1]$$$writeJsonFileFromResourceconstQString& -->
|
|
<h3 class="fn" id="writeJsonFileFromResource"><a name="writeJsonFileFromResource"></a><code>[slot] </code><span class="type">void</span> Settings::<span class="name">writeJsonFileFromResource</span>(const <span class="type">QString</span> &<i>filename</i>)</h3>
|
|
<p>Writes the default JsonFile from the resources and the given <i>filename</i>. Currently we have two default json files:</p>
|
|
<ul>
|
|
<li>profiles.json</li>
|
|
<li>settings.json</li>
|
|
</ul>
|
|
<!-- @@@writeJsonFileFromResource -->
|
|
<!-- $$$writeSingleSettingConfig[overload1]$$$writeSingleSettingConfigQStringQVariant -->
|
|
<h3 class="fn" id="writeSingleSettingConfig"><a name="writeSingleSettingConfig"></a><code>[slot] </code><span class="type">bool</span> Settings::<span class="name">writeSingleSettingConfig</span>(<span class="type">QString</span> <i>name</i>, <span class="type">QVariant</span> <i>value</i>)</h3>
|
|
<p>Save a single <i>value</i> with a given <i>name</i> (key) into the settings.json. Returns <code>true</code> when successful otherise returns <code>false</code>.</p>
|
|
<!-- @@@writeSingleSettingConfig -->
|
|
</div>
|
|
<div id= license class="footer center"><p>This documentation is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p></div> <script src="../js/mermaid.min.js"></script> <script>var config = {startOnLoad:true,flowchart:{useMaxWidth:true,htmlLabels:true}};mermaid.initialize(config);</script></body>
|
|
</html>
|