#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'tdewalletwizard.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "tdewalletwizard.h"

#include <ntqvariant.h>
#include <tdelocale.h>
#include <ntqpushbutton.h>
#include <ntqwidget.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "tdewalletwizard.ui.h"

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

    page1 = new TQWidget( this, "page1" );
    page1Layout = new TQGridLayout( page1, 1, 1, 11, 6, "page1Layout"); 
    spacer3 = new TQSpacerItem( 21, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    page1Layout->addItem( spacer3, 3, 1 );

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

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

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

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

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

    _basic = new TQRadioButton( buttonGroup1, "_basic" );
    _basic->setChecked( true );

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

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

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

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

    page4 = new TQWidget( this, "page4" );
    page4Layout = new TQGridLayout( page4, 1, 1, 11, 6, "page4Layout"); 

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

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

    page2 = new TQWidget( this, "page2" );
    page2Layout = new TQGridLayout( page2, 1, 1, 11, 6, "page2Layout"); 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    page3 = new TQWidget( this, "page3" );
    page3Layout = new TQGridLayout( page3, 1, 1, 11, 6, "page3Layout"); 

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

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

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

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

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

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

    // signals and slots connections
    connect( _useWallet, TQ_SIGNAL( toggled(bool) ), textLabel1_2, TQ_SLOT( setEnabled(bool) ) );
    connect( _useWallet, TQ_SIGNAL( toggled(bool) ), textLabel2_2, TQ_SLOT( setEnabled(bool) ) );
    connect( _useWallet, TQ_SIGNAL( toggled(bool) ), _pass1, TQ_SLOT( setEnabled(bool) ) );
    connect( _useWallet, TQ_SIGNAL( toggled(bool) ), _pass2, TQ_SLOT( setEnabled(bool) ) );
    connect( _useWallet, TQ_SIGNAL( clicked() ), _pass1, TQ_SLOT( setFocus() ) );
    connect( _useWallet, TQ_SIGNAL( clicked() ), this, TQ_SLOT( passwordPageUpdate() ) );
    connect( _pass1, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( passwordPageUpdate() ) );
    connect( _pass2, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( passwordPageUpdate() ) );
    connect( _advanced, TQ_SIGNAL( clicked() ), this, TQ_SLOT( setAdvanced() ) );
    connect( _basic, TQ_SIGNAL( clicked() ), this, TQ_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
 */
TDEWalletWizard::~TDEWalletWizard()
{
    destroy();
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TDEWalletWizard::languageChange()
{
    setCaption( tr2i18n( "TDE Wallet Wizard" ) );
    textLabel1->setText( tr2i18n( "<u>TDEWallet</u> - The TDE Wallet System" ) );
    textLabel2->setText( tr2i18n( "Welcome to TDEWallet, the TDE Wallet System.  TDEWallet 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 TDEWallet and help you configure it for the first time." ) );
    buttonGroup1->setTitle( TQString::null );
    _basic->setText( tr2i18n( "&Basic setup (recommended)" ) );
    _advanced->setText( tr2i18n( "&Advanced setup" ) );
    setTitle( page1, tr2i18n( "Introduction" ) );
    textLabel2_3->setText( tr2i18n( "The TDE 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 TDE 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 TDE wallet to store my personal information." ) );
    _matchLabel->setText( TQString::null );
    setTitle( page2, tr2i18n( "Password Selection" ) );
    textLabel1_3->setText( tr2i18n( "The TDE 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 TDEWallet 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" ) );
}

/****************************************************************************
** TDEWalletWizard meta object code from reading C++ file 'tdewalletwizard.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "tdewalletwizard.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *TDEWalletWizard::className() const
{
    return "TDEWalletWizard";
}

TQMetaObject *TDEWalletWizard::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_TDEWalletWizard( "TDEWalletWizard", &TDEWalletWizard::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString TDEWalletWizard::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "TDEWalletWizard", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString TDEWalletWizard::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "TDEWalletWizard", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* TDEWalletWizard::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = KWizard::staticMetaObject();
    static const TQUMethod slot_0 = {"setAdvanced", 0, 0 };
    static const TQUMethod slot_1 = {"setBasic", 0, 0 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQUMethod slot_3 = {"passwordPageUpdate", 0, 0 };
    static const TQUMethod slot_4 = {"init", 0, 0 };
    static const TQUMethod slot_5 = {"destroy", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "setAdvanced()", &slot_0, TQMetaData::Public },
	{ "setBasic()", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected },
	{ "passwordPageUpdate()", &slot_3, TQMetaData::Private },
	{ "init()", &slot_4, TQMetaData::Private },
	{ "destroy()", &slot_5, TQMetaData::Private }
    };
    metaObj = TQMetaObject::new_metaobject(
	"TDEWalletWizard", parentObject,
	slot_tbl, 6,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_TDEWalletWizard.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* TDEWalletWizard::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "TDEWalletWizard" ) )
	return this;
    return KWizard::tqt_cast( clname );
}

bool TDEWalletWizard::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setAdvanced(); break;
    case 1: setBasic(); break;
    case 2: languageChange(); break;
    case 3: passwordPageUpdate(); break;
    case 4: init(); break;
    case 5: destroy(); break;
    default:
	return KWizard::tqt_invoke( _id, _o );
    }
    return true;
}

bool TDEWalletWizard::tqt_emit( int _id, TQUObject* _o )
{
    return KWizard::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool TDEWalletWizard::tqt_property( int id, int f, TQVariant* v)
{
    return KWizard::tqt_property( id, f, v);
}

bool TDEWalletWizard::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
