<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="password" xml:lang="ja">
  <info>
    <link type="guide" xref="index#dialogs"/>
    <desc><cmd>--password</cmd> オプションの使用</desc>
  
    <mal:credit xmlns:mal="http://projectmallard.org/1.0/" type="translator copyright">
      <mal:name>赤星　柔充</mal:name>
      <mal:email>yasumichi@vinelinux.org</mal:email>
      <mal:years>2011,2012</mal:years>
    </mal:credit>
  </info>
  <title>パスワードダイアログ</title>
  <p>パスワードダイアログを作成するには、<cmd>--password</cmd> というオプションを使ってください。</p>
  <p>パスワードダイアログは、以下のオプションをサポートしています。</p>

  <terms>
    <item>
      <title><cmd>--username</cmd></title>
      <p>ユーザー名入力欄を表示します。</p>
    </item>
  </terms>

  <p>以下のスクリプトの例でパスワードダイアログの作成方法を示します。</p>

<code>
#!/bin/sh

ENTRY=`zenity --password --username`

case $? in
         0)
	 	echo "ユーザー名: `echo $ENTRY | cut -d'|' -f1`"
	 	echo "パスワード: `echo $ENTRY | cut -d'|' -f2`"
		;;
         1)
                echo "ログインを中止しました。";;
        -1)
                echo "予期せぬエラーが発生しました。";;
esac
</code>

  <figure>
    <title>パスワード入力ダイアログの例</title>
    <desc><app>Zenity</app> パスワード入力ダイアログの例</desc>
    <media type="image" mime="image/png" src="figures/zenity-password-screenshot.png"/>
  </figure>

</page>
