00001 #include <klocale.h>
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "kwalletwizard.h"
00012
00013 #include <qvariant.h>
00014 #include <klocale.h>
00015 #include <qpushbutton.h>
00016 #include <qwidget.h>
00017 #include <qlabel.h>
00018 #include <qbuttongroup.h>
00019 #include <qradiobutton.h>
00020 #include <qlineedit.h>
00021 #include <qcheckbox.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include "./kwalletwizard.ui.h"
00026
00027
00028
00029
00030
00031
00032
00033
00034 KWalletWizard::KWalletWizard( QWidget* parent, const char* name, bool modal, WFlags fl )
00035 : QWizard( parent, name, modal, fl )
00036 {
00037 if ( !name )
00038 setName( "KWalletWizard" );
00039
00040 page1 = new QWidget( this, "page1" );
00041 page1Layout = new QGridLayout( page1, 1, 1, 11, 6, "page1Layout");
00042 QSpacerItem* spacer = new QSpacerItem( 21, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
00043 page1Layout->addItem( spacer, 3, 1 );
00044
00045 textLabel1 = new QLabel( page1, "textLabel1" );
00046 QFont textLabel1_font( textLabel1->font() );
00047 textLabel1_font.setPointSize( 20 );
00048 textLabel1->setFont( textLabel1_font );
00049 textLabel1->setTextFormat( QLabel::RichText );
00050 textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
00051
00052 page1Layout->addMultiCellWidget( textLabel1, 0, 0, 0, 2 );
00053
00054 textLabel2 = new QLabel( page1, "textLabel2" );
00055 textLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 2, textLabel2->sizePolicy().hasHeightForWidth() ) );
00056 textLabel2->setMargin( 43 );
00057 textLabel2->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00058
00059 page1Layout->addMultiCellWidget( textLabel2, 1, 1, 0, 2 );
00060
00061 buttonGroup1 = new QButtonGroup( page1, "buttonGroup1" );
00062 buttonGroup1->setFrameShape( QButtonGroup::NoFrame );
00063 buttonGroup1->setColumnLayout(0, Qt::Vertical );
00064 buttonGroup1->layout()->setSpacing( 6 );
00065 buttonGroup1->layout()->setMargin( 0 );
00066 buttonGroup1Layout = new QGridLayout( buttonGroup1->layout() );
00067 buttonGroup1Layout->setAlignment( Qt::AlignTop );
00068
00069 _basic = new QRadioButton( buttonGroup1, "_basic" );
00070 _basic->setChecked( TRUE );
00071
00072 buttonGroup1Layout->addWidget( _basic, 0, 0 );
00073
00074 _advanced = new QRadioButton( buttonGroup1, "_advanced" );
00075
00076 buttonGroup1Layout->addWidget( _advanced, 1, 0 );
00077
00078 page1Layout->addWidget( buttonGroup1, 2, 1 );
00079 QSpacerItem* spacer_2 = new QSpacerItem( 140, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00080 page1Layout->addItem( spacer_2, 2, 2 );
00081 QSpacerItem* spacer_3 = new QSpacerItem( 140, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00082 page1Layout->addItem( spacer_3, 2, 0 );
00083 addPage( page1, QString("") );
00084
00085 page4 = new QWidget( this, "page4" );
00086 page4Layout = new QGridLayout( page4, 1, 1, 11, 6, "page4Layout");
00087
00088 textLabel2_3 = new QLabel( page4, "textLabel2_3" );
00089
00090 page4Layout->addWidget( textLabel2_3, 0, 0 );
00091 addPage( page4, QString("") );
00092
00093 page2 = new QWidget( this, "page2" );
00094 page2Layout = new QGridLayout( page2, 1, 1, 11, 6, "page2Layout");
00095
00096 textLabel3 = new QLabel( page2, "textLabel3" );
00097
00098 page2Layout->addMultiCellWidget( textLabel3, 0, 0, 0, 2 );
00099
00100 layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
00101
00102 layout5 = new QVBoxLayout( 0, 0, 6, "layout5");
00103
00104 textLabel1_2 = new QLabel( page2, "textLabel1_2" );
00105 textLabel1_2->setEnabled( FALSE );
00106 textLabel1_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00107 layout5->addWidget( textLabel1_2 );
00108
00109 textLabel2_2 = new QLabel( page2, "textLabel2_2" );
00110 textLabel2_2->setEnabled( FALSE );
00111 textLabel2_2->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) );
00112 layout5->addWidget( textLabel2_2 );
00113 layout7->addLayout( layout5 );
00114
00115 layout4 = new QVBoxLayout( 0, 0, 6, "layout4");
00116
00117 _pass1 = new QLineEdit( page2, "_pass1" );
00118 _pass1->setEnabled( FALSE );
00119 _pass1->setEchoMode( QLineEdit::Password );
00120 layout4->addWidget( _pass1 );
00121
00122 _pass2 = new QLineEdit( page2, "_pass2" );
00123 _pass2->setEnabled( FALSE );
00124 _pass2->setEchoMode( QLineEdit::Password );
00125 layout4->addWidget( _pass2 );
00126 layout7->addLayout( layout4 );
00127
00128 page2Layout->addLayout( layout7, 3, 1 );
00129
00130 _useWallet = new QCheckBox( page2, "_useWallet" );
00131
00132 page2Layout->addMultiCellWidget( _useWallet, 1, 1, 0, 2 );
00133 QSpacerItem* spacer_4 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00134 page2Layout->addItem( spacer_4, 2, 1 );
00135 QSpacerItem* spacer_5 = new QSpacerItem( 101, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00136 page2Layout->addItem( spacer_5, 3, 2 );
00137 QSpacerItem* spacer_6 = new QSpacerItem( 111, 31, QSizePolicy::Expanding, QSizePolicy::Minimum );
00138 page2Layout->addItem( spacer_6, 3, 0 );
00139 QSpacerItem* spacer_7 = new QSpacerItem( 21, 70, QSizePolicy::Minimum, QSizePolicy::Expanding );
00140 page2Layout->addItem( spacer_7, 4, 1 );
00141
00142 _matchLabel = new QLabel( page2, "_matchLabel" );
00143 _matchLabel->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter | QLabel::AlignRight ) );
00144
00145 page2Layout->addMultiCellWidget( _matchLabel, 5, 5, 0, 2 );
00146 addPage( page2, QString("") );
00147
00148 page3 = new QWidget( this, "page3" );
00149 page3Layout = new QGridLayout( page3, 1, 1, 11, 6, "page3Layout");
00150
00151 textLabel1_3 = new QLabel( page3, "textLabel1_3" );
00152 textLabel1_3->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
00153
00154 page3Layout->addMultiCellWidget( textLabel1_3, 0, 0, 0, 1 );
00155 QSpacerItem* spacer_8 = new QSpacerItem( 21, 121, QSizePolicy::Minimum, QSizePolicy::Expanding );
00156 page3Layout->addItem( spacer_8, 4, 1 );
00157
00158 _networkWallet = new QCheckBox( page3, "_networkWallet" );
00159
00160 page3Layout->addMultiCellWidget( _networkWallet, 3, 3, 0, 1 );
00161
00162 _closeIdle = new QCheckBox( page3, "_closeIdle" );
00163
00164 page3Layout->addWidget( _closeIdle, 2, 0 );
00165 QSpacerItem* spacer_9 = new QSpacerItem( 21, 51, QSizePolicy::Minimum, QSizePolicy::Expanding );
00166 page3Layout->addItem( spacer_9, 1, 0 );
00167 addPage( page3, QString("") );
00168 languageChange();
00169 resize( QSize(732, 484).expandedTo(minimumSizeHint()) );
00170 clearWState( WState_Polished );
00171
00172
00173 connect( _useWallet, SIGNAL( toggled(bool) ), textLabel1_2, SLOT( setEnabled(bool) ) );
00174 connect( _useWallet, SIGNAL( toggled(bool) ), textLabel2_2, SLOT( setEnabled(bool) ) );
00175 connect( _useWallet, SIGNAL( toggled(bool) ), _pass1, SLOT( setEnabled(bool) ) );
00176 connect( _useWallet, SIGNAL( toggled(bool) ), _pass2, SLOT( setEnabled(bool) ) );
00177 connect( _useWallet, SIGNAL( clicked() ), _pass1, SLOT( setFocus() ) );
00178 connect( _useWallet, SIGNAL( clicked() ), this, SLOT( passwordPageUpdate() ) );
00179 connect( _pass1, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
00180 connect( _pass2, SIGNAL( textChanged(const QString&) ), this, SLOT( passwordPageUpdate() ) );
00181 connect( _advanced, SIGNAL( clicked() ), this, SLOT( setAdvanced() ) );
00182 connect( _basic, SIGNAL( clicked() ), this, SLOT( setBasic() ) );
00183
00184
00185 setTabOrder( _basic, _advanced );
00186 setTabOrder( _advanced, _useWallet );
00187 setTabOrder( _useWallet, _pass1 );
00188 setTabOrder( _pass1, _pass2 );
00189
00190
00191 textLabel1_2->setBuddy( _pass1 );
00192 textLabel2_2->setBuddy( _pass2 );
00193 init();
00194 }
00195
00196
00197
00198
00199 KWalletWizard::~KWalletWizard()
00200 {
00201 destroy();
00202
00203 }
00204
00205
00206
00207
00208
00209 void KWalletWizard::languageChange()
00210 {
00211 setCaption( tr2i18n( "KDE Wallet Wizard" ) );
00212 textLabel1->setText( tr2i18n( "<u>KWallet</u> - The KDE Wallet System" ) );
00213 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." ) );
00214 buttonGroup1->setTitle( QString::null );
00215 _basic->setText( tr2i18n( "&Basic setup (recommended)" ) );
00216 _advanced->setText( tr2i18n( "&Advanced setup" ) );
00217 setTitle( page1, tr2i18n( "Introduction" ) );
00218 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." ) );
00219 setTitle( page4, tr2i18n( "Information" ) );
00220 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." ) );
00221 textLabel1_2->setText( tr2i18n( "Enter a new password:" ) );
00222 textLabel2_2->setText( tr2i18n( "Verify password:" ) );
00223 _useWallet->setText( tr2i18n( "Yes, I wish to use the KDE wallet to store my personal information." ) );
00224 _matchLabel->setText( QString::null );
00225 setTitle( page2, tr2i18n( "Password Selection" ) );
00226 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." ) );
00227 _networkWallet->setText( tr2i18n( "Store network passwords and local passwords in separate wallet files" ) );
00228 _closeIdle->setText( tr2i18n( "Automatically close idle wallets" ) );
00229 setTitle( page3, tr2i18n( "Security Level" ) );
00230 }
00231
00232 #include "kwalletwizard.moc"