summaryrefslogtreecommitdiff
path: root/noncore/applets/wirelessapplet
Unidiff
Diffstat (limited to 'noncore/applets/wirelessapplet') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp8
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
139void WirelessControl::advancedConfigClicked() 139void 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
152void WirelessControl::updateDelayChange( int delay ) 152void 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
161void WirelessControl::displayStyleChange( int style ) 161void 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
167void WirelessControl::show ( bool ) 167void 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
181void WirelessControl::readConfig() 181void WirelessControl::readConfig()
182{ 182{