summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 6fea3ed..a163d38 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -169,108 +169,112 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl )
169// qDebug("QDialog::accept();"); 169// qDebug("QDialog::accept();");
170// ::exit(0); 170// ::exit(0);
171// } 171// }
172 172
173void SoundSettings::setVolume(int v) 173void SoundSettings::setVolume(int v)
174{ 174{
175 Config config( "qpe" ); 175 Config config( "qpe" );
176 config.setGroup( "Volume" ); 176 config.setGroup( "Volume" );
177 config.writeEntry("VolumePercent",100-v); 177 config.writeEntry("VolumePercent",100-v);
178#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 178#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
179 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; 179 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
180#endif 180#endif
181} 181}
182 182
183void SoundSettings::setMic(int m) 183void SoundSettings::setMic(int m)
184{ 184{
185 Config config( "qpe" ); 185 Config config( "qpe" );
186 config.setGroup( "Volume" ); 186 config.setGroup( "Volume" );
187 config.writeEntry("Mic",100-m); 187 config.writeEntry("Mic",100-m);
188#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 188#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
189 QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; 189 QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE;
190#endif 190#endif
191} 191}
192 192
193void SoundSettings::volumeChanged( bool ) 193void SoundSettings::volumeChanged( bool )
194{ 194{
195 Config config( "qpe" ); 195 Config config( "qpe" );
196 config.setGroup( "Volume" ); 196 config.setGroup( "Volume" );
197 volume->setValue(100-config.readNumEntry("VolumePercent")); 197 volume->setValue(100-config.readNumEntry("VolumePercent"));
198} 198}
199 199
200void SoundSettings::micChanged( bool ) 200void SoundSettings::micChanged( bool )
201{ 201{
202 Config config( "qpe" ); 202 Config config( "qpe" );
203 config.setGroup( "Volume" ); 203 config.setGroup( "Volume" );
204 mic->setValue(100-config.readNumEntry("Mic")); 204 mic->setValue(100-config.readNumEntry("Mic"));
205} 205}
206 206
207void SoundSettings::updateStorageCombo() { 207void SoundSettings::updateStorageCombo() {
208 208
209 Config config( "Vmemo" ); 209 Config config( "Vmemo" );
210 config.setGroup( "System" ); 210 config.setGroup( "System" );
211 QString loc = config.readEntry("RecLocation","/"); 211 QString loc = config.readEntry("RecLocation","/");
212int i=0; 212int i=0;
213int set=0; 213int set=0;
214 StorageInfo storageInfo; 214 StorageInfo storageInfo;
215 QString sName, sPath; 215 QString sName, sPath;
216 QStringList list; 216 QStringList list;
217 list << "Documents : "+QPEApplication::documentDir();
218 list << "tmp : /tmp";
219
217 const QList<FileSystem> &fs = storageInfo.fileSystems(); 220 const QList<FileSystem> &fs = storageInfo.fileSystems();
218 QListIterator<FileSystem> it ( fs ); 221 QListIterator<FileSystem> it ( fs );
219 for( ; it.current(); ++it ){ 222 for( ; it.current(); ++it ){
220 const QString name = (*it)->name(); 223 const QString name = (*it)->name();
221 const QString path = (*it)->path(); 224 const QString path = (*it)->path();
222 qDebug("storage name "+name +" storage path is "+path); 225 qDebug("storage name "+name +" storage path is "+path);
223 list << name + ": " +path; 226 list << name + ": " +path;
224 if( loc.find( path,0,TRUE) != -1) 227 if( loc.find( path,0,TRUE) != -1)
225 set = i; 228 set = i;
226// if(dit.current()->file().find(path) != -1 ) storage=name; 229// if(dit.current()->file().find(path) != -1 ) storage=name;
227 i++; 230 i++;
228 } 231 }
232
229 LocationComboBox->insertStringList(list); 233 LocationComboBox->insertStringList(list);
230 qDebug("set item %d", set); 234 qDebug("set item %d", set);
231 LocationComboBox->setCurrentItem(set); 235 LocationComboBox->setCurrentItem(set);
232} 236}
233 237
234void SoundSettings::setLocation(const QString & string) { 238void SoundSettings::setLocation(const QString & string) {
235 Config config( "Vmemo" ); 239 Config config( "Vmemo" );
236 config.setGroup( "System" ); 240 config.setGroup( "System" );
237 config.writeEntry("RecLocation",string); 241 config.writeEntry("RecLocation",string);
238 qDebug("set location "+string); 242 qDebug("set location "+string);
239 config.write(); 243 config.write();
240} 244}
241 245
242void SoundSettings::cleanUp() { 246void SoundSettings::cleanUp() {
243 qDebug("cleanup"); 247 qDebug("cleanup");
244 Config config( "qpe" ); 248 Config config( "qpe" );
245 config.setGroup( "Volume" ); 249 config.setGroup( "Volume" );
246 config.writeEntry("VolumePercent",100-volume->value()); 250 config.writeEntry("VolumePercent",100-volume->value());
247 config.writeEntry("Mic",100-mic->value()); 251 config.writeEntry("Mic",100-mic->value());
248// config.writeEntry("TouchSound",touchsound->isChecked()); 252// config.writeEntry("TouchSound",touchsound->isChecked());
249// config.writeEntry("KeySound",keysound->isChecked()); 253// config.writeEntry("KeySound",keysound->isChecked());
250 254
251 Config cfg("Vmemo"); 255 Config cfg("Vmemo");
252 cfg.writeEntry("Alert",AlertCheckBox->isChecked()); 256 cfg.writeEntry("Alert",AlertCheckBox->isChecked());
253 setVolume(volume->value()); 257 setVolume(volume->value());
254 setMic(mic->value()); 258 setMic(mic->value());
255 259
256 cfg.setGroup("Record"); 260 cfg.setGroup("Record");
257 cfg.writeEntry("SampleRate",sampleRate->currentText()); 261 cfg.writeEntry("SampleRate",sampleRate->currentText());
258 cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); 262 cfg.writeEntry("Stereo",stereoCheckBox->isChecked());
259 cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); 263 cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
260 264
261 if(keyReset) QCopEnvelope ("QPE/System", "restart()"); 265 if(keyReset) QCopEnvelope ("QPE/System", "restart()");
262 266
263} 267}
264 268
265void SoundSettings::setKeyButton(const QString &name) { 269void SoundSettings::setKeyButton(const QString &name) {
266 Config cfg("Vmemo"); 270 Config cfg("Vmemo");
267 cfg.setGroup("Defaults"); 271 cfg.setGroup("Defaults");
268 cfg.writeEntry( "toggleKey", keyComboBox->currentItem() ); 272 cfg.writeEntry( "toggleKey", keyComboBox->currentItem() );
269 keyReset = TRUE; 273 keyReset = TRUE;
270 if(keyComboBox->currentItem() == 1) 274 if(keyComboBox->currentItem() == 1)
271 cfg.writeEntry( "hideIcon", 0 ); 275 cfg.writeEntry( "hideIcon", 0 );
272 else 276 else
273 cfg.writeEntry( "hideIcon", 1); 277 cfg.writeEntry( "hideIcon", 1);
274 278
275 279
276 cfg.write(); 280 cfg.write();