Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 84 |
1 files changed, 46 insertions, 38 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index c1918de..cdee87c 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp @@ -19,2 +19,3 @@ **********************************************************************/ + #include "soundsettings.h" @@ -35,23 +36,26 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) { - Config config( "Sound" ); - config.setGroup( "System" ); - volume->setValue(100-config.readNumEntry("Volume")); + Config config( "qpe"); + config.setGroup( "Volume" ); + volume->setValue(100-config.readNumEntry("VolumePercent")); mic->setValue(100-config.readNumEntry("Mic")); - touchsound->setChecked(config.readBoolEntry("Touch")); - keysound->setChecked(config.readBoolEntry("Key")); - AlertCheckBox->setChecked(config.readBoolEntry("Alert")); +// touchsound->setChecked(config.readBoolEntry("TouchSound")); +// keysound->setChecked(config.readBoolEntry("KeySound")); + Config cfg("Vmemo"); + AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); - config.setGroup("Record"); + cfg.setGroup("Record"); int rate=config.readNumEntry("SampleRate", 22050); - if(rate == 11025) + if(rate == 8000) sampleRate->setCurrentItem(0); - else if(rate == 22050) + else if(rate == 11025) sampleRate->setCurrentItem(1); - else if(rate == 32000) + else if(rate == 22050) sampleRate->setCurrentItem(2); + else if(rate == 33075) + sampleRate->setCurrentItem(3); else if(rate==44100) - sampleRate->setCurrentItem(2); + sampleRate->setCurrentItem(4); - stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); - sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); + stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); + sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); @@ -68,6 +72,6 @@ void SoundSettings::reject() { - Config config( "Sound" ); - config.setGroup( "System" ); + Config config( "qpe"); + config.setGroup( "Volume"); - setVolume(100-config.readNumEntry("Volume")); + setVolume(100-config.readNumEntry("VolumePercent")); setMic(100-config.readNumEntry("Mic")); @@ -92,9 +96,11 @@ void SoundSettings::accept() { - Config config( "Sound" ); - config.setGroup( "System" ); - config.writeEntry("Volume",100-volume->value()); + Config config( "qpe" ); + config.setGroup( "Volume" ); + config.writeEntry("VolumePercent",100-volume->value()); config.writeEntry("Mic",100-mic->value()); - config.writeEntry("Touch",touchsound->isChecked()); - config.writeEntry("Key",keysound->isChecked()); - config.writeEntry("Alert",AlertCheckBox->isChecked()); +// config.writeEntry("TouchSound",touchsound->isChecked()); +// config.writeEntry("KeySound",keysound->isChecked()); + + Config cfg("Vmemo"); + cfg.writeEntry("Alert",AlertCheckBox->isChecked()); setVolume(volume->value()); @@ -102,7 +108,9 @@ void SoundSettings::accept() - config.setGroup("Record"); - config.writeEntry("SampleRate",sampleRate->currentText()); - config.writeEntry("Stereo",stereoCheckBox->isChecked()); - config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); - + cfg.setGroup("Record"); + cfg.writeEntry("SampleRate",sampleRate->currentText()); + cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); + cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); +// Config cfg( "VMemo" ); +// cfg.setGroup( "Defaults" ); +// cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked()); QDialog::accept(); @@ -112,5 +120,5 @@ void SoundSettings::setVolume(int v) { - Config config( "Sound" ); - config.setGroup( "System" ); - config.writeEntry("Volume",100-v); + Config config( "qpe" ); + config.setGroup( "Volume" ); + config.writeEntry("VolumePercent",100-v); #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) @@ -122,4 +130,4 @@ void SoundSettings::setMic(int m) { - Config config( "Sound" ); - config.setGroup( "System" ); + Config config( "qpe" ); + config.setGroup( "Volume" ); config.writeEntry("Mic",100-m); @@ -132,5 +140,5 @@ void SoundSettings::volumeChanged( bool ) { - Config config( "Sound" ); - config.setGroup( "System" ); - volume->setValue(100-config.readNumEntry("Volume")); + Config config( "qpe" ); + config.setGroup( "Volume" ); + volume->setValue(100-config.readNumEntry("VolumePercent")); } @@ -139,4 +147,4 @@ void SoundSettings::micChanged( bool ) { - Config config( "Sound" ); - config.setGroup( "System" ); + Config config( "qpe" ); + config.setGroup( "Volume" ); mic->setValue(100-config.readNumEntry("Mic")); @@ -162,3 +170,3 @@ void SoundSettings::updateStorageCombo() { void SoundSettings::setLocation(const QString & string) { - Config config( "Sound" ); + Config config( "Vmemo" ); config.setGroup( "System" ); |