/**
 * File:        include/firewall/dialogs.ycp
 * Package:     Configuration YaST2 Firewall
 * Summary:     Configuration screens
 * Authors:     Lukas Ocilka <locilka@suse.cz>
 *
 * $Id: subdialogs.ycp 21781 2005-02-21 15:29:52Z locilka $
 *
 * Configuration dialogs divided into smaller logic groups.
 * Both Expert and Simple.
 */
{
    textdomain "firewall";

    import "Label";
    import "ProductFeatures";
    import "SuSEFirewallServices";
    import "SuSEFirewall";

    // UI VARIABLES AND FUNCTIONS
    boolean expert_ui = (ProductFeatures::ui_mode == "expert");

    /**
     * Function returns if this UI is an Expert UI.
     *
     * @return	boolean if is expert or not
     */
    boolean IsThisExpertConfiguration() {
	return expert_ui;
    }

    list <term> GetZonesListedItems () {
	list <term> items = [];

	map <string, string> zone_names_to_zones = $[];
	
	foreach (string zone_id, SuSEFirewall::GetKnownFirewallZones(), {
	    zone_names_to_zones[SuSEFirewall::GetZoneFullName(zone_id)] = zone_id;
	});

	foreach (string zone_name, string zone_id, zone_names_to_zones, {
	    items = add (items, `item(`id(zone_id), zone_name));
	});

	return items;
    }

    // TERM FUNCTIONS, WHOLE DIALOGS OR FRAMES

    term FirewallInterfaces () {
	term dialog = `Frame (
	    // TRANSLATORS: Frame label
	    _("Firewall Interfaces"),
	    `VBox (
		`Table (
		    `id("table_firewall_interfaces"),
		    `header (
			// TRANSLATORS: table header item
			_("Device"),
			// TRANSLATORS: table header item
			_("Interface or String"),
			// TRANSLATORS: table header item
			_("Configured In")
	    	    ), []
		),
		`HBox (
		    // TRANSLATORS: push button
		    `PushButton(`id("change_firewall_interface"), _("&Change")),
		    // TRANSLATORS: push button
		    `PushButton(`id("user_defined_firewall_interface"), _("C&ustom"))
		)
	    )
	);

	return dialog;
    }

    term SetFirewallInterfaceIntoZone (string device, string interface, list <term> zones) {
	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("Select Zone for Network Interface"),
	    `VBox (
		`HBox (
		    `VBox (
			// FIXME: this label should show an interface name got as parameter
			`Left ( `Label(device) ),
			`Left ( `Label(interface) )
		    ),
		    `ComboBox (`id("zone_for_interface"), `opt(`hstretch),
			// TRANSLATORS: select box
			_("&Interface Zone"), zones
		    )
		),
		`VSpacing(1),
		`HBox (
		    `PushButton(`id("ok"), Label::OKButton()),
		    `PushButton(`id("cancel"), Label::CancelButton())
		)
	    )
	);
	
	return dialog;
    }

    /**
     * Function returns dialog for additional zone strings (like 'any', 'auto'...)
     */
    term AdditionalSettingsForZones (map <string, map <string, string> > zones_additons) {
	term user_defined_zones = `VBox();

	foreach (string zone_id, map <string, string> zone_attributes, zones_additons, {
	    user_defined_zones = add(user_defined_zones,
		`TextEntry(`id("zone_additions_" + zone_id), zone_attributes["name"]:"", zone_attributes["items"]:"")
	    );
	});

	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("Additional Interface Settings for Zones"),
	    `VBox (
		`HStretch(),
		`VSpacing(1),
		user_defined_zones,
		`VSpacing(1),
		`VSpacing(1),
		`HBox (
		    `PushButton(`id("ok"), Label::OKButton()),
		    `PushButton(`id("cancel"), Label::CancelButton())
		)
	    )
	);
	
	return dialog;
    }

    term Masquerading () {
	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("Masquerading"),
	    `VBox (
		`ReplacePoint( `id("replacepoint_masquerade_information"), `Empty() ),
		`Left( `CheckBox(`id("masquerade_networks"), `opt(`notify),
		    // TRANSLATORS: check box
		    _("&Masquerade Networks"))
		),
		(IsThisExpertConfiguration() ?
		    // TRANSLATORS: select box
		    `Left( `ComboBox(`id("masquerade_outer_zone"), _("Zone &to Masquerade On"), GetZonesListedItems() ) )
		    :
		    nil
		)
	    )
	);
	
	return dialog;
    }

    list <term> GetDefinedServicesListedItems() {
	list <term> services_list = [];

	// sorted by service_name instead of service_id
	map <string, string> translations_to_service_ids = $[];

	foreach (string service_id, string service_name, SuSEFirewallServices::GetSupportedServices(), {
	    // checking for yet defined name...
	    if (translations_to_service_ids[service_name]:nil != nil) {
		y2error("More services with the same translation: %1", service_name);
	    }
	    translations_to_service_ids[service_name] = service_id;
	});

	foreach (string service_name, string service_id, translations_to_service_ids, {
	    services_list = add (services_list, `item( `id(service_id), service_name));
	});

	return services_list;
    }

    term AllowedServices () {
	term dialog = `VBox(
	    `Left( `ComboBox(`id("allowed_services_zone"), `opt(`notify),
		// TRANSLATORS: combo box
		_("All&owed Services for Selected Zone"), GetZonesListedItems() )
	    ),
	    `VSquash (
		`HBox (
		    `HWeight ( 9,
			`Bottom ( `Left( `ReplacePoint( `id("allow_service_names_replacepoint"),
			    // items handled by replacepoint
			    // TRANSLATORS: combo box
			    `ComboBox(`id("allow_service_names"), _("&Service to Allow"),[])
			)))
		    ),
		    `HWeight ( 2,
			`Bottom ( `PushButton ( `id ( "add_allowed_service" ), `opt ( `hstretch ), Label::AddButton() ) )
		    )
		)
	    ),
	    `HBox (
		`HWeight ( 9,
		    `VBox (
			`Table (
			    `id("table_allowed_services"),
			    `header (
				// TRANSLATORS: table header item
				_("Allowed Service")
	    		    ), []
			),
			`VSpacing(1),
			`Left( `CheckBox(`id("protect_from_internal"), `opt(`notify),
			    // TRANSLATORS: check box
			    _("&Protect Firewall from Internal Zone"))
			)
		    )
		),
		`HWeight ( 2,
		    `VBox (
			`Top ( `PushButton ( `id ( "remove_allowed_service" ), `opt ( `hstretch ), Label::RemoveButton() ) ),
			`HStretch(),
			// TRANSLATORS: push button
			`Bottom ( `PushButton ( `id ( "advanced_allowed_service" ), `opt ( `hstretch ), _("A&dvanced") ) )
		    )
		)
	    )
	);

	return dialog;
    }

    term AdditionalServices (string zone_name) {
	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("Additional Allowed Ports"),
	    `VBox (
		`HSpacing(45),
		`VSpacing(1),
		// TRANSLATORS: label, %1 is a zone name like "External Zone"
		`Left ( `Label(sformat(_("Settings for Zone: %1"), zone_name)) ),
		// TRANSLATORS: text entry
		`TextEntry(`id("additional_tcp"), _("&TCP Ports")),
		// TRANSLATORS: text entry
		`TextEntry(`id("additional_udp"), _("&UDP Ports")),
		// TRANSLATORS: text entry
		`TextEntry(`id("additional_rpc"), _("&RPC Ports")),
		// TRANSLATORS: text entry
		`TextEntry(`id("additional_ip"),  _("&IP Protocols")),
		`VSpacing(1),
		`HBox (
		    `PushButton(`id("ok"), Label::OKButton()),
		    `PushButton(`id("cancel"), Label::CancelButton())
		)
	    )
	);

	return dialog;
    }

/**
 * Expert configuration only
 *
 *    term MasqueradeNetworks () {
 *	term dialog = `Frame (
 *	    // TRANSLATORS: frame label
 *	    _("Allowed Network Masquerading"),
 *	    `VBox (
 *		`Table (
 *		    `header (
 *			// TRANSLATORS: table header item
 *			_("Local Network"),
 *			// TRANSLATORS: table header item
 *			_("Destination Network"),
 *			// TRANSLATORS: table header item
 *			_("Protocol"),
 *			// TRANSLATORS: table header item
 *			_("Port")
 *		    ), []
 *		),
 *		`VSquash (
 *		    `HBox (
 *			`PushButton(`id("add_masquerade_network"), Label::AddButton()),
 *			`PushButton(`id("remove_masquerade_network"), Label::RemoveButton())
 *		    )
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 *
 */

/*
 *    term AddNetworkMasqueradeRule () {
 *	term dialog = `Frame (
 *	    // TRANSLATORS: frame label
 *	    _("Add New Allowed Masquerading Rule"),
 *	    `VBox (
 *		`HBox (
 *		    `HWeight ( 50,
 *		    `VBox (
 *			// TRANSLATORS: editable select box
 *			`ComboBox (`id("add_source_network"), `opt(`editable,`hstretch), _("&Source Network"), [
 *			    `item( `id("0/0"), "0/0")
 *			]),
 *			// TRANSLATORS: editable select box
 *			`ComboBox (`id("add_protocol"), `opt(`editable,`hstretch), _("&Protocol"), [
 *			    `item( `id(""), ""),
 *			    `item( `id("tcp"), "tcp"),
 *			    `item( `id("tcp"), "udp")
 *			])
 *		    )),
 *		    `HWeight ( 50,
 *		    `VBox (
 *			// TRANSLATORS: editable select box
 *			`ComboBox (`id("add_destination_network"), `opt(`editable,`hstretch), _("Destination Network"), [
 *			    `item( `id("0/0"), "0/0")
 *			]),
 *			// TRANSLATORS: text entry
 *			`TextEntry (`id("add_destination_port"), _("Port"))
 *		    ))
 *		),
 *		`VSpacing(1),
 *		`HBox (
 *		    `PushButton(`id("ok"), Label::AddButton()),
 *		    `PushButton(`id("cancel"), Label::CancelButton())
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 *
 */

    term RedirectToMasqueradedIP () {
	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("Redirect Requests to Masqueraded IP"),
	    `VBox (
		`Table (
		    `id("table_redirect_masq"),
		    `header (
			// TRANSLATORS: table header item
			_("Source Network"),
			// TRANSLATORS: table header item
			_("Protocol"),
			// TRANSLATORS: table header item, Req. == Requested
			_("Req. IP"),
			// TRANSLATORS: table header item, Req. == Requested
			_("Req. Port"),
			"",
			// TRANSLATORS: table header item, Redir. == Redirect
			_("Redir. to IP"),
			// TRANSLATORS: table header item, Redir. == Redirect
			_("Redir. to Port")
		    ), []
		),
		`VSquash (
		    `HBox (
			`PushButton(`id("add_redirect_to_masquerade"), Label::AddButton()),
			`PushButton(`id("remove_redirect_to_masquerade"), Label::RemoveButton())
		    )
		)
	    )
	);
	
	return dialog;
    }

    term AddRedirectToMasqueradedIPRule () {
	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("Add Masqueraded Redirect Rule"),
	    `VBox (
		`VSpacing(1),
		// TRANSLATORS: section title in popup window
		`Left ( `Label(_("Redirect Matching Rule:")) ),
		`HBox (
		    `VBox (
			// TRANSLATORS: editable select box
			`ComboBox (`id("add_source_network"), `opt(`editable,`hstretch), _("&Source Network"), [
			    `item( `id("0/0"), "0/0")
			]),
			// TRANSLATORS: text entry
			`TextEntry (`id("add_requested_ip"), _("Re&quested IP"))
		    ),
		    `VBox (
			// TRANSLATORS: select box
			`ComboBox (`id("add_protocol"), `opt(`hstretch), _("&Protocol"), [
			    `item( `id("tcp"), "TCP"),
			    `item( `id("udp"), "UDP")
			]),
			// TRANSLATORS: text entry
			`TextEntry (`id("add_requested_port"), _("R&equested Port"))
		    )
		),
		`VSpacing(1),
		// TRANSLATORS: section title in popup window
		`Left( `Label(_("Redirection:")) ),
		`HBox (
		    // TRANSLATORS: text entry
		    `TextEntry (`id("add_redirectto_ip"), _("Re&direct to Masqueraded IP")),
		    // TRANSLATORS: text entry
		    `TextEntry (`id("add_redirectto_port"), _("&Redirect to Port"))
		),
		`VSpacing(1),
		`HBox (
		    `PushButton(`id("ok"), Label::AddButton()),
		    `PushButton(`id("cancel"), Label::CancelButton())
		)
	    )
	);
	
	return dialog;
    }

/**
 * Only for Expert configuration
 *
 *    term TransparentLocalRedirection () {
 *	term dialog = `Frame (
 *	    _("Transparent Local Redirection"),
 *	    `VBox (
 *		`Left( `Label (_("Attention: Packets are transparently redirected to '127.0.0.1'."))),
 *		`Table (
 *		    `header (
 *			_("Source Network"),
 *			_("Destination Network"),
 *			_("Protocol"),
 *			_("Requested Port"),
 *			"",
 *			_("Local Port")
 *		    ),
 *		    // FIXME: fake items
 *		    [
 *			`item(`id("1"), "10.0.0.0/24", "0/0", "tcp", "http", UI::Glyph(`BulletArrowRight), "3128"),
 *			`item(`id("2"), "10.0.0.0/24", "0/0", "tcp", "smtp", UI::Glyph(`BulletArrowRight), "smtp"),
 *		    ]
 *		),
 *		`VSquash (
 *		    `HBox (
 *			`PushButton(`id("add_transparent_redirection"), Label::AddButton()),
 *			`PushButton(`id("remove_transparent_redirection"), Label::RemoveButton())
 *		    )
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

/**
 * Only for Expert configuration
 *
 *    term AddTransparentLocalRedirectionRule () {
 *	term dialog = `Frame (
 *	    _("Add New Transparent Local Redirection"),
 *	    `VBox (
 *		`VSpacing(1),
 *		`Left ( `Label(_("Transparent Redirection Matching Rule:")) ),
 *		`HBox (
 *		    `HWeight ( 10,
 *			`ComboBox (`id("add_source_network"), `opt(`editable,`hstretch), _("Source Network"), [
 *			    `item( `id("0/0"), "0/0")
 *			])
 *		    ),
 *		    `HWeight ( 10,
 *			`ComboBox (`id("add_destination_network"), `opt(`editable,`hstretch), _("Destination Network"), [
 *			    `item( `id("0/0"), "0/0")
 *			])
 *		    )
 *		),
 *		`HBox (
 *		    `HWeight ( 10,
 *			// FIXME: another protocols?
 *			`ComboBox (`id("add_protocol"), `opt(`hstretch), _("Protocol"), [
 *			    `item( `id("tcp"), "tcp"),
 *			    `item( `id("tcp"), "udp")
 *			])
 *		    ),
 *		    `HWeight ( 10,
 *			`TextEntry (`id("add_destination_port"), _("Requested Port"))
 *		    )
 *		),
 *		`VSpacing(1),
 *		`Left ( `Label(_("Transparently Redirect To:")) ),
 *		`TextEntry (`id("add_localredirect_port"), _("Local Port On 127.0.0.1")),
 *		`VSpacing(1),
 *		`HBox (
 *		    `PushButton(`id("ok"), Label::AddButton()),
 *		    `PushButton(`id("cancel"), Label::CancelButton())
 *		)
 *	    )
 *	);
 *
 *	return dialog;
 *    }
 */

/**
 * Only for Expert configuration
 *
 *    term ForwardNetworks () {
 *	term dialog = `Frame (
 *	    _("Forwarding Networks"),
 *	    `VBox (
 *		`Left( `Label(_("Atention: These networks are forwarder without any firewall filtering."))),
 *		`Table (
 *		    `header (
 *			_("Source Network"),
 *			_("Destination Network"),
 *			_("Protocol"),
 *			_("Port"),
 *			_("Flags")
 *		    ),
 *		    // FIXME: fake items
 *		    [
 *			`item(`id("1"), "0/0", "147.42.95.2", "tcp", "http", ""),
 *			`item(`id("1"), "0/0", "147.42.95.2", "tcp", "smtp", "")
 *		    ]
 *		),
 *		`VSquash (
 *		    `HBox (
 *			`PushButton(`id("add_forward_network"), Label::AddButton()),
 *			`PushButton(`id("remove_forward_network"), Label::RemoveButton())
 *		    )
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }    
 */

/**
 * Only for Expert configuration
 *
 *    term AddForwardNetworkRule () {
 *	term dialog = `Frame (
 *	    _("Add New Forward Rule"),
 *	    `VBox (
 *		`VSpacing(1),
 *		`Left ( `Label(_("Allow Forwarding Matching This Rule:")) ),
 *		`HBox (
 *		    `HWeight ( 10,
 *			`ComboBox (`id("add_source_network"), `opt(`editable,`hstretch), _("Source Network"), [
 *			    `item( `id("0/0"), "0/0")
 *			])
 *		    ),
 *		    `HWeight ( 10,
 *			`ComboBox (`id("add_destination_network"), `opt(`editable,`hstretch), _("Destination Network"), [
 *			    `item( `id("0/0"), "0/0")
 *			])
 *		    )
 *		),
 *		`HBox (
 *		    `HWeight ( 10,
 *			// FIXME: another protocols?
 *			`ComboBox (`id("add_protocol"), `opt(`hstretch), _("Protocol"), [
 *			    `item( `id("tcp"), "tcp"),
 *			    `item( `id("tcp"), "udp"),
 *			    `item( `id("icmp"), "icmp"),
 *			    `item( `id("icmp"), "esp (IPsec)"),
 *			    `item( `id(""), ""),
 *			])
 *		    ),
 *		    `HWeight ( 10,
 *			`TextEntry (`id("add_port"), _("Port"))
 *		    )
 *		),
 *		`VSpacing(1),
 *		`HBox (
 *		    `PushButton(`id("ok"), Label::AddButton()),
 *		    `PushButton(`id("cancel"), Label::CancelButton())
 *		)
 *	    )
 *	);
 *
 *	return dialog;
 *    }
 */

/**
 * Only for Expert configuration
 *
 *    term RoutingInZones () {
 *	term dialog = `Frame (
 *	    _("Routing In Zones"),
 *	    `Left (
 *		// Allow Same-Class Routing
 *		`CheckBox (`id("same_class_routing"),
 *		    _("Allow Routing Between Interfaces in The Same Zone")
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

/**
 * Only for Expert configuration
 *
 *    term LoggingTuning () {
 *	term dialog = `Frame (
 *	    _("Logging Tuning"),
 *	    `VBox (
 *		`Left (
 *		    `HBox (
 *			// FIXME: fake frequency
 *			`HVSquash ( `TextEntry (`id("frequency"), _("Frequency"), "3")),
 *			`VBox ( `Label(""), `Label ("/") ),
 *			`ComboBox (`id("unit"),	 _("Unit"), [
 *			    `item(`id("second"), _("Second")),
 *			    `item(`id("minute"), _("Minute")),
 *			    `item(`id("hour"),   _("Hour")),
 *			    `item(`id("day"),    _("Day"))
 *			])
 *		    )
 *		),
 *		`Left (
 *		    `HBox (
 *			// FIXME: fake log file
 *			`TextEntry (`id("file_name"), Label::FileName(), "/var/log/SuSEfirewall2"),
 *			`VBox ( `Label(""), `PushButton (`id("browse_logfile"), Label::BrowseButton()) )
 *		    )
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

    term LoggingLevel () {
	list<term> logging_options = [
	    // TRANSLATORS: select box item
	    `item(`id("ALL"), _("Log All")),
	    // TRANSLATORS: select box item
	    `item(`id("CRIT"), _("Log Only Critical")),
	    // TRANSLATORS: select box item
	    `item(`id("NONE"), _("Do Not Log Any"))
	];

	term dialog = `VBox (
	    `Frame (
		_("Logging Level"),
		`VBox (
		    `Left (
			// TRANSLATORS: select box
			`ComboBox (`id("logging_ACCEPT"), _("&Logging Accepted Packets"), logging_options)
		    ),
		    `Left (
			// TRANSLATORS: select box
			`ComboBox (`id("logging_DROP"), _("L&ogging Not Accepted Packets"), logging_options)
		    )
		)
	    )
	);

	return dialog;
    }

/**
 * Only for Expert configuration
 *
 *    term BroadcastConfigurationExpert () {
 *	term dialog = `Frame (
 *	    _("Broadcast Configuration"),
 *	    `VBox (
 *		`RadioButtonGroup (`id("broadcast_configuration"),
 *		    `VBox (
 *			`Left ( `RadioButton (`id("drop_incoming"), _("Drop Incoming Broadcast")) ),
 *			`Left( `RadioButton (`id("allow_incoming"), _("Allow Incoming Broadcast")) )
 *		    )
 *		),
 *		`HBox (
 *		    `HWeight( 4,
 *			`Empty()
 *		    ),
 *		    `HWeight( 50,
 *			`MultiSelectionBox (`id("accept_broadcast_packets"),
 *			    _("Firewall Zones Allowing Broadcast Packets"),
 *			    GetZonesListedItems()
 *			)
 *		    )
 *		),
 *		`Left (
 *		    `CheckBox (`id("dropped_packets"), _("Log Not Accepted Broadcast Packets"))
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

    term BroadcastConfigurationSimple () {
	term dialog = `Frame (
	    _("Broadcast Configuration"),
	    `ReplacePoint (
		`id("replace_point_bcast"),
		`Empty()
	    )
	);
	
	return dialog;
    }

/**
 * Only for Expert configuration
 *
 *    term HierarchicalTokenBucket () {
 *	term dialog = `Frame (
 *	    _("Hierarchical Token Bucket"),
 *	    `VBox (
 *		`Left ( `Label (_("Adjust upstream limit for selected interface")) ),
 *		`HBox (
 *		    `HWeight ( 3,
 *			`ComboBox (`id("htb_interface"), _("Interface"), [
 *			    // FIXME: fake items
 *			    `item(`id(1), "RTL-8139 / eth-aa-bb-cc-dd-ee"),
 *			    `item(`id(1), "Askey 815C / modem0")
 *			])
 *		    ),
 *		    `HWeight ( 1,
 *			`TextEntry (`id("htb_unit"), `opt(`hsquash), _("kbit/sec."))
 *		    )
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

/**
 * Only for Exper configuration
 *
 *    term AdvancedSecuritySettings () {
 *	term dialog = `Frame (
 *	    _("Advanced Security Settings"),
 *	    `VBox (
 *		`Left( `ComboBox (`id("disallowed_packets"), _("Disallowed Packets"), [
 *		    `item(`id("drop"), _("Drop")),
 *		    `item(`id("drop"), _("Reject"))
 *		])),
 *		`Left ( `CheckBox (`id("block_new_connections"), _("Block New Connections from This Host")) ),
 *		`Left ( `CheckBox (`id("allow_ping"), _("Allow to Ping This Host")) ),
 *		`Left ( `CheckBox (`id("allow_traceroute"), _("Allow Traceroute through This Host")) )
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

    term IPsecSupport () {
	term dialog = `Frame (
	    _("IPsec Support"),
	    `HBox (
		// TRANSLATORS: check box
		`Left ( `CheckBox (`id("ispsec_support"), _("&IPsec Support Enabled")) ),
		`HStretch (),
		// TRANSLATORS: push button
		`Right ( `PushButton(`id("ipsec_details"), _("&Details")) )
	    )
	);

	return dialog;
    }

    term IPsecTrustAsZone () {
	list<term> trust_zones = add(GetZonesListedItems(), `item(`id("no"),
	    // TRANSLATORS: select box item, trust IPsec packet the same as the origin of the packet
	    _("Same Zone as Original Source Network")));

	term dialog = `Frame (
	    // TRANSLATORS: frame label
	    _("IPsec Zone"),
	    `VBox (
		`VSpacing(1),
		`Left (
		    `ComboBox (`id("trust_ipsec_as"),
			// TRANSLATORS: select box
			_("&Trust IPsec As"),
			trust_zones
		    )
		),
		`VSpacing(1),
		`HBox (
		    `PushButton(`id("ok"), Label::OKButton()),
		    `PushButton(`id("cancel"), Label::CancelButton())
		)
	    )
	);

	return dialog;
    }

/**
 * Only for Expert configuration
 *
 *    term IPv6Support () {
 *	term dialog = `Frame (
 *	    _("IPv6 Support"),
 *	    `VBox (
 *		`Label ("H I C   S U N T   L E O N E S")
 *	    )
 *	);
 *
 *	return dialog;
 *    }
 */

/**
 * Only for Expert configuration
 *
 *    term CustomFirewallRules () {
 *	term dialog = `Frame (
 *	    _("Custom Allowed Rules"),
 *	    `VBox (
 *		`Table (
 *		    `header (
 *			_("Source Network"),
 *			_("Protocol"),
 *			_("Port")
 *		    ),
 *		    // FIXME: fake items
 *		    [
 *			`item(`id("1"), "189.12.35.0/24", "tcp", "ssh"),
 *			`item(`id("2"), "147.25.136.9", "tcp", "ssh"),
 *			`item(`id("3"), "145.8.0.0/20", "tcp", "domain"),
 *			`item(`id("3"), "145.8.0.0/20", "udp", "domain")
 *		    ]
 *		),
 *		`VSquash (
 *		    `HBox (
 *			`PushButton(`id("add_custom_rule"), Label::AddButton()),
 *			`PushButton(`id("remove_custom_rule"), Label::RemoveButton())
 *		    )
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

/**
 * Only for Expert configuration
 *
 *    term AddCustomFirewallRule () {
 *	term dialog = `Frame (
 *	    _("Add New Allowing Rule"),
 *	    `VBox (
 *		`HBox (
 *		    `TextEntry(`id("add_source_network"), _("Source Network")),
 *		    `HSquash (
 *			`ComboBox (`id("add_protocol"), _("Protocol"), [
 *			    `item( `id("tcp"),  "tcp"),
 *			    `item( `id("udp"),  "udp"),
 *			    `item( `id("icmp"), "icmp"),
 *			])
 *		    ),
 *		    `HSquash (
 *			`TextEntry (`id("add_destination_port"), _("Port"))
 *		    )
 *		),
 *		`VSpacing(1),
 *		`HBox (
 *		    `PushButton(`id("ok"), Label::AddButton()),
 *		    `PushButton(`id("cancel"), Label::CancelButton())
 *		)
 *	    )
 *	);
 *	
 *	return dialog;
 *    }
 */

    // local helper function for Summary
    string HTMLWrong (string emphasize_string) {
	return sformat ("<font color='#993300'>%1</font>", emphasize_string);
    }

    term BoxSummary () {
	term dialog = `HBox (
	    // TRANSLATORS: informative label in dialog
	    `RichText(`id("box_summary_richtext"), _("Creating summary.  Please wait..."))
	);

	return dialog;
    }

/**
 * Only for Expert configuration
 *
 *    term ProposeConfiguration () {
 *	term dialog = `Frame (
 *	    _("Simple Configuration Proposal"),
 *	    `Left ( `PushButton(`id("propose_box_configuration"), _("Propose Configuration")) )
 *	);
 *	
 *	return dialog;
 *    }
 */

}