1 u It would be very useful in some circumstances if kdialog
2 could be used as a direct replacement for dialog and/or xdialog.
4 In general, the differences between the kdialog we shipped with
5 KDE3 and the dialog / xdialog options are pretty minor, except
7 1. KDE3 kdialog doesn't accept (and doesn't need) the size options
8 (height and width). We don't need them because of the use of layouts
10 2. There are some dialog types that aren't supported by KDE3 kdialog.
12 There is more than one kind of dialog, and they take different options.
13 See below for the cdialog options:
15 cdialog (ComeOn Dialog!) version 1.0-20051107
16 Copyright (C) 2005 Thomas E. Dickey
17 This is free software; see the source for copying conditions. There is NO
18 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 * Display dialog boxes from shell scripts *
22 Usage: dialog <options> { --and-widget <options> }
23 where options are "common" options, followed by "box" options
28 [--aspect <ratio>] [--backtitle <backtitle>] [--begin <y> <x>]
29 [--cancel-label <str>] [--clear] [--colors] [--cr-wrap]
30 [--default-item <str>] [--defaultno] [--exit-label <str>]
31 [--extra-button] [--extra-label <str>] [--help-button]
32 [--help-label <str>] [--help-status] [--ignore] [--input-fd <fd>]
33 [--insecure] [--item-help] [--keep-window] [--max-input <n>]
34 [--no-cancel] [--no-collapse] [--no-kill] [--no-label <str>]
35 [--no-shadow] [--ok-label <str>] [--output-fd <fd>] [--print-maxsize]
36 [--print-size] [--print-version] [--separate-output]
37 [--separate-widget <str>] [--shadow] [--single-quoted] [--size-err]
38 [--sleep <secs>] [--stderr] [--stdout] [--tab-correct] [--tab-len <n>]
39 [--timeout <secs>] [--title <title>] [--trim] [--visit-items]
40 [--version] [--yes-label <str>]
42 --calendar <text> <height> <width> <day> <month> <year>
43 --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
44 --form <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
45 --fselect <filepath> <height> <width>
46 --gauge <text> <height> <width> [<percent>]
47 --infobox <text> <height> <width>
48 --inputbox <text> <height> <width> [<init>]
49 --inputmenu <text> <height> <width> <menu height> <tag1> <item1>...
50 --menu <text> <height> <width> <menu height> <tag1> <item1>...
51 --msgbox <text> <height> <width>
52 --passwordbox <text> <height> <width> [<init>]
53 --pause <text> <height> <width> <seconds>
54 --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
55 --tailbox <file> <height> <width>
56 --tailboxbg <file> <height> <width>
57 --textbox <file> <height> <width>
58 --timebox <text> <height> <width> <hour> <minute> <second>
59 --yesno <text> <height> <width>
61 Auto-size with height and width = 0. Maximize with height and width = -1.
62 Global-auto-size if also menu_height/list_height = 0.
67 The Dragonfly BSD version (and presumably other BSD flavours)
68 takes a different set of options.
72 dialog - display dialog boxes from shell scripts
78 dialog --create-rc file
79 dialog [ --title title ] [ --clear ] [ --hline line ] [ --hfile file ]
85 Dialog is a program which allows you to present a variety of questions
86 or display messages in dialog box form from a shell script. The fol-
87 lowing types of dialog objects are currently supported:
89 yes/no box, menu box, input box, message box, text box, info box,
90 checklist box, program box, ftree and tree boxes.
96 The screen will be cleared to the screen attribute on exit.
99 Since dialog supports run-time configuration, this can be used
100 to dump a sample configuration file to the file specified by
104 Specifies a title string to be displayed at the top of the dia-
108 Specifies a line string to be displayed at the bottom of the
112 Specifies a file to be displayed by pressing ? or F1.
116 --yesno text height width
117 A yes/no dialog box of size height rows by width columns will be
118 displayed. The string specified by text is displayed inside the
119 dialog box. If this string is too long to fit in one line, it
120 will be automatically divided into multiple lines at the appro-
121 priate points. The text string may also contain the sub-string
122 "\n" or newline characters `\n' to control line breaking explic-
123 itly. This dialog box is useful for asking questions that
124 require the user to answer either yes or no. The dialog box has
125 a Yes button and a No button, in which the user can switch
126 between by pressing the TAB key.
128 --msgbox text height width
129 A message box is very similar to a yes/no box. The only differ-
130 ence between a message box and a yes/no box is that a message
131 box has only a single OK button. You can use this dialog box to
132 display any message you like. After reading the message, the
133 user can press the ENTER key so that dialog will exit and the
134 calling shell script can continue its operation.
136 --infobox text height width
137 An info box is basically a message box. However, in this case,
138 dialog will exit immediately after displaying the message to the
139 user. The screen is not cleared when dialog exits, so that the
140 message will remain on the screen until the calling shell script
141 clears it later. This is useful when you want to inform the user
142 that some operations are carrying on that may require some time
145 --inputbox text height width
146 An input box is useful when you want to ask questions that
147 require the user to input a string as the answer. When inputing
148 the string, the BACKSPACE key can be used to correct typing
149 errors. If the input string is longer than can be fitted in the
150 dialog box, the input field will be scrolled. On exit, the input
151 string will be printed on stderr.
153 --textbox file height width
154 A text box lets you display the contents of a text file in a
155 dialog box. It is like a simple text file viewer. The user can
156 move through the file by using the UP/DOWN, PGUP/PGDN and
157 HOME/END keys available on most keyboards. If the lines are too
158 long to be displayed in the box, the LEFT/RIGHT keys can be used
159 to scroll the text region horizontally. For more convenience,
160 forward and backward searching functions are also provided.
162 --menu text height width menu-height [ tag item ] ...
163 As its name suggests, a menu box is a dialog box that can be
164 used to present a list of choices in the form of a menu for the
165 user to choose. Each menu entry consists of a tag string and an
166 item string. The tag gives the entry a name to distinguish it
167 from the other entries in the menu. The item is a short descrip-
168 tion of the option that the entry represents. The user can move
169 between the menu entries by pressing the UP/DOWN keys, the first
170 letter of the tag as a hot-key, or the number keys 1-9. There
171 are menu-height entries displayed in the menu at one time, but
172 the menu will be scrolled if there are more entries than that.
173 When dialog exits, the tag of the chosen menu entry will be
176 --prgbox command height width
177 A program box lets you display output of command in dialog box.
179 --checklist text height width list-height [ tag item status ] ...
180 A checklist box is similar to a menu box in that there are mul-
181 tiple entries presented in the form of a menu. Instead of choos-
182 ing one entry among the entries, each entry can be turned on or
183 off by the user. The initial on/off state of each entry is spec-
184 ified by status. On exit, a list of the tag strings of those
185 entries that are turned on will be printed on stderr.
187 --ftree file FS text height width menu-height
188 ftree box is a dialog box showing the tree described by the data
189 from the file file. The data in the file should look like
190 find(1) output. For the find output, the field separator FS
191 will be '/'. If height and width are positive numbers, they set
192 the absolute size of the whole ftree box. If height and width
193 are negative numbers, the size of the ftree box will be selected
194 automatically. menu-height sets the height of the tree subwin-
195 dow inside the ftree box and must be set. text is shown inside
196 the ftree box above the tree subwindow and can contain newline
197 characters '\n' to split lines. One can navigate in the tree by
198 pressing UP/DOWN or '+'/'-', PG_UP/PG_DOWN or 'b'/SPACE and
199 HOME/END or 'g'/'G'. A leaf of the tree is selected by pressing
200 TAB or LEFT/RIGHT the OK button and pressing ENTER. The
201 selected leaf (to be more exact, the full path to it from the
202 root of the tree) is printed to stderr. If Cancel and then
203 ENTER is pressed, nothing is printed to stderr. file may con-
204 tain data like find(1) output, as well as like the output of
205 find(1) with -d option. Some of the transient paths to the
206 leaves of the tree may be absent. Such data is corrected when
209 --tree FS text height width menu-height [ item ] ...
210 tree box is like ftree box with some exceptions. First, the data
211 is not entered from a file, but from the command line as item
212 item ... Second, the data thus entered is not corrected in any
213 way. Thus, the data like the output of find(1) with -d option
214 will look incorrectly.
216 RUN-TIME CONFIGURATION
217 1. Create a sample configuration file by typing:
219 "dialog --create-rc <file>"
221 2. At start, dialog determines the settings to use as follows:
223 a) if environment variable DIALOGRC is set, its value determines
224 the name of the configuration file.
226 b) if the file in (a) can't be found, use the file $HOME/.dialogrc
227 as the configuration file.
229 c) if the file in (b) can't be found, use compiled in defaults.
231 3. Edit the sample configuration file and copy it to some place that
232 dialog can find, as stated in step 2 above.
237 DIALOGRC Define this variable if you want to specify the name of
238 the configuration file to use.
243 $HOME/.dialogrc default configuration file
248 Exit status is 0 if dialog is exited by pressing the Yes or OK button,
249 and 1 if the No or Cancel button is pressed. Otherwise, if errors occur
250 inside dialog or dialog is exited by pressing the ESC key, the exit
255 Xdialog has an inordinately large collection of options. As of 2.3.1, the
256 help text offers the following:
257 [<common options>] [<transient options>] <box option> ...
261 --rc-file <gtkrc filename>
262 --backtitle <backtitle>
264 --allow-close | --no-close
265 --screen-center | --under-mouse | --auto-placement
266 --center | --right | --left | --fill
268 --cr-wrap | --no-cr-wrap
270 --separator <character> | --separate-output
271 --buttons-style default|icon|text
275 --password (may be repeated 2 or 3 times before --2inputsbox or --3inputsbox)
276 --password=1|2 (for --2inputsbox or --3inputsbox)
278 --time-stamp | --date-stamp
282 --timeout <timeout> (in seconds)
284 --item-help (if used, the {...} parameters are needed in menus/lists widgets)
286 --icon <xpm filename>
293 --print <printer> (1)
294 --check <label> [<status>]
296 --cancel-label <label>
299 --begin <Yorg> <Xorg>
304 --yesno <text> <height> <width>
305 --msgbox <text> <height> <width>
306 --infobox <text> <height> <width> [<timeout>]
307 --gauge <text> <height> <width> [<percent>]
308 --progress <text> <height> <width> [<maxdots> [[-]<msglen>]]
309 --inputbox <text> <height> <width> [<init>]
310 --2inputsbox <text> <height> <width> <label1> <init1> <label2> <init2>
311 --3inputsbox <text> <height> <width> <label1> <init1> <label2> <init2> <label3> <init3>
312 --combobox <text> <height> <width> <item1> ... <itemN>
313 --rangebox <text> <height> <width> <min value> <max value> [<default value>]
314 --2rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> <label2> <min2> <max2> <def2>
315 --3rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> ... <label3> <min3> <max3> <def3>
316 --spinbox <text> <height> <width> <min value> <max value> <default value> <label>
317 --2spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> <min2> <max2> <def2> <label2>
318 --3spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> ... <min3> <max3> <def3> <label3>
319 --textbox <file> <height> <width>
320 --editbox <file> <height> <width>
321 --tailbox <file> <height> <width>
322 --logbox <file> <height> <width>
323 --menubox <text> <height> <width> <menu height> <tag1> <item1> {<help1>}...
324 --checklist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
325 --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
326 --buildlist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
327 --treeview <text> <height> <width> <list height> <tag1> <item1> <status1> <item_depth1> {<help1>}...
328 --fselect <file> <height> <width>
329 --dselect <directory> <height> <width>
330 --colorsel <text> <height> <width> [<red> <green> <blue>]
331 --fontsel <font name> <height> <width>
332 --calendar <text> <height> <width> [<day> <month> <year>]
333 --timebox <text> <height> <width> [<hours> <minutes> <seconds>]
336 --version (prints version number to stderr and exits).
337 --print-version (same as above in a cdialog-compatible way).
338 --print-maxsize (prints maximum menu size in characters and exits).
340 Note that <height> and <width> are in characters and may be replaced by a single
341 XSIZExYSIZE[+/-XORG+/-YORG] parameter (like the one passed in the -geometry option
342 of X) which will represent the size of the Xdialog window in pixels. Specifying
343 a size of 0 0 (or 0x0) will auto-size Xdialog, while a size of -1 -1 (or -1x-1)
347 The KDE3 version of kdialog has yet another set of options:
349 Usage: kdialog [Qt-options] [KDE-options] [options] [arg]
351 KDialog can be used to show nice dialog boxes from shell scripts
354 --help Show help about options
355 --help-qt Show Qt specific options
356 --help-kde Show KDE specific options
357 --help-all Show all options
358 --author Show author information
359 -v, --version Show version information
360 --license Show license information
364 --yesno <text> Question message box with yes/no buttons
365 --yesnocancel <text> Question message box with yes/no/cancel buttons
366 --warningyesno <text> Warning message box with yes/no buttons
367 --warningcontinuecancel <text> Warning message box with continue/cancel buttons
368 --warningyesnocancel <text> Warning message box with yes/no/cancel buttons
369 --sorry <text> 'Sorry' message box
370 --error <text> 'Error' message box
371 --msgbox <text> Message Box dialog
372 --inputbox <text> <init> Input Box dialog
373 --password <text> Password dialog
374 --textbox <file> [width] [height] Text Box dialog
375 --textinputbox <text> <init> [width] [height] Text Input Box dialog
376 --combobox <text> [tag item] [tag item] ... ComboBox dialog
377 --menu <text> [tag item] [tag item] ... Menu dialog
378 --checklist <text> [tag item status] ... Check List dialog
379 --radiolist <text> [tag item status] ... Radio List dialog
380 --passivepopup <text> <timeout> Passive Popup
381 --getopenfilename [startDir] [filter] File dialog to open an existing file
382 --getsavefilename [startDir] [filter] File dialog to save a file
383 --getexistingdirectory [startDir] File dialog to select an existing directory
384 --getopenurl [startDir] [filter] File dialog to open an existing URL
385 --getsaveurl [startDir] [filter] File dialog to save a URL
386 --geticon [group] [context] Icon chooser dialog
387 --progressbar <text> [totalsteps] Progress bar dialog, returns a DCOP reference for communication
388 --title <text> Dialog title
389 --default <text> Default entry to use for combobox and menu
390 --multiple Allows the --getopenurl and --getopenfilename options to return multiple files
391 --separate-output Return list items on separate lines (for checklist option and file open with --multiple)
392 --print-winid Outputs the winId of each dialog
393 --embed <winid> Makes the dialog transient for an X app specified by winid
394 --dontagain <file:entry> Config file and option name for saving the "dont-show/ask-again" state
397 arg Arguments - depending on main option
401 Some of those options are common
403 So the dialog types we need for KDE4 are:
405 --yesno <text> <height> <width>
407 --warningyesno <text>
408 --warningcontinuecancel <text>
409 --warningyesnocancel <text>
413 --msgbox <text> <height> <width>
414 --infobox <text> <height> <width> [<timeout>]
415 --inputbox <text> <init>
416 --inputbox <text> <height> <width> [<init>]
417 --inputmenu <text> <height> <width> <menu height> <tag1> <item1>...
418 --textinputbox <text> <init> [width] [height]
420 --passwordbox <text> <height> <width> [<init>]
421 --textbox <file> [width] [height]
422 --combobox <text> [tag item] [tag item] ...
423 --combobox <text> <height> <width> <item1> ... <itemN>
424 --menu <text> [tag item] [tag item] ...
425 --menu <text> <height> <width> <menu height> <tag1> <item1>...
426 --menubox <text> <height> <width> <menu height> <tag1> <item1> {<help1>}...
427 --checklist <text> [tag item status] ...
428 --checklist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
429 --checklist <text> <height> <width> <list height> <tag1> <item1> <status1>...
430 --radiolist <text> [tag item status] ...
431 --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1>...
432 --passivepopup <text> <timeout>
433 --getopenfilename [startDir] [filter]
434 --fselect <file> <height> <width>
435 --getsavefilename [startDir] [filter]
436 --getexistingdirectory [startDir]
437 --dselect <directory> <height> <width>
438 --getopenurl [startDir] [filter]
439 --getsaveurl [startDir] [filter]
440 --geticon [group] [context]
441 --progressbar <text> [totalsteps]
442 --gauge <text> <height> <width> [<percent>]
444 --progress <text> <height> <width> [<maxdots> [[-]<msglen>]]
445 --prgbox command height width
446 --2inputsbox <text> <height> <width> <label1> <init1> <label2> <init2>
447 --3inputsbox <text> <height> <width> <label1> <init1> <label2> <init2> <label3> <init3>
448 --rangebox <text> <height> <width> <min value> <max value> [<default value>]
449 --2rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> <label2> <min2> <max2> <def2>
450 --3rangesbox <text> <height> <width> <label1> <min1> <max1> <def1> ... <label3> <min3> <max3> <def3>
451 --spinbox <text> <height> <width> <min value> <max value> <default value> <label>
452 --2spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> <min2> <max2> <def2> <label2>
453 --3spinsbox <text> <height> <width> <min1> <max1> <def1> <label1> ... <min3> <max3> <def3> <label3>
454 --editbox <file> <height> <width>
455 --tailbox <file> <height> <width>
456 --logbox <file> <height> <width>
457 --radiolist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
458 --buildlist <text> <height> <width> <list height> <tag1> <item1> <status1> {<help1>}...
459 --treeview <text> <height> <width> <list height> <tag1> <item1> <status1> <item_depth1> {<help1>}...
460 --colorsel <text> <height> <width> [<red> <green> <blue>]
461 --fontsel <font name> <height> <width>
462 --calendar <text> <height> <width> [<day> <month> <year>]
463 --timebox <text> <height> <width> [<hours> <minutes> <seconds>]
464 --ftree file FS text height width menu-height
465 --tree FS text height width menu-height [ item ] ...
466 --calendar <text> <height> <width> <day> <month> <year>
467 --form <text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>...
468 --pause <text> <height> <width> <seconds>
469 --tailbox <file> <height> <width>
470 --tailboxbg <file> <height> <width>
472 The non-specific options we need to handle include:
473 --title <text> Dialog title
474 --default <text> Default entry to use for combobox and menu
475 --multiple Allows the --getopenurl and --getopenfilename options to return multiple files
476 --separate-output Return list items on separate lines (for checklist option and file open with --multiple)
477 --print-winid Outputs the winId of each dialog
478 --embed <winid> Makes the dialog transient for an X app specified by winid
479 --dontagain <file:entry> Config file and option name for saving the "dont-show/ask-again" state
480 --caption <caption> Use 'caption' as name in the titlebar
481 --icon <icon> Use 'icon' as the application icon
482 --miniicon <icon> Use 'icon' as the icon in the titlebar
483 --config <filename> Use alternative configuration file
484 --dcopserver <server> Use the DCOP Server specified by 'server'
485 --nocrashhandler Disable crash handler, to get core dumps
486 --waitforwm Waits for a WM_NET compatible windowmanager
487 --style <style> sets the application GUI style
488 --geometry <geometry> sets the client geometry of the main widget - see man X for the argument format
489 --display <displayname> Use the X-server display 'displayname'
490 --session <sessionId> Restore the application for the given 'sessionId'
491 --cmap Causes the application to install a private color
492 map on an 8-bit display
493 --ncols <count> Limits the number of colors allocated in the color
494 cube on an 8-bit display, if the application is
495 using the QApplication::ManyColor color
497 --nograb tells Qt to never grab the mouse or the keyboard
498 --dograb running under a debugger can cause an implicit
499 -nograb, use -dograb to override
500 --sync switches to synchronous mode for debugging
501 --fn, --font <fontname> defines the application font
502 --bg, --background <color> sets the default background color and an
503 application palette (light and dark shades are
505 --fg, --foreground <color> sets the default foreground color
506 --btn, --button <color> sets the default button color
507 --name <name> sets the application name
508 --title <title> sets the application title (caption)
509 --visual TrueColor forces the application to use a TrueColor visual on
511 --inputstyle <inputstyle> sets XIM (X Input Method) input style. Possible
512 values are onthespot, overthespot, offthespot and
514 --im <XIM server> set XIM server
516 --reverse mirrors the whole layout of widgets
517 --version (prints version number to stderr and exits).
518 --print-version (same as above in a cdialog-compatible way).
519 --print-maxsize (prints maximum menu size in characters and exits).
521 --rc-file <gtkrc filename>
522 --backtitle <backtitle>
524 --allow-close | --no-close
525 --screen-center | --under-mouse | --auto-placement
526 --center | --right | --left | --fill
528 --cr-wrap | --no-cr-wrap
530 --separator <character> | --separate-output
531 --buttons-style default|icon|text
533 --password (may be repeated 2 or 3 times before --2inputsbox or --3inputsbox)
534 --password=1|2 (for --2inputsbox or --3inputsbox)
536 --time-stamp | --date-stamp
540 --timeout <timeout> (in seconds)
542 --item-help (if used, the {...} parameters are needed in menus/lists widgets)
544 --icon <xpm filename>
551 --print <printer> (1)
552 --check <label> [<status>]
554 --cancel-label <label>
557 --begin <Yorg> <Xorg>
566 --backtitle <backtitle>
597 --separate-widget <str>