Diffstat (limited to 'pwmanager/pwmanager/pwgenwnd.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwgenwnd.cpp | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/pwgenwnd.cpp b/pwmanager/pwmanager/pwgenwnd.cpp new file mode 100644 index 0000000..bb1ab92 --- a/dev/null +++ b/pwmanager/pwmanager/pwgenwnd.cpp | |||
@@ -0,0 +1,187 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'pwgenwnd.ui' | ||
3 | ** | ||
4 | ** Created: Tue Sep 14 15:34:41 2004 | ||
5 | ** by: The User Interface Compiler ($Id$) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | |||
10 | #include "pwgenwnd.h" | ||
11 | |||
12 | #include <qvariant.h> | ||
13 | #include <qpushbutton.h> | ||
14 | #include <qgroupbox.h> | ||
15 | #include <qcheckbox.h> | ||
16 | #include <qlabel.h> | ||
17 | #include <qlineedit.h> | ||
18 | #include <qspinbox.h> | ||
19 | #include <qlayout.h> | ||
20 | #include <qtooltip.h> | ||
21 | #include <qwhatsthis.h> | ||
22 | |||
23 | /* | ||
24 | * Constructs a pwGenWnd as a child of 'parent', with the | ||
25 | * name 'name' and widget flags set to 'f'. | ||
26 | * | ||
27 | * The dialog will by default be modeless, unless you set 'modal' to | ||
28 | * TRUE to construct a modal dialog. | ||
29 | */ | ||
30 | pwGenWnd::pwGenWnd( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
31 | : QDialog( parent, name, modal, fl ) | ||
32 | { | ||
33 | if ( !name ) | ||
34 | setName( "pwGenWnd" ); | ||
35 | pwGenWndLayout = new QVBoxLayout( this, 11, 6, "pwGenWndLayout"); | ||
36 | |||
37 | groupBox1 = new QGroupBox( this, "groupBox1" ); | ||
38 | groupBox1->setColumnLayout(0, Qt::Vertical ); | ||
39 | groupBox1->layout()->setSpacing( 6 ); | ||
40 | groupBox1->layout()->setMargin( 11 ); | ||
41 | groupBox1Layout = new QVBoxLayout( groupBox1->layout() ); | ||
42 | groupBox1Layout->setAlignment( Qt::AlignTop ); | ||
43 | |||
44 | layout2 = new QHBoxLayout( 0, 0, 6, "layout2"); | ||
45 | |||
46 | int_charLowerCheckBox = new QCheckBox( groupBox1, "int_charLowerCheckBox" ); | ||
47 | int_charLowerCheckBox->setChecked( TRUE ); | ||
48 | layout2->addWidget( int_charLowerCheckBox ); | ||
49 | spacer1 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
50 | layout2->addItem( spacer1 ); | ||
51 | |||
52 | textLabel4 = new QLabel( groupBox1, "textLabel4" ); | ||
53 | layout2->addWidget( textLabel4 ); | ||
54 | groupBox1Layout->addLayout( layout2 ); | ||
55 | |||
56 | layout3 = new QHBoxLayout( 0, 0, 6, "layout3"); | ||
57 | |||
58 | int_charUpperCheckBox = new QCheckBox( groupBox1, "int_charUpperCheckBox" ); | ||
59 | int_charUpperCheckBox->setChecked( TRUE ); | ||
60 | layout3->addWidget( int_charUpperCheckBox ); | ||
61 | spacer2 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
62 | layout3->addItem( spacer2 ); | ||
63 | |||
64 | textLabel5 = new QLabel( groupBox1, "textLabel5" ); | ||
65 | layout3->addWidget( textLabel5 ); | ||
66 | groupBox1Layout->addLayout( layout3 ); | ||
67 | |||
68 | layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); | ||
69 | |||
70 | int_charNumCheckBox = new QCheckBox( groupBox1, "int_charNumCheckBox" ); | ||
71 | int_charNumCheckBox->setChecked( TRUE ); | ||
72 | layout4->addWidget( int_charNumCheckBox ); | ||
73 | spacer3 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
74 | layout4->addItem( spacer3 ); | ||
75 | |||
76 | textLabel6 = new QLabel( groupBox1, "textLabel6" ); | ||
77 | layout4->addWidget( textLabel6 ); | ||
78 | groupBox1Layout->addLayout( layout4 ); | ||
79 | |||
80 | layout6 = new QHBoxLayout( 0, 0, 6, "layout6"); | ||
81 | |||
82 | int_charSpecCheckBox = new QCheckBox( groupBox1, "int_charSpecCheckBox" ); | ||
83 | layout6->addWidget( int_charSpecCheckBox ); | ||
84 | spacer4 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
85 | layout6->addItem( spacer4 ); | ||
86 | |||
87 | textLabel7 = new QLabel( groupBox1, "textLabel7" ); | ||
88 | layout6->addWidget( textLabel7 ); | ||
89 | groupBox1Layout->addLayout( layout6 ); | ||
90 | |||
91 | int_charBlankCheckBox = new QCheckBox( groupBox1, "int_charBlankCheckBox" ); | ||
92 | groupBox1Layout->addWidget( int_charBlankCheckBox ); | ||
93 | |||
94 | layout7 = new QHBoxLayout( 0, 0, 6, "layout7"); | ||
95 | |||
96 | int_charUserCheckBox = new QCheckBox( groupBox1, "int_charUserCheckBox" ); | ||
97 | layout7->addWidget( int_charUserCheckBox ); | ||
98 | spacer5 = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | ||
99 | layout7->addItem( spacer5 ); | ||
100 | |||
101 | int_userDefLineEdit = new QLineEdit( groupBox1, "int_userDefLineEdit" ); | ||
102 | int_userDefLineEdit->setEnabled( FALSE ); | ||
103 | layout7->addWidget( int_userDefLineEdit ); | ||
104 | groupBox1Layout->addLayout( layout7 ); | ||
105 | pwGenWndLayout->addWidget( groupBox1 ); | ||
106 | |||
107 | layout8 = new QHBoxLayout( 0, 0, 6, "layout8"); | ||
108 | |||
109 | textLabel2 = new QLabel( this, "textLabel2" ); | ||
110 | layout8->addWidget( textLabel2 ); | ||
111 | |||
112 | int_lenSpinBox = new QSpinBox( this, "int_lenSpinBox" ); | ||
113 | int_lenSpinBox->setMaxValue( 9999 ); | ||
114 | int_lenSpinBox->setMinValue( 1 ); | ||
115 | int_lenSpinBox->setValue( 8 ); | ||
116 | layout8->addWidget( int_lenSpinBox ); | ||
117 | pwGenWndLayout->addLayout( layout8 ); | ||
118 | |||
119 | int_filterCheckBox = new QCheckBox( this, "int_filterCheckBox" ); | ||
120 | int_filterCheckBox->setChecked( TRUE ); | ||
121 | pwGenWndLayout->addWidget( int_filterCheckBox ); | ||
122 | |||
123 | layout1 = new QHBoxLayout( 0, 0, 6, "layout1"); | ||
124 | |||
125 | genButton = new QPushButton( this, "genButton" ); | ||
126 | layout1->addWidget( genButton ); | ||
127 | |||
128 | cancelButton = new QPushButton( this, "cancelButton" ); | ||
129 | layout1->addWidget( cancelButton ); | ||
130 | pwGenWndLayout->addLayout( layout1 ); | ||
131 | languageChange(); | ||
132 | resize( QSize(450, 349).expandedTo(minimumSizeHint()) ); | ||
133 | clearWState( WState_Polished ); | ||
134 | |||
135 | // signals and slots connections | ||
136 | connect( int_charUserCheckBox, SIGNAL( toggled(bool) ), int_userDefLineEdit, SLOT( setEnabled(bool) ) ); | ||
137 | connect( cancelButton, SIGNAL( clicked() ), this, SLOT( cancelButton_slot() ) ); | ||
138 | connect( genButton, SIGNAL( clicked() ), this, SLOT( genButton_slot() ) ); | ||
139 | } | ||
140 | |||
141 | /* | ||
142 | * Destroys the object and frees any allocated resources | ||
143 | */ | ||
144 | pwGenWnd::~pwGenWnd() | ||
145 | { | ||
146 | // no need to delete child widgets, Qt does it all for us | ||
147 | } | ||
148 | |||
149 | /* | ||
150 | * Sets the strings of the subwidgets using the current | ||
151 | * language. | ||
152 | */ | ||
153 | void pwGenWnd::languageChange() | ||
154 | { | ||
155 | setCaption( tr( "Password generator" ) ); | ||
156 | groupBox1->setTitle( tr( "Character set:" ) ); | ||
157 | int_charLowerCheckBox->setText( tr( "Lowercase:" ) ); | ||
158 | textLabel4->setText( tr( "abc" ) ); | ||
159 | int_charUpperCheckBox->setText( tr( "Uppercase:" ) ); | ||
160 | textLabel5->setText( tr( "ABC" ) ); | ||
161 | int_charNumCheckBox->setText( tr( "Numbers:" ) ); | ||
162 | textLabel6->setText( tr( "123" ) ); | ||
163 | int_charSpecCheckBox->setText( tr( "Special characters:" ) ); | ||
164 | #ifndef PWM_EMBEDDED | ||
165 | textLabel7->setText( trUtf8( "\x21\x22\xc2\xa7\x24\x25\x26\x2f\x28\x29\x3d\x3f\x2c\x2e\x2d\x3b\x3a\x5f\x2b" ) ); | ||
166 | #else | ||
167 | QString st("\x21\x22\xc2\xa7\x24\x25\x26\x2f\x28\x29\x3d\x3f\x2c\x2e\x2d\x3b\x3a\x5f\x2b"); | ||
168 | textLabel7->setText( st.utf8() ); | ||
169 | #endif | ||
170 | int_charBlankCheckBox->setText( tr( "Spaces (blank characters)" ) ); | ||
171 | int_charUserCheckBox->setText( tr( "User defined:" ) ); | ||
172 | textLabel2->setText( tr( "Password Length:" ) ); | ||
173 | int_filterCheckBox->setText( tr( "Enable Filtering to get better passwords" ) ); | ||
174 | genButton->setText( tr( "&Generate now" ) ); | ||
175 | cancelButton->setText( tr( "&Cancel" ) ); | ||
176 | } | ||
177 | |||
178 | void pwGenWnd::cancelButton_slot() | ||
179 | { | ||
180 | qWarning( "pwGenWnd::cancelButton_slot(): Not implemented yet" ); | ||
181 | } | ||
182 | |||
183 | void pwGenWnd::genButton_slot() | ||
184 | { | ||
185 | qWarning( "pwGenWnd::genButton_slot(): Not implemented yet" ); | ||
186 | } | ||
187 | |||