00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
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 "/usr/src/packages/BUILD/kdelibs-3.4.2/kio/misc/kwalletd/kwalletwizard.ui.h"
00027
00028
00029
00030
00031
00032
00033
00034
00035 KWalletWizard::KWalletWizard( QWidget* parent, const char* name, bool modal, WFlags fl )
00036 : QWizard( 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->setTextFormat( QLabel::RichText );
00059 textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00060
00061 page1Layout->addMultiCellWidget( textLabel2, 1, 1, 0, 2 );
00062
00063 buttonGroup1 = new QButtonGroup( page1, "buttonGroup1" );
00064 buttonGroup1->setFrameShape( QButtonGroup::NoFrame );
00065 buttonGroup1->setColumnLayout(0, Qt::Vertical );
00066 buttonGroup1->layout()->setSpacing( 6 );
00067 buttonGroup1->layout()->setMargin( 0 );
00068 buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
00069 buttonGroup1Layout->setAlignment( Qt::AlignTop );
00070
00071 _basic = new QRadioButton( buttonGroup1, "_basic" );
00072 _basic->setChecked( TRUE );
00073
00074 buttonGroup1Layout->addWidget( _basic, 0, 0 );
00075
00076 _advanced = new QRadioButton( buttonGroup1, "_advanced" );
00077
00078 buttonGroup1Layout->addWidget( _advanced, 1, 0 );
00079
00080 page1Layout->addWidget( buttonGroup1, 2, 1 );
00081 spacer2 = new QSpacerItem( 140, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00082 page1Layout->addItem( spacer2, 2, 2 );
00083 spacer1 = new QSpacerItem( 140, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00084 page1Layout->addItem( spacer1, 2, 0 );
00085 addPage( page1, QString("") );
00086
00087 page4 = new QWidget( this, "page4" );
00088 page4Layout = new QGridLayout( page4, 1, 1, 11, 6, "page4Layout");
00089
00090 textLabel2_3 = new QLabel( page4, "textLabel2_3" );
00091 textLabel2_3->setTextFormat( QLabel::RichText );
00092
00093 page4Layout->addWidget( textLabel2_3, 0, 0 );
00094 addPage( page4, QString("") );
00095
00096 page2 = new QWidget( this, "page2" );
00097 page2Layout = new QGridLayout( page2, 1, 1, 11, 6, "page2Layout");
00098
00099 textLabel3 = new QLabel( page2, "textLabel3" );
00100 textLabel3->setTextFormat( QLabel::RichText );
00101
00102 page2Layout->addMultiCellWidget( textLabel3, 0, 0, 0, 2 );
00103
00104 layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
00105
00106 layout5 = new QVBoxLayout( 0, 0, 6, "layout5");
00107
00108 textLabel1_2 = new QLabel( page2, "textLabel1_2" );
00109 textLabel1_2->setEnabled( FALSE );
00110 textLabel1_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00111 layout5->addWidget( textLabel1_2 );
00112
00113 textLabel2_2 = new QLabel( page2, "textLabel2_2" );
00114 textLabel2_2->setEnabled( FALSE );
00115 textLabel2_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00116 layout5->addWidget( textLabel2_2 );
00117 layout7->addLayout( layout5 );
00118
00119 layout4 = new QVBoxLayout( 0, 0, 6, "layout4");
00120
00121 _pass1 = new QLineEdit( page2, "_pass1" );
00122 _pass1->setEnabled( FALSE );
00123 _pass1->setEchoMode( QLineEdit::Password );
00124 layout4->addWidget( _pass1 );
00125
00126 _pass2 = new QLineEdit( page2, "_pass2" );
00127 _pass2->setEnabled( FALSE );
00128 _pass2->setEchoMode( QLineEdit::Password );
00129 layout4->addWidget( _pass2 );
00130 layout7->addLayout( layout4 );
00131
00132 page2Layout->addLayout( layout7, 3, 1 );
00133
00134 _useWallet = new QCheckBox( page2, "_useWallet" );
00135
00136 page2Layout->addMultiCellWidget( _useWallet, 1, 1, 0, 2 );
00137 spacer5 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00138 page2Layout->addItem( spacer5, 2, 1 );
00139 spacer6 = new QSpacerItem( 101, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00140 page2Layout->addItem( spacer6, 3, 2 );
00141 spacer7 = new QSpacerItem( 111, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00142 page2Layout->addItem( spacer7, 3, 0 );
00143 spacer4 = new QSpacerItem( 21, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
00144 page2Layout->addItem( spacer4, 4, 1 );
00145
00146 _matchLabel = new QLabel( page2, "_matchLabel" );
00147 _matchLabel->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignRight ) );
00148
00149 page2Layout->addMultiCellWidget( _matchLabel, 5, 5, 0, 2 );
00150 addPage( page2, QString("") );
00151
00152 page3 = new QWidget( this, "page3" );
00153 page3Layout = new QGridLayout( page3, 1, 1, 11, 6, "page3Layout");
00154
00155 textLabel1_3 = new QLabel( page3, "textLabel1_3" );
00156 textLabel1_3->setTextFormat( QLabel::RichText );
00157 textLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00158
00159 page3Layout->addMultiCellWidget( textLabel1_3, 0, 0, 0, 1 );
00160 spacer8 = new QSpacerItem( 21, 121, QSizePolicy::Minimum, QSizePolicy::Expanding );
00161 page3Layout->addItem( spacer8, 4, 1 );
00162
00163 _networkWallet = new QCheckBox( page3, "_networkWallet" );
00164
00165 page3Layout->addMultiCellWidget( _networkWallet, 3, 3, 0, 1 );
00166
00167 _closeIdle = new QCheckBox( page3, "_closeIdle" );
00168
00169 page3Layout->addWidget( _closeIdle, 2, 0 );
00170 spacer9 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00171 page3Layout->addItem( spacer9, 1, 0 );
00172 addPage( page3, QString("") );
00173 languageChange();
00174 resize( QSize(556, 385).expandedTo(minimumSizeHint()) );
00175 clearWState( WState_Polished );
00176
00177
00178 connect( _useWallet, SIGNAL( toggled(bool) ), textLabel1_2, SLOT( setEnabled(bool) ) );
00179 connect( _useWallet, SIGNAL( toggled(bool) ), textLabel2_2, SLOT( setEnabled(bool) ) );
00180 connect( _useWallet, SIGNAL( toggled(bool) ), _pass1, SLOT( setEnabled(bool) ) );
00181 connect( _useWallet, SIGNAL( toggled(bool) ), _pass2, SLOT( setEnabled(bool) ) );
00182 connect( _useWallet, SIGNAL( clicked() ), _pass1, SLOT( setFocus() ) );
00183 connect( _useWallet, SIGNAL( clicked() ), this, SLOT( passwordPageUpdate() ) );
00184 connect( _pass1, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
00185 connect( _pass2, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
00186 connect( _advanced, SIGNAL( clicked() ), this, SLOT( setAdvanced() ) );
00187 connect( _basic, SIGNAL( clicked() ), this, SLOT( setBasic() ) );
00188
00189
00190 setTabOrder( _basic, _advanced );
00191 setTabOrder( _advanced, _useWallet );
00192 setTabOrder( _useWallet, _pass1 );
00193 setTabOrder( _pass1, _pass2 );
00194
00195
00196 textLabel1_2->setBuddy( _pass1 );
00197 textLabel2_2->setBuddy( _pass2 );
00198 init();
00199 }
00200
00201
00202
00203
00204 KWalletWizard::~KWalletWizard()
00205 {
00206 destroy();
00207
00208 }
00209
00210
00211
00212
00213
00214 void KWalletWizard::languageChange()
00215 {
00216 setCaption( tr2i18n( "KDE Wallet Wizard" ) );
00217 textLabel1->setText( tr2i18n( "<u>KWallet</u> - The KDE Wallet System" ) );
00218 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." ) );
00219 buttonGroup1->setTitle( QString::null );
00220 _basic->setText( tr2i18n( "&Basic setup (recommended)" ) );
00221 _advanced->setText( tr2i18n( "&Advanced setup" ) );
00222 setTitle( page1, tr2i18n( "Introduction" ) );
00223 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." ) );
00224 setTitle( page4, tr2i18n( "Information" ) );
00225 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." ) );
00226 textLabel1_2->setText( tr2i18n( "Enter a new password:" ) );
00227 textLabel2_2->setText( tr2i18n( "Verify password:" ) );
00228 _useWallet->setText( tr2i18n( "Yes, I wish to use the KDE wallet to store my personal information." ) );
00229 _matchLabel->setText( QString::null );
00230 setTitle( page2, tr2i18n( "Password Selection" ) );
00231 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." ) );
00232 _networkWallet->setText( tr2i18n( "Store network passwords and local passwords in separate wallet files" ) );
00233 _closeIdle->setText( tr2i18n( "Automatically close idle wallets" ) );
00234 setTitle( page3, tr2i18n( "Security Level" ) );
00235 }
00236
00237 #include "kwalletwizard.moc"