Get started: create your own dialog in YAML

Author(s):
Manuela Hutter
Last updated:
2010-11-19

This document will help you create your first dialog in YAML.
If you want to know more about YAML in general and how it is used, see the YAML Introduction.

  1. Create a file <dialog-name>.yml in adjunct/resources/ui/dialogs/

    To get your dialog file included, you will have to build the resources. Opera will concatenate all yaml files (dialogs and definitions) into one big file. The file is located in $OPERADIR$/ui/dialogs.yml

  2. Write your yaml dialog in the file you have created

    See the YAML reference for help.
    Also, don't forget that the file will be concatenated, and you have to have the right indentation in your file. The top-most level in each individual file is a sequence of dialogs, with one level of indenation.

  3. Test your dialog by launching Opera with the option ' -dialogtest "<dialog-name>" '.

    You can also see ini-dialogs with the option ' - inidialogtest "<dialog-name>" '

  4. Write some code that launches your dialog, e.g. make a class that derives from OkCancelDialogContext, create an instance and call ShowDialog(DialogContext* dialog_context, UiContext* parent_context), DesktopWindow* parent_window).
  5. Launch Opera with the commandline option '-uiparserlog <filename>' to enable parser log output for dialogs.yml.
  6. Launch Opera with the commandline option '-uiwidgetsparserlog <filename>' to enable parser log output for widgets.yml.