#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/kio/misc/kwalletd/kwalletwizard.ui'
**
** Created by User Interface Compiler
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kwalletwizard.h"

#include <qvariant.h>
#include <klocale.h>
#include <qpushbutton.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include "/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/kio/misc/kwalletd/kwalletwizard.ui.h"

/*
 *  Constructs a KWalletWizard as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The wizard will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal wizard.
 */
KWalletWizard::KWalletWizard( QWidget* parent, const char* name, bool modal, WFlags fl )
    : KWizard( parent, name, modal, fl )
{
    if ( !name )
	setName( "KWalletWizard" );

    page1 = new QWidget( this, "page1" );
    page1Layout = new QGridLayout( page1, 1, 1, 11, 6, "page1Layout"); 
    spacer3 = new QSpacerItem( 21, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
    page1Layout->addItem( spacer3, 3, 1 );

    textLabel1 = new QLabel( page1, "textLabel1" );
    QFont textLabel1_font(  textLabel1->font() );
    textLabel1_font.setPointSize( 20 );
    textLabel1->setFont( textLabel1_font ); 
    textLabel1->setTextFormat( QLabel::RichText );
    textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );

    page1Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 2 );

    textLabel2 = new QLabel( page1, "textLabel2" );
    textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 2, textLabel2->sizePolicy().hasHeightForWidth() ) );
    textLabel2->setMargin( 26 );
    textLabel2->setTextFormat( QLabel::RichText );
    textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );

    page1Layout->addMultiCellWidget( textLabel2, 1, 1, 0, 2 );

    buttonGroup1 = new QButtonGroup( page1, "buttonGroup1" );
    buttonGroup1->setFrameShape( QButtonGroup::NoFrame );
    buttonGroup1->setColumnLayout(0, Qt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 0 );
    buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( Qt::AlignTop );

    _basic = new QRadioButton( buttonGroup1, "_basic" );
    _basic->setChecked( TRUE );

    buttonGroup1Layout->addWidget( _basic, 0, 0 );

    _advanced = new QRadioButton( buttonGroup1, "_advanced" );

    buttonGroup1Layout->addWidget( _advanced, 1, 0 );

    page1Layout->addWidget( buttonGroup1, 2, 1 );
    spacer2 = new QSpacerItem( 140, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    page1Layout->addItem( spacer2, 2, 2 );
    spacer1 = new QSpacerItem( 140, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
    page1Layout->addItem( spacer1, 2, 0 );
    addPage( page1, QString("") );

    page4 = new QWidget( this, "page4" );
    page4Layout = new QGridLayout( page4, 1, 1, 11, 6, "page4Layout"); 

    textLabel2_3 = new QLabel( page4, "textLabel2_3" );
    textLabel2_3->setTextFormat( QLabel::RichText );

    page4Layout->addWidget( textLabel2_3, 0, 0 );
    addPage( page4, QString("") );

    page2 = new QWidget( this, "page2" );
    page2Layout = new QGridLayout( page2, 1, 1, 11, 6, "page2Layout"); 

    textLabel3 = new QLabel( page2, "textLabel3" );
    textLabel3->setTextFormat( QLabel::RichText );

    page2Layout->addMultiCellWidget( textLabel3, 0, 0, 0, 2 );

    layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 

    layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 

    textLabel1_2 = new QLabel( page2, "textLabel1_2" );
    textLabel1_2->setEnabled( FALSE );
    textLabel1_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
    layout5->addWidget( textLabel1_2 );

    textLabel2_2 = new QLabel( page2, "textLabel2_2" );
    textLabel2_2->setEnabled( FALSE );
    textLabel2_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
    layout5->addWidget( textLabel2_2 );
    layout7->addLayout( layout5 );

    layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); 

    _pass1 = new QLineEdit( page2, "_pass1" );
    _pass1->setEnabled( FALSE );
    _pass1->setEchoMode( QLineEdit::Password );
    layout4->addWidget( _pass1 );

    _pass2 = new QLineEdit( page2, "_pass2" );
    _pass2->setEnabled( FALSE );
    _pass2->setEchoMode( QLineEdit::Password );
    layout4->addWidget( _pass2 );
    layout7->addLayout( layout4 );

    page2Layout->addLayout( layout7, 3, 1 );

    _useWallet = new QCheckBox( page2, "_useWallet" );

    page2Layout->addMultiCellWidget( _useWallet, 1, 1, 0, 2 );
    spacer5 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
    page2Layout->addItem( spacer5, 2, 1 );
    spacer6 = new QSpacerItem( 101, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    page2Layout->addItem( spacer6, 3, 2 );
    spacer7 = new QSpacerItem( 111, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
    page2Layout->addItem( spacer7, 3, 0 );
    spacer4 = new QSpacerItem( 21, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
    page2Layout->addItem( spacer4, 4, 1 );

    _matchLabel = new QLabel( page2, "_matchLabel" );
    _matchLabel->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignRight ) );

    page2Layout->addMultiCellWidget( _matchLabel, 5, 5, 0, 2 );
    addPage( page2, QString("") );

    page3 = new QWidget( this, "page3" );
    page3Layout = new QGridLayout( page3, 1, 1, 11, 6, "page3Layout"); 

    textLabel1_3 = new QLabel( page3, "textLabel1_3" );
    textLabel1_3->setTextFormat( QLabel::RichText );
    textLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );

    page3Layout->addMultiCellWidget( textLabel1_3, 0, 0, 0, 1 );
    spacer8 = new QSpacerItem( 21, 121, QSizePolicy::Minimum, QSizePolicy::Expanding );
    page3Layout->addItem( spacer8, 4, 1 );

    _networkWallet = new QCheckBox( page3, "_networkWallet" );

    page3Layout->addMultiCellWidget( _networkWallet, 3, 3, 0, 1 );

    _closeIdle = new QCheckBox( page3, "_closeIdle" );

    page3Layout->addWidget( _closeIdle, 2, 0 );
    spacer9 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
    page3Layout->addItem( spacer9, 1, 0 );
    addPage( page3, QString("") );
    languageChange();
    resize( QSize(556, 385).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( _useWallet, SIGNAL( toggled(bool) ), textLabel1_2, SLOT( setEnabled(bool) ) );
    connect( _useWallet, SIGNAL( toggled(bool) ), textLabel2_2, SLOT( setEnabled(bool) ) );
    connect( _useWallet, SIGNAL( toggled(bool) ), _pass1, SLOT( setEnabled(bool) ) );
    connect( _useWallet, SIGNAL( toggled(bool) ), _pass2, SLOT( setEnabled(bool) ) );
    connect( _useWallet, SIGNAL( clicked() ), _pass1, SLOT( setFocus() ) );
    connect( _useWallet, SIGNAL( clicked() ), this, SLOT( passwordPageUpdate() ) );
    connect( _pass1, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
    connect( _pass2, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
    connect( _advanced, SIGNAL( clicked() ), this, SLOT( setAdvanced() ) );
    connect( _basic, SIGNAL( clicked() ), this, SLOT( setBasic() ) );

    // tab order
    setTabOrder( _basic, _advanced );
    setTabOrder( _advanced, _useWallet );
    setTabOrder( _useWallet, _pass1 );
    setTabOrder( _pass1, _pass2 );

    // buddies
    textLabel1_2->setBuddy( _pass1 );
    textLabel2_2->setBuddy( _pass2 );
    init();
}

/*
 *  Destroys the object and frees any allocated resources
 */
KWalletWizard::~KWalletWizard()
{
    destroy();
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KWalletWizard::languageChange()
{
    setCaption( tr2i18n( "KDE Wallet Wizard" ) );
    textLabel1->setText( tr2i18n( "<u>KWallet</u> - The KDE Wallet System" ) );
    textLabel2->setText( tr2i18n( "Welcome to KWallet, the KDE Wallet System.  KWallet allows you to store your passwords and other personal information on disk in an encrypted file, preventing others from viewing the information.  This wizard will tell you about KWallet and help you configure it for the first time." ) );
    buttonGroup1->setTitle( QString::null );
    _basic->setText( tr2i18n( "&Basic setup (recommended)" ) );
    _advanced->setText( tr2i18n( "&Advanced setup" ) );
    setTitle( page1, tr2i18n( "Introduction" ) );
    textLabel2_3->setText( tr2i18n( "The KDE Wallet system stores your data in a <i>wallet</i> file on your local hard disk.  The data is only written in encrypted form, presently using the blowfish algorithm with your password as the key.  When a wallet is opened, the wallet manager application will launch and display an icon in the system tray.  You can use this application to manage your wallets.  It even permits you to drag wallets and wallet contents, allowing you to easily copy a wallet to a remote system." ) );
    setTitle( page4, tr2i18n( "Information" ) );
    textLabel3->setText( tr2i18n( "Various applications may attempt to use the KDE wallet to store passwords or other information such as web form data and cookies.  If you would like these applications to use the wallet, you must enable it now and choose a password.  The password you choose <i>cannot</i> be recovered if it is lost, and will allow anyone who knows it to obtain all the information contained in the wallet." ) );
    textLabel1_2->setText( tr2i18n( "Enter a new password:" ) );
    textLabel2_2->setText( tr2i18n( "Verify password:" ) );
    _useWallet->setText( tr2i18n( "Yes, I wish to use the KDE wallet to store my personal information." ) );
    _matchLabel->setText( QString::null );
    setTitle( page2, tr2i18n( "Password Selection" ) );
    textLabel1_3->setText( tr2i18n( "The KDE Wallet system allows you to control the level of security of your personal data.  Some of these settings do impact usability.  While the default settings are generally acceptable for most users, you may wish to change some of them.  You may further tune these settings from the KWallet control module." ) );
    _networkWallet->setText( tr2i18n( "Store network passwords and local passwords in separate wallet files" ) );
    _closeIdle->setText( tr2i18n( "Automatically close idle wallets" ) );
    setTitle( page3, tr2i18n( "Security Level" ) );
}

#include "kwalletwizard.moc"
