Diffstat (limited to 'pwmanager/pwmanager/setmasterpwwnd_emb.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/setmasterpwwnd_emb.cpp | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/setmasterpwwnd_emb.cpp b/pwmanager/pwmanager/setmasterpwwnd_emb.cpp new file mode 100644 index 0000000..e6471e6 --- a/dev/null +++ b/pwmanager/pwmanager/setmasterpwwnd_emb.cpp | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | This file is part of PwManager/Platform independent. | ||
3 | Copyright (c) 2004 Ulf Schenk | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program; if not, write to the Free Software | ||
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
18 | |||
19 | As a special exception, permission is given to link this program | ||
20 | with any edition of Qt, and distribute the resulting executable, | ||
21 | without including the source code for Qt in the source distribution. | ||
22 | |||
23 | $Id$ | ||
24 | */ | ||
25 | |||
26 | #include "setmasterpwwnd_emb.h" | ||
27 | |||
28 | #include <qpushbutton.h> | ||
29 | #include <qtabwidget.h> | ||
30 | #include <qwidget.h> | ||
31 | #include <qlabel.h> | ||
32 | #include <qlineedit.h> | ||
33 | #include <qlayout.h> | ||
34 | |||
35 | #include <klocale.h> | ||
36 | |||
37 | /*US | ||
38 | #include <qvariant.h> | ||
39 | #include <qpushbutton.h> | ||
40 | #include <qtabwidget.h> | ||
41 | #include <qwidget.h> | ||
42 | #include <qlabel.h> | ||
43 | #include <qlineedit.h> | ||
44 | #include <qlayout.h> | ||
45 | #include <qtooltip.h> | ||
46 | #include <qwhatsthis.h> | ||
47 | */ | ||
48 | |||
49 | /* | ||
50 | * Constructs a setMasterPwWnd as a child of 'parent', with the | ||
51 | * name 'name' | ||
52 | * | ||
53 | */ | ||
54 | setMasterPwWnd::setMasterPwWnd( QWidget* parent, const char* name ) | ||
55 | : KDialogBase( KDialogBase::Plain, i18n( "Set master-password" ), | ||
56 | KDialogBase::Ok | KDialogBase::Cancel, | ||
57 | KDialogBase::Ok, parent, name, true ) | ||
58 | { | ||
59 | QWidget *page = plainPage(); | ||
60 | QVBoxLayout *pageLayout = new QVBoxLayout( page ); | ||
61 | |||
62 | mainTab = new QTabWidget( page ); | ||
63 | pageLayout->addWidget( mainTab ); | ||
64 | |||
65 | |||
66 | if ( !name ) | ||
67 | setName( "setMasterPwWnd" ); | ||
68 | |||
69 | //////////////////////////////////////////////////////////////////// | ||
70 | // This is the Password tab1 | ||
71 | tab = new QWidget( mainTab ); | ||
72 | |||
73 | QGridLayout *layout = new QGridLayout( tab, 5, 1 ); | ||
74 | layout->setMargin( KDialogBase::marginHint() ); | ||
75 | layout->setSpacing( KDialogBase::spacingHint() ); | ||
76 | |||
77 | QLabel* label = new QLabel( i18n( "Using a normal password-string to encrypt the data." ), tab ); | ||
78 | label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); | ||
79 | layout->addWidget(label, 0, 0); | ||
80 | |||
81 | pwEdit_1 = new QLineEdit( tab, "pwEdit_1" ); | ||
82 | pwEdit_1->setEchoMode( QLineEdit::Password ); | ||
83 | |||
84 | label = new QLabel( pwEdit_1, i18n( "Please enter the new master-password:" ), tab ); | ||
85 | layout->addWidget(label, 1, 0); | ||
86 | layout->addWidget(pwEdit_1, 2, 0); | ||
87 | |||
88 | pwEdit_2 = new QLineEdit( tab, "pwEdit_2" ); | ||
89 | pwEdit_2->setEchoMode( QLineEdit::Password ); | ||
90 | |||
91 | label = new QLabel( pwEdit_2, i18n( "Please enter the password again:" ), tab ); | ||
92 | layout->addWidget(label, 3, 0); | ||
93 | layout->addWidget(pwEdit_2, 4, 0); | ||
94 | |||
95 | mainTab->insertTab( tab, i18n("Normal password") ); | ||
96 | |||
97 | |||
98 | //////////////////////////////////////////////////////////////////// | ||
99 | // This is the Password tab2 | ||
100 | tab_2 = new QWidget( mainTab ); | ||
101 | |||
102 | layout = new QGridLayout( tab_2, 5, 1 ); | ||
103 | layout->setMargin( KDialogBase::marginHint() ); | ||
104 | layout->setSpacing( KDialogBase::spacingHint() ); | ||
105 | |||
106 | label = new QLabel( i18n( "Using a PwM key-card to encrypt the data." ), tab_2 ); | ||
107 | label->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); | ||
108 | layout->addWidget(label, 0, 0); | ||
109 | |||
110 | label = new QLabel( i18n( "selected card:" ), tab_2 ); | ||
111 | label->setAlignment( int( QLabel::AlignVCenter | QLabel::AlignRight ) ); | ||
112 | layout->addWidget(label, 1, 0); | ||
113 | |||
114 | selCardButton = new QPushButton( i18n( "&Select the currently inserted card as key-card" ), tab_2 ); | ||
115 | layout->addWidget(selCardButton, 2, 0); | ||
116 | |||
117 | genCardButton = new QPushButton( i18n( "&generate new key-card") , tab_2 ); | ||
118 | layout->addWidget(genCardButton, 3, 0); | ||
119 | |||
120 | curCardIdLabel = new QLabel( QString("") , tab_2 ); | ||
121 | layout->addWidget(curCardIdLabel, 4, 0); | ||
122 | |||
123 | mainTab->insertTab( tab_2, i18n("Key-card (chipcard)" ) ); | ||
124 | |||
125 | |||
126 | // resize( QSize(411, 313).expandedTo(minimumSizeHint()) ); | ||
127 | |||
128 | // signals and slots connections | ||
129 | // connect( okButton, SIGNAL( clicked() ), this, SLOT( okButton_slot() ) ); | ||
130 | // connect( cancelButton, SIGNAL( clicked() ), this, SLOT( cancelButton_slot() ) ); | ||
131 | connect( genCardButton, SIGNAL( clicked() ), this, SLOT( genCardButton_slot() ) ); | ||
132 | connect( selCardButton, SIGNAL( clicked() ), this, SLOT( selCardButton_slot() ) ); | ||
133 | |||
134 | } | ||
135 | |||
136 | /* | ||
137 | * Destroys the object and frees any allocated resources | ||
138 | */ | ||
139 | setMasterPwWnd::~setMasterPwWnd() | ||
140 | { | ||
141 | // no need to delete child widgets, Qt does it all for us | ||
142 | } | ||
143 | |||
144 | void setMasterPwWnd::okButton_slot() | ||
145 | { | ||
146 | qWarning( "setMasterPwWnd::okButton_slot(): Not implemented yet" ); | ||
147 | } | ||
148 | |||
149 | void setMasterPwWnd::cancelButton_slot() | ||
150 | { | ||
151 | qWarning( "setMasterPwWnd::cancelButton_slot(): Not implemented yet" ); | ||
152 | } | ||
153 | |||
154 | void setMasterPwWnd::genCardButton_slot() | ||
155 | { | ||
156 | qWarning( "setMasterPwWnd::genCardButton_slot(): Not implemented yet" ); | ||
157 | } | ||
158 | |||
159 | void setMasterPwWnd::selCardButton_slot() | ||
160 | { | ||
161 | qWarning( "setMasterPwWnd::selCardButton_slot(): Not implemented yet" ); | ||
162 | } | ||
163 | |||