forked from linuxmint/cinnamon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow column options in the xlet settings list widget (linuxmint#7040)
* settings widgets combobox: use the valtype if given, and take a variable type not a string * xlet settings list widget: add the ability to supply options to a given key, and if so, use a combo box in the add/edit dialog rather than the usual widget for that type * settings example applet: update to demonstrate the new options functionality introduced to the settings list widget * settings reference tutorial: update to reflect changes to the list widget
- Loading branch information
Showing
10 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,15 +308,17 @@ | |
</itemizedlist> | ||
|
||
<para> | ||
This widget provides a list which can be edited and reordered from the settings window. The columns in the list are specified by the <code>columns</code> propery. Each column object in the array must have the following properties: | ||
This widget provides a list with columns, and rows which can be created, edited, deleted and reordered. The columns in the list are specified by the <code>columns</code> propery. All columns have the following properties: | ||
<itemizedlist> | ||
<listitem><code>id</code>: a unique string for identifying the column</listitem> | ||
<listitem><code>title</code>: the title that will be displayed in the column header</listitem> | ||
<listitem><code>type</code>: the data type for the column</listitem> | ||
<listitem><code>default</code>: (optional) a default value for the column when a new row is being created. This will only be used to auto-populate the corresponding widget when it is first generated in the add row dialog. If this property is omitted, the default will be determined by the widget.</listitem> | ||
<listitem><code>options</code>: (optional) A list of acceptable values for that column. Either an array or an object with key value pairs may be used. If an object is given, the key is displayed as the text of the widget, and must be a string; the value must match the data type of the column (ie. string, integer, boolean, etc).</listitem> | ||
</itemizedlist> | ||
</para> | ||
<para> | ||
Each column type determines the data type that is stored. In addition, it specifies the widget that is generated when the user clicks the add or edit buttons. These widgets act just like the corresponding widgets in this document, and all the same properties are available, with the exception of <code>description</code> and <code>type</code>. The following types are currently available: | ||
The column type determines the type of data that will be stored. When the user presses the add or edit button, a dialog is generated with a widget for each column definition. Starting in Cinnamon 3.8, if the <code>options</code> property is given, the widget will be a combo box. Otherwise the widget will be determined by the data type of the column as listed below. These widgets act just like the corresponding widgets in this document, and all the same properties can be included in the column definition, with the exception of <code>description</code> and <code>type</code>. The following types are currently available: | ||
<itemizedlist> | ||
<listitem><code>string</code>: this type stores data as a string. An <code>entry</code> is generated in the add/edit dialog. The default value for new entries is an empty string unless specified with the <code>default</code> property.</listitem> | ||
<listitem><code>file</code>: this type stores data as a string. A <code>filechooser</code> is generated in the add/edit dialog. The default value for new entries is an empty string unless specified with the <code>default</code> property.</listitem> | ||
|
@@ -325,7 +327,8 @@ | |
<listitem><code>boolean</code>: this type stores data as a bool. A <code>switch</code> is generated in the add/edit dialog. The default value for new entries is false unless specified with the <code>default</code> property.</listitem> | ||
</itemizedlist> | ||
</para> | ||
<para>The values are stored as an array of row objects. Each row object has a set of key:value pairs where the key is the <code>column id</code> of the column to which the value corresponds.</para> | ||
<para>The values are stored as an array of objects where each object in the array corresponds to a row in the list, and each entry in the row object is a key:value pair where the key being the <code>column id</code> of the column to which the value corresponds.</para> | ||
<para>For an example of how to use this widget, see the settings example applet that is included with Cinnamon. The source code for it can be found in <code>/usr/share/cinnamon/applets/[email protected]</code></para> | ||
<para>Note: For appearance, it is recommended that you do not use the description property of this setting, but rather place it in it's own <code>section</code>.</para> | ||
<para>New in Cinnamon 3.4</para> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters