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 | |||
@@ -17,6 +17,7 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
20 | #include "soundsettings.h" | 21 | #include "soundsettings.h" |
21 | 22 | ||
22 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
@@ -33,27 +34,30 @@ | |||
33 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | 34 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) |
34 | : SoundSettingsBase( parent, name, TRUE, fl ) | 35 | : SoundSettingsBase( parent, name, TRUE, fl ) |
35 | { | 36 | { |
36 | Config config( "Sound" ); | 37 | Config config( "qpe"); |
37 | config.setGroup( "System" ); | 38 | config.setGroup( "Volume" ); |
38 | volume->setValue(100-config.readNumEntry("Volume")); | 39 | volume->setValue(100-config.readNumEntry("VolumePercent")); |
39 | mic->setValue(100-config.readNumEntry("Mic")); | 40 | mic->setValue(100-config.readNumEntry("Mic")); |
40 | touchsound->setChecked(config.readBoolEntry("Touch")); | 41 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); |
41 | keysound->setChecked(config.readBoolEntry("Key")); | 42 | // keysound->setChecked(config.readBoolEntry("KeySound")); |
42 | AlertCheckBox->setChecked(config.readBoolEntry("Alert")); | 43 | Config cfg("Vmemo"); |
44 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); | ||
43 | 45 | ||
44 | config.setGroup("Record"); | 46 | cfg.setGroup("Record"); |
45 | int rate=config.readNumEntry("SampleRate", 22050); | 47 | int rate=config.readNumEntry("SampleRate", 22050); |
46 | if(rate == 11025) | 48 | if(rate == 8000) |
47 | sampleRate->setCurrentItem(0); | 49 | sampleRate->setCurrentItem(0); |
48 | else if(rate == 22050) | 50 | else if(rate == 11025) |
49 | sampleRate->setCurrentItem(1); | 51 | sampleRate->setCurrentItem(1); |
50 | else if(rate == 32000) | 52 | else if(rate == 22050) |
51 | sampleRate->setCurrentItem(2); | 53 | sampleRate->setCurrentItem(2); |
54 | else if(rate == 33075) | ||
55 | sampleRate->setCurrentItem(3); | ||
52 | else if(rate==44100) | 56 | else if(rate==44100) |
53 | sampleRate->setCurrentItem(2); | 57 | sampleRate->setCurrentItem(4); |
54 | 58 | ||
55 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 59 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); |
56 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); | 60 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); |
57 | 61 | ||
58 | updateStorageCombo(); | 62 | updateStorageCombo(); |
59 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); | 63 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); |
@@ -66,10 +70,10 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | |||
66 | 70 | ||
67 | void SoundSettings::reject() | 71 | void SoundSettings::reject() |
68 | { | 72 | { |
69 | Config config( "Sound" ); | 73 | Config config( "qpe"); |
70 | config.setGroup( "System" ); | 74 | config.setGroup( "Volume"); |
71 | 75 | ||
72 | setVolume(100-config.readNumEntry("Volume")); | 76 | setVolume(100-config.readNumEntry("VolumePercent")); |
73 | setMic(100-config.readNumEntry("Mic")); | 77 | setMic(100-config.readNumEntry("Mic")); |
74 | 78 | ||
75 | // config.setGroup("Record"); | 79 | // config.setGroup("Record"); |
@@ -90,29 +94,33 @@ void SoundSettings::reject() | |||
90 | 94 | ||
91 | void SoundSettings::accept() | 95 | void SoundSettings::accept() |
92 | { | 96 | { |
93 | Config config( "Sound" ); | 97 | Config config( "qpe" ); |
94 | config.setGroup( "System" ); | 98 | config.setGroup( "Volume" ); |
95 | config.writeEntry("Volume",100-volume->value()); | 99 | config.writeEntry("VolumePercent",100-volume->value()); |
96 | config.writeEntry("Mic",100-mic->value()); | 100 | config.writeEntry("Mic",100-mic->value()); |
97 | config.writeEntry("Touch",touchsound->isChecked()); | 101 | // config.writeEntry("TouchSound",touchsound->isChecked()); |
98 | config.writeEntry("Key",keysound->isChecked()); | 102 | // config.writeEntry("KeySound",keysound->isChecked()); |
99 | config.writeEntry("Alert",AlertCheckBox->isChecked()); | 103 | |
104 | Config cfg("Vmemo"); | ||
105 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | ||
100 | setVolume(volume->value()); | 106 | setVolume(volume->value()); |
101 | setMic(mic->value()); | 107 | setMic(mic->value()); |
102 | 108 | ||
103 | config.setGroup("Record"); | 109 | cfg.setGroup("Record"); |
104 | config.writeEntry("SampleRate",sampleRate->currentText()); | 110 | cfg.writeEntry("SampleRate",sampleRate->currentText()); |
105 | config.writeEntry("Stereo",stereoCheckBox->isChecked()); | 111 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); |
106 | config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 112 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
107 | 113 | // Config cfg( "VMemo" ); | |
114 | // cfg.setGroup( "Defaults" ); | ||
115 | // cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked()); | ||
108 | QDialog::accept(); | 116 | QDialog::accept(); |
109 | } | 117 | } |
110 | 118 | ||
111 | void SoundSettings::setVolume(int v) | 119 | void SoundSettings::setVolume(int v) |
112 | { | 120 | { |
113 | Config config( "Sound" ); | 121 | Config config( "qpe" ); |
114 | config.setGroup( "System" ); | 122 | config.setGroup( "Volume" ); |
115 | config.writeEntry("Volume",100-v); | 123 | config.writeEntry("VolumePercent",100-v); |
116 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 124 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
117 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | 125 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; |
118 | #endif | 126 | #endif |
@@ -120,8 +128,8 @@ void SoundSettings::setVolume(int v) | |||
120 | 128 | ||
121 | void SoundSettings::setMic(int m) | 129 | void SoundSettings::setMic(int m) |
122 | { | 130 | { |
123 | Config config( "Sound" ); | 131 | Config config( "qpe" ); |
124 | config.setGroup( "System" ); | 132 | config.setGroup( "Volume" ); |
125 | config.writeEntry("Mic",100-m); | 133 | config.writeEntry("Mic",100-m); |
126 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 134 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
127 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; | 135 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; |
@@ -130,15 +138,15 @@ void SoundSettings::setMic(int m) | |||
130 | 138 | ||
131 | void SoundSettings::volumeChanged( bool ) | 139 | void SoundSettings::volumeChanged( bool ) |
132 | { | 140 | { |
133 | Config config( "Sound" ); | 141 | Config config( "qpe" ); |
134 | config.setGroup( "System" ); | 142 | config.setGroup( "Volume" ); |
135 | volume->setValue(100-config.readNumEntry("Volume")); | 143 | volume->setValue(100-config.readNumEntry("VolumePercent")); |
136 | } | 144 | } |
137 | 145 | ||
138 | void SoundSettings::micChanged( bool ) | 146 | void SoundSettings::micChanged( bool ) |
139 | { | 147 | { |
140 | Config config( "Sound" ); | 148 | Config config( "qpe" ); |
141 | config.setGroup( "System" ); | 149 | config.setGroup( "Volume" ); |
142 | mic->setValue(100-config.readNumEntry("Mic")); | 150 | mic->setValue(100-config.readNumEntry("Mic")); |
143 | } | 151 | } |
144 | 152 | ||
@@ -160,7 +168,7 @@ void SoundSettings::updateStorageCombo() { | |||
160 | } | 168 | } |
161 | 169 | ||
162 | void SoundSettings::setLocation(const QString & string) { | 170 | void SoundSettings::setLocation(const QString & string) { |
163 | Config config( "Sound" ); | 171 | Config config( "Vmemo" ); |
164 | config.setGroup( "System" ); | 172 | config.setGroup( "System" ); |
165 | config.writeEntry("RecLocation",string); | 173 | config.writeEntry("RecLocation",string); |
166 | 174 | ||