Structures are shown to have an idea how the files are defined. Categories and Sheets are stored on disk. The other structures are in categories, sets or sheets.
A set is not stored on disk on its own. A set is used to group a series of questions. A set has a name, a title and a description.
"set-name": used as a key to get and save values,
"title": ... ,
"description": ... ,
"hide": ... ,
"questions": [ {
... question ...
}, {
... next question ...
}
]
Questions are what it is all about. In short a piece of text to pose the question and a field where the answer can be given. However, more data is needed to fully display a question like what kind of input do we need, are there limits, is there a choice from a set of possibilities etc.
QAEntry
for text, QATextView
for multiline text, QAComboBox
a list of possibilities to chose from, QARadioButton
a select of one of a set of posibilities, QACheckButton
, one or more possebilities QAToggleButton
boolean input, QAScale
a slider, QASwitch
also boolean input, QAUserWidget
with a user definable input. Other types are QAColorChooser
, QAFileChooser
, QAList
, QASpin
and QAImage
. Some of these are not yet implemented.open
; Indicates open mode. The file chooser will only let the user pick an existing file.
save
; Indicates save mode. The file chooser will let the user pick an existing file, or type in a new filename.
select
; Indicates an Open mode for selecting folders. The file chooser will let the user pick an existing folder.
create
; Indicates a mode for creating a new folder. The file chooser will let the user name an existing or new folder.text/plain, text/x-perl
. You can also makeup targets as long as you have some source application supporting the targets.False
if not mentioned.The result returned from the QA dialog is a Hash. The keys to a questions answer is following a path through the sheet name, set name and questions name like shown below;
page-name1 => {
set-name1 => {
question-name1 => value-spec,
question-name2 => ...
...
},
set-name2 => {
...
}
},
page-name2 => {
...
}
The structure of a value-spec provided by the caller or returned by the program, can differ for each input type.
The formats used are shown below for each input type with the variables which control this output format.
Field Type | Repeatable | Selectlist | Returned |
---|---|---|---|
QACheckButton | ignored | ignored | [ $value, … ] |
QAColorChooser | ignored | ignored | $value |
QAComboBox | ignored | ignored | $value |
QAEntry | False | ignored | $value |
True | ∅ | [ $value, … ] |
|
True | [ $category, … ] |
[ :$category($value), … ] |
|
QAFileChooser | False | ignored | $value |
True | ∅ | [ $value, … ] |
|
True | [ $category, … ] |
[ :$category($value), … ] |
|
QAImage | False | ignored | $value |
True | ∅ | [ $value, … ] |
|
True | [ $category, … ] |
[ :$category($value), … ] |
|
QAList | ignored | ignored | [ $value, … ] |
QARadioButton | ignored | ignored | $value |
QAScale | ignored | ignored | $value |
QASwitch | ignored | ignored | $value |
QATextView | ignored | ignored | $value |
QAToggleButton | ignored | ignored | $value |
QASpinButton | ignored | ignored | $value |
QAUserWidget | user definable | user definable | user definable |
Symbol | Explanation |
---|---|
! | Must be provided with used type |
o | Optional |
- | Cannot be used and is ignored |
Unknown yet |
Field Type | Used letter in table header | Implemented |
---|---|---|
QACheckButton | Cb | ✓ |
QAColorChooser | Cc | |
QAComboBox | Co | ✓ |
QAEntry | En | ✓ |
QAFileChooser | Fc | ✓ |
QAImage | Im | ✓ |
QAList | Li | |
QARadioButton | Rb | ✓ |
QAScale | Sc | |
QASpinButton | Sp | ✓ |
QASwitch | Sw | ✓ |
QATextView | Tv | ✓ |
QAToggleButton | Tb | |
QAUserWidget | Uw | ✓ |
En | Cb | Co | Im | Li | Rb | Sc | Sw | Tv | Tb | Cc | Fc | Sp | Uw | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
action | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
buttons | o | - | - | o | - | - | - | - | - | o | o | ||||
callback | o | - | - | - | o | ||||||||||
default | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
description | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
fieldlist | - | ! | ! | - | ! | ! | o | ||||||||
fieldtype | o | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | |
height | - | - | - | o | - | o | o | ||||||||
hide | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
name | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | ! | |
options | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
repeatable | o | - | - | o | - | o | o | ||||||||
required | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
selectlist | o | - | - | o | - | - | - | - | - | - | o | o | - | ||
title | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
tooltip | o | o | o | o | o | o | o | o | o | o | o | o | o | o | |
userwidget | - | - | - | - | - | - | - | - | - | - | - | - | - | ! | |
width | - | - | - | o | - |
The sheet is used to present questions to the user. In a sheet there are pages which hold sets of questions. When shown there is only one page visible and using tabs or buttons you can show another.
button-map; A map of button names to a structure. There are two default buttons save-quit
and cancel
which do not need extra info and will be displayed by default. For changes and additions one need a structure. For instance on a login one would not like to have a ‘save-quit’ label on a button but rename it to Login
. The first letter of every word is uppercased and dashes are replaced with spaces. If a button is not desired, i.e. the default visible ones, a button is hidden when a name is set to an empty string. Otherwise, without a structure, the button is not shown.
The supported buttons are;
save-quit
; Save and close. Checks are done to see if it is safe to save. Its options may be;
name
; Different text on the button or empty string to hide the button.save-continue
: Save but do not close. Checks are done. This works like an ‘Apply’.
name
; Different text on the button.cancel
; Close without saving.
name
; Different text on the button or empty string to hide the button.help-info
; Show help dialog. Text is from help-message
,
name
; Different text on the button.message
; When help button is shown, this text is displayed. When absent, the help button is NOT shown.user
; A user definable button.
name
; Different text on the button.action
; A name of a method which can be called on a previously provided object. The method is called when the answer on the question in accepted and saved in the users data. This is like the action from the question explained above.{ "width": ... ,
"height": ... ,
"button-map": {
"default label text": {
"name": "changed label text",
"text": "optional text",
"action": "optional action"
}
...
},
"pages": [ {
... page ...
}, {
... next page ...
},
]
}
The questions are grouped in sets as explained above. Sets are referred to from a page to prevent duplication of structures. The problem which may arise is that sets in categories can be replaced or removed. The sheet display software will than issue a warning and skips the display of that particularly set.
QAContent
, QAPageIntro
, QAConfirm
, QASummary
, QAProgress
or QACustom
. The QAContent
is the default. A few are only useful for QAAssistant
and almost none for QADialog
."page-name": ... ,
"title": ... ,
"description": ... ,
"page-type": ... ,
"sets": [ {
... set ...
}, {
... next set ...
}
]