# -*- coding: utf-8; indent-tabs-mode: t; tab-width: 4 -*-

## Copyright 2001-2003, Danger, Inc.  All Rights Reserved.
## This file is subject to the Danger, Inc. Sample Code License,
## which is provided in the file SAMPLE_CODE_LICENSE.
## Copies are also available from http://developer.danger.com/

package "com.danger.terminal"

interface "{source}src/com/danger/terminal/TerminalResources.java"
events "{source}src/com/danger/terminal/TerminalEvents.java"

string ID_APP_NAME                  "MonkeyTerm"
string ID_APP_SHORT_NAME            "MonkeyTerm"
string STRING_TITLE                 "MonkeyTerm"

string ID_APP_CLASS                 "com.danger.terminal.Terminal"

# magick!
@ IF {os_version} = {3.0}
string ID_CHOOSER_CATEGORY "apps"
@ ELSE
string -1015 "apps"
@ ENDIF

bitmap ID_SMALL_ICON                "{base}ID_SmallIcon.png"
bitmap ID_LARGE_ICON                "{base}ID_LargeIcon.png"
bitmap ID_SPLASH_SCREEN             "{base}ID_SplashScreen.png"
bitmap ID_SPLASH_SCREEN_NO_TITLE    "{base}ID_SplashScreenNoTitle.png"
bitmap ID_SPLASH_SCREEN_NO_MONKEY   "{base}ID_SplashScreenNoTitleNoMonkey.png"
bitmap ID_ABOUT_SPLASH              "{base}ID_AboutSplash.png"

bitmap ID_CONNECTED_DOT             "{base}connected.png"
bitmap ID_DISCONNECTED_DOT          "{base}disconnected.png"
bitmap ID_LOCKED_KEY_ICON           "{base}icon-locked.png"

bitmap ID_UP_TRIANGLE               "{base}UpTriangle.png"
bitmap ID_DOWN_TRIANGLE             "{base}DownTriangle.png"

# easter egg
bitmap ID_BASTILLE_ICON             "{base}ID_MonkeyBastille.png"
bitmap ID_IND_ICON                  "{base}ID_MonkeyInd.png"
bitmap ID_CANADA_ICON               "{base}ID_MonkeyCanada.png"
bitmap ID_AUS_ICON                  "{base}ID_MonkeyAus.png"
bitmap ID_DEUTSCH_ICON              "{base}ID_MonkeyDeutsch.png"
bitmap ID_CINCO_ICON                "{base}ID_MonkeyCinco.png"
bitmap ID_ENGLAND_ICON              "{base}ID_MonkeyEng.png"
bitmap ID_SCOTLAND_ICON             "{base}ID_MonkeyEco.png"
bitmap ID_WALES_ICON                "{base}ID_MonkeyWales.png"
bitmap ID_NIRELAND_ICON             "{base}ID_MonkeyPat.png"
bitmap ID_AUSTRIA_ICON              "{base}ID_MonkeyAustria.png"
bitmap ID_PIRATE_ICON               "{base}ID_MonkeyPirate.png"
bitmap ID_CONNECTED_ICON            "{base}ID_MonkeyConnected.png"
bitmap ID_DISCONNECTED_ICON         "{base}ID_MonkeyDisconnected.png"
bitmap ID_PAUSED_ICON               "{base}ID_MonkeyPaused.png"

string ID_LOCALE                    "fr_FR"

constant EVENT_SWITCH_CONSOLE 100

event EVENT_PAUSED
event EVENT_RESUMED


string DEFAULT_FONT                     "Fixed5x7"

# if the user tries to create a new session with an invalid hostname,
# a dialog with this text pops up.
string STRING_INVALID_HOSTNAME          "Nom d'hôte non valide."

# supported protocols
string PROTOCOL_SSH2                    "SSH2"
string PROTOCOL_TELNET                  "Telnet"
string PROTOCOL_RAW                     "Raw"

# action menu in an active/inactive console
string STRING_CLOSE_FORMAT              "Fermer ^0"
string STRING_SESSION_LIST              "Liste de sessions"
string STRING_PREFERENCES_MENU          "Paramètres du serveur..."
string STRING_FONT_MENU                 "Police"
string STRING_COPY                      "Copier"
string STRING_PASTE                     "Coller"
string STRING_CLEAR_SCREEN              "Effacer écran"
string STRING_RECONNECT                 "Reconnecter"
string STRING_HELP                      "Aide…"

# while connecting (displayed in terminal window)
string STRING_TRYING                    "Essai de ^0..."
string STRING_CONNECTED_TO              "Connecté à ^0."
string STRING_NEGOTIATING_ENCRYPTION    "Négociation du cryptage..."
string STRING_AUTHENTICATED             "Authentifié."
string STRING_CONNECTION_FAILED         "Echec de la connexion."
string STRING_CONNECTION_CLOSED         "Connexion terminée."
string STRING_HOST_KEY_REJECTED         "Déconnecté (clé de serveur " +
		"rejetée)"
string STRING_DISCONNECTED_NO_AUTH      "Déconnecté (connexion annulée)."
string STRING_AUTH_FAILED               "Echec de l'authentification."

# errors during ssh negotiation (very rare)
string STRING_UNABLE_TO_OPEN_PTY        "Impossible d'ouvrir le terminal."
string STRING_UNABLE_TO_OPEN_SHELL      "Impossible d'ouvrir le boîtier."

# ssh channel failure reasons (very rare)
string STRING_CHAN_PROHIBITED           "Echec : interdiction " +
		"administrative."
string STRING_CHAN_CONNECT_FAILED       "Echec : Echec de la connexion."
string STRING_CHAN_UNKNOWN_TYPE         "Echec : Type de canal inconnu."
string STRING_CHAN_RESOURCE_SHORTAGE    "Echec : manque de ressources."

#'Shift' glyph in menu can be changed on a locale by locale basis
string STRING_SHIFT_GLYPH		"\uf02d"



menu ID_KEY_MENU
    menuItem    title = "(aucun)"    event = EVENT_KEY_MENU
endMenu


dialog ID_LOGIN_DIALOG
    title = "Connexion"
    widthPct = 100
    showCancel

    container
        # spacer: "top = 5" on staticTextBox does not work
        height = 5
        width = 10
        id = ID_LOGIN_SPACER
        top = 0
        left = 0
    endContainer

    staticTextBox
        id = ID_LOGIN_DIALOG_HEADING
        text = "Connexion à ^0 :"
        left = 5
        positionBelow = ID_LOGIN_SPACER : 0
        fillToRight = 5
        doesNotHaveBorder

    button
        id = ID_LOGIN_OK
        title = okButton
        position = buttonBottom1
        shortcut = backButton
        event = EVENT_AUTHENTICATE

    labeledGrid
        id = ID_LOGIN_GRID
        fillToRight = 5
        positionBelow = ID_LOGIN_DIALOG_HEADING : 6
        left = 5

        row
            staticText
                id = ID_LOGIN_USERNAME_TEXT
                text = "Connexion"
                font = boldSysFont
                                
            textField
                id = ID_LOGIN_USERNAME
                maxLength = 64
                initialFocus
        endRow

        row
            staticText
                id = ID_LOGIN_PASSWORD_TEXT
                text = "Mot de passe"
                font = boldSysFont

            textField
                id = ID_LOGIN_PASSWORD
                maxLength = 64
                passwordField
        endRow
                
        row
            staticText
                id = ID_LOGIN_KEY_TEXT
                text = "Clé"
                font = boldSysFont
                        
            popupMenu
                id = ID_LOGIN_KEY
                menu = ID_KEY_MENU
                event = EVENT_KEY_MENU
        endRow
    endLabeledGrid
        
    checkBox
        id = ID_LOGIN_REMEMBER
        title = "Mémoriser pour les sessions futures"
        positionBelow = ID_LOGIN_KEY : 5
        left = 5
        matchHeight = ID_LOGIN_KEY
                
    container
        # spacer
        positionBelow = ID_LOGIN_REMEMBER : 0
        height = 4
        width = 10
    endContainer
endDialog

string STRING_RETRY_LOGIN               "Réessayez de vous connecter à ^0 :"
event EVENT_DONT_AUTHENTICATE


dialog ID_KEY_PASSWORD_DIALOG
    title = "Déverrouiller \"^0\""
    widthPct = 100
    showCancel
        
    container
        # spacer: "top = 5" on staticTextBox does not work
        height = 5
        width = 10
        id = ID_KEY_SPACER
        top = 0
        left = 0
    endContainer

    button
        id = ID_KEY_OK
        title = okButton
        position = buttonBottom1
        shortcut = backButton
        event = EVENT_KEY_AUTHENTICATE

    labeledGrid
        fillToRight = 5
        positionBelow = ID_KEY_SPACER : 0
        left = 5

        row
            staticText
                id = ID_KEY_PASSWORD_TEXT
                text = "Mot de passe"
                font = boldSysFont

            textField
                id = ID_KEY_PASSWORD
                maxLength = 64
                passwordField
        endRow
    endLabeledGrid
    
    checkBox
        id = ID_KEY_REMEMBER
        title = "Mémoriser clé de déverrouillage"
        positionBelow = ID_KEY_PASSWORD : 7
        left = 1
        matchHeight = ID_KEY_PASSWORD
    
    staticTextBox
    	id = ID_KEY_EXPLAIN
    	text = "La carte de déverrouillage sera conservée en mémoire jusqu'à ce que " +
		"l'appareil soit éteint ou la carte mémoire retirée."
    	font = "Bort7"
    	left = 16
    	fillToRight = 5
    	positionBelow = ID_KEY_REMEMBER : 1
    	doesNotHaveBorder
                
    container
        # spacer
        positionBelow = ID_KEY_EXPLAIN : 0
        height = 4
        width = 10
    endContainer
endDialog

event EVENT_KEY_DONT_AUTHENTICATE


dialog ID_HOST_KEY_DIALOG
    className = "com.danger.terminal.HostKeyDialog"
    title = "^0"
    leftBorder = 3
    rightBorder = 3
    width = 200
    showCancel

    image
        id = ID_HOST_KEY_IMAGE
        top = 5
        left = 3
        width = 32
        height = 32

    staticTextBox
        id = ID_HOST_KEY_TEXT
        top = 3
        width = 140
        positionToRight = ID_HOST_KEY_IMAGE : 10
        doesNotHaveBorder
        text = "Empreinte digitale clé du serveur (^0) :\n^1"

    button
        title = okButton
        position = buttonBottom1
        event = EVENT_DISMISS_HOST_KEY
        shortcut = doneButton
        initialFocus

    button
        id = ID_HOST_KEY_SAVE_BUTTON
        title = "Enregistrer"
        position = buttonBottom2
        event = EVENT_SAVE_HOST_KEY
endDialog

string STRING_ERASE "Supprimer"
event EVENT_ERASE_HOST_KEY


dialog ID_CHANGED_HOST_KEY_DIALOG
    className = "com.danger.terminal.HostKeyDialog"
    title = "^0: Clé du serveur modifiée."

    leftBorder = 3
    rightBorder = 3
    width = 240
    showCancel

    image
        id = ID_HOST_KEY_IMAGE2
        top = 5
        left = 3
        width = 32
        height = 32

    staticText
        id = ID_HOST_KEY_WARNING
        top = 3
        width = 180
        positionToRight = ID_HOST_KEY_IMAGE2 : 10
        font = boldSysFont
        text = "AVERTISSEMENT :"

    staticTextBox
        id = ID_HOST_KEY_WARNING2
        positionBelow = ID_HOST_KEY_WARNING : 2
        matchWidth = ID_HOST_KEY_WARNING
        positionToRight = ID_HOST_KEY_IMAGE2 : 10
        doesNotHaveBorder
        text = "La clé du serveur est différente de celle enregistrée."
                
    staticTextBox
        id = ID_HOST_KEY_TEXT2
        positionBelow = ID_HOST_KEY_WARNING2 : 6
        matchWidth = ID_HOST_KEY_WARNING
        positionToRight = ID_HOST_KEY_IMAGE2 : 10
        doesNotHaveBorder
        text = "Empreinte digitale clé du serveur (^0) :\n^1"

    button
        title = okButton
        position = buttonBottom1
        event = EVENT_DISMISS_HOST_KEY
        initialFocus

    button
        id = ID_HOST_KEY_SAVE_BUTTON2
        title = "Remplacer"
        position = buttonBottom2
        event = EVENT_SAVE_HOST_KEY
endDialog

event EVENT_REJECT_HOST_KEY


# Session List Screen

menu ID_SERVER_MENU
	menuItem
        title = "Ajouter serveur..."
        event = EVENT_NEW_SERVER
        id = ID_NEW_SERVER
        shortcut = 'N'

    menuItem
        title = "Modifier…"
        event = EVENT_EDIT_SERVER
        id = ID_EDIT_SERVER

	menuItem
		title = "Déplacer…"
		event = EVENT_MOVE_SERVER
		id = ID_MOVE_SERVER
		shortcut = 'O'

    menuItem
        title = "Jeter…"
        event = EVENT_DISCARD_SERVER_DIALOG
        id = ID_DELETE_SERVER

    divider
        id = ID_MENU_DIVIDER

    menuItem
        title = "Ouvrir session"
        event = EVENT_OPEN_SESSION
        id = ID_OPEN_SESSION
        shortcut = returnKey
    
    divider
    
    menuItem
        title = STRING_HELP
        event = EVENT_HELP
        id = ID_HELP
        shortcut = 'H'
endMenu

menu ID_SERVER_CONTEXT_MENU
    menuItem
        title = "Modifier…"
        event = EVENT_EDIT_SERVER
        id = ID_EDIT_SERVER

	menuItem
		title = "Déplacer…"
		event = EVENT_MOVE_SERVER
		id = ID_MOVE_SERVER
		shortcut = 'O'

    menuItem
        title = "Jeter…"
        event = EVENT_DISCARD_SERVER_DIALOG
        id = ID_DELETE_SERVER

    divider
        id = ID_MENU_DIVIDER

    menuItem
        title = "Ouvrir session"
        event = EVENT_OPEN_SESSION
        id = ID_OPEN_SESSION
        shortcut = returnKey

    divider
    
    menuItem
        title = "Aide"
        event = EVENT_HELP
        id = ID_HELP
        shortcut = 'H'
endMenu

menu ID_SESSION_MENU
	menuItem
        title = "Ajouter serveur..."
        event = EVENT_NEW_SERVER
        id = ID_NEW_SERVER
        shortcut = 'N'

    divider
        id = ID_MENU_DIVIDER

    menuItem
        title = "Fermer session"
        event = EVENT_CLOSE_SESSION
        id = ID_CLOSE_SESSION
        shortcut = deleteKey
endMenu

menu ID_SESSION_CONTEXT_MENU
    menuItem
        title = "Fermer session"
        event = EVENT_CLOSE_SESSION
        id = ID_CLOSE_SESSION
        shortcut = deleteKey
endMenu

menu ID_EMPTY_MENU
	menuItem
        title = "Ajouter serveur..."
        event = EVENT_NEW_SERVER
        id = ID_NEW_SERVER
        shortcut = 'N'
endMenu

menu ID_MOVE_MENU
    menuItem
        title = "Placer serveur"
        event = EVENT_PLACE_SERVER
        shortcut = backButton
        id = ID_PLACE_SERVER_ITEM

    menuItem
        title = "Annuler"
        shortcut = cancelButton
        event = EVENT_CANCEL_MOVE
endMenu


alert DIALOG_CONFIRM_DISCARD_SERVER
    title = "Jeter serveur ?"
    text = "Jeter définitivement le serveur \"^0\" ?"
    icon = stopIcon

    button
        title = backButton
        position = buttonBottom1
        shortcut = backButton

    button
        title = discardButton
        id = ID_DISCARD_SERVER_BUTTON
        position = buttonBottom2
        event = EVENT_DISCARD_SERVER
endAlert


screen ID_SESSION_LIST_SCREEN
    title = STRING_TITLE
    icon = ID_SMALL_ICON
#    actionMenu = ID_SESSION_LIST_MENU
    className = "com.danger.terminal.SessionListWindow"

    view
        alignWithParentTop = 0
        alignWithParentLeft = 1
        height = 115
        width = 238
        className = "com.danger.terminal.SessionListView"
        id = ID_SESSION_LIST_VIEW
        initialFocus
        doesNotHaveBorder
        
    button
        positionBelow = ID_SESSION_LIST_VIEW : 3
        alignWithParentLeft = 2
        title = "Ajouter serveur..."
        event = EVENT_NEW_SERVER
endScreen


dialog ID_KEYBOARD_HELP_DIALOG
    title = "Astuces clavier"
    doneEvent = ID_DISMISS_KEYBOARD_HELP_DIALOG
    doneIsDefault
    width = 240

    scrollView
        id = ID_HELP_SCROLLER
        alignWithParentTop = 0
        alignWithParentLeft = 0
        width = 228
        height = 110
        initialFocus

        staticTextBox
            id = ID_HELP_TEXT0
            alignWithParentTop = 0
            alignWithParentLeft = 3
            fillToRight = 0
            doesNotHaveBorder
            text = "Contactez <catalog_support@danger.com>  pour d’obtenir de " +
		"l’assistance à propos de cette application."

        staticTextBox
            id = ID_HELP_TEXT1
            positionBelow = ID_HELP_TEXT0 : 8
            alignWithParentLeft = 3
            fillToRight = 0
            doesNotHaveBorder
            text = "Le Client terminal a quelques raccourcis clavier personnalisés.  " +
		"\uF007 sert de touche de \"Control\" (\uF007 C = " +
		"control-C), et \uF00A sert de touche \"Meta\".  Les " +
		"touches manquantes sont émulées : "

        staticTextBox
            id = ID_HELP_TEXT2
            alignWithParentLeft = 15
            positionBelow = ID_HELP_TEXT1 : 8
            fillToRight = 0
            doesNotHaveBorder
            font = "Fixed6x10"
            text = "TAB       \uF007I  ou  \uF003-espace\nESC       \uF0071 ou \uF0079 " +
		"ou \uF00A\nCtrl-\\    \uF0072\nCtrl-]    \uF0070\nCtrl-^   " +
		" \uF0076\nCtrl-_    \uF007.\nflèches    Pavé directionnel\n" +
		"Accueil      \uF003\uF00B\nFin       \uF003\uF00C\nPgPréc  " +
		"    \uF003\uF004\nPgSuiv      \uF003\uF00D\nF1-F10    " +
		"\uF02C1 à \uF02C0"

        staticTextBox
            id = ID_HELP_TEXT3
            alignWithParentLeft = 3
            positionBelow = ID_HELP_TEXT2 : 8
            fillToRight = 0
            doesNotHaveBorder
            text = "Utilisez \uF00A pour afficher le texte de défilement.\n\uF007 + " +
		"\uF00A permet de faire défiler page par page.\n\uF003 + " +
		"\uF00A permet de passer au début ou à la fin."

        staticTextBox
            id = ID_HELP_TEXT4
            alignWithParentLeft = 3
            positionBelow = ID_HELP_TEXT3 : 8
            fillToRight = 0
            doesNotHaveBorder
            text = "De plus, les boutons latéraux pivotent entre les consoles ouvertes " +
		"et \uF007 \uF002 réinitialise le terminal et efface " +
		"l'écran."

        staticText
            id = ID_HELP_TEXT5
            alignWithParentLeft = 3
            positionBelow = ID_HELP_TEXT4 : 8
            text = "Mode Copier"
            font = boldSysFont

        staticTextBox
            alignWithParentLeft = 3
            positionBelow = ID_HELP_TEXT5 : 8
            fillToRight = 0
            doesNotHaveBorder
            text = "Le mode Copier se comporte comme le mode copier dans 'écran' : " +
		"utilisez D-pad pour trouver le début de la sélection et " +
		"appuyez sur \uF00A (ou barre d'espace) pour la marquer. " +
		"Ensuite, utilisez de nouveau D-pad et le bouton de la " +
		"\uF00A pour trouver et marquer la fin. La zone " +
		"sélectionnée est copiée dans le presse-papiers du système."
    endScrollView
endDialog


dialog ID_ABOUT_DIALOG
    title = "A propos de " + 
		STRING_TITLE
    doneEvent = EVENT_DISMISS_ABOUT
    leftBorder = 5
    rightBorder = 5
    doneIsDefault

    staticTextBox
        id = ID_ABOUT_TEXT1
        top = 0
        left = 0
        widthPct = 100
        doesNotHaveBorder
        text = "^0, de vos amis de Danger."

    image bitmap = ID_ABOUT_SPLASH
        positionBelow = ID_ABOUT_TEXT1 : 3
        centerHorizontally
endDialog


menu ID_PROTOCOL_MENU
    menuItem
        title = "SSH2"
        id = ID_PROTOCOL_SSH2

    menuItem
        title = "Telnet"
        id = ID_PROTOCOL_TELNET

    menuItem
        title = "Raw"
        id = ID_PROTOCOL_RAW
endMenu

dialog ID_CONNECT_DIALOG
    className = "com.danger.terminal.ConnectDialog"
    title = "Ajouter serveur"
    leftBorder = 3
    rightBorder = 3
    center
    showCancel
	widthPct = 100

    labeledGrid
        fillToRight = 0
        left = 3
        top = 3

        row
            staticText
                id = ID_CONNECT_NAME_TEXT
                text = "Nom"
                font = boldSysFont

            textField
                id = ID_CONNECT_NAME
                maxLength = 60
        endRow

        row
            staticText
                id = ID_CONNECT_HOST_TEXT
                text = "Nom d'hôte"
                font = boldSysFont

            textField
                className = "com.danger.terminal.ConnectDialog$HostTextField"
                id = ID_CONNECT_HOST
                maxLength = 60
                initialFocus
        endRow
        
        row dontResizeLeftView
            staticText
                id = ID_CONNECT_PORT_TEXT
                text = "Port"
                font = boldSysFont
            
            textField
                id = ID_CONNECT_PORT
                maxLength = 5
                width = 35
                numericOnly
        endRow

        row dontResizeLeftView
            staticText
                id = ID_CONNECT_PROTOCOL_TEXT
                text = "Protocole"
                font = boldSysFont

            popupMenu
                id = ID_CONNECT_PROTOCOL
                menu = ID_PROTOCOL_MENU
        endRow
    endLabeledGrid
    
    button
        title = "Enregistrer"
        id = ID_CONNECT_BUTTON_SAVE
        position = buttonBottom1
        event = EVENT_SAVE

    button
        title = "Enregistrer et connecter"
        id = ID_CONNECT_BUTTON
        position = buttonBottom2
        shortcut = doneButton
        event = EVENT_CONNECT
endDialog

# alternate title for button
string STRING_CONNECT "Connecter"
event EVENT_PROTOCOL_CHANGED


menu ID_FONT_MENU
    menuItem        title = "Tom Thumb"
    menuItem        title = "Twiggy"
    menuItem        title = "Goldilocks"
    menuItem        title = "Franklin"
    menuItem        title = "Knob 6"
    menuItem        title = "Knob 7"
    menuItem        title = "Knob 9"
    menuItem        title = "Knob 12"
endMenu

# equivalent fonts for the human names above
stringArray FONT_NAMES
    "Fixed4x6"
    "Fixed4x8"
    "Fixed5x7"
    "Fixed6x10"
    "Knob6"
    "Knob7"
    "Knob9"
    "Knob12"
endStringArray

menu ID_CONSOLE_MENU
    menuItem
        title = "Liste de sessions"
        id = ID_CONSOLE_SESSION_LIST
        event = EVENT_SESSION_LIST
        shortcut = backButton

    menuItem
        title = "Fermer ^0"
        id = ID_CONSOLE_CLOSE
        event = EVENT_CLOSE

    divider

    # these are for open settings

    menuItem
        title = "Paramètres du serveur..."
        id = ID_CONSOLE_SETTINGS
        event = EVENT_SETTINGS

    menuItem
        title = "Police"
        id = ID_CONSOLE_FONT_MENU
        event = EVENT_FONT
        subMenu = ID_FONT_MENU

    menuItem
        title = "Mode d'entrée de ligne"
        id = ID_CONSOLE_LINE_ENTRY
        event = EVENT_LINE_ENTRY_MODE
        shortcut = returnKey

    menuItem
        title = "Copier"
        id = ID_CONSOLE_COPY
        event = EVENT_COPY

    menuItem
        title = "Coller"
        id = ID_CONSOLE_PASTE
        event = EVENT_PASTE

    # these are for closed sessions

    menuItem
        title = "Reconnecter"
        id = ID_CONSOLE_RECONNECT
        event = EVENT_RECONNECT

    menuItem
        title = "Effacer écran"
        id = ID_CONSOLE_CLEAR
        event = EVENT_CLEAR_SCREEN

    # always here

    menuItem
        title = STRING_HELP
        id = ID_CONSOLE_HINTS
        event = EVENT_HINTS
endMenu

event EVENT_LINE_ENTRY


menu ID_SETTINGS_MENU
    menuItem        title = "Terminé"          shortcut = backButton           event = EVENT_SETTINGS_DONE
    menuItem        title = "Annuler"        shortcut = cancelButton         event = EVENT_SETTINGS_CANCEL
    textEditMenu
endMenu

menu ID_EMULATOR_MENU
    menuItem        title = "VT100"         id = ID_EMULATE_VT100
    menuItem        title = "ANSI"          id = ID_EMULATE_ANSI
    menuItem        title = "XTerm"         id = ID_EMULATE_XTERM
    menuItem        title = "Linux"         id = ID_EMULATE_LINUX
endMenu

menu ID_CODEC_MENU
    menuItem        title = "Latin-1"       id = ID_CODEC_LATIN1
    menuItem        title = "Latin-9"       id = ID_CODEC_LATIN9
    menuItem        title = "UTF-8"         id = ID_CODEC_UTF8
endMenu


screen ID_SETTINGS_SCREEN
    title = "Paramètres : ^0"
    className = "com.danger.terminal.SettingsScreen"
    actionMenu = ID_SETTINGS_MENU

    scrollView
        id = ID_SETTINGS_SCROLLER
        alignWithParentTop = 0
        alignWithParentLeft = 0
        widthPct = 100
        heightPct = 100

    staticText
        id = ID_SETTINGS_HEADER
        text = "Paramètres de " + 
		STRING_TITLE
        font = boldSysFont
        textColor = 0x006600
        top = 3
        left = 5

    # first, the usual edit-host stuff

    labeledGrid
        positionBelow = ID_SETTINGS_HEADER : 5
        left = 5
        fillToRight = 5

        row
            staticText
                id = ID_SETTINGS_NAME_TEXT
                text = "Nom"
                font = boldSysFont

            textField
                id = ID_SETTINGS_NAME
                className = "com.danger.terminal.SettingsScreen$SessionTextField"
                maxLength = 60
                initialFocus
        endRow

        row
            staticText
                id = ID_SETTINGS_HOST_TEXT
                text = "Nom d'hôte"
                font = boldSysFont

            textField
                className = "com.danger.terminal.SettingsScreen$HostTextField"
                id = ID_SETTINGS_HOST
                maxLength = 60
        endRow

        row
            staticText
                id = ID_SETTINGS_PORT_TEXT
                text = "Port"
                font = boldSysFont
            
            textField
                id = ID_SETTINGS_PORT
                maxLength = 5
                numericOnly
        endRow

        row
            staticText
                id = ID_SETTINGS_USERNAME_TEXT
                text = "Nom d'utilisateur"
                font = boldSysFont

            textField
                className = "com.danger.terminal.SettingsScreen$HostTextField"
                id = ID_SETTINGS_USERNAME
                maxLength = 20
        endRow

        row
            staticText
                id = ID_SETTINGS_PROTOCOL_TEXT
                text = "Protocole"
                font = boldSysFont

            popupMenu
                id = ID_SETTINGS_PROTOCOL
                menu = ID_PROTOCOL_MENU
                event = EVENT_PROTOCOL_MENU
        endRow

        # font selection
        row
            staticText
                id = ID_SETTINGS_FONT_TEXT
                text = "Police"
                font = boldSysFont

            popupMenu
                id = ID_SETTINGS_FONT
                menu = ID_FONT_MENU
        endRow

        row
            staticText
                id = ID_SETTINGS_EMULATOR_TEXT
                text = "Simuler"
                font = boldSysFont

            popupMenu
                id = ID_SETTINGS_EMULATOR
                menu = ID_EMULATOR_MENU
        endRow

        row
            staticText

            # auto-wrap checkbox
            checkBox
                id = ID_SETTINGS_WRAP_CHECKBOX
                title = "Renvoi à la ligne auto."
                multiLine
        endRow

        row
            staticText

            # backspace checkbox
            checkBox
                id = ID_SETTINGS_BACKSPACE_CHECKBOX
                title = "Espacement arrière envoie DEL"
                multiLine
        endRow

    endLabeledGrid

    # scrollback # lines
    textField
        id = ID_SETTINGS_SCROLLBACK
        justifyLeft
        width = 25
        maxLength = 3
        numericOnly
        matchHeight = ID_SETTINGS_NAME
        positionBelow = ID_SETTINGS_BACKSPACE_CHECKBOX : 5
        alignLeft = ID_SETTINGS_NAME

    staticTextBox
        id = ID_SETTINGS_SCROLLBACK_TEXT
        text = "Lignes de texte de défilement"
        font = boldSysFont
        justifyLeft
        fillToRight = 2
        doesNotHaveBorder
        positionBelow = ID_SETTINGS_BACKSPACE_CHECKBOX : 8
        positionToRight = ID_SETTINGS_SCROLLBACK : 5

    # character encoding (latin-1, etc)
    popupMenu
        id = ID_SETTINGS_CODEC
        menu = ID_CODEC_MENU
        matchWidth = ID_SETTINGS_BACKSPACE_CHECKBOX
        matchHeight = ID_SETTINGS_NAME
        positionBelow = ID_SETTINGS_SCROLLBACK_TEXT : 5
        alignLeft = ID_SETTINGS_SCROLLBACK
               
    staticText
        id = ID_SETTINGS_CODEC_TEXT
        text = "Codage"
        font = boldSysFont
        justifyRight
        alignVertical = ID_SETTINGS_CODEC
        alignRight = ID_SETTINGS_NAME_TEXT
        matchHeight = ID_SETTINGS_NAME_TEXT

    shape
        id = ID_SETTINGS_DIVIDER
        type = line
        lineType = horizontal
        left = 0
        positionBelow = ID_SETTINGS_CODEC : 10
        widthPct = 100
        height = 1
        frameColor = 0x006600

    ##########   SSH OPTIONS   ##########

    staticText
        id = ID_SETTINGS_SSH_HEADER
        text = "Paramètres SSH"
        font = boldSysFont
        left = 5
        positionBelow = ID_SETTINGS_DIVIDER : 2
        textColor = 0x006600

    checkBox
        id = ID_SETTINGS_REMEMBER_PASSWORD
        title = "Conserver mot de passe/clé"
        left = 20
        positionBelow = ID_SETTINGS_SSH_HEADER : 5
        matchHeight = ID_SETTINGS_NAME_TEXT

    checkBox
        id = ID_SETTINGS_PREFER_DSS
        title = "Préférer DSS à RSA"
        alignLeft = ID_SETTINGS_REMEMBER_PASSWORD
        positionBelow = ID_SETTINGS_REMEMBER_PASSWORD : 5
        matchHeight = ID_SETTINGS_NAME_TEXT

    button
        id = ID_SETTINGS_KEY_BUTTON
        title = "Afficher la clé du serveur..."
        event = EVENT_VIEW_HOST_KEY
        left = 23
        positionBelow = ID_SETTINGS_PREFER_DSS : 5

    container
        positionBelow = ID_SETTINGS_KEY_BUTTON : 0
        left = 0
        width = 10
        height = 4
        disabled
    endContainer

    endScrollView
endScreen


# new splash screen resource

splashScreen ID_SPLASH_SCREEN_RESOURCE

    image
        bitmap = ID_SPLASH_SCREEN_NO_TITLE
        alignWithParentLeft = 0
        alignWithParentTop = 0
        id = ID_SPLASH_IMAGE

    staticTextBox
        text = ID_APP_SHORT_NAME
        alignWithParentLeft = 2
        alignWithParentTop = 0
        fillToRight = 2
        transparent
        doesNotHaveBorder
        id = ID_NAME_FIELD

endSplashScreen
