author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/applets/wirelessapplet/wireless.cpp | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/applets/wirelessapplet/wireless.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp index 9ce6618..6ef2e44 100644 --- a/noncore/applets/wirelessapplet/wireless.cpp +++ b/noncore/applets/wirelessapplet/wireless.cpp | |||
@@ -76,107 +76,107 @@ WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const | |||
76 | statusLabel->setFixedSize( statusLabel->sizeHint() ); | 76 | statusLabel->setFixedSize( statusLabel->sizeHint() ); |
77 | grid->addWidget( statusLabel, 0, 0 ); | 77 | grid->addWidget( statusLabel, 0, 0 ); |
78 | 78 | ||
79 | /* visualization group box */ | 79 | /* visualization group box */ |
80 | 80 | ||
81 | QButtonGroup* group = new QButtonGroup( 1, Qt::Horizontal, "Visualization", this ); | 81 | QButtonGroup* group = new QButtonGroup( 1, Qt::Horizontal, "Visualization", this ); |
82 | QRadioButton* r1 = new QRadioButton( "Color Bars", group ); | 82 | QRadioButton* r1 = new QRadioButton( "Color Bars", group ); |
83 | QRadioButton* r2 = new QRadioButton( "Antenna", group ); | 83 | QRadioButton* r2 = new QRadioButton( "Antenna", group ); |
84 | r1->setFocusPolicy( QWidget::NoFocus ); | 84 | r1->setFocusPolicy( QWidget::NoFocus ); |
85 | r2->setFocusPolicy( QWidget::NoFocus ); | 85 | r2->setFocusPolicy( QWidget::NoFocus ); |
86 | group->setFocusPolicy( QWidget::NoFocus ); | 86 | group->setFocusPolicy( QWidget::NoFocus ); |
87 | group->setButton( displayStyle ); | 87 | group->setButton( displayStyle ); |
88 | grid->addWidget( group, 0, 1 ); | 88 | grid->addWidget( group, 0, 1 ); |
89 | 89 | ||
90 | /* quality graph */ | 90 | /* quality graph */ |
91 | 91 | ||
92 | mgraph = new MGraph( this ); | 92 | mgraph = new MGraph( this ); |
93 | mgraph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 93 | mgraph->setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
94 | mgraph->setMin( 0 ); | 94 | mgraph->setMin( 0 ); |
95 | mgraph->setMax( 92 ); | 95 | mgraph->setMax( 92 ); |
96 | grid->addWidget( mgraph, 1, 0 ); | 96 | grid->addWidget( mgraph, 1, 0 ); |
97 | mgraph->setFocusPolicy( QWidget::NoFocus ); | 97 | mgraph->setFocusPolicy( QWidget::NoFocus ); |
98 | 98 | ||
99 | /* advanced configuration Button */ | 99 | /* advanced configuration Button */ |
100 | 100 | ||
101 | QPushButton* advanced = new QPushButton( "Advanced...", this ); | 101 | QPushButton* advanced = new QPushButton( "Advanced...", this ); |
102 | advanced->setFocusPolicy( QWidget::NoFocus ); | 102 | advanced->setFocusPolicy( QWidget::NoFocus ); |
103 | grid->addWidget( advanced, 2, 0, Qt::AlignCenter ); | 103 | grid->addWidget( advanced, 2, 0, Qt::AlignCenter ); |
104 | connect( advanced, SIGNAL( clicked() ), | 104 | connect( advanced, SIGNAL( clicked() ), |
105 | this, SLOT( advancedConfigClicked() ) ); | 105 | this, SLOT( advancedConfigClicked() ) ); |
106 | 106 | ||
107 | /* update Frequency Label */ | 107 | /* update Frequency Label */ |
108 | 108 | ||
109 | updateLabel = new QLabel( this ); | 109 | updateLabel = new QLabel( this ); |
110 | text.sprintf( "Update every %d s", updateFrequency ); | 110 | text.sprintf( "Update every %d s", updateFrequency ); |
111 | updateLabel->setText( text ); | 111 | updateLabel->setText( text ); |
112 | grid->addWidget( updateLabel, 2, 1 ); | 112 | grid->addWidget( updateLabel, 2, 1 ); |
113 | 113 | ||
114 | /* update Frequency Slider */ | 114 | /* update Frequency Slider */ |
115 | 115 | ||
116 | QSlider* updateSlider = new QSlider( QSlider::Horizontal, this ); | 116 | QSlider* updateSlider = new QSlider( QSlider::Horizontal, this ); |
117 | updateSlider->setRange( 0, 9 ); | 117 | updateSlider->setRange( 0, 9 ); |
118 | updateSlider->setValue( updateFrequency ); | 118 | updateSlider->setValue( updateFrequency ); |
119 | updateSlider->setTickmarks( QSlider::Both ); | 119 | updateSlider->setTickmarks( QSlider::Both ); |
120 | updateSlider->setTickInterval( 1 ); | 120 | updateSlider->setTickInterval( 1 ); |
121 | updateSlider->setSteps( 1, 1 ); | 121 | updateSlider->setSteps( 1, 1 ); |
122 | updateSlider->setFocusPolicy( QWidget::NoFocus ); | 122 | updateSlider->setFocusPolicy( QWidget::NoFocus ); |
123 | grid->addWidget( updateSlider, 1, 1 ); | 123 | grid->addWidget( updateSlider, 1, 1 ); |
124 | connect( updateSlider, SIGNAL( valueChanged( int ) ), | 124 | connect( updateSlider, SIGNAL( valueChanged(int) ), |
125 | this, SLOT( updateDelayChange( int ) ) ); | 125 | this, SLOT( updateDelayChange(int) ) ); |
126 | 126 | ||
127 | setFixedSize( sizeHint() ); | 127 | setFixedSize( sizeHint() ); |
128 | setFocusPolicy( QWidget::NoFocus ); | 128 | setFocusPolicy( QWidget::NoFocus ); |
129 | 129 | ||
130 | applet->displayStyleChange( displayStyle ); | 130 | applet->displayStyleChange( displayStyle ); |
131 | applet->updateDelayChange( updateFrequency ); | 131 | applet->updateDelayChange( updateFrequency ); |
132 | 132 | ||
133 | connect( group, SIGNAL( clicked( int ) ), | 133 | connect( group, SIGNAL( clicked(int) ), |
134 | this, SLOT( displayStyleChange( int ) ) ); | 134 | this, SLOT( displayStyleChange(int) ) ); |
135 | 135 | ||
136 | applet->updateDHCPConfig( rocESSID, rocFREQ, rocAP, rocMODE ); | 136 | applet->updateDHCPConfig( rocESSID, rocFREQ, rocAP, rocMODE ); |
137 | } | 137 | } |
138 | 138 | ||
139 | void WirelessControl::advancedConfigClicked() | 139 | void WirelessControl::advancedConfigClicked() |
140 | { | 140 | { |
141 | AdvancedConfig * a = new AdvancedConfig( this, "dialog", TRUE ); | 141 | AdvancedConfig * a = new AdvancedConfig( this, "dialog", TRUE ); |
142 | int result = a->exec(); | 142 | int result = a->exec(); |
143 | a->hide(); | 143 | a->hide(); |
144 | delete a; | 144 | delete a; |
145 | if ( result == QDialog::Accepted ) | 145 | if ( result == QDialog::Accepted ) |
146 | { | 146 | { |
147 | readConfig(); | 147 | readConfig(); |
148 | applet->updateDHCPConfig( rocESSID, rocFREQ, rocAP, rocMODE ); | 148 | applet->updateDHCPConfig( rocESSID, rocFREQ, rocAP, rocMODE ); |
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
152 | void WirelessControl::updateDelayChange( int delay ) | 152 | void WirelessControl::updateDelayChange( int delay ) |
153 | { | 153 | { |
154 | QString text; | 154 | QString text; |
155 | text.sprintf( "Update every %d s", delay ); | 155 | text.sprintf( "Update every %d s", delay ); |
156 | updateLabel->setText( text ); | 156 | updateLabel->setText( text ); |
157 | applet->updateDelayChange( delay ); | 157 | applet->updateDelayChange( delay ); |
158 | writeConfigEntry( "UpdateFrequency", delay ); | 158 | writeConfigEntry( "UpdateFrequency", delay ); |
159 | } | 159 | } |
160 | 160 | ||
161 | void WirelessControl::displayStyleChange( int style ) | 161 | void WirelessControl::displayStyleChange( int style ) |
162 | { | 162 | { |
163 | applet->displayStyleChange( style ); | 163 | applet->displayStyleChange( style ); |
164 | writeConfigEntry( "DisplayStyle", style ); | 164 | writeConfigEntry( "DisplayStyle", style ); |
165 | } | 165 | } |
166 | 166 | ||
167 | void WirelessControl::show ( bool ) | 167 | void WirelessControl::show ( bool ) |
168 | { | 168 | { |
169 | QPoint curPos = applet->mapToGlobal( QPoint ( 0, 0 ) ); | 169 | QPoint curPos = applet->mapToGlobal( QPoint ( 0, 0 ) ); |
170 | 170 | ||
171 | int w = sizeHint().width(); | 171 | int w = sizeHint().width(); |
172 | int x = curPos.x() - ( w / 2 ); | 172 | int x = curPos.x() - ( w / 2 ); |
173 | 173 | ||
174 | if ( ( x + w ) > QPEApplication::desktop() ->width() ) | 174 | if ( ( x + w ) > QPEApplication::desktop() ->width() ) |
175 | x = QPEApplication::desktop ( ) -> width ( ) - w; | 175 | x = QPEApplication::desktop ( ) -> width ( ) - w; |
176 | 176 | ||
177 | move( x, curPos.y () - sizeHint().height () ); | 177 | move( x, curPos.y () - sizeHint().height () ); |
178 | QFrame::show(); | 178 | QFrame::show(); |
179 | } | 179 | } |
180 | 180 | ||
181 | void WirelessControl::readConfig() | 181 | void WirelessControl::readConfig() |
182 | { | 182 | { |