Diffstat (limited to 'noncore/apps/opie-console/atconfigdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/atconfigdialog.cpp | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp new file mode 100644 index 0000000..ef6d1ae --- a/dev/null +++ b/noncore/apps/opie-console/atconfigdialog.cpp | |||
@@ -0,0 +1,182 @@ | |||
1 | |||
2 | #include <qlineedit.h> | ||
3 | #include <qspinbox.h> | ||
4 | #include <qlayout.h> | ||
5 | #include <qcombobox.h> | ||
6 | #include <qtabwidget.h> | ||
7 | #include <qlabel.h> | ||
8 | #include <qcombobox.h> | ||
9 | #include <qscrollview.h> | ||
10 | |||
11 | #include "atconfigdialog.h" | ||
12 | |||
13 | |||
14 | ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | ||
15 | : QDialog( parent, name, modal, fl ) { | ||
16 | |||
17 | |||
18 | setCaption( tr( "Dialing parameter setup" ) ); | ||
19 | |||
20 | QVBoxLayout *layout = new QVBoxLayout( this ); | ||
21 | QTabWidget *tabWidget = new QTabWidget( this ); | ||
22 | |||
23 | tabWidget->addTab( tab0( this ), tr("Settings1") ); | ||
24 | tabWidget->addTab( tab1( this ), tr("Settings2") ); | ||
25 | |||
26 | layout->addWidget( tabWidget ); | ||
27 | |||
28 | } | ||
29 | |||
30 | QWidget* ATConfigDialog::tab0( QWidget* parent) { | ||
31 | |||
32 | |||
33 | QScrollView* sv = new QScrollView( parent ); | ||
34 | |||
35 | QWidget *returnWidget = new QWidget( sv->viewport() ); | ||
36 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
37 | // sv->setHScrollBarMode( QScrollView::AlwaysOff ); | ||
38 | // sv->setFrameShape( QFrame::NoFrame ); | ||
39 | |||
40 | |||
41 | |||
42 | |||
43 | QGridLayout *layout = new QGridLayout( returnWidget, 10, 2 ); | ||
44 | |||
45 | QLabel *initStringLabel = new QLabel( tr("Init string "), returnWidget ); | ||
46 | initStringLine = new QLineEdit( returnWidget ); | ||
47 | layout->addWidget( initStringLabel, 0, 0 ); | ||
48 | layout->addWidget( initStringLine, 0, 1 ); | ||
49 | |||
50 | QLabel *resetStringLabel = new QLabel( tr("Reset string "), returnWidget ); | ||
51 | resetStringLine = new QLineEdit( returnWidget ); | ||
52 | layout->addWidget( resetStringLabel, 1, 0 ); | ||
53 | layout->addWidget( resetStringLine, 1, 1 ); | ||
54 | |||
55 | QLabel *dialPref1Label = new QLabel( tr("Dialing prefix #1 " ), returnWidget ); | ||
56 | dialPref1Line = new QLineEdit( returnWidget ); | ||
57 | layout->addWidget( dialPref1Label, 2, 0 ); | ||
58 | layout->addWidget( dialPref1Line, 2, 1 ); | ||
59 | |||
60 | QLabel *dialSuf1Label = new QLabel( tr("Dialing suffix #1 " ), returnWidget ); | ||
61 | dialSuf1Line = new QLineEdit( returnWidget ); | ||
62 | layout->addWidget( dialSuf1Label, 3, 0 ); | ||
63 | layout->addWidget( dialSuf1Line, 3, 1 ); | ||
64 | |||
65 | QLabel *dialPref2Label = new QLabel( tr("Dialing prefix #2 " ), returnWidget ); | ||
66 | dialPref2Line = new QLineEdit( returnWidget ); | ||
67 | layout->addWidget( dialPref2Label, 4, 0 ); | ||
68 | layout->addWidget( dialPref2Line, 4, 1 ); | ||
69 | |||
70 | QLabel *dialSuf2Label = new QLabel( tr("Dialing suffix #2 " ), returnWidget ); | ||
71 | dialSuf2Line = new QLineEdit( returnWidget ); | ||
72 | layout->addWidget( dialSuf2Label, 5, 0 ); | ||
73 | layout->addWidget( dialSuf2Line, 5, 1 ); | ||
74 | |||
75 | QLabel *dialPref3Label = new QLabel( tr("Dialing prefix #3 " ), returnWidget ); | ||
76 | dialPref3Line = new QLineEdit( returnWidget ); | ||
77 | layout->addWidget( dialPref3Label, 6, 0 ); | ||
78 | layout->addWidget( dialPref3Line, 6, 1 ); | ||
79 | |||
80 | QLabel *dialSuf3Label = new QLabel( tr("Dialing suffix #3 " ), returnWidget ); | ||
81 | dialSuf3Line = new QLineEdit( returnWidget ); | ||
82 | layout->addWidget( dialSuf3Label, 7, 0 ); | ||
83 | layout->addWidget( dialSuf3Line, 7, 1 ); | ||
84 | |||
85 | QLabel *connectLabel = new QLabel( tr("Connect string " ), returnWidget ); | ||
86 | connectLine = new QLineEdit( returnWidget ); | ||
87 | layout->addWidget( connectLabel, 8, 0 ); | ||
88 | layout->addWidget( connectLine, 8, 1 ); | ||
89 | |||
90 | QLabel *hangupLabel = new QLabel( tr("Hang-up string " ), returnWidget ); | ||
91 | hangupLine = new QLineEdit( returnWidget ); | ||
92 | layout->addWidget( hangupLabel, 9, 0 ); | ||
93 | layout->addWidget( hangupLine, 9, 1 ); | ||
94 | |||
95 | sv->addChild( returnWidget ); | ||
96 | |||
97 | return sv; | ||
98 | |||
99 | } | ||
100 | |||
101 | QWidget* ATConfigDialog::tab1( QWidget* parent ) { | ||
102 | |||
103 | |||
104 | QWidget *returnWidget = new QWidget( parent ); | ||
105 | |||
106 | QGridLayout *layout = new QGridLayout( returnWidget, 8, 2 ); | ||
107 | |||
108 | QLabel *dialTimeLabel = new QLabel( tr("Dial time " ), returnWidget ); | ||
109 | dialTimeSpin = new QSpinBox( returnWidget ); | ||
110 | layout->addWidget( dialTimeLabel, 0, 0 ); | ||
111 | layout->addWidget( dialTimeSpin, 0, 1 ); | ||
112 | |||
113 | QLabel *delayRedialLabel = new QLabel( tr("Delay before redial " ), returnWidget ); | ||
114 | delayRedialSpin = new QSpinBox( returnWidget ); | ||
115 | layout->addWidget( delayRedialLabel, 1, 0 ); | ||
116 | layout->addWidget( delayRedialSpin, 1, 1 ); | ||
117 | |||
118 | QLabel *numberTriesLabel = new QLabel( tr("Number of tries " ), returnWidget ); | ||
119 | numberTriesSpin = new QSpinBox( returnWidget ); | ||
120 | layout->addWidget( numberTriesLabel, 2, 0 ); | ||
121 | layout->addWidget( numberTriesSpin, 2, 1 ); | ||
122 | |||
123 | QLabel *dtrDropTimeLabel = new QLabel( tr("DTR drop time (0=no) " ), returnWidget ); | ||
124 | dtrDropTimeSpin = new QSpinBox( returnWidget ); | ||
125 | layout->addWidget( dtrDropTimeLabel, 3, 0 ); | ||
126 | layout->addWidget( dtrDropTimeSpin, 3, 1 ); | ||
127 | |||
128 | QLabel *bpsDetectLabel = new QLabel( tr("Auto bps detect " ), returnWidget ); | ||
129 | bpsDetectBox = new QComboBox( returnWidget ); | ||
130 | layout->addWidget( bpsDetectLabel, 4, 0 ); | ||
131 | layout->addWidget( bpsDetectBox, 4, 1 ); | ||
132 | bpsDetectBox->insertItem( tr("No") ); | ||
133 | bpsDetectBox->insertItem( tr("Yes") ); | ||
134 | |||
135 | QLabel *dcdLinesLabel = new QLabel( tr("Modem has DCD line " ), returnWidget ); | ||
136 | dcdLinesBox = new QComboBox( returnWidget ); | ||
137 | layout->addWidget( dcdLinesLabel, 5, 0 ); | ||
138 | layout->addWidget( dcdLinesBox, 5, 1 ); | ||
139 | dcdLinesBox->insertItem( tr("No") ); | ||
140 | dcdLinesBox->insertItem( tr("Yes") ); | ||
141 | |||
142 | QLabel *multiLineUntagLabel = new QLabel( tr("Multi-line untag " ), returnWidget ); | ||
143 | multiLineUntagBox = new QComboBox( returnWidget ); | ||
144 | layout->addWidget( multiLineUntagLabel, 6, 0 ); | ||
145 | layout->addWidget( multiLineUntagBox, 6, 1 ); | ||
146 | multiLineUntagBox->insertItem( tr("No") ); | ||
147 | multiLineUntagBox->insertItem( tr("Yes") ); | ||
148 | |||
149 | return returnWidget; | ||
150 | |||
151 | } | ||
152 | |||
153 | |||
154 | void ATConfigDialog::readConfig() { | ||
155 | /* | ||
156 | initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); | ||
157 | resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); | ||
158 | dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | ||
159 | dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | ||
160 | dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | ||
161 | dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | ||
162 | dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | ||
163 | dialSuf3Line->setText( config.readEntry("DialSuffix3", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | ||
164 | connectLine->setText( config.readEntry("DefaultConnect" MODEM_DEFAULT_CONNECT_STRING ) ); | ||
165 | hangupLine->setText( config.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) ); | ||
166 | dialTimeSpin; | ||
167 | delayRedialSpin; | ||
168 | numberTriesSpin; | ||
169 | dtrDropTimeSpin; | ||
170 | bpsDetectBox; | ||
171 | cdLinesBox; | ||
172 | multiLineUntagBox; | ||
173 | */ | ||
174 | } | ||
175 | |||
176 | void ATConfigDialog::writeConfig() { | ||
177 | |||
178 | } | ||
179 | |||
180 | |||
181 | ATConfigDialog::~ATConfigDialog() { | ||
182 | } | ||