summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/modemcmds.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/ppp/modemcmds.cpp b/noncore/settings/networksettings/ppp/modemcmds.cpp
index e797795..3d15b96 100644
--- a/noncore/settings/networksettings/ppp/modemcmds.cpp
+++ b/noncore/settings/networksettings/ppp/modemcmds.cpp
@@ -12,129 +12,129 @@
12 * This library is free software; you can redistribute it and/or 12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public 13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either 14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version. 15 * version 2 of the License, or (at your option) any later version.
16 * 16 *
17 * This library is distributed in the hope that it will be useful, 17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details. 20 * Library General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU Library General Public 22 * You should have received a copy of the GNU Library General Public
23 * License along with dummyWidget program; if not, write to the Free 23 * License along with dummyWidget program; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */ 25 */
26 26
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qslider.h> 28#include <qslider.h>
29#include <qbuttongroup.h> 29#include <qbuttongroup.h>
30#include <qscrollview.h> 30#include <qscrollview.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <stdlib.h> 32#include <stdlib.h>
33#include "modemcmds.h" 33#include "modemcmds.h"
34#include "pppdata.h" 34#include "pppdata.h"
35 35
36#define ADJUSTEDIT(e) //e->setText("XXXXXXXXqy"); e->setMinimumSize(e->sizeHint()); /*e->setFixedHeight(e->sizeHint().height());*/ e->setText(""); e->setMaxLength(MODEMSTR_SIZE); 36#define ADJUSTEDIT(e) //e->setText("XXXXXXXXqy"); e->setMinimumSize(e->sizeHint()); /*e->setFixedHeight(e->sizeHint().height());*/ e->setText(""); e->setMaxLength(MODEMSTR_SIZE);
37 37
38// a little trick to make the label look like a disabled lineedit 38// a little trick to make the label look like a disabled lineedit
39#define FORMATSLIDERLABEL(l) //l->setFixedWidth(l->sizeHint().width()); l->setFixedHeight(QLineEdit(dummyWidget).sizeHint().height()); l->setAlignment(AlignCenter); l->setFrameStyle(QFrame::WinPanel|QFrame::Sunken); l->setLineWidth(2); 39#define FORMATSLIDERLABEL(l) //l->setFixedWidth(l->sizeHint().width()); l->setFixedHeight(QLineEdit(dummyWidget).sizeHint().height()); l->setAlignment(AlignCenter); l->setFrameStyle(QFrame::WinPanel|QFrame::Sunken); l->setLineWidth(2);
40 40
41ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name , bool modal, WFlags f) 41ModemCommands::ModemCommands(PPPData *pd, QWidget *parent, const char *name , bool modal, WFlags f)
42 : QDialog( parent, name, modal, f ), _pppdata(pd) 42 : QDialog( parent, name, modal, f ), _pppdata(pd)
43{ 43{
44 setCaption(QObject::tr("Edit Modem Commands")); 44 setCaption(QObject::tr("Edit Modem Commands"));
45 45
46 const int GRIDROWS = 22; 46 const int GRIDROWS = 22;
47 int row = 0; 47 int row = 0;
48 48
49 QVBoxLayout *main = new QVBoxLayout( this ); 49 QVBoxLayout *main = new QVBoxLayout( this );
50 QScrollView *sv = new QScrollView( this ); 50 QScrollView *sv = new QScrollView( this );
51 QWidget *mainW = new QWidget( sv->viewport() ); 51 QWidget *mainW = new QWidget( sv->viewport() );
52 sv->setResizePolicy( QScrollView::AutoOneFit ); 52 sv->setResizePolicy( QScrollView::AutoOneFit );
53 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 53 sv->setHScrollBarMode( QScrollView::AlwaysOff );
54 sv->setFrameShape( QFrame::NoFrame ); 54 sv->setFrameShape( QFrame::NoFrame );
55 sv->addChild( mainW ); 55 sv->addChild( mainW );
56 main->addWidget( sv ); 56 main->addWidget( sv );
57 // evil hack 57 // evil hack
58 mainW->setMaximumWidth( QApplication::desktop()->width() - 10 ); 58 mainW->setMaximumWidth( QApplication::desktop()->width() - 10 );
59 59
60 // toplevel layout 60 // toplevel layout
61 QVBoxLayout *tl = new QVBoxLayout( mainW, 10, 4); 61 QVBoxLayout *tl = new QVBoxLayout( mainW, 10, 4);
62 62
63 // add grid + frame 63 // add grid + frame
64 QGridLayout *l1 = new QGridLayout(GRIDROWS, 4); 64 QGridLayout *l1 = new QGridLayout(GRIDROWS, 4);
65 tl->addLayout(l1); 65 tl->addLayout(l1);
66 box = new QGroupBox(mainW, "box"); 66 box = new QGroupBox(mainW, "box");
67 box->setMargin( 0 ); 67 box->setMargin( 0 );
68 l1->addMultiCellWidget(box, row++, GRIDROWS, 0, 3); 68 l1->addMultiCellWidget(box, row++, GRIDROWS, 0, 3);
69 69
70 // put slider and label into a separate H-Box 70 // put slider and label into a separate H-Box
71 QHBoxLayout *l2 = new QHBoxLayout; 71 QHBoxLayout *l2 = new QHBoxLayout;
72 l1->addLayout(l2, row, 2); 72 l1->addLayout(l2, row, 2);
73 lpreinitslider = new QLabel("MMMM", mainW); 73 lpreinitslider = new QLabel("MMMM", mainW);
74 FORMATSLIDERLABEL(lpreinitslider); 74 FORMATSLIDERLABEL(lpreinitslider);
75 75
76 QSlider *preinitslider = new QSlider(0, 300, 1, 0, 76 QSlider *preinitslider = new QSlider(0, 600, 1, 0,
77 QSlider::Horizontal, mainW); 77 QSlider::Horizontal, mainW);
78// preinitslider->setFixedHeight(preinitslider->sizeHint().height()); 78// preinitslider->setFixedHeight(preinitslider->sizeHint().height());
79 connect(preinitslider, SIGNAL(valueChanged(int)), 79 connect(preinitslider, SIGNAL(valueChanged(int)),
80 lpreinitslider, SLOT(setNum(int))); 80 lpreinitslider, SLOT(setNum(int)));
81 l2->addWidget(lpreinitslider, 0); 81 l2->addWidget(lpreinitslider, 0);
82 l2->addWidget(preinitslider, 1); 82 l2->addWidget(preinitslider, 1);
83 83
84 lpreinit = new QLabel(QObject::tr("Pre-init delay (sec/100):"), mainW); 84 lpreinit = new QLabel(QObject::tr("Pre-init delay (sec/100):"), mainW);
85 l1->addWidget(lpreinit, row++, 1); 85 l1->addWidget(lpreinit, row++, 1);
86 86
87 for(int i = 0; i < PPPData::NumInitStrings; i++) { 87 for(int i = 0; i < PPPData::NumInitStrings; i++) {
88 initstr[i] = new QLineEdit(mainW); 88 initstr[i] = new QLineEdit(mainW);
89 QLabel *initLabel = new QLabel(QObject::tr("Initialization string %1:").arg(i + 1), 89 QLabel *initLabel = new QLabel(QObject::tr("Initialization string %1:").arg(i + 1),
90 mainW); 90 mainW);
91 ADJUSTEDIT(initstr[i]); 91 ADJUSTEDIT(initstr[i]);
92 l1->addWidget(initLabel, row, 1); 92 l1->addWidget(initLabel, row, 1);
93 l1->addWidget(initstr[i], row++, 2); 93 l1->addWidget(initstr[i], row++, 2);
94 } 94 }
95 95
96 QHBoxLayout *l3 = new QHBoxLayout; 96 QHBoxLayout *l3 = new QHBoxLayout;
97 l1->addLayout(l3, row, 2); 97 l1->addLayout(l3, row, 2);
98 linitslider = new QLabel("MMMM", mainW); 98 linitslider = new QLabel("MMMM", mainW);
99 FORMATSLIDERLABEL(linitslider); 99 FORMATSLIDERLABEL(linitslider);
100 QSlider *initslider = new QSlider(1, 300, 1, 0, 100 QSlider *initslider = new QSlider(1, 300, 1, 0,
101 QSlider::Horizontal, mainW); 101 QSlider::Horizontal, mainW);
102// initslider->setFixedHeight(initslider->sizeHint().height()); 102// initslider->setFixedHeight(initslider->sizeHint().height());
103 connect(initslider, SIGNAL(valueChanged(int)), 103 connect(initslider, SIGNAL(valueChanged(int)),
104 linitslider, SLOT(setNum(int))); 104 linitslider, SLOT(setNum(int)));
105 l3->addWidget(linitslider, 0); 105 l3->addWidget(linitslider, 0);
106 l3->addWidget(initslider, 1); 106 l3->addWidget(initslider, 1);
107 107
108 label3 = new QLabel(QObject::tr("Post-init delay (sec/100):"), mainW); 108 label3 = new QLabel(QObject::tr("Post-init delay (sec/100):"), mainW);
109 l1->addWidget(label3, row++, 1); 109 l1->addWidget(label3, row++, 1);
110 110
111 /* Set ATS11 (Dial tone duration) between 0-255 (Default ~ 70) */ 111 /* Set ATS11 (Dial tone duration) between 0-255 (Default ~ 70) */
112 QHBoxLayout *l4 = new QHBoxLayout; 112 QHBoxLayout *l4 = new QHBoxLayout;
113 l1->addLayout(l4, row, 2); 113 l1->addLayout(l4, row, 2);
114 ldurationslider = new QLabel("MMMM", mainW); 114 ldurationslider = new QLabel("MMMM", mainW);
115 FORMATSLIDERLABEL(ldurationslider); 115 FORMATSLIDERLABEL(ldurationslider);
116 QSlider *durationslider = new QSlider(1, 255, 1, 0, 116 QSlider *durationslider = new QSlider(1, 255, 1, 0,
117 QSlider::Horizontal, mainW); 117 QSlider::Horizontal, mainW);
118// durationslider->setFixedHeight(durationslider->sizeHint().height()); 118// durationslider->setFixedHeight(durationslider->sizeHint().height());
119 connect(durationslider, SIGNAL(valueChanged(int)), 119 connect(durationslider, SIGNAL(valueChanged(int)),
120 ldurationslider, SLOT(setNum(int))); 120 ldurationslider, SLOT(setNum(int)));
121 l4->addWidget(ldurationslider, 0); 121 l4->addWidget(ldurationslider, 0);
122 l4->addWidget(durationslider, 1); 122 l4->addWidget(durationslider, 1);
123 123
124 lduration = new QLabel(QObject::tr("Dialing speed (sec/100):"), mainW); 124 lduration = new QLabel(QObject::tr("Dialing speed (sec/100):"), mainW);
125 l1->addWidget(lduration, row++, 1); 125 l1->addWidget(lduration, row++, 1);
126 126
127 127
128 initresp = new QLineEdit(mainW); 128 initresp = new QLineEdit(mainW);
129 label2 = new QLabel(QObject::tr("Init response:"), mainW); 129 label2 = new QLabel(QObject::tr("Init response:"), mainW);
130 ADJUSTEDIT(initresp); 130 ADJUSTEDIT(initresp);
131 l1->addWidget(label2, row, 1); 131 l1->addWidget(label2, row, 1);
132 l1->addWidget(initresp, row++, 2); 132 l1->addWidget(initresp, row++, 2);
133 133
134 nodetectdialtone = new QLineEdit(mainW); 134 nodetectdialtone = new QLineEdit(mainW);
135 lnodetectdialtone = new QLabel(QObject::tr("No dial tone detection:"), mainW); 135 lnodetectdialtone = new QLabel(QObject::tr("No dial tone detection:"), mainW);
136 ADJUSTEDIT(nodetectdialtone); 136 ADJUSTEDIT(nodetectdialtone);
137 l1->addWidget(lnodetectdialtone, row, 1); 137 l1->addWidget(lnodetectdialtone, row, 1);
138 l1->addWidget(nodetectdialtone, row++, 2); 138 l1->addWidget(nodetectdialtone, row++, 2);
139 139
140 dialstr = new QLineEdit(mainW); 140 dialstr = new QLineEdit(mainW);