Update ProjectSpecificPrefs.md file

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
Vitalii Koshura 2023-04-02 04:59:24 +02:00
parent 7dcff929f4
commit 063aafc8ec
No known key found for this signature in database
GPG Key ID: CE0DB1726070A5A3
1 changed files with 19 additions and 12 deletions

@ -1,17 +1,24 @@
# Project-specific preferences
You can provide users with a set of project-specific preferences, controlled via a web interface. You can provide users with a set of project-specific preferences, controlled via a web interface.
These preferences are stored in XML, in a field of the user table. These preferences are stored in XML, in a field of the user table.
You determine the structure of this XML, and what it's used for. The code related to project-specific preferences is in `html/project/project_specific_prefs.inc`.
On the client, the XML is passed to your application in the [APP_INIT_DATA structure](BasicApi#Communicatingwiththecoreclient).
Examples of project-specific preferences include:
* Graphics preferences: e.g., color scheme.
* [Application selection](AppFiltering): you can allow users to select which of your applications they will be sent work for.
The PHP code related to project-specific preferences is in `html/project/project_specific_prefs.inc`.
When you create your project, this is initialized to sample code. When you create your project, this is initialized to sample code.
To create your own project-specific preferences, edit this file
(and keep it under SVN or CVS somewhere). The sample code contains a number of preferences that you can enable
by setting the corresponding constant to true in your html/project/project.inc:
* APP_SELECT_PREFS:
[Application selection](AppFiltering): users can select which of your applications they will be sent work for.
* MAX_JOBS_PREFS: users can limit the number of this project's jobs in progress
* MAX_CPUS_PREFS: users can limit the number of CPUs used by this project.
* NON_GRAPHICAL_PREF: users can choose to run non-graphical versions of apps if available.
* COLOR_PREFS: let the user select a color scheme for your application graphics.
(On the client, the XML is passed to your applications in the [APP_INIT_DATA structure](BasicApi#Communicatingwiththecoreclient);
your graphics app can parse this and changes it colors accordingly).
* GFX_CPU_PREFS: the user can limit the % of CPU used by the graphics app.
To create your own project-specific preferences, edit this file (and keep it under version control somewhere).
The functions you must supply are: The functions you must supply are:
* `project_specific_prefs_default()` * `project_specific_prefs_default()`