author | tille <tille> | 2003-05-23 19:43:46 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-23 19:43:46 (UTC) |
commit | 9b6b21112f38181f49b07e973bfe00c0d83a6900 (patch) (unidiff) | |
tree | c2fa45a93ac5c26fe98558f28bb0a166b14ad065 /noncore/settings/networksettings/ppp/pwentry.cpp | |
parent | 34b9974063032242e5de65fa56d4c2cb5e1ce565 (diff) | |
download | opie-9b6b21112f38181f49b07e973bfe00c0d83a6900.zip opie-9b6b21112f38181f49b07e973bfe00c0d83a6900.tar.gz opie-9b6b21112f38181f49b07e973bfe00c0d83a6900.tar.bz2 |
configure dialog basicly working
more kppp stuff... ;)
Diffstat (limited to 'noncore/settings/networksettings/ppp/pwentry.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/ppp/pwentry.cpp | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/ppp/pwentry.cpp b/noncore/settings/networksettings/ppp/pwentry.cpp new file mode 100644 index 0000000..842dc87 --- a/dev/null +++ b/noncore/settings/networksettings/ppp/pwentry.cpp | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Kppp: A pppd front end for the KDE project | ||
4 | * | ||
5 | * $Id$ | ||
6 | * | ||
7 | * Copyright (C) 1997 Bernd Johannes Wuebben | ||
8 | * wuebben@math.cornell.edu | ||
9 | * | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU Library General Public | ||
13 | * License as published by the Free Software Foundation; either | ||
14 | * version 2 of the License, or (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
19 | * Library General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU Library General Public | ||
22 | * License along with this program; if not, write to the Free | ||
23 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | |||
27 | |||
28 | #include <stdio.h> | ||
29 | #include <qapplication.h> | ||
30 | #include "pwentry.h" | ||
31 | |||
32 | PWEntry::PWEntry( QWidget *parent, const char *name ) | ||
33 | : QWidget(NULL, name) { | ||
34 | |||
35 | if(parent){ | ||
36 | |||
37 | QPoint point = this->mapToGlobal (QPoint (0,0)); | ||
38 | QRect pos = this->geometry(); | ||
39 | |||
40 | setGeometry(point.x() + pos.width()/2 - 300/2, | ||
41 | point.y() + pos.height()/2 - 90/2, | ||
42 | 300, | ||
43 | 90); | ||
44 | } | ||
45 | // else{ | ||
46 | // int scnum = QApplication::desktop()->screenNumber(parent); | ||
47 | // QRect desk = QApplication::desktop()->screenGeometry(scnum); | ||
48 | // setGeometry( desk.center().x() - 150, desk.center().y() - 50, 300, 90 ); | ||
49 | // } | ||
50 | |||
51 | frame = new QGroupBox(name, this ); | ||
52 | |||
53 | this->setFocusPolicy( QWidget::StrongFocus ); | ||
54 | |||
55 | pw = new QLineEdit( this, "le" ); | ||
56 | pw->setEchoMode( QLineEdit::Password ); | ||
57 | connect( pw, SIGNAL(returnPressed()), this, SLOT(hide()) ); | ||
58 | |||
59 | isconsumed = TRUE; | ||
60 | } | ||
61 | |||
62 | QString PWEntry::text() { return (pw->text()); } | ||
63 | |||
64 | void PWEntry::focusInEvent( QFocusEvent *){ | ||
65 | |||
66 | pw->setFocus(); | ||
67 | |||
68 | } | ||
69 | |||
70 | void PWEntry::setEchoModeNormal() { | ||
71 | |||
72 | pw->setEchoMode(QLineEdit::Normal); | ||
73 | |||
74 | } | ||
75 | |||
76 | void PWEntry::setEchoModePassword() { | ||
77 | |||
78 | pw->setEchoMode(QLineEdit::Password); | ||
79 | |||
80 | } | ||
81 | |||
82 | void PWEntry::setPrompt(const QString &p) { | ||
83 | |||
84 | frame->setTitle(p); | ||
85 | |||
86 | } | ||
87 | |||
88 | void PWEntry::resizeEvent(QResizeEvent* ){ | ||
89 | |||
90 | pw->setGeometry( 15,35, this->width() - 30, 25 ); | ||
91 | frame->setGeometry(5,5,this->width() - 10, this->height() - 10 ); | ||
92 | |||
93 | } | ||
94 | |||
95 | |||
96 | void PWEntry::show() { | ||
97 | |||
98 | pw->setText(""); | ||
99 | isconsumed = FALSE; | ||
100 | QWidget::show(); | ||
101 | } | ||
102 | |||
103 | bool PWEntry::Consumed() { | ||
104 | return(isconsumed); | ||
105 | } | ||
106 | |||
107 | void PWEntry::setConsumed() { | ||
108 | isconsumed = TRUE; | ||
109 | } | ||
110 | |||
111 | void PWEntry::hide() { | ||
112 | QWidget::hide(); | ||
113 | return; | ||
114 | } | ||
115 | |||
116 | //#include "pwentry.moc" | ||