kio Library API Documentation

kwalletwizard.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './kwalletwizard.ui'
00005 **
00006 ** Created: Sat Jul 2 12:47:35 2005
00007 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
00008 **
00009 ** WARNING! All changes made in this file will be lost!
00010 ****************************************************************************/
00011 
00012 #include "kwalletwizard.h"
00013 
00014 #include <qvariant.h>
00015 #include <klocale.h>
00016 #include <qpushbutton.h>
00017 #include <qwidget.h>
00018 #include <qlabel.h>
00019 #include <qbuttongroup.h>
00020 #include <qradiobutton.h>
00021 #include <qlineedit.h>
00022 #include <qcheckbox.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026 #include "./kwalletwizard.ui.h"
00027 
00028 /*
00029  *  Constructs a KWalletWizard as a child of 'parent', with the
00030  *  name 'name' and widget flags set to 'f'.
00031  *
00032  *  The wizard will by default be modeless, unless you set 'modal' to
00033  *  TRUE to construct a modal wizard.
00034  */
00035 KWalletWizard::KWalletWizard( QWidget* parent, const char* name, bool modal, WFlags fl )
00036     : KWizard( parent, name, modal, fl )
00037 {
00038     if ( !name )
00039     setName( "KWalletWizard" );
00040 
00041     page1 = new QWidget( this, "page1" );
00042     page1Layout = new QGridLayout( page1, 1, 1, 11, 6, "page1Layout"); 
00043     spacer3 = new QSpacerItem( 21, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
00044     page1Layout->addItem( spacer3, 3, 1 );
00045 
00046     textLabel1 = new QLabel( page1, "textLabel1" );
00047     QFont textLabel1_font(  textLabel1->font() );
00048     textLabel1_font.setPointSize( 20 );
00049     textLabel1->setFont( textLabel1_font ); 
00050     textLabel1->setTextFormat( QLabel::RichText );
00051     textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00052 
00053     page1Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 2 );
00054 
00055     textLabel2 = new QLabel( page1, "textLabel2" );
00056     textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 2, textLabel2->sizePolicy().hasHeightForWidth() ) );
00057     textLabel2->setMargin( 26 );
00058     textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00059 
00060     page1Layout->addMultiCellWidget( textLabel2, 1, 1, 0, 2 );
00061 
00062     buttonGroup1 = new QButtonGroup( page1, "buttonGroup1" );
00063     buttonGroup1->setFrameShape( QButtonGroup::NoFrame );
00064     buttonGroup1->setColumnLayout(0, Qt::Vertical );
00065     buttonGroup1->layout()->setSpacing( 6 );
00066     buttonGroup1->layout()->setMargin( 0 );
00067     buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
00068     buttonGroup1Layout->setAlignment( Qt::AlignTop );
00069 
00070     _basic = new QRadioButton( buttonGroup1, "_basic" );
00071     _basic->setChecked( TRUE );
00072 
00073     buttonGroup1Layout->addWidget( _basic, 0, 0 );
00074 
00075     _advanced = new QRadioButton( buttonGroup1, "_advanced" );
00076 
00077     buttonGroup1Layout->addWidget( _advanced, 1, 0 );
00078 
00079     page1Layout->addWidget( buttonGroup1, 2, 1 );
00080     spacer2 = new QSpacerItem( 140, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00081     page1Layout->addItem( spacer2, 2, 2 );
00082     spacer1 = new QSpacerItem( 140, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00083     page1Layout->addItem( spacer1, 2, 0 );
00084     addPage( page1, QString("") );
00085 
00086     page4 = new QWidget( this, "page4" );
00087     page4Layout = new QGridLayout( page4, 1, 1, 11, 6, "page4Layout"); 
00088 
00089     textLabel2_3 = new QLabel( page4, "textLabel2_3" );
00090 
00091     page4Layout->addWidget( textLabel2_3, 0, 0 );
00092     addPage( page4, QString("") );
00093 
00094     page2 = new QWidget( this, "page2" );
00095     page2Layout = new QGridLayout( page2, 1, 1, 11, 6, "page2Layout"); 
00096 
00097     textLabel3 = new QLabel( page2, "textLabel3" );
00098 
00099     page2Layout->addMultiCellWidget( textLabel3, 0, 0, 0, 2 );
00100 
00101     layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); 
00102 
00103     layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 
00104 
00105     textLabel1_2 = new QLabel( page2, "textLabel1_2" );
00106     textLabel1_2->setEnabled( FALSE );
00107     textLabel1_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00108     layout5->addWidget( textLabel1_2 );
00109 
00110     textLabel2_2 = new QLabel( page2, "textLabel2_2" );
00111     textLabel2_2->setEnabled( FALSE );
00112     textLabel2_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00113     layout5->addWidget( textLabel2_2 );
00114     layout7->addLayout( layout5 );
00115 
00116     layout4 = new QVBoxLayout( 0, 0, 6, "layout4"); 
00117 
00118     _pass1 = new QLineEdit( page2, "_pass1" );
00119     _pass1->setEnabled( FALSE );
00120     _pass1->setEchoMode( QLineEdit::Password );
00121     layout4->addWidget( _pass1 );
00122 
00123     _pass2 = new QLineEdit( page2, "_pass2" );
00124     _pass2->setEnabled( FALSE );
00125     _pass2->setEchoMode( QLineEdit::Password );
00126     layout4->addWidget( _pass2 );
00127     layout7->addLayout( layout4 );
00128 
00129     page2Layout->addLayout( layout7, 3, 1 );
00130 
00131     _useWallet = new QCheckBox( page2, "_useWallet" );
00132 
00133     page2Layout->addMultiCellWidget( _useWallet, 1, 1, 0, 2 );
00134     spacer5 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00135     page2Layout->addItem( spacer5, 2, 1 );
00136     spacer6 = new QSpacerItem( 101, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00137     page2Layout->addItem( spacer6, 3, 2 );
00138     spacer7 = new QSpacerItem( 111, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00139     page2Layout->addItem( spacer7, 3, 0 );
00140     spacer4 = new QSpacerItem( 21, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
00141     page2Layout->addItem( spacer4, 4, 1 );
00142 
00143     _matchLabel = new QLabel( page2, "_matchLabel" );
00144     _matchLabel->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignRight ) );
00145 
00146     page2Layout->addMultiCellWidget( _matchLabel, 5, 5, 0, 2 );
00147     addPage( page2, QString("") );
00148 
00149     page3 = new QWidget( this, "page3" );
00150     page3Layout = new QGridLayout( page3, 1, 1, 11, 6, "page3Layout"); 
00151 
00152     textLabel1_3 = new QLabel( page3, "textLabel1_3" );
00153     textLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00154 
00155     page3Layout->addMultiCellWidget( textLabel1_3, 0, 0, 0, 1 );
00156     spacer8 = new QSpacerItem( 21, 121, QSizePolicy::Minimum, QSizePolicy::Expanding );
00157     page3Layout->addItem( spacer8, 4, 1 );
00158 
00159     _networkWallet = new QCheckBox( page3, "_networkWallet" );
00160 
00161     page3Layout->addMultiCellWidget( _networkWallet, 3, 3, 0, 1 );
00162 
00163     _closeIdle = new QCheckBox( page3, "_closeIdle" );
00164 
00165     page3Layout->addWidget( _closeIdle, 2, 0 );
00166     spacer9 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00167     page3Layout->addItem( spacer9, 1, 0 );
00168     addPage( page3, QString("") );
00169     languageChange();
00170     resize( QSize(556, 385).expandedTo(minimumSizeHint()) );
00171     clearWState( WState_Polished );
00172 
00173     // signals and slots connections
00174     connect( _useWallet, SIGNAL( toggled(bool) ), textLabel1_2, SLOT( setEnabled(bool) ) );
00175     connect( _useWallet, SIGNAL( toggled(bool) ), textLabel2_2, SLOT( setEnabled(bool) ) );
00176     connect( _useWallet, SIGNAL( toggled(bool) ), _pass1, SLOT( setEnabled(bool) ) );
00177     connect( _useWallet, SIGNAL( toggled(bool) ), _pass2, SLOT( setEnabled(bool) ) );
00178     connect( _useWallet, SIGNAL( clicked() ), _pass1, SLOT( setFocus() ) );
00179     connect( _useWallet, SIGNAL( clicked() ), this, SLOT( passwordPageUpdate() ) );
00180     connect( _pass1, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
00181     connect( _pass2, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
00182     connect( _advanced, SIGNAL( clicked() ), this, SLOT( setAdvanced() ) );
00183     connect( _basic, SIGNAL( clicked() ), this, SLOT( setBasic() ) );
00184 
00185     // tab order
00186     setTabOrder( _basic, _advanced );
00187     setTabOrder( _advanced, _useWallet );
00188     setTabOrder( _useWallet, _pass1 );
00189     setTabOrder( _pass1, _pass2 );
00190 
00191     // buddies
00192     textLabel1_2->setBuddy( _pass1 );
00193     textLabel2_2->setBuddy( _pass2 );
00194     init();
00195 }
00196 
00197 /*
00198  *  Destroys the object and frees any allocated resources
00199  */
00200 KWalletWizard::~KWalletWizard()
00201 {
00202     destroy();
00203     // no need to delete child widgets, Qt does it all for us
00204 }
00205 
00206 /*
00207  *  Sets the strings of the subwidgets using the current
00208  *  language.
00209  */
00210 void KWalletWizard::languageChange()
00211 {
00212     setCaption( tr2i18n( "KDE Wallet Wizard" ) );
00213     textLabel1->setText( tr2i18n( "<u>KWallet</u> - The KDE Wallet System" ) );
00214     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." ) );
00215     buttonGroup1->setTitle( QString::null );
00216     _basic->setText( tr2i18n( "&Basic setup (recommended)" ) );
00217     _advanced->setText( tr2i18n( "&Advanced setup" ) );
00218     setTitle( page1, tr2i18n( "Introduction" ) );
00219     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." ) );
00220     setTitle( page4, tr2i18n( "Information" ) );
00221     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." ) );
00222     textLabel1_2->setText( tr2i18n( "Enter a new password:" ) );
00223     textLabel2_2->setText( tr2i18n( "Verify password:" ) );
00224     _useWallet->setText( tr2i18n( "Yes, I wish to use the KDE wallet to store my personal information." ) );
00225     _matchLabel->setText( QString::null );
00226     setTitle( page2, tr2i18n( "Password Selection" ) );
00227     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." ) );
00228     _networkWallet->setText( tr2i18n( "Store network passwords and local passwords in separate wallet files" ) );
00229     _closeIdle->setText( tr2i18n( "Automatically close idle wallets" ) );
00230     setTitle( page3, tr2i18n( "Security Level" ) );
00231 }
00232 
00233 #include "kwalletwizard.moc"
KDE Logo
This file is part of the documentation for kio Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jul 2 13:05:54 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003