summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/password.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/password.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/password.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/checkbook/password.cpp b/noncore/apps/checkbook/password.cpp
index f381271..89a6bc6 100644
--- a/noncore/apps/checkbook/password.cpp
+++ b/noncore/apps/checkbook/password.cpp
@@ -1,97 +1,97 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org> 4             .=l. Copyright (c) 2002 Dan Williams <drw@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "password.h" 29#include "password.h"
30 30
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qlineedit.h> 33#include <qlineedit.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35 35
36static const char* const showhideimage_data[] = { 36static const char* const showhideimage_data[] = {
37"16 16 2 1", 37"16 16 2 1",
38". c None", 38". c None",
39"# c #000000", 39"# c #000000",
40"................", 40"................",
41"...#...###...##.", 41"...#...###...##.",
42"..#.#..#..#.##..", 42"..#.#..#..#.##..",
43"..###..###.##...", 43"..###..###.##...",
44".#...#.#..##....", 44".#...#.#..##....",
45".#...#.#.##.....", 45".#...#.#.##.....",
46"........##.#..#.", 46"........##.#..#.",
47"..##...##...##..", 47"..##...##...##..",
48".#..#.###...##..", 48".#..#.###...##..",
49".#...##..#.#..#.", 49".#...##..#.#..#.",
50".#..##..........", 50".#..##..........",
51".#.##.#..#.#..#.", 51".#.##.#..#.#..#.",
52"..##...##...##..", 52"..##...##...##..",
53".##....##...##..", 53".##....##...##..",
54".#....#..#.#..#.", 54".#....#..#.#..#.",
55"................"}; 55"................"};
56 56
57Password::Password( QWidget *parent, const char *caption, const char *prompt ) 57Password::Password( QWidget *parent, const char *caption, const char *prompt )
58 : QDialog( parent, 0x0, TRUE, 0x0 ) 58 : QDialog( parent, 0x0, TRUE, 0x0 )
59{ 59{
60 setCaption( caption ); 60 setCaption( caption );
61 61
62 QGridLayout *layout = new QGridLayout( this ); 62 QGridLayout *layout = new QGridLayout( this );
63 layout->setSpacing( 2 ); 63 layout->setSpacing( 2 );
64 layout->setMargin( 4 ); 64 layout->setMargin( 4 );
65 65
66 QLabel *label = new QLabel( prompt, this ); 66 QLabel *label = new QLabel( prompt, this );
67 label->setAlignment( AlignLeft | AlignTop | WordBreak ); 67 label->setAlignment( AlignLeft | AlignTop | WordBreak );
68 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 68 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
69 69
70 pw = new QLineEdit( this ); 70 pw = new QLineEdit( this );
71 pw->setEchoMode( QLineEdit::Password ); 71 pw->setEchoMode( QLineEdit::Password );
72 layout->addWidget( pw, 1, 0 ); 72 layout->addWidget( pw, 1, 0 );
73 73
74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data ); 74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data );
75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this ); 75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this );
76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 ); 76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 );
77 btn->setToggleButton( TRUE ); 77 btn->setToggleButton( TRUE );
78 connect( btn, SIGNAL( toggled( bool ) ), this, SLOT( slotTogglePassword( bool ) ) ); 78 connect( btn, SIGNAL( toggled(bool) ), this, SLOT( slotTogglePassword(bool) ) );
79 layout->addWidget( btn, 1, 1 ); 79 layout->addWidget( btn, 1, 1 );
80 80
81 password == ""; 81 password == "";
82} 82}
83 83
84Password::~Password() 84Password::~Password()
85{ 85{
86} 86}
87 87
88void Password::accept() 88void Password::accept()
89{ 89{
90 password = pw->text(); 90 password = pw->text();
91 QDialog::accept(); 91 QDialog::accept();
92} 92}
93 93
94void Password::slotTogglePassword( bool showPW ) 94void Password::slotTogglePassword( bool showPW )
95{ 95{
96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password ); 96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password );
97} 97}