#!/bin/bash

# Kiosk Wizard - A wizard for settings and features in Porteus Kiosk
# Copyright (C) 2014-2020 Jay Flood (aka brokenman)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# Project Page: http://porteus-kiosk.org
# Wizard functionality extended by Tomasz Jokiel <http://porteus-kiosk.org>

## ====================================================================
## variables
## ====================================================================

## These will need changing
## Default wallpaper link
WALLPAPER=http://porteus-kiosk.org/public/wallpapers/sample.jpg
SCRIPT="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
SPATH=${SCRIPT%/*}
BUTNEXT=/usr/share/icons/oxygen/16x16/actions/go-next.png
BUTPREV=/usr/share/icons/oxygen/16x16/actions/go-previous.png

## Backup network settings
if [ -e /tmp/net-conf ]; then
    cp -a /tmp/net-conf /tmp/config
else
    cp -a /tmp/config /tmp/net-conf
fi

## Create temporary working directory
rm -rf /tmp/kwiz.* /tmp/wizard-lock 2>/dev/null
export TMPDIR=/tmp/kwiz.$$
mkdir -p $TMPDIR
if [ $? -ne 0 ]; then
	TMPFAIL=`gettext "Failed to create temporary directory. Fatal."`
	xmessage "$TMPFAIL" || exit 1
	exit
fi

## We need to export these variables so they are available to gtkdialog
export CONF=/tmp/config
export ICONS=/usr/share/pixmaps
export PCID=`grep ^ID: /etc/version | cut -d" " -f2`

## ====================================================================
## Functions
## ====================================================================
cleanup(){
rm -rf $TMPDIR
exit
}

## ====================================================================
## Main dialog
## ====================================================================

## Trap exits
trap 'cleanup' SIGHUP SIGINT SIGTERM

################# Setup required files
export IMAGEONE="/usr/share/icons/oxygen/22x22/actions/gtk-no.png"
export IMAGETWO="/usr/share/icons/oxygen/22x22/actions/gtk-ok.png"
export IMGPASS=$TMPDIR/img.png
cp -L $IMAGEONE $TMPDIR/img.png

## These monitor files are being watched by radiobuttons
## We use these so other widgets can interact with radiobuttons
## by echoing into the monitor file
echo true > $TMPDIR/icmpDisable.mon
echo true > $TMPDIR/addressbarEn.mon
echo true > $TMPDIR/autonavDis.mon
echo true > $TMPDIR/KbdPri.mon
echo true > $TMPDIR/KbdSec.mon
echo true > $TMPDIR/Num.mon
echo true > $TMPDIR/Mouse.mon
echo true > $TMPDIR/RMC.mon
test -e /mnt/ISO/boot/isolinux/efi/efiboot.img && { echo false > $TMPDIR/uefiDis.mon; echo true > $TMPDIR/uefiEn.mon; echo uefi.zip > $TMPDIR/uefi.add; } || { echo true > $TMPDIR/uefiDis.mon; echo false > $TMPDIR/uefiEn.mon; }
echo true > $TMPDIR/disablessh.mon
echo true > $TMPDIR/disablevnc.mon
echo false > $TMPDIR/enablevnc.mon
echo false > $TMPDIR/enablessh.mon

## Set some text files that should exist before the main
## gtkdialog is rendered
echo -en '#!/bin/sh\n\nfirefox `grep . /tmp/kwiz.*/homepage`' >/tmp/hpage
chmod +x /tmp/hpage
echo "domain.com:443" > $TMPDIR/server.txt
echo "5000" > $TMPDIR/client.txt
echo "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)" > $TMPDIR/agent.txt
echo "https://john:secret@domain.com/kiosks/group2.txt" > $TMPDIR/net-config.txt
echo porteus-kiosk > $TMPDIR/hostname.txt
echo "some password" > $TMPDIR/sessionp.txt
echo "dunstify -u low 'command test'" > $TMPDIR/rcommand.txt
echo "http://domain.com/files/chrome-policies.txt" > $TMPDIR/preferences.txt
echo "$WALLPAPER" > $TMPDIR/wallpaper.txt
#lsblk -o NAME,TYPE,MODEL,SIZE | egrep -v 'NAME|loop|part|rom' | tr -s ' ' | sed -e 's/ /_/g' -e 's/_/|/1' -e 's/_/|/1' -e 's/\(.*\)_/\1|/' > $TMPDIR/block.txt

## Default minutes in case user chooses suspend to RAM (mem)
echo 10 > $TMPDIR/idle-minutes.txt

echo 22 > $TMPDIR/sshport.txt

## echo 0 (first main page) into the page monitor file
echo 0 > $TMPDIR/.knetPage

## Setup browser:
if [ -e /mnt/ISO/xzm/002-chrome.xzm ]; then
    mkdir -p /dev/shm && chmod 1777 /dev/shm
    ln -sf /usr/bin/chrome /usr/bin/firefox
    ln -sf /usr/share/pixmaps/chrome-48.png /usr/share/pixmaps/browser-48.png
    FFWRN="*Firefox only*"
    sed -i 's/"AllowFileSelectionDialogs": false,/"AllowFileSelectionDialogs": true,/g' /etc/opt/chrome/policies/managed/chrome.json 2>/dev/null
else
    ln -sf /usr/share/pixmaps/firefox-48.png /usr/share/pixmaps/browser-48.png
fi

## Preserve configuration files - required for testing
if [ -e /tmp/log/md5 ]; then
    cp -a /etc/hosts /etc/hosts-org
    profile=/home/guest/.mozilla/firefox/c3pp43bg.default
    cp -a /home/guest /opt/porteus-scripts
    cp -a $profile/localstore.rdf /opt/porteus-scripts
    cp -a $profile/prefs.js /opt/porteus-scripts
    cp -a $profile/chrome/userChrome.css /opt/porteus-scripts
fi

# Debug log:
echo -e 'Please copy (Ctrl+a -> Ctrl+c) and send this report to support@porteus-kiosk.org in case of hardware/software/configuration issues.' > /var/log/debug
sed -i -e 's_ps _pss 2>/dev/null_g' -e 's_top -b -n1_topp 2>/dev/null_g' /opt/porteus-scripts/debug

# Chrome quirk:
echo false > $TMPDIR/chrome.mon
(
sleep 1
test -e /mnt/ISO/xzm/002-chrome.xzm && echo true > $TMPDIR/chrome.mon
) &

# Primary kbd layout quirk:
echo false > $TMPDIR/pkbdl.mon
(
sleep 1
grep -q ^primary_keyboard_layout /tmp/config 2>/dev/null && echo true > $TMPDIR/pkbdl.mon
) &

# Launch wizard:
export WIZARD_MAIN='
<window title="Kiosk Wizard" icon-name="porteus-kiosk" resizable="false" width-request="780" height-request="580" decorated="true">
<vbox>

## <------- FIRST PAGE CONFIGURATIONS
<notebook page="0" show-tabs="false" show-border="false" labels="configurations|report|autoupdates|device"  height-request="540">

################## PAGE 0 INITIAL CHOICE
<vbox margin="10">
	<text use-markup="true" yalign="1"><label>"<span weight='"'bold'"' size='"'x-large'"'>Porteus Kiosk</span>"</label></text>
	<text><label>""</label></text>
	<hseparator></hseparator>
	<text xalign="0" width-request="760" wrap="true"><label>Select an action below. You may start Kiosk Wizard to create new kiosk configuration, add kiosk to existing remote management configuration or load previously created kiosk config from the network/removable device.</label></text>
	<text xalign="0" width-request="760" wrap="true"><label>Start the Kiosk Wizard if you are unsure.</label></text>
	<text><label>""</label></text>
	<text><label>""</label></text>
	<hbox>
                <button image-position="2" tooltip-text="Launch Kiosk Wizard with all options">
                        <width>160</width>
                        <height>150</height>
                        <input file>'$ICONS'/wizard-160.png</input>
                        <label>Launch the Kiosk Wizard to create new configuration</label>
                        <action>echo 1 > '$TMPDIR'/.knetPage</action>
                        <action function="refresh">nPage</action>
                        <action function="show">butBack</action>
                        <action function="show">butBrowser</action>
                        <action function="show">butNextWizard</action>
                </button>
                <button image-position="2" tooltip-text="Add kiosk to remote management configuration">
                        <width>160</width>
                        <height>150</height>
                        <input file>'$ICONS'/net-config-160.png</input>
                        <label>Point kiosk to remote management configuration</label>
                        <action>get_input "Kiosk config URL" "Enter the link to previously generated kiosk config to make it loading during every system startup. Kiosk will reburn itself automatically when remote configuration is changed. Access to the config can be protected with SSL and username/password. In case of doing manual edits to the config under Windows plese make sure its saved with ANSI or UTF-8 encoding rather than UTF-16 (Unicode) which is not supported in kiosk. Please verify that URL is typed in correctly by clicking on the '"'Test config'"' button." 760 '$TMPDIR'/net-config.tmp kiosk_config '$TMPDIR'/net-config.txt</action>
                        <action>process_settings</action>
                        <action>echo 2 > '$TMPDIR'/.knetPage</action>
                        <action function="refresh">nPage</action>
                        <action function="refresh">txtReport</action>
                        <action function="show">butBack</action>
                        <action function="show">butBrowser</action>
                        <action function="show">butLoadConf</action>
                        <action function="show">butSaveConf</action>
                        <action function="show">butNextReport</action>
                </button>
                <text width-request="30"><label>""</label></text>
        </hbox>
        <hbox>
                <button image-position="2" tooltip-text="Load previously saved kiosk config from the URL">
                        <width>160</width>
                        <height>150</height>
                        <input file>'$ICONS'/download-160.png</input>
                        <label>Load kiosk configuration from the network location   </label>
                        <action>get_input "Kiosk config URL" "Enter the link to previously generated kiosk config to load it from the network right now. Please verify that URL is typed in correctly by clicking on the '"'Test config'"' button." 760 '$TMPDIR'/net-config kiosk_config '$TMPDIR'/net-config.txt load_config</action>
                        <action>echo 2 > '$TMPDIR'/.knetPage</action>
                        <action function="refresh">nPage</action>
                        <action function="refresh">txtReport</action>
                        <action function="show">butBack</action>
                        <action function="show">butBrowser</action>
                        <action function="show">butLoadConf</action>
                        <action function="show">butSaveConf</action>
                        <action function="show">butNextReport</action>
                </button>
                <button image-position="2" tooltip-text="Load previously saved kiosk config from removable device">
                        <width>160</width>
                        <height>150</height>
                        <input file>'$ICONS'/removable-media-160.png</input>
                        <label>Load kiosk configuration from removable device  </label>
                        <action>gtk_lconfig</action>
                        <action>echo 2 > '$TMPDIR'/.knetPage</action>
                        <action function="refresh">nPage</action>
                        <action function="refresh">txtReport</action>
                        <action function="show">butBack</action>
                        <action function="show">butBrowser</action>
                        <action function="show">butLoadConf</action>
                        <action function="show">butSaveConf</action>
                        <action function="show">butNextReport</action>
                </button>
                <text width-request="30"><label>""</label></text>
        </hbox>
</vbox>

################## PAGE 1 WIZARD
<vbox scrollable="true" margin="8" hscrollbar-policy="2">
## <------- PAGE TITLE
	<text use-markup="true" yalign="1"><label>"<span weight='"'bold'"' size='"'x-large'"'>Wizard</span>"</label></text>
	<hseparator></hseparator>
	<text xalign="0" use-markup="true"><label>"<span weight='"'bold'"' color='"'red'"'>NOTE:</span> please scroll down for more options."</label></text>
	<text><label>""</label></text>
	
	
## <------- Chrome Tweaks
<vbox>
	<radiobutton visible="false" file-monitor="true" auto-refresh="true">
	</radiobutton>
	<radiobutton visible="false" file-monitor="true" auto-refresh="true">
		<input file>'$TMPDIR'/chrome.mon</input>
		<action function="disable">rbutAutonavEn</action>
		<action function="disable">rbutAutonavDis</action>
		<action function="disable">rbutAutonavTest</action>
		<action function="disable">pixAutonav</action>
		<action function="disable">txtAutonav</action>
		<action function="disable">rbutAddressEn</action>
		<action function="disable">rbutAddressDis</action>
		<action function="disable">rbutAddressTest</action>
		<action function="disable">pixAddressbar</action>
		<action function="disable">txtAddressbar</action>
		<action function="disable">pixFlash</action>
		<action function="disable">txtFlash</action>
		<action function="disable">rbutFlashEn</action>
		<action function="disable">rbutFlashDis</action>
		<action function="disable">pixJava</action>
		<action function="disable">txtJava</action>
		<action function="disable">rbutJavaEn</action>
		<action function="disable">rbutJavaDis</action>
		<action function="disable">pixCitrix</action>
		<action function="disable">txtCitrix</action>
		<action function="disable">rbutCitrixEn</action>
		<action function="disable">rbutCitrixDis</action>
	</radiobutton>
</vbox>

######################## CENTRAL MANAGEMENT CATEGORY #############################
<expander expanded="true">
<vbox>

######### REMOTE CONFIG
	<frame Remote kiosk management>
		<hbox>
			<pixmap><input file>'$ICONS'/net-config-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Load config from the network">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Kiosk config URL" "Enter the link to previously generated kiosk config to make it loading during every system startup. Kiosk will reburn itself automatically when remote configuration changes. Access to the config can be protected with SSL and username/password. In case of doing manual edits to the config under Windows plese make sure its saved with ANSI or UTF-8 encoding rather than UTF-16 (Unicode) which is not supported in kiosk. Please verify that URL is typed in correctly by clicking on the '"'Test config'"' button." 760 '$TMPDIR'/net-config.tmp kiosk_config '$TMPDIR'/net-config.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Load config from booting media">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm -f '$TMPDIR'/net-config.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" selectable="true">
				<label>Load kiosk configuration from the network during every system startup. The kiosk will reburn itself automatically when remote configuration is changed. This option allows to centrally manage multiple kiosk PCs from one location. Please read following document to find additional information about this powerful feature: http://porteus-kiosk.org/remote-management.html</label>
			</text>
		</hbox>
	</frame>
		
######### SERVER
	<frame Porteus Kiosk Server>
		<hbox>
			<pixmap><input file>'$ICONS'/server-64.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Associate the kiosk client with the server">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Porteus Kiosk Server" "Provide domain/IP address and port on which the the server is accessible. Following parameter value format must be preserved: '"'domain:port'"' or '"'ip:port'"'." 760 '$TMPDIR'/server.tmp kiosk_server '$TMPDIR'/server.txt</action>
					<action>if true get_input "Client ID" "Provide client ID (port which will be opened on the server for communication). ID number must be included in the following range: 1024 - 65535." 760 '$TMPDIR'/client.tmp client_id '$TMPDIR'/client.txt</action>
					<action>if true echo "true" > '$TMPDIR'/enablessh.mon</action>
					<action>if true echo "true" > '$TMPDIR'/enablevnc.mon</action>
					<action function="disable">rbutSSHEn</action>
					<action function="disable">rbutVNCEn</action>
					<action function="disable">rbutSSHDis</action>
					<action function="disable">rbutVNCDis</action>
				</radiobutton>
				<radiobutton tooltip-text="Do no associate the kiosk client with the server">
					<label>Disable</label>
					<default>true</default>
					<action>if true echo "true" > '$TMPDIR'/disablessh.mon</action>
					<action>if true echo "true" > '$TMPDIR'/disablevnc.mon</action>
					<action>if true rm -f '$TMPDIR'/server.tmp '$TMPDIR'/client.tmp</action>
					<action function="enable">rbutSSHEn</action>
					<action function="enable">rbutVNCEn</action>
					<action function="enable">rbutSSHDis</action>
					<action function="enable">rbutVNCDis</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" selectable="true">
				<label>Associate kiosk client with Porteus Kiosk Server. If you activate this function then SSH and VNC components will be forcibly enabled to allow communication between the client and the server. Please read following document to find additional information about requirements and supported features: http://porteus-kiosk.org/server.html</label>
			</text>
		</hbox>
	</frame>
		
		
</vbox>
<variable>xNetwork</variable>
<label>CENTRAL MANAGEMENT</label>
</expander>
<text><label>""</label></text>
<text><label>""</label></text>



######################## NETWORK CATEGORY #############################
<expander expanded="true">
<vbox>
		
######### FIREWALL SETTINGS
	<frame Firewall>
		<hbox>
			<pixmap><input file>'$ICONS'/firewall-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Allow outgoing traffic only on ports 80, 443 and 53">
					<label>Enable</label>
					<variable>rbutFirewallEn</variable>
					<default>true</default>
					<action>if true rm $TMPDIR/firewall.tmp 2>/dev/null</action>
					<action function="enable">rbutIcmpDis</action>
					<action function="enable">rbutIcmpEn</action>
					<action function="enable">pixIcmp</action>
					<action function="enable">txtIcmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the firewall to get total unrestricted access to the network">
					<label>Disable</label>
					<variable>rbutFirewallDis</variable>
					<default>false</default>
					<action>if true echo disable_firewall=yes > $TMPDIR/firewall.tmp</action>
					<action>if true echo true > $TMPDIR/icmpDisable.mon</action>
					<action>if true rm '$TMPDIR'/icmp.tmp 2>/dev/nulll</action>
					<action function="disable">rbutIcmpDis</action>
					<action function="disable">rbutIcmpEn</action>
					<action function="disable">pixIcmp</action>
					<action function="disable">txtIcmp</action>
				</radiobutton>
			</vbox>
## <------- This text is blank padding to put space after radiobuttons
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>"Firewall controls network traffic for kiosk. Default rules are set to reject all incomming/forwarded connections and allow outgoing traffic. Disable only when you need to add a non standard service to kiosk (e.g. http/mysql servers) or allow incoming RTP/UDP network stream."</label>
			</text>
		</hbox>
	</frame>

######### ICMP PROTOCOL
	<frame ICMP protocol>
		<hbox>
			<pixmap><input file>'$ICONS'/icmp-48.png</input><variable>pixIcmp</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Allow incoming ICMP. This is useful when you want to check if the kiosk is up and running from another computer using the ping utility">
					<label>Enable</label>
					<variable>rbutIcmpEn</variable>
					<default>false</default>
					<action>if true echo allow_icmp_protocol=yes > $TMPDIR/icmp.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the ability to ping the kiosk from other computers" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<variable>rbutIcmpDis</variable>
					<default>true</default>
					<input file>'$TMPDIR'/icmpDisable.mon</input>
					<action>if true rm $TMPDIR/icmp.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
## <------- This text is blank padding to put space after radiobuttons
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<variable>txtIcmp</variable>
				<label>"Answer incoming ICMP queries. This is useful when you want to check if the kiosk is up and running from another computer using the ping utility."</label>
			</text>
		</hbox>
	</frame>
		
######### FILTER URL AND IP ADDRESSES
	<frame URL filter>
		<hbox>
			<pixmap><input file>'$ICONS'/filter-48.png</input><variable>pixFilter</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable whitelisting">
					<label>Whitelist</label>
					<variable>rbutFilterWh</variable>
					<default>false</default>
					<action>if true rm -f '$TMPDIR'/blacklist.tmp</action>
					<action>if true get_whitelist</action>
				</radiobutton>
				<radiobutton tooltip-text="Enable blacklisting">
					<label>Blacklist</label>
					<variable>rbutFilterBl</variable>
					<default>false</default>
					<action>if true rm -f '$TMPDIR'/whitelist.tmp</action>
					<action>if true get_blacklist</action>
				</radiobutton>
				<radiobutton  tooltip-text="Do not filter anything">
					<label>Disable</label>
					<variable>rbutFilterDis</variable>
					<default>true</default>
					<action>if true rm '$TMPDIR'/whitelist.tmp '$TMPDIR'/blacklist.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
## <------- This text is blank padding to put space after radiobuttons
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
			<variable>txtFilter</variable>
			<label>"Block/Allow an access to specified URL(s), IP(s) or IP ranges. You can block everything by default and make exception only for certain URLs (whitelist function). You can also allow everything by default but block an access to certain domains or IPs (blacklist function)."</label>
			</text>
		</hbox>
	</frame>
		
######### WAKE ON LAN
	<frame Wake On LAN>
		<hbox>
			<pixmap><input file>'$ICONS'/wol-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable WOL function">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo wake_on_lan=yes > $TMPDIR/wol.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable WOL function" file-monitor="true">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm $TMPDIR/wol.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
## <------- This text is blank padding to put space after radiobuttons
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" selectable="true">
			<label>"Wake up the kiosk PCs remotely by sending a magic packet to them. Please follow this guide to find about requirements:  http://porteus-kiosk.org/wol.html"</label>
			</text>
		</hbox>
	</frame>
		
######### HOSTNAME ALIASES
	<frame Hostname aliases>
		<hbox>
			<pixmap><input file>'$ICONS'/static-hostnames-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Add hostname aliases">
					<label>Enable</label>
					<variable>rbutHostnamesEn</variable>
					<action>if true gtk_entry_box "Hostname aliases" "Enter your fixed aliases below in following format: '"'IP domain'"' or '"'IP domain hostname'"'. They will be added to /etc/hosts file in the system. Use one entry per line." 760 390 "10.0.0.15 first.domain.local first" '$TMPDIR'/hostname-aliases hostnames</action>
					<default>false</default>
				</radiobutton>
				<radiobutton tooltip-text="Do not add hostname aliases">
					<label>Disable</label>
					<variable>rbutHostnamesDis</variable>
					<action>if true rm '$TMPDIR'/hostname-aliases.tmp</action>
					<default>true</default>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Add fixed aliases-to-address mappings for local host. Enable this option if kiosk is having troubles with resolving non fully qualified domain names, e.g: http://server.local</label>
			</text>
		</hbox>
	</frame>
	
######### CUSTOM HOSTNAME
	<frame Kiosk hostname>
		<hbox>
			<pixmap><input file>'$ICONS'/hostname-64.png</input><width>48</width></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set custom hostname">
					<label>Enable</label>
					<variable>rbutHostnameEn</variable>
					<default>false</default>
					<action>if true get_input "Custom hostname" "Enter your custom hostname in the box and press enter or click OK button." 760 '$TMPDIR'/hostname.tmp hostname '$TMPDIR'/hostname.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Use porteus-kiosk as hostname">
					<label>Disable</label>
					<variable>rbutHostnameDis</variable>
					<default>true</default>
					<action>if true rm $TMPDIR/hostname.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>"Set a custom hostname for the kiosk. Whitespaces in the name are not supported. This feature is useful if you want to indentify the kiosk in logs or through the shell prompt. Its safe to keep default hostname in other cases."</label>
			</text>
		</hbox>
	</frame>
		
		
</vbox>
<variable>xNetwork</variable>
<label>NETWORK SETTINGS</label>
</expander>
<text><label>""</label></text>
<text><label>""</label></text>



######################## BROWSER CATEGORY #############################
<expander expanded="true">
<vbox>
######### HOMEPAGE
	<frame Homepage>
		<hbox>
			<pixmap><input file>'$ICONS'/homepage-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set a custom homepage or multiple startup tabs in the browser">
					<label>Enable</label>
					<variable>rbutHomepageEn</variable>
					<action>if true gtk_entry_box "Custom home page" "Enter your custom home page below. SSL addresses (https://) and webpages hosted on non standard ports (http://domain.com:8888) are supported. Local pages from the offline content (e.g.: file:///var/www/localhost/index.html) are supported only when you enable file protocol in the wizard options. Enter one URL per line to start browser with multiple tabs opened each time it starts." 760 220 http://porteus-kiosk.org $TMPDIR/homepage homepage</action>
					<default>false</default>
				</radiobutton>
				<radiobutton tooltip-text="Use http://porteus-kiosk.org as default homepage">
					<label>Disable</label>
					<variable>rbutHomepageDis</variable>
					<action>if true rm -f '$TMPDIR'/homepage.tmp '$TMPDIR'/homepage-append.tmp '$TMPDIR'/homepage-check.tmp</action>
					<default>true</default>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enter a custom homepage for the browser. SSL protocol (https) is supported as well as multiple startup tabs. The default homepage is set to: http://porteus-kiosk.org</label>
			</text>
		</hbox>
	</frame>
	
######### PRIVATE MODE
	<frame Private Mode>
		<hbox>
			<pixmap><input file>'$ICONS'/private-mode-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Keep private mode enabled by default">
					<label>Enable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/private-mode.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable private mode in the browser">
					<label>Disable</label>
					<default>false</default>
					<action>if true echo "disable_private_mode=yes" > '$TMPDIR'/private-mode.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Disable private mode to let the browser remember form/search history, cookies and caches during the session. Signons (passwords) are not remembered. A browser restart still returns to factory defaults. Use with caution as caches are saved in RAM and may slow down the kiosk when the PC has low memory.</label>
			</text>
		</hbox>
	</frame>
	
######### PERSISTENCE
	<frame Persistence>
		<hbox>
			<pixmap><input file>'$ICONS'/persistence-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Persist browser data when application is restarted">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "persistence=session" > '$TMPDIR'/persistence.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Clear browser data when application is restarted">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/persistence.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable this option to keep the data persistent even if browser is restarted. User data are available for the whole session until system reboots or shuts down. Useful mostly with private mode disabled.</label>
			</text>
		</hbox>
	</frame>
	
######### RESTART BROWSER IDLE
	<frame Browser idle time>
		<hbox>
			<pixmap><input file>'$ICONS'/idle-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Restart the browser after specified time of inactivity">
					<label>Enable</label>
					<variable>rbutFfoxidleEn</variable>
					<default>false</default>
					<action>if true echo browser_idle=5 > '$TMPDIR/idle.tmp'</action>
					<action>if true get_input_minutes "Browser idle time" "Set the time (in minutes) of inactivity after which the browser will be restarted. Inactivity is considered as no mouse/keyboard/touch input event. If browser is restarted and there is no user activity detected then it wont be restarted again until the activity happens. This is to save on CPU cycles and power." 740 $TMPDIR/idle.tmp browser_idle</action>
				</radiobutton>
				<radiobutton tooltip-text="Never restart browser when inactive">
					<label>Disable</label>
					<variable>rbutFfoxidleDis</variable>
					<default>true</default>
					<action>if true rm '$TMPDIR'/idle.tmp '$TMPDIR'/idle-forced.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Restart the browser after specified time of inactivity. This enhances user security by resetting Firefox/Chrome when a user leaves the kiosk without closing his web page.</label>
			</text>
		</hbox>
	</frame>
	
######### BOOKMARKS
	<frame Managed bookmarks>
		<hbox>
			<pixmap><input file>'$ICONS'/bookmarks-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable bookmarks toolbar">
					<label>Enable</label>
					<variable>rbutBookmarksEn</variable>
					<action>if true gtk_entry_box "Managed bookmarks" "Enter your bookmarks below preserving URL format. Use one entry per line." 760 400 http://porteus-kiosk.org $TMPDIR/bookmarks bookmarks</action>
					<default>false</default>
				</radiobutton>
				<radiobutton tooltip-text="Do not use bookmarks">
					<label>Disable</label>
					<variable>rbutBookmarksDis</variable>
					<action>if true rm '$TMPDIR'/bookmarks.tmp</action>
					<default>true</default>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable bookmarks toolbar in the browser UI and display provided webpages in it. Generic favicon will be used until user clicks on the bookmark.</label>
			</text>
		</hbox>
	</frame>
	
######### CERTIFICATES
	<frame SSL certificates>
		<hbox>
			<pixmap><input file>'$ICONS'/certificates-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Import additional SSL certificates">
					<label>Enable</label>
					<variable>rbutCertificatesEn</variable>
					<action>if true gtk_entry_box "Import SSL certificates" "Enter URL or addresses from which certificates will be imported during system boot. Use following format: URL, url:port or ip:port. Example: http://domain.com/files/certificate1.crt http://domain.com/files/certificate2.pem kernel.org:443 localdomain:1010" 760 400 http://domain.com/files/certificate1.crt $TMPDIR/certificates certificates</action>
					<default>false</default>
				</radiobutton>
				<radiobutton tooltip-text="Do not import additional certificates">
					<label>Disable</label>
					<variable>rbutCertificatesDis</variable>
					<action>if true rm '$TMPDIR'/certificates.tmp</action>
					<default>true</default>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Import additional SSL certificates from a file (certificate.crt, certificate.pem) or directly from the domain to the browser certificates database during every system boot. Self signed certificates are not supported and must be added to the ISO through manual customization. Please contact support@porteus-kiosk.org when in doubt.</label>
			</text>
		</hbox>
	</frame>
	
######### POPUP WINDOWS
	<frame Popup windows>
		<hbox>
			<pixmap><input file>'$ICONS'/popup-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Allow popup windows in the browser">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "allow_popup_windows=yes" > '$TMPDIR'/popup-windows.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Keep popup windows disabled">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/popup-windows.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable this option to allow popup windows which are opened as a new tabs in Firefox and directly on the screen in Chrome.</label>
			</text>
		</hbox>
	</frame>
	
######### ZOOM CONTROLS
	<frame Zoom controls>
		<hbox>
			<pixmap><input file>'$ICONS'/zoom-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Allow for controlling the zoom level in the browser">
					<label>Enable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/zoom.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable zoom controls in the browser">
					<label>Disable</label>
					<default>false</default>
					<action>if true echo "disable_zoom_controls=yes" > '$TMPDIR'/zoom.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Disable this option to remove zoom controls from the Firefox UI, deactivate '"'pinch to zoom'"' touch gesture in Chrome and block Ctrl++/Ctrl+- keyboard shortcuts. This is to prevent the users from changing zoom level in the browser. If Chrome has navigation bar enabled then its still possible to zoom in and out through the browser menu.</label>
			</text>
		</hbox>
	</frame>
	
######### AGENT
	<frame User agent>
		<hbox>
			<pixmap><input file>'$ICONS'/browser-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set a custom user agent for the browser">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Custom user agent" "Set a custom user agent below. WARNING: Many web pages rely on the user agent to know how to display the webpage (example: phone, tablet) and an incorrect string may break the display of these pages for the kiosk." 760 '$TMPDIR'/agent.tmp browser_user_agent '$TMPDIR'/agent.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Use the default user agent for the browser">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/agent.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Modify user agent for the browser. This may be helpful in forcing layouts on some websites which are set to support certain browsers only (eg. Internet Explorer 6) or identifying the Porteus Kiosk sessions with an unique string in your web server logs. Use with caution as many web pages rely on the user agent to know how to display the webpage (e.g. phone, tablet) and an incorrect string may break the display of these pages for the kiosk.</label>
			</text>
		</hbox>
	</frame>
	
######### FILE PROTOCOL
	<frame File browsing>
		<hbox>
			<pixmap><input file>'$ICONS'/fileprotocol-48.png</input><variable>pixFile</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable the ability to browse the file system using browser">
					<label>Enable</label>
					<variable>rbutFileEn</variable>
					<default>false</default>
					<action>if true echo "enable_file_protocol=yes" > '$TMPDIR'/fileprotocol.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the ability to browse the file system using browser">
					<label>Disable</label>
					<variable>rbutFileDis</variable>
					<default>true</default>
					<action>if true rm '$TMPDIR'/fileprotocol.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<variable>txtFile</variable>
				<label>This option enables the ability to browse the file system using the file:// address in the browser. Activate if you want to display an offline content in kiosk.</label>
			</text>
		</hbox>
	</frame>
	
######### BROWSER PREFERENCES
	<frame Browser preferences>
		<hbox>
			<pixmap><input file>'$ICONS'/preferences-48.png</input><width>48</width></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set custom browser preferences">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Browser settings" "Enter URL to a text file containing Firefox preferences or Chrome policies. Its content will be added to default browser settings during every kiosk boot. In case of doing manual edits to the file under Windows plese make sure its saved with ANSI or UTF-8 encoding rather than UTF-16 (Unicode) which is not supported in kiosk." 760 '$TMPDIR'/preferences.tmp browser_preferences '$TMPDIR'/preferences.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Use default browser preferences">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm $TMPDIR/preferences.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" selectable="true" use-markup="true">
				<label>"Add new or override default browser settings through an online text file containing browser preferences. For Firefox you may use all preferences listed in '"'about:config'"', Chrome policies can be find here: http://www.chromium.org/administrators/policy-list-3. WARNING: use with caution as browser upgrade could make certain preferences obsolete. Sample files containing browser preferences can be find here: http://porteus-kiosk.org/public/files."</label>
			</text>
		</hbox>
	</frame>
		
######### NAVIGATION BAR
	<frame Navigation bar>
		<hbox>
			<pixmap><input file>'$ICONS'/navigationbar-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Make the navigation bar visible in the browser">
					<label>Enable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/navbar.tmp 2>/dev/null</action>
					<action function="enable">rbutAutonavEn</action>
					<action function="enable">rbutAutonavDis</action>
					<action function="enable">rbutAutonavTest</action>
					<action function="enable">pixAutonav</action>
					<action function="enable">txtAutonav</action>
					<action function="enable">rbutAddressEn</action>
					<action function="enable">rbutAddressDis</action>
					<action function="enable">rbutAddressTest</action>
					<action function="enable">pixAddressbar</action>
					<action function="enable">txtAddressbar</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the navigation bar" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>false</default>
					<action>if true echo "disable_navigation_bar=yes" > '$TMPDIR'/navbar.tmp</action>
					<action>if true echo "true" > '$TMPDIR'/addressbarEn.mon</action>
					<action>if true echo "true" > '$TMPDIR'/autonavDis.mon</action>
					<action>if true rm '$TMPDIR'/addressbar.tmp 2>/dev/null</action>
					<action>if true rm '$TMPDIR'/autonavbar.tmp 2>/dev/null</action>
					<action function="disable">rbutAutonavEn</action>
					<action function="disable">rbutAutonavDis</action>
					<action function="disable">rbutAutonavTest</action>
					<action function="disable">pixAutonav</action>
					<action function="disable">txtAutonav</action>
					<action function="disable">rbutAddressEn</action>
					<action function="disable">rbutAddressDis</action>
					<action function="disable">rbutAddressTest</action>
					<action function="disable">pixAddressbar</action>
					<action function="disable">txtAddressbar</action>
				</radiobutton>
				<radiobutton tooltip-text="Launch browser with the navigation bar disabled" auto-refresh="true">
					<label>Test</label>
					<default>false</default>
					<action>if true test_navigation_bar</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Disable the navigation bar to convert the kiosk into digital signgage station displaying a picture, video or a single webpage. If you activate the '"'Test'"' entry then (for a short period) browser is launched with the navigation bar disabled so you can check how its UI will look after instalaltion.</label>
			</text>
		</hbox>
	</frame>
	
######### AUTOHIDE NAVIGATION BAR
	<frame Autohide navigation bar   '$FFWRN'>
		<hbox>
			<pixmap><input file>'$ICONS'/ok-48.png</input><variable>pixAutonav</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Autohide the navigation bar in Firefox when not in use">
					<label>Enable</label>
					<default>false</default>
					<variable>rbutAutonavEn</variable>
					<action>if true echo "autohide_navigation_bar=yes" > '$TMPDIR'/autonavbar.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Make the navigation bar always visible in Firefox" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>true</default>
					<variable>rbutAutonavDis</variable>
					<input file>'$TMPDIR'/autonavDis.mon</input>
					<action>if true rm '$TMPDIR'/autonavbar.tmp 2>/dev/null</action>
				</radiobutton>
				<radiobutton tooltip-text="Launch Firefox with the navigation bar hidden" auto-refresh="true">
					<label>Test</label>
					<default>false</default>
					<variable>rbutAutonavTest</variable>
					<action>if true test_hide_bar</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable this option to automatically hide the Firefox navigation bar when not in use. When bumping the mouse into the top of the window the navigation reappears again. If you activate the '"'Test'"' entry then (for a short period) Firefox is launched with the navigation bar hidden so you can check how its UI behaves.</label>
				<variable>txtAutonav</variable>
			</text>
		</hbox>
	</frame>
	
######### ADDRESS BAR
	<frame Address bar   '$FFWRN'>
		<hbox>
			<pixmap><input file>'$ICONS'/addressbar-48.png</input><variable>pixAddressbar</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Make the address bar visible in Firefox" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<default>true</default>
					<variable>rbutAddressEn</variable>
					<input file>'$TMPDIR'/addressbarEn.mon</input>
					<action>if true rm '$TMPDIR'/addressbar.tmp 2>/dev/null</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the Firefox address bar">
					<label>Disable</label>
					<default>false</default>
					<variable>rbutAddressDis</variable>
					<action>if true echo "disable_address_bar=yes" > '$TMPDIR'/addressbar.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Launch Firefox with the address bar disabled" auto-refresh="true">
					<label>Test</label>
					<default>false</default>
					<variable>rbutAddressTest</variable>
					<action>if true test_address_bar</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<variable>txtAddressbar</variable>
				<label>Disable this option to hide the address bar in Firefox but keep the navigation toolbar and toolbar buttons present. Useful for displaying company intranet pages and removing external browsing. If you activate the '"'Test'"' entry then (for a short period) Firefox is launched with the address bar disabled so you can check how its UI will look after instalaltion.</label>
			</text>
		</hbox>
	</frame>
	

</vbox>
<variable>xFirefox</variable>
<label>BROWSER SETTINGS</label>
</expander>
<text><label>""</label></text>
<text><label>""</label></text>



######################## SYSTEM CATEGORY #############################
<expander expanded="true">
<vbox>
######### SWAP PARTITIONS
	<frame SWAP partition>
		<hbox>
			<pixmap><input file>'$ICONS'/swap-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Use available swap partitions">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "enable_swap=yes" > '$TMPDIR'/swap.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not use the swap">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/swap.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable the use of existing SWAP partitions. When installed kiosk occupies whole device so swap must be located on separated media (kiosk burnt on CD/usb and swap available on a hard drive). This option is less secure as some data may persist in swap. Only enable this option on a PCs with a low amount of RAM.</label>
			</text>
		</hbox>
	</frame>
	
######### zRAM COMPRESSION
	<frame zRAM compression>
		<hbox>
			<pixmap><input file>'$ICONS'/zram-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable zRAM compression">
					<label>Enable</label>
					<default>false</default>
					<action>if true gtk_get_range "Select zRAM percentage" "Use the slider to select a percentage value of zRAM to use. The maximum amount allowed is 50%" 760 zRAM '$TMPDIR'/zram.tmp 50 %</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not use zRAM compression">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/zram.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Compress data in RAM using the zRAM kernel feature. It is faster than using swap on a hard drive and creates more (virtual) memory than using RAM alone due to the compression used.</label>
			</text>
		</hbox>
	</frame>
	
######### REMOVABLE DEVICES
	<frame Removable devices>
		<hbox>
			<pixmap><input file>'$ICONS'/removable-media-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable support for removable devices">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "removable_devices=yes" > '$TMPDIR'/removable.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not allow removable devices">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/removable.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable support for removable devices like usb sticks or flash cards. The only accepted filesystems are: FAT16/32, NTFS and XFS. Devices are mounted as read-only under the /media folder and displayed in a separate tab in the browser. This feature allows kiosk users to read or upload images, PDFs and documents from external storage media.</label>
			</text>
		</hbox>
	</frame>
	
######### TIME ZONE
	<frame Time zone>
		<hbox>
			<pixmap><input file>'$ICONS'/timezone-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable custom timezone">
					<label>Enable</label>
					<default>false</default>
					<action>if true gtk_list "Choose a timezone" "Choose a timezone from the list below:" 760 timezone /usr/share/wizard/timezones.txt '$TMPDIR'/timezone.tmp ntpserver</action>
				</radiobutton>
				<radiobutton tooltip-text="Use Factory as default timezone">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/timezone.tmp '$TMPDIR'/ntp-server.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Choose a timezone from a list of world timezones. Hardware clock will be set through the NTP protocol during every kiosk boot if PC is connected to the network. Make sure that your company firewall is not blocking this protocol.</label>
			</text>
		</hbox>
	</frame>
	
######### PLANNER
	<frame Scheduled tasks>
		<hbox>
			<pixmap><input file>'$ICONS'/planner-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable scheduled tasks">
					<label>Enable</label>
					<default>false</default>
					<action>if true gtk_planner</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not enable scheduled tasks">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm -f '$TMPDIR'/planner.tmp '$TMPDIR'/sched-*</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable if you need to run certain actions periodically. You can schedule a kiosk reboot, shutdown, browser restart, rsync action and more at specified day/hour/minute within each day of the week.</label>
			</text>
		</hbox>
	</frame>
	
######### RTC WAKE
	<frame RTC wake alarm>
		<hbox>
			<pixmap><input file>'$ICONS'/rtc-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable RTC wake alarm">
					<label>Enable</label>
					<default>false</default>
					<action>if true gtk_rtc</action>
				</radiobutton>
				<radiobutton tooltip-text="Keep the RTC wake alarm disabled">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm -f '$TMPDIR'/rtc.tmp '$TMPDIR'/sched-*</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable if you want to setup a RTC wake alarm to power up the kiosk at certain hour:minute within each day of the week. Your PC motherboard must support this feature and '"'Wake up events'"' must be enabled in the BIOS/EFI firmware in order to get this function working properly.</label>
			</text>
		</hbox>
	</frame>
	
######### INPUT
	<frame Input devices>
		<hbox>
			<pixmap><input file>'$ICONS'/input-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Keep the input devices enabled">
					<label>Enable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/input_devices.tmp 2>/dev/null</action>
					<action function="enable">pixKbdPri</action>
					<action function="enable">pixKbdSec</action>
					<action function="enable">pixNum</action>
					<action function="enable">pixMouse</action>
					<action function="enable">pixRMC</action>
					<action function="enable">pixCalibrate</action>
					<action function="enable">txtKbdPri</action>
					<action function="enable">txtKbdSec</action>
					<action function="enable">txtNum</action>
					<action function="enable">txtMouse</action>
					<action function="enable">txtRMC</action>
					<action function="enable">txtCalibrate</action>
					<action function="enable">rbutKbdPriEn</action>
					<action function="enable">rbutKbdPriDis</action>
					<action function="enable">rbutKbdSecEn</action>
					<action function="enable">rbutKbdSecDis</action>
					<action function="enable">rbutNumEn</action>
					<action function="enable">rbutNumDis</action>
					<action function="enable">rbutMouseEn</action>
					<action function="enable">rbutMouseDis</action>
					<action function="enable">rbutRMCEn</action>
					<action function="enable">rbutRMCDis</action>
					<action function="enable">rbutCalibrateEn</action>
					<action function="enable">rbutCalibrateDis</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable all input devices">
					<label>Disable</label>
					<default>false</default>
					<action>if true echo "disable_input_devices=yes" > '$TMPDIR'/input_devices.tmp</action>
					<action>if true echo "true" > '$TMPDIR'/KbdPri.mon</action>
					<action>if true echo "true" > '$TMPDIR'/KbdSec.mon</action>
					<action>if true echo "true" > '$TMPDIR'/Num.mon</action>
					<action>if true echo "true" > '$TMPDIR'/Mouse.mon</action>
					<action>if true echo "true" > '$TMPDIR'/RMC.mon</action>
					<action> if true rm '$TMPDIR'/keyboard1.tmp 2>/dev/null</action>
					<action> if true rm '$TMPDIR'/keyboard2.tmp 2>/dev/null</action>
					<action> if true rm '$TMPDIR'/numlock.tmp 2>/dev/null</action>
					<action> if true rm '$TMPDIR'/mouse.tmp 2>/dev/null</action>
					<action> if true rm '$TMPDIR'/rmc.tmp 2>/dev/null</action>
					<action function="disable">pixKbdPri</action>
					<action function="disable">pixKbdSec</action>
					<action function="disable">pixNum</action>
					<action function="disable">pixMouse</action>
					<action function="disable">pixRMC</action>
					<action function="disable">pixCalibrate</action>
					<action function="disable">txtKbdPri</action>
					<action function="disable">txtKbdSec</action>
					<action function="disable">txtNum</action>
					<action function="disable">txtMouse</action>
					<action function="disable">txtRMC</action>
					<action function="disable">txtCalibrate</action>
					<action function="disable">rbutKbdPriEn</action>
					<action function="disable">rbutKbdPriDis</action>
					<action function="disable">rbutKbdSecEn</action>
					<action function="disable">rbutKbdSecDis</action>
					<action function="disable">rbutNumEn</action>
					<action function="disable">rbutNumDis</action>
					<action function="disable">rbutMouseEn</action>
					<action function="disable">rbutMouseDis</action>
					<action function="disable">rbutRMCEn</action>
					<action function="disable">rbutRMCDis</action>
					<action function="disable">rbutCalibrateEn</action>
					<action function="disable">rbutCalibrateDis</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable input devices temporarily" auto-refresh="true">
					<label>Test</label>
					<default>false</default>
					<action>if true test_input</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Disable all input devices like mice, keyboards, touchpads, touchscreens, digital pens, etc so its not possible to type, touch, scroll, draw or click on any objects. This is useful when kiosk works in a digital signage mode. If you activate the '"'Test'"' entry then input devices will be disabled for 10 seconds.</label>
			</text>
		</hbox>
	</frame>
	
######### KEYBOARD LAYOUT
	<frame Primary keyboard layout>
		<hbox>
			<pixmap><input file>'$ICONS'/keyboard-48.png</input><variable>pixKbdPri</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable custom keyboard layout" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<default>false</default>
					<input file>'$TMPDIR'/pkbdl.mon</input>
					<variable>rbutKbdPriEn</variable>
					<action>if true gtk_list "Primary keyboard layout" "Choose a keyboard layout from the list:" 760 primary_keyboard_layout /usr/share/wizard/keyboards.txt '$TMPDIR'/keyboard1.txt keyboard1</action>
				</radiobutton>
				<radiobutton tooltip-text="Use en-US as default keyboard layout" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>true</default>
					<variable>rbutKbdPriDis</variable>
					<input file>'$TMPDIR'/KbdPri.mon</input>
					<action>if true rm '$TMPDIR'/keyboard1.tmp 2>/dev/null</action>
					<action>if true sed -i /^primary_keyboard_layout/d /tmp/config 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Choose a primary keyboard from the list of known keyboard layouts and variants. You can also choose a secondary keyboard layout below. The default is English (US).</label>
				<variable>txtKbdPri</variable>
			</text>
		</hbox>
	</frame>
	<frame Secondary keyboard layout>
		<hbox>
			<pixmap><input file>'$ICONS'/keyboard-48.png</input><variable>pixKbdSec</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable secondary keyboard layout">
					<label>Enable</label>
					<default>false</default>
					<variable>rbutKbdSecEn</variable>
					<action>if true gtk_list "Secondary keyboard layout" "Choose a keyboard layout from the list:" 760 secondary_keyboard_layout /usr/share/wizard/keyboards.txt '$TMPDIR'/keyboard1.txt keyboard2</action>
				</radiobutton>
				<radiobutton tooltip-text="Use only one keyboard layout" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>true</default>
					<variable>rbutKbdSecDis</variable>
					<input file>'$TMPDIR'/KbdSec.mon</input>
					<action>if true rm '$TMPDIR'/keyboard2.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Choose a secondary keyboard layout. Use Ctrl+Space key combination to switch between the layouts during kiosk session.</label>
				<variable>txtKbdSec</variable>
			</text>
		</hbox>
	</frame>
	
######### NUMLOCK
	<frame Numlock key>
		<hbox>
			<pixmap><input file>'$ICONS'/numlock-48.png</input><variable>pixNum</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Leave the numlock enabled" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<default>true</default>
					<variable>rbutNumEn</variable>
					<input file>'$TMPDIR'/Num.mon</input>
					<action>if true rm '$TMPDIR'/numlock.tmp 2>/dev/null</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the numlock key">
					<label>Disable</label>
					<default>false</default>
					<variable>rbutNumDis</variable>
					<action>if true echo "disable_numlock=yes" > '$TMPDIR'/numlock.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Disable the numlock key when the kiosk boots. Useful if you are having trouble with keyboards that have number panels.</label>
				<variable>txtNum</variable>
			</text>
		</hbox>
	</frame>
	
######### CURSOR
	<frame Mouse cursor visibility>
		<hbox>
			<pixmap><input file>'$ICONS'/cursor-48.png</input><variable>pixMouse</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Keep the mouse cursor visible" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<default>true</default>
					<variable>rbutMouseEn</variable>
					<input file>'$TMPDIR'/Mouse.mon</input>
					<action>if true rm '$TMPDIR'/mouse.tmp '$TMPDIR'/mouse-seconds.tmp 2>/dev/null</action>
				</radiobutton>
				<radiobutton tooltip-text="Hide the mouse cursor">
					<label>Disable</label>
					<default>false</default>
					<variable>rbutMouseDis</variable>
					<action>if true echo "hide_mouse=yes" > '$TMPDIR'/mouse.tmp</action>
					<action>if true get_cursor_mode</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Hide the mouse cursor either permanently or after X seconds of inactivity. This setting may be useful for touchscreens or when you want to display a static page or advertisement.</label>
				<variable>txtMouse</variable>
			</text>
		</hbox>
	</frame>
	
######### RMC
	<frame Right mouse click>
		<hbox>
			<pixmap><input file>'$ICONS'/rmc-48.png</input><variable>pixRMC</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable right mouse click">
					<label>Enable</label>
					<default>false</default>
					<variable>rbutRMCEn</variable>
					<action>if true echo "right_mouse_click=yes" > '$TMPDIR'/rmc.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Keep the right mouse click disabled" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>true</default>
					<variable>rbutRMCDis</variable>
					<input file>'$TMPDIR'/RMC.mon</input>
					<action>if true rm '$TMPDIR'/rmc.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable support for right mouse click in kiosk. Right mouse click provides an access to additional menus (e.g. Chrome browser, flash content) and is usually not needed in kiosk. Here you can enable it to cover rare cases, e.g. it helps when working with online documents.</label>
				<variable>txtRMC</variable>
			</text>
		</hbox>
	</frame>
	
######### Calibration
	<frame Touchscreen calibration>
		<hbox>
			<pixmap><input file>'$ICONS'/calibration-48.png</input><variable>pixCalibrate</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Calibrate touchscreen">
					<label>Enable</label>
					<default>false</default>
					<variable>rbutCalibrateEn</variable>
					<action>if true gtk_calibrate</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not calibrate the touchscreen">
					<label>Disable</label>
					<default>true</default>
					<variable>rbutCalibrateDis</variable>
					<action>if true rm '$TMPDIR'/calibrate.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Calibrate your touchscreen by pressing the points on the screen. Certain models may require proprietary drivers to work which are not included in Porteus Kiosk by default. Please contact support@porteus-kiosk.org when in doubt.</label>
				<variable>txtCalibrate</variable>
			</text>
		</hbox>
	</frame>
	
######### WALLPAPER
	<frame Background wallpaper>
		<hbox>
			<pixmap><input file>'$ICONS'/wp-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Change the wallpaper">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Custom wallpaper URL" "Enter a link to your online wallpaper and it will be downloaded and added to the kiosk ISO. You could also launch the browser and copy/paste wallpaper URL to the input field below. After downloading the browser will be closed so you can view your wallpaper before accepting it." 760 '$TMPDIR'/wallpaper.tmp wallpaper '$TMPDIR'/wallpaper.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Use default kiosk wallpaper">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/wallpaper.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>You may use an online image (JPG or PNG) as your background wallpaper. It will be downloaded and included in the kiosk ISO during system installation/reconfiguration.</label>
			</text>
		</hbox>
	</frame>
	
######### SCREEN
	<frame Screen settings>
		<hbox>
			<pixmap><input file>'$ICONS'/screenres-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Custom screen setup">
					<label>Enable</label>
					<default>false</default>
					<action>if true /opt/porteus-scripts/screen-setup</action>
				</radiobutton>
				<radiobutton tooltip-text="Use default screen settings">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/screen-settings.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>By default the kiosk will use maximum supported screen resolution, refresh rate and backlight brightness. When enabling this option you may choose custom screen parameters but also disable certain video outputs, rotate screens or set them in certain position: e.g. create a video wall for digital signage.</label>
			</text>
		</hbox>
	</frame>


######### SCREENRES
##	<frame Screen resolution>
		<hbox visible="false">
			<pixmap><input file>'$ICONS'/screenres-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set a lower screen resolution">
					<label>Enable</label>
					<default>false</default>
					<action>if true xrandr|grep [0-9].*x[0-9]|grep -v connect|tr -s "'" "'"|cut -d"'" "'" -f2 > '$TMPDIR'/res.txt</action>
					<action> if true gtk_list "Choose resolution" "Choose from one of the supported screen resolutions or enter your own below (provided value must be supported by the monitor)." 760 screen_resolution '$TMPDIR'/res.txt '$TMPDIR'/res.tmp res</action>
				</radiobutton>
				<radiobutton tooltip-text="Use the maximum available screen resolution">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/res.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>By default the kiosk will use maximum supported screen resolution but you may also set a custom lower resolution.</label>
			</text>
		</hbox>
##	</frame>


######### SCREEN REFRESH RATE
##	<frame Screen refresh rate>
		<hbox visible="false">
			<pixmap><input file>'$ICONS'/refresh-rate-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set a lower refresh rate">
					<label>Enable</label>
					<default>false</default>
					<action>if true xrandr|grep [0-9].*x[0-9]|grep -v connect|tr -s "'" "'"|cut -d"'" "'" -f3|cut -d"'"*"'" -f1|sort -u > '$TMPDIR'/refresh.txt</action>
					<action> if true gtk_list "Choose refresh rate" "Choose from one of the supported refresh rates or enter your own below (provided value must be supported by the monitor)." 760 screen_refresh_rate '$TMPDIR'/refresh.txt '$TMPDIR'/refresh.tmp refresh</action>
				</radiobutton>
				<radiobutton tooltip-text="Use maximum available refresh rate">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/refresh.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>By default the kiosk will use maximum supported screen refresh rate but you may also set a custom lower refresh rate.</label>
			</text>
		</hbox>
##	</frame>
	
######### SCREEN BRIGHTNESS
##	<frame Screen brightness>
		<hbox visible="false">
			<pixmap><input file>'$ICONS'/brightness-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set a lower screen brightness">
					<label>Enable</label>
					<default>false</default>
					<action>if true gtk_get_range "Screen brightness percentage" "Use the slider to select a percentage value of the screen brightness to use." 760 screen_brightness '$TMPDIR'/brightness.tmp 99 " "</action>
				</radiobutton>
				<radiobutton tooltip-text="Use the maximum available screen brightness">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/brightness.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>By default the kiosk will use maximum supported screen brightness but you may also set a custom lower screen brightness.</label>
			</text>
		</hbox>
##	</frame>
	
######### SCREEN ROTATION
##	<frame Screen rotation>
		<hbox visible="false">
			<pixmap><input file>'$ICONS'/rotate-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Rotate the screen">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_rotate_option</action>
				</radiobutton>
				<radiobutton tooltip-text="Keep the screen in normal position">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/rotate.* 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>By default the kiosk will keep the screen in a normal position but you may also rotate it to some other position.</label>
			</text>
		</hbox>
##	</frame>
	
######### SOUND CARD
	<frame Default system sound card>
		<hbox>
			<pixmap><input file>'$ICONS'/sound-card-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set default sound card">
					<label>Enable</label>
					<default>false</default>
					<action>if true aplay -l | grep ^card > '$TMPDIR'/sound-cards.txt</action>
					<action>if true gtk_list "Default system sound card" "Choose default sound device from the list below:" 760 default_sound_card '$TMPDIR'/sound-cards.txt '$TMPDIR'/selected-card.txt sound-card</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not change default sound card">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/sound-card.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Set default sound card in case when you have no sound in kiosk or when you want to redirect the sound output to different device like external monitor/TV.</label>
			</text>
		</hbox>
	</frame>
	
######### SOUND VOLUME LEVEL
	<frame Sound volume>
		<hbox>
			<pixmap><input file>'$ICONS'/sound-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Set custom sound volume level">
					<label>Enable</label>
					<default>false</default>
					<action>if true gtk_get_range "Set sound volume level" "Use the slider to select a percentage value of the sound level to use. When set to 0 the sound will be muted." 760 volume_level '$TMPDIR'/sound.tmp 100 %</action>
				</radiobutton>
				<radiobutton tooltip-text="Set sound volume level to 90%">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/sound.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>By default the kiosk will set the sound volume to 90% but you may also choose a custom level.</label>
			</text>
		</hbox>
	</frame>
	
######### SESSION PASSWORD
	<frame Session password>
		<hbox>
			<pixmap><input file>'$ICONS'/lock-48.png</input><width>48</width></pixmap>
			<vbox>
				<radiobutton tooltip-text="Protect the session with a password">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Session password" "Enter the password which will be used to unlock the session for the user." 760 '$TMPDIR'/sessionp.tmp session_password '$TMPDIR'/sessionp.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Keep the session unlocked">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm $TMPDIR/sessionp.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>"Protect the session with a password. Only authorized users can access the browser and use the kiosk."</label>
			</text>
		</hbox>
	</frame>
		
######### RUN COMMAND
	<frame Run command>
		<hbox>
			<pixmap><input file>'$ICONS'/command-48.png</input><width>48</width></pixmap>
			<vbox>
				<radiobutton tooltip-text="Run custom command during system startup">
					<label>Enable</label>
					<default>false</default>
					<action>if true get_input "Run command" "Enter the command(s) which will be started during system boot." 760 '$TMPDIR'/rcommand.tmp run_command '$TMPDIR'/rcommand.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not run any custom commands">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm $TMPDIR/rcommand.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>"Run custom command during system startup. Your commands will be executed once network is established so utilities like rsync, wget and also graphical ones like xrandr could work."</label>
			</text>
		</hbox>
	</frame>
		
		
######### SHUTDOWN COMBINATION
	<frame Shutdown menu>
		<hbox>
			<pixmap><input file>'$ICONS'/shutdown-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable the shudown utility">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "shutdown_combination=yes" > '$TMPDIR'/shudowncombo.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the shutdown utility">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/shutdowncombo.tmp 2>/dev/null</action>
				</radiobutton>
				<radiobutton tooltip-text="Test shutdown utility">
					<label>Test</label>
					<default>false</default>
					<action>if true xdotool key Ctrl+Alt+Delete</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable the shutdown/reboot/suspend/restart menu by using the Ctrl+Alt+Del key combination or by pressing the PCs power button. Do not use this option if the kiosk is used publicly otherwise it may be powered off with the keyboard by unauthorized users.</label>
			</text>
		</hbox>
	</frame>

</vbox>
<variable>xSystem</variable>
<label>SYSTEM SETTINGS</label>
</expander>
<text><label>""</label></text>
<text><label>""</label></text>



######################## POWER SAVING #############################
<expander expanded="true">
<vbox>
######### SCREEN SAVER
	<frame Screen saver>
		<hbox>
			<pixmap><input file>'$ICONS'/screensaver-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable the screensaver">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "screensaver_idle=5" > '$TMPDIR'/screensaver.tmp</action>
					<action>if true echo true > '$TMPDIR'/srcSlideDis.mon</action>
					<action>if true echo true > '$TMPDIR'/srcVideoDis.mon</action>
					<action>if true get_input_minutes "Screensaver idle time" "Set the time (in minutes) of inactivity after which the screensaver will be started. Inactivity is considered as no mouse/keyboard activity. Default '"'ripples'"' screensaver will be used unless you enable the slideshow or screensaver video below." 760 '$TMPDIR'/screensaver.tmp screensaver_idle</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable the screensaver">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm -f '$TMPDIR'/screensaver.tmp '$TMPDIR'/slideshow.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable the kiosk screensaver which is either a default '"'ripples'"' screensaver, slideshow of JPG/PNG images or video played in a loop.</label>
			</text>
		</hbox>
	</frame>
	
######### DPMS
	<frame DPMS>
		<hbox>
			<pixmap><input file>'$ICONS'/dpms-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable DPMS">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "enable_dpms=yes" > '$TMPDIR'/dpms.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Disable DPMS">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/dpms.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable DPMS (Display Power Management Signaling) which turns the monitor off after 10 minutes of keyboard/mouse inactivity.</label>
			</text>
		</hbox>
	</frame>
	
######### FREEZE/STANDBY/SUSPEND
	<frame Power settings>
		<hbox>
			<pixmap><input file>'$ICONS'/suspend-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Enable power saving feature when the PC is at idle">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "freeze_idle=10" > '$TMPDIR'/powersave.tmp</action>
					<action>if true get_power_option</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not enable any power saving features when the PC is at idle">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/powersave.* 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Enable power saving to choose between freeze, standby, suspend, or shutdown when the computer is idle/inactive for a definied time period.</label>
			</text>
		</hbox>
	</frame>
	
</vbox>
<variable>xPower</variable>
<label>POWER SAVING OPTIONS</label>
</expander>
<text><label>""</label></text>
<text><label>""</label></text>



###################### ADDITIONAL COMPONENTS ###########################
<expander expanded="true">
<vbox>
######### UEFI
<frame UEFI support>
		<hbox>
			<pixmap><input file>'$ICONS'/uefi-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Add UEFI component to the ISO" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<default>true</default>
					<input file>'$TMPDIR'/uefiEn.mon</input>
					<action>if true echo uefi.zip > '$TMPDIR'/uefi.add</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not add the UEFI component to the ISO" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>false</default>
					<input file>'$TMPDIR'/uefiDis.mon</input>
					<action>if true rm '$TMPDIR'/uefi.add 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>UEFI component allows booting Porteus Kiosk on PCs supplied with UEFI firmware and others supplied with traditional BIOS. Disable this component if you experience booting problems.</label>
			</text>
		</hbox>
	</frame>
	
######### FLASH PLAYER
	<frame Flash player NPAPI plugin   '$FFWRN'>
		<hbox>
			<pixmap><input file>'$ICONS'/flash-48.png</input><variable>pixFlash</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Add flash player plugin">
					<label>Enable</label>
					<variable>rbutFlashEn</variable>
					<default>false</default>
					<action>if true gtk_list "Adobe Flash EULA" "Click OK button to accept the Adobe Flash license." 760 EULA /usr/share/wizard/license-AdobeFlash.txt</action>
					<action>if true get_flash_player</action>
				</radiobutton>
				<radiobutton tooltip-text="Use html5 for playing audio/video content">
					<label>Disable</label>
					<variable>rbutFlashDis</variable>
					<default>true</default>
					<action>if true rm '$TMPDIR'/flash.add 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<variable>txtFlash</variable>
				<label>Adobe Flash Player plugin allows Firefox to display pages containing flash content. When enabling this component you have to agree to the terms and conditions of respective proprietary license. Please disable this component if you do not accept the EULA.</label>
			</text>
		</hbox>
	</frame>
	
######### JAVA
<frame JAVA openjre NPAPI plugin   '$FFWRN'>
		<hbox>
			<pixmap><input file>'$ICONS'/java-48.png</input><variable>pixJava</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Include java plugin">
					<label>Enable</label>
					<variable>rbutJavaEn</variable>
					<default>false</default>
					<action>if true echo 07-java.xzm > '$TMPDIR'/java.add</action>
				</radiobutton>
				<radiobutton tooltip-text="Exclude java plugin">
					<label>Disable</label>
					<variable>rbutJavaDis</variable>
					<default>true</default>
					<action>if true rm '$TMPDIR'/java.add 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<variable>txtJava</variable>
				<label>Java JRE (Java Runtime Environment) and the java browser plugin allows Firefox to display web pages that contain java content.</label>
			</text>
		</hbox>
	</frame>
	
######### CITRIX
<frame Citrix Receiver NPAPI plugin   '$FFWRN'>
		<hbox>
			<pixmap><input file>'$ICONS'/citrix-48.png</input><variable>pixCitrix</variable></pixmap>
			<vbox>
				<radiobutton tooltip-text="Include Citrix Receiver plugin">
					<label>Enable</label>
					<variable>rbutCitrixEn</variable>
					<default>false</default>
					<action>if true gtk_list "Citrix Receiver EULA" "Click OK button to accept the Citrix Receiver license." 760 EULA /usr/share/wizard/license-CitrixReceiver.txt</action>
					<action>if true echo 11-citrix.xzm > '$TMPDIR'/citrix.add</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not include Citrix Receiver plugin">
					<label>Disable</label>
					<variable>rbutCitrixDis</variable>
					<default>true</default>
					<action>if true rm '$TMPDIR'/citrix.add 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<variable>txtCitrix</variable>
				<label>ICA Client for Citrix Presentation servers. When enabling this component you have to agree to the terms and conditions of respective proprietary license. Please disable this component if you do not accept the EULA.</label>
			</text>
		</hbox>
	</frame>
	
######### ADDITIONAL FONTS
<frame Additional fonts>
		<hbox>
			<pixmap><input file>'$ICONS'/fonts-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Include additional fonts">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo 06-fonts.xzm > '$TMPDIR'/fonts.add</action>
				</radiobutton>
				<radiobutton tooltip-text="Exclude additional fonts">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/fonts.add 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>Full dejavu font package and other fonts for displaying characters from Asian languages: Chinese, Hindi, Korean, Japanese, Thai, Vietnamese and various others.</label>
			</text>
		</hbox>
	</frame>
	
######### PXE BOOT
<frame PXE client>
		<hbox>
			<pixmap><input file>'$ICONS'/pxe-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Add PXE client component to the ISO">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo initrdpxe.xz > '$TMPDIR'/pxe.add</action>
				</radiobutton>
				<radiobutton tooltip-text="Do not add the PXE client component to the ISO">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/pxe.add 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" selectable="true">
				<label>PXE client component allows booting the kiosk on multiple PCs over a network. To setup the PXE server please follow the doc at:  http://porteus-kiosk.org/pxe-server.html.</label>
			</text>
		</hbox>
	</frame>
	
######### SSH COMPONENT
<frame SSH service>
		<hbox>
			<pixmap><input file>'$ICONS'/ssh-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Include the ssh service" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<variable>rbutSSHEn</variable>
					<default>false</default>
					<input file>'$TMPDIR'/enablessh.mon</input>
					<action>if true echo 08-ssh.xzm > '$TMPDIR'/ssh.add</action>
					<action>if true gtk_password "Root Password" "Enter a root password that will be used to connect to the kiosk through ssh." "root"</action>
					<action>if true get_input "SSH Port" "Port number on which the SSH service will be listening." 760 $TMPDIR/sshport.tmp ssh_port $TMPDIR/sshport.txt</action>
				</radiobutton>
				<radiobutton tooltip-text="Exclude the ssh service" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<variable>rbutSSHDis</variable>
					<default>true</default>
					<input file>'$TMPDIR'/disablessh.mon</input>
					<action>if true rm '$TMPDIR'/ssh.* 2>/dev/null</action>
					<action>if true rm '$TMPDIR'/sshport.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>SSH (Secure shell) service allows to connect/communicate to the kiosk machine via the SSH protocol. Selected port will be opened in the kiosk firewall configuration.</label>
			</text>
		</hbox>
	</frame>
	
######### VNC SERVER
<frame VNC service>
		<hbox>
			<pixmap><input file>'$ICONS'/vnc-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Include vnc server" file-monitor="true" auto-refresh="true">
					<label>Enable</label>
					<variable>rbutVNCEn</variable>
					<default>false</default>
					<input file>'$TMPDIR'/enablevnc.mon</input>
					<action>if true echo 09-x11vnc.xzm > '$TMPDIR'/vnc.add</action>
					<action>if true gtk_password "VNC Server Password" "Enter a vnc password (must be 8 characters or less) that will be used to connect to the kiosk through vnc." vnc</action>
					<action>if true get_vnc_mode</action>
				</radiobutton>
				<radiobutton tooltip-text="Exclude vnc server" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<variable>rbutVNCDis</variable>
					<default>true</default>
					<input file>'$TMPDIR'/disablevnc.mon</input>
					<action>if true rm '$TMPDIR'/vnc.* 2>/dev/null</action>
					<action>if true rm '$TMPDIR'/vncport.tmp 2>/dev/null</action>
					<action>if true rm '$TMPDIR'/vnc-control.tmp 2>/dev/null</action>
					<action>if true rm '$TMPDIR'/vnc-key.tmp 2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>VNC service allows to connect to the graphical interface of the kiosk from another computer via the VNC protocol. Useful for monitoring the kiosk. Port 5900 will be opened in the kiosk firewall configuration.</label>
			</text>
		</hbox>
	</frame>


######### PRINTING SUPPORT
<frame Printing support>
		<hbox>
			<pixmap><input file>'$ICONS'/printer-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Include printing support">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo printer_connection=direct > '$TMPDIR'/printer-connection.tmp</action>
					<action>if true get_printer_info</action>
					<action>if true gtk_password "Root Password" "Enter a root password needed to access the CUPS web interface on http://127.0.0.1:631 for printer settings." root</action>
					<action>if true echo 10-printing.xzm > '$TMPDIR'/printer.add</action>
				</radiobutton>
				<radiobutton tooltip-text="Exclude printing support" file-monitor="true" auto-refresh="true">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/printer-model.tmp '$TMPDIR'/printer-connection.tmp '$TMPDIR'/printer.add '$TMPDIR'/silent-printing.tmp '$TMPDIR'/share-printer.tmp  2>/dev/null</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" selectable="true">
				<label>Printing support for local printers connected directly through the usb, parallel or serial ports and remote printers connected over the network through the http, ipp, lpd or socket protocols.</label>
			</text>
		</hbox>
	</frame>

</vbox>
<variable>xAdditional</variable>
<label>ADDITIONAL COMPONENTS</label>
</expander>
<text><label>""</label></text>
<text><label>""</label></text>



######################## KIOSK DEBUGGING #############################
<expander expanded="true">
<vbox>
######### GPU DRIVER
	<frame GPU DRIVER>
		<hbox>
			<pixmap><input file>'$ICONS'/gpu-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Use native GPU driver">
					<label>Default</label>
					<default>true</default>
					<action>if true rm -f '$TMPDIR'/gpu.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Force kernel modesetting driver">
					<label>KMS</label>
					<default>false</default>
					<action>if true echo "gpu_driver=modesetting" > '$TMPDIR'/gpu.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Force generic VESA driver">
					<label>VESA</label>
					<default>false</default>
					<action>if true echo "gpu_driver=vesa" > '$TMPDIR'/gpu.tmp</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560" use-markup="true">
				<label>"Select 2D DDX driver for your GPU card. <span weight='"'bold'"' color='"'red'"'>WARNING:</span> kernel modesetting and VESA drivers are generic, unaccelerated and offer less features than the default driver. Use them only if you are having display problems in kiosk."</label>
			</text>
		</hbox>
	</frame>


######### DEBUG MODE
	<frame Kiosk Debug Mode>
		<hbox>
			<pixmap><input file>'$ICONS'/debug-48.png</input></pixmap>
			<vbox>
				<radiobutton tooltip-text="Generate system report during first boot">
					<label>Enable</label>
					<default>false</default>
					<action>if true echo "debug=yes" > '$TMPDIR'/debug.tmp</action>
				</radiobutton>
				<radiobutton tooltip-text="Install kiosk as normal">
					<label>Disable</label>
					<default>true</default>
					<action>if true rm '$TMPDIR'/debug.tmp 2>/dev/null</action>
				</radiobutton>
				<radiobutton tooltip-text="Generate short report">
					<label>Short log</label>
					<default>false</default>
					<action>if true cp -a /var/log/Xorg.0.log /opt/porteus-scripts; /opt/porteus-scripts/debug; sed -i "s/|^file:.\*//g" '$profile'/chrome/userContent.css; killall firefox chrome >/dev/null; su - guest -c "DISPLAY=:0 firefox /var/log/debug &"; sleep 3</action>
				</radiobutton>
			</vbox>
			<text width-request="10"><label>""</label></text>
			<text yalign="0" width-request="560">
				<label>When enbled displays full system report during first boot after instalaltion. Some settings are forced so please do not enable this option if you are installing the kiosk for use in production. If you activate the '"'Short log'"' entry then crippled system report will be displayed right now so you can send it using your email account to support@porteus-kiosk.org.</label>
			</text>
		</hbox>
	</frame>


</vbox>
<variable>xDebug</variable>
<label>DEBUGGING OPTIONS</label>
</expander>



## This vbox closes the opening vbox for notebooks
</vbox>


################## PAGE 2 USER REPORT
<vbox margin="10">
	<text use-markup="true" yalign="1"><label>"<span weight='"'bold'"' size='"'x-large'"'>Setting report</span>"</label></text>
	<hseparator></hseparator>
	<text xalign="0" width-request="740" wrap="true"><label>Review the kiosk settings below. You can preserve your current config by saving it on removable device or launching the browser, copying it with Ctrl+c keyboard shortcut and sending to your email account. You can also paste or load previously saved kiosk settings up here. Click '"'Next'"' button to proceed with installation.</label></text>
	<text><label>""</label></text>
	<edit height-request="300" sensitive="true">
		<variable>txtReport</variable>
		<input file>/tmp/config</input>
		<output file>/tmp/config</output>
	</edit>
</vbox>


################## PAGE 3 AUTOMATIC UPDATES
<vbox margin="10">
	<text use-markup="true" yalign="1"><label>"<span weight='"'bold'"' size='"'x-large'"'>Automatic updates</span>"</label></text>
	<hseparator></hseparator>
	<text xalign="0" width-request="740" wrap="true"><label>Porteus Kiosk is available free of charge. The free version does not have the automatic system updates enabled by default. Please find out more about this feature:</label></text>
	<hbox>
	<text width-request="400" xalign="0" selectable="true"><label>"http://porteus-kiosk.org/automatic-updates.html"</label></text>
	<button>
	    <label>Visit webpage</label>
	    <action>killall firefox chrome 2>/dev/null; su - guest -c "DISPLAY=:0 firefox http://porteus-kiosk.org/automatic-updates.html &"; sleep 3</action>
	</button>
	</hbox>
	<text><label>""</label></text>
	<text xalign="0" width-request="740" wrap="true" use-markup="true"><label>"<span weight='"'bold'"' color='"'red'"'>NOTE:</span> if you select the free trial option for the automatic updates then after 3 months you will have to reinstall the kiosk and either buy the subscription or disable automatic updates service."</label></text>
	<text><label>""</label></text>
	<radiobutton>
		<label>Disable Porteus Kiosk automatic fixes and updates service</label>
		<action>if true sed -i "/automatic_updates/d" /tmp/config 2>/dev/null</action>
		<action>if true sed -i "/trial_au/d" /tmp/config 2>/dev/null</action>
	</radiobutton>
	<radiobutton>
		<label>Enable 3 months free trial of the automatic fixes and updates service</label>
		<action>if true sed -i "/automatic_updates/d" /tmp/config 2>/dev/null</action>
		<action>if true echo "automatic_updates=yes" >> /tmp/config</action>
		<action>if true echo "trial_au=yes" >> /tmp/config</action>
	</radiobutton>
	<radiobutton>
		<variable>rbtUpdatesEnable</variable>
		<label>Enable automatic fixes and updates service (paid subscription required)</label>
		<action>if true sed -i "/automatic_updates/d" /tmp/config 2>/dev/null</action>
		<action>if true sed -i "/trial_au/d" /tmp/config 2>/dev/null</action>
		<action>if true echo "automatic_updates=yes" >> /tmp/config</action>
		<action>if true /opt/porteus-scripts/subscribe</action>
	</radiobutton>
	<text><label>""</label></text>
	<hseparator></hseparator>
	<text xalign="1" width-request="580" use-markup="true" selectable="true"><label>"<span weight='"'bold'"'>PC identification number (PC ID): '$PCID'</span>"</label></text>
	<hseparator></hseparator>
	<text><label>""</label></text>
	<text><label>""</label></text>
	<hbox>
	<text xalign="0" width-request="685"><label>If you wont enable automatic updates then please consider making a single donation to our project.</label></text>
	<button>
		<label>Donate</label>
		<action>killall firefox chrome >/dev/null; su - guest -c "DISPLAY=:0 firefox http://porteus-kiosk.org/donate.html &"; sleep 3</action>
	</button>
	</hbox>
	<text><label>""</label></text>
	<text><label>""</label></text>
	<text width-request="760" use-markup="true"><label>"<b>Thank you for supporting Porteus Kiosk financially.</b>"</label></text>
</vbox>


################## PAGE 4 BURN
<vbox margin="10">
	<text use-markup="true" yalign="1"><label>"<span weight='"'bold'"' size='"'x-large'"'>Kiosk installation</span>"</label></text>
	<hseparator></hseparator>
	<text xalign="0" width-request="740" wrap="true" use-markup="true"><label>"Please choose the target device (must have at least <span weight='"'bold'"' color='"'red'"'>950 MB</span> size, optical media are not supported) to which you will be installing your customized kiosk ISO. You may also save the ISO on removable device or click on the '"'Exit'"' button to leave the wizard. If you exit the wizard then your ISO will be saved as /mnt/kiosk.iso. You can upload it using the browser to your email account or some online storage for burning later on a CD or DVD."</label></text>
	<text><label>""</label></text>
	<text xalign="0" width-request="740" wrap="true" use-markup="true"><label>"<span weight='"'bold'"' color='"'red'"'>WARNING:</span> if you click the '"'Install Kiosk'"' button then kiosk will be burned on selected device destroying all existing data. Be careful when selecting the device!"</label></text>
	<text><label>""</label></text>
	<hseparator></hseparator>
	<table>
		<variable>tblTarget</variable>
		<width>700</width>
		<label>"NAME               |TYPE           |MODEL                                              |SIZE"</label>
		<height>250</height>
		<input file>'$TMPDIR'/block.txt</input>
		<action>echo $tblTarget > '$TMPDIR'/target.txt</action>
	</table>
</vbox>


######### END OF PAGES
<variable>nPage</variable>
<input file>'$TMPDIR'/.knetPage</input>
</notebook>

######### BUTTONS
<hbox>
	<button visible="false">
		<label>Restart</label>
		<variable>butBack</variable>
		<input file>'$BUTPREV'</input>
		<action>echo > /tmp/wizard-lock</action>
		<action function="exit">finished</action>
	</button>
	<button visible="false" tooltip-text="Launch browser. Use Alt+Tab to switch between the browser and the Kiosk Wizard windows.">
	    <label>Browser</label>
	    <variable>butBrowser</variable>
	    <input file>/usr/share/pixmaps/browser-48.png</input>
	    <width>16</width>
	    <action>killall firefox chrome >/dev/null; su - guest -c "DISPLAY=:0 firefox &"; sleep 3</action>
	</button>
	<button visible="false" tooltip-text="Exit the wizard">
	    <variable>xExit</variable>
	    <label>Exit</label>
	    <input file stock="gtk-no"></input>
	    <width>16</width>
	    <action>sed -i '/burn_dev/d' /tmp/config</action>
	    <action function="exit">skip</action>
	</button>
	<button visible="false" tooltip-text="Load kiosk config from removable device">
		<label>Load config</label>
		<variable>butLoadConf</variable>
		<input file>/usr/share/pixmaps/removable-media-48.png</input>
		<height>16</height>
		<action>gtk_lconfig</action>
		<action function="refresh">txtReport</action>
	</button>
	<button visible="false" tooltip-text="Save kiosk config on removable device">
		<label>Save config</label>
		<variable>butSaveConf</variable>
		<input file>/usr/share/pixmaps/removable-media-48.png</input>
		<height>16</height>
		<action>save:txtReport</action>
		<action>echo >> /tmp/config</action>
		<action>gtk_sconfig</action>
	</button>
	<button visible="false" tooltip-text="Save kiosk ISO on removable device">
		<label>Save ISO</label>
		<variable>butSaveISO</variable>
		<input file>/usr/share/pixmaps/removable-media-48.png</input>
		<height>16</height>
		<action>gtk_sISO</action>
	</button>
## <-------- wizard page button
	<button visible="false" tooltip-text="Proceed">
		<label>Next</label>
		<variable>butNextWizard</variable>
		<input file>'$BUTNEXT'</input>
		<action>process_settings</action>
		<action>echo 2 > '$TMPDIR'/.knetPage</action>
		<action function="refresh">nPage</action>
		<action function="refresh">txtReport</action>
		<action condition="command_is_true( [ `grep 2 '$TMPDIR'/.knetPage` ] && echo true )">show:butLoadConf</action>
		<action condition="command_is_true( [ `grep 2 '$TMPDIR'/.knetPage` ] && echo true )">show:butSaveConf</action>
		<action condition="command_is_true( [ `grep 2 '$TMPDIR'/.knetPage` ] && echo true )">hide:butNextWizard</action>
		<action condition="command_is_true( [ `grep 2 '$TMPDIR'/.knetPage` ] && echo true )">show:butNextReport</action>
	</button>
## <-------- report page button
	<button visible="false" tooltip-text="Proceed">
		<label>Next</label>
		<variable>butNextReport</variable>
		<input file>'$BUTNEXT'</input>
		<action>echo 3 > '$TMPDIR'/.knetPage</action>
		<action function="refresh">nPage</action>
		<action condition="command_is_true( [ `grep 3 '$TMPDIR'/.knetPage` ] && echo true )">save:txtReport</action>
		<action condition="command_is_true( [ `grep 3 '$TMPDIR'/.knetPage` ] && echo true )">echo >> /tmp/config</action>
		<action condition="command_is_true( [ `grep 3 '$TMPDIR'/.knetPage` ] && echo true )">hide:butLoadConf</action>
		<action condition="command_is_true( [ `grep 3 '$TMPDIR'/.knetPage` ] && echo true )">hide:butSaveConf</action>
		<action condition="command_is_true( [ `grep 3 '$TMPDIR'/.knetPage` ] && echo true )">hide:butNextReport</action>
		<action condition="command_is_true( [ `grep 3 '$TMPDIR'/.knetPage` ] && echo true )">show:butNextAuto</action>
	</button>
## <-------- autoupdate page button
	<button visible="false" tooltip-text="Proceed">
		<label>Next</label>
		<variable>butNextAuto</variable>
		<input file>'$BUTNEXT'</input>
		<action>lsblk -o NAME,TYPE,MODEL,SIZE | egrep -v "NAME|loop|part|rom" | tr -s " " | sed -e "s/ /_/g" -e "s/_/|/1" -e "s/_/|/1" -e "s/\(.*\)_/\1|/" > '$TMPDIR'/block.txt</action>
		<action>echo 4 > '$TMPDIR'/.knetPage</action>
		<action function="refresh">nPage</action>
		<action function="refresh">tblTarget</action>
		<action condition="command_is_true( [ `grep 4 '$TMPDIR'/.knetPage` ] && echo true )">hide:butNextAuto</action>
		<action condition="command_is_true( [ `grep 4 '$TMPDIR'/.knetPage` ] && echo true )">show:butSaveISO</action>
		<action condition="command_is_true( [ `grep 4 '$TMPDIR'/.knetPage` ] && echo true )">show:xExit</action>
		<action condition="command_is_true( [ `grep 4 '$TMPDIR'/.knetPage` ] && echo true )">show:butRefList</action>
		<action condition="command_is_true( [ `grep 4 '$TMPDIR'/.knetPage` ] && echo true )">show:butBurn</action>
	</button>
	<button visible="false" tooltip-text="Refresh device list">
		<label>Refresh list</label>
		<variable>butRefList</variable>
		<input file stock="gtk-refresh"></input>
		<action function="clear">tblTarget</action>
		<action>dlist</action>
		<action function="refresh">tblTarget</action>
	</button>
	<button visible="false" tooltip-text="Burn kiosk ISO on selected device">
		<label>Install Kiosk</label>
		<variable>butBurn</variable>
		<input file>/usr/share/icons/oxygen/16x16/devices/drive-harddisk.png</input>
		<action condition="command_is_true( [ ! -f '$TMPDIR'/target.txt ] && echo true )">gtk_warning "Missing parameter" "You must choose a target device to burn the ISO to. You can also save the ISO on removable device or exit the wizard to upload the image to some online storage." 600</action>
		<action>test -e '$TMPDIR'/target.txt && { test $(lsblk -b -o TYPE,SIZE /dev/$tblTarget | egrep -v "SIZE|part" | rev | cut -d" " -f1 | rev | sed s/......$//) -gt 950 || { rm -f '$TMPDIR'/target.txt; gtk_warning "Device too small" "You must choose a target device which is at least 950 MB in size. You can also save the ISO on removable device or exit the wizard to upload the image to some online storage." 600; }; }</action>
		<action condition="command_is_true( [ ! -f '$TMPDIR'/target.txt ] && echo true )" function="break">break</action>
		<action>echo "burn_dev=$tblTarget" >> /tmp/config</action>
		<action function="exit">finished</action>
	</button>
</hbox>
</vbox>
</window>'

# /usr/share/icons/oxygen/16x16/devices/drive-harddisk.png
## Remove any comments and launch
echo "$WIZARD_MAIN"| sed '/^##/d' | gtkdialog -i /usr/share/wizard/wizard-functions -s -c > $TMPDIR/output
unset WIZARD_MAIN TMPDIR CONF ICONS
cleanup
