Contact cannot be a null ptr, and it is accessed before anyway. Disscussed with kedge.
[kdenetwork.git] / kppp / edit.h
blob4c8cec977afc49e03b796a880697fd0a0ebcb18c
1 /* -*- C++ -*-
3 * kPPP: A pppd Front End for the KDE project
5 * $Id$
6 * Copyright (C) 1997 Bernd Johannes Wuebben
7 * wuebben@math.cornell.edu
9 * based on EzPPP:
10 * Copyright (C) 1997 Jay Painter
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this program; if not, write to the Free
25 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #ifndef _EDIT_H_
30 #define _EDIT_H_
32 #include <qdialog.h>
33 #include <qpushbutton.h>
34 #include <q3groupbox.h>
35 #include <qscrollbar.h>
36 #include <qcombobox.h>
37 #include <qlineedit.h>
38 #include <q3listbox.h>
39 #include <qradiobutton.h>
40 #include <q3buttongroup.h>
41 #include <qcheckbox.h>
42 #include <qlabel.h>
43 #include <kdialog.h>
44 #include "scriptedit.h"
45 #include "kpppconfig.h"
46 #include "pppdargs.h"
47 class IPLineEdit;
49 class DialWidget : public QWidget {
50 Q_OBJECT
51 public:
52 explicit DialWidget( QWidget *parent=0, bool isnewaccount = true);
53 ~DialWidget() {}
55 public slots:
56 bool save();
57 void pppdargsbutton();
58 void numbersChanged();
59 void cbtypeChanged(int);
60 void selectionChanged(int);
61 void addNumber();
62 void delNumber();
63 void upNumber();
64 void downNumber();
66 private:
67 QLineEdit *connectname_l;
68 QLabel *connect_label;
69 QLabel *number_label;
70 QPushButton *pppdargs;
71 QComboBox *auth;
72 QLabel *auth_l;
73 QCheckBox *store_password;
75 // callback support
76 QComboBox *cbtype;
77 QLabel *cbtype_l;
78 QLineEdit *cbphone;
79 QLabel *cbphone_l;
80 // for the phonenumber selection
81 QPushButton *add, *del, *up, *down;
82 Q3ListBox *numbers;
86 /////////////////////////////////////////////////////////////////////////////
88 // tab-window to select what to execute when
90 /////////////////////////////////////////////////////////////////////////////
91 class ExecWidget : public QWidget {
92 Q_OBJECT
93 public:
94 explicit ExecWidget(QWidget *parent=0, bool isnewaccount=true);
96 public slots:
97 bool save();
99 private:
100 QLineEdit *before_connect;
101 QLabel *before_connect_l;
103 QLineEdit *command;
104 QLabel *command_label;
106 QLineEdit *predisconnect;
107 QLabel *predisconnect_label;
109 QLineEdit *discommand;
110 QLabel *discommand_label;
114 class IPWidget : public QWidget {
115 Q_OBJECT
116 public:
117 explicit IPWidget( QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
118 ~IPWidget() {}
120 public slots:
121 void save();
123 protected slots:
124 void hitIPSelect( int );
125 void autoname_t(bool on);
127 private:
128 QLabel *ipaddress_label;
129 QLabel *sub_label;
130 Q3GroupBox *box1;
131 Q3GroupBox *box;
133 Q3ButtonGroup *rb;
134 QRadioButton *dynamicadd_rb;
135 QRadioButton *staticadd_rb;
137 IPLineEdit *ipaddress_l;
138 IPLineEdit *subnetmask_l;
140 QCheckBox *autoname;
144 class DNSWidget : public QWidget {
145 Q_OBJECT
146 public:
147 explicit DNSWidget( QWidget *parent=0, bool isnewaccount = true );
148 ~DNSWidget() {}
150 public slots:
151 void save();
153 protected slots:
154 void adddns();
155 void removedns();
156 void DNS_Edit_Changed(const QString &);
157 void DNS_Entry_Selected(int);
158 void DNS_Mode_Selected(int);
160 private:
161 QLabel *conf_label;
162 Q3ButtonGroup *bg;
163 QRadioButton *autodns, *mandns;
164 QLabel *dns_label;
165 QLabel *servers_label;
166 IPLineEdit *dnsipaddr;
167 QPushButton *add;
168 QPushButton *remove;
169 Q3ListBox *dnsservers;
170 QLineEdit *dnsdomain;
171 QLabel *dnsdomain_label;
172 QCheckBox *exdnsdisabled_toggle;
176 class GatewayWidget : public QWidget {
177 Q_OBJECT
178 public:
179 explicit GatewayWidget( QWidget *parent=0, bool isnewaccount = true );
180 ~GatewayWidget() {}
182 public slots:
183 void save();
185 private slots:
186 void hitGatewaySelect( int );
188 private:
189 Q3GroupBox *box;
190 QLabel *gate_label;
191 Q3GroupBox *box1;
192 Q3ButtonGroup *rb;
193 QRadioButton *defaultgateway;
194 QRadioButton *staticgateway;
195 IPLineEdit *gatewayaddr;
196 QCheckBox *defaultroute;
200 class ScriptWidget : public QWidget {
201 Q_OBJECT
202 public:
203 explicit ScriptWidget( QWidget *parent=0, bool isnewaccount = true, const char *name=0 );
204 ~ScriptWidget() {}
206 public slots:
207 void save();
208 bool check();
210 private slots:
211 void addButton();
212 void insertButton();
213 void removeButton();
215 //signals linked to the scroll bar
216 void scrolling(int);
218 //signals to keep the two listboxes highlighted in sync
219 void slhighlighted(int);
220 void stlhighlighted(int);
222 private:
223 void adjustScrollBar();
225 ScriptEdit *se;
226 QPushButton *add;
227 QPushButton *remove;
228 QPushButton *insert;
229 Q3ListBox *sl, *stl;
231 QScrollBar *slb;
235 /////////////////////////////////////////////////////////////////////////////
237 // Used to specify a new phone number
239 /////////////////////////////////////////////////////////////////////////////
240 class PhoneNumberDialog : public KDialog {
241 Q_OBJECT
242 public:
243 PhoneNumberDialog(QWidget *parent = 0);
245 QString phoneNumber();
247 private slots:
248 void textChanged(const QString &);
250 private:
251 QLineEdit *le;
255 #endif