<?xml version="1.0" encoding="UTF-8"?>
<gui name="kronometer"
     version="7"
     xmlns="http://www.kde.org/standards/kxmlgui/1.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
                         http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >

    <MenuBar>
        <Menu name="file">
            <text>&amp;File</text>
            <Action name="export_laps" />
        </Menu>
        <Menu name="kronometerActions" >
            <text>&amp;Kronometer</text>
            <Action name="start" />
            <Action name="pause" />
            <Action name="reset" />
            <Action name="lap" />
        </Menu>
    </MenuBar>

    <!-- Empty "mainToolBar" on top position. Without this bogus toolbar:
    1. A default top-position "mainToolBar" is created with the KDE standard actions used by kronometer. We want to prevent this.
    2. "kronometerToolBar" refuses to stay on bottom position. It seems like a top toolbar is mandatory in order to have toolbars in other positions. -->
    <ToolBar position="top" name="mainToolBar" noMerge="1">
        <text>Empty Toolbar</text>
    </ToolBar>

    <!-- Toolbar with stopwatch actions -->
    <ToolBar position="bottom" iconSize="48" name="kronometerToolBar" noMerge="1">
        <text>Kronometer Toolbar</text>
        <Action name="start" />
        <Action name="pause" />
        <Action name="reset" />
        <Action name="lap" />
    </ToolBar>

    <!-- State rules definition (enabling/disabling actions) -->

    <State name="inactive" >
        <enable>
            <Action name="start" />
        </enable>

        <disable>
            <Action name="pause" />
            <Action name="reset" />
            <Action name="lap" />
            <Action name="file_save" />
            <Action name="file_save_as" />
            <Action name="export_laps" />
        </disable>
    </State>

    <State name="running" >
        <enable>
            <Action name="pause" />
            <Action name="reset" />
            <Action name="lap" />
        </enable>

        <disable>
            <Action name="start" />
            <Action name="file_save" />
            <Action name="file_save_as" />
            <Action name="export_laps" />
        </disable>
    </State>

    <State name="paused" >
        <enable>
            <Action name="start" />
            <Action name="reset" />
            <Action name="file_save_as" />
        </enable>

        <disable>
            <Action name="pause" />
            <Action name="lap" />
        </disable>
    </State>

    <!-- There is a session that has been modified and then paused -->
    <State name="pausedSession" >
        <enable>
            <Action name="start" />
            <Action name="reset" />
            <Action name="file_save" />
            <Action name="file_save_as" />
        </enable>

        <disable>
            <Action name="pause" />
            <Action name="lap" />
        </disable>
    </State>

</gui>
