Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 107 |
1 files changed, 0 insertions, 107 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index a163d38..99fccf7 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -45,10 +45,6 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | |||
45 | 45 | ||
46 | Config config( "qpe"); | 46 | Config config( "qpe"); |
47 | config.setGroup( "Volume" ); | 47 | config.setGroup( "Volume" ); |
48 | volume->setValue(100-config.readNumEntry("VolumePercent")); | ||
49 | mic->setValue(100-config.readNumEntry("Mic")); | ||
50 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); | ||
51 | // keysound->setChecked(config.readBoolEntry("KeySound")); | ||
52 | Config cfg("Vmemo"); | 48 | Config cfg("Vmemo"); |
53 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 49 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
54 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); | 50 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); |
@@ -100,110 +96,17 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | |||
100 | else | 96 | else |
101 | timeLimitComboBox->setCurrentItem(4); | 97 | timeLimitComboBox->setCurrentItem(4); |
102 | 98 | ||
103 | |||
104 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); | 99 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); |
105 | 100 | ||
106 | cfg.setGroup("Defaults"); | 101 | cfg.setGroup("Defaults"); |
107 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); | 102 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); |
108 | 103 | ||
109 | updateStorageCombo(); | 104 | updateStorageCombo(); |
110 | |||
111 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); | ||
112 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); | ||
113 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | ||
114 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); | ||
115 | |||
116 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); | 105 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); |
117 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); | 106 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); |
118 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); | 107 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); |
119 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 108 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
120 | } | 109 | } |
121 | |||
122 | // void SoundSettings::reject() | ||
123 | // { | ||
124 | // qDebug("reject"); | ||
125 | // Config config( "qpe"); | ||
126 | // config.setGroup( "Volume"); | ||
127 | |||
128 | // setVolume(100-config.readNumEntry("VolumePercent")); | ||
129 | // setMic(100-config.readNumEntry("Mic")); | ||
130 | |||
131 | // // config.setGroup("Record"); | ||
132 | // // int rate=config.readNumEntry("SampleRate", 11025); | ||
133 | // // if(rate == 11025) | ||
134 | // // sampleRate->setCurrentItem(0); | ||
135 | // // else if(rate == 22050) | ||
136 | // // sampleRate->setCurrentItem(1); | ||
137 | // // else if(rate == 32000) | ||
138 | // // sampleRate->setCurrentItem(2); | ||
139 | // // else if(rate==44100) | ||
140 | // // sampleRate->setCurrentItem(3); | ||
141 | // // stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | ||
142 | // // sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | ||
143 | // qDebug("QDialog::reject();"); | ||
144 | // ::exit(-1); | ||
145 | // } | ||
146 | |||
147 | // void SoundSettings::accept() | ||
148 | // { | ||
149 | // qDebug("accept"); | ||
150 | // Config config( "qpe" ); | ||
151 | // config.setGroup( "Volume" ); | ||
152 | // config.writeEntry("VolumePercent",100-volume->value()); | ||
153 | // config.writeEntry("Mic",100-mic->value()); | ||
154 | // // config.writeEntry("TouchSound",touchsound->isChecked()); | ||
155 | // // config.writeEntry("KeySound",keysound->isChecked()); | ||
156 | |||
157 | // Config cfg("Vmemo"); | ||
158 | // cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | ||
159 | // setVolume(volume->value()); | ||
160 | // setMic(mic->value()); | ||
161 | |||
162 | // cfg.setGroup("Record"); | ||
163 | // cfg.writeEntry("SampleRate",sampleRate->currentText()); | ||
164 | // cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); | ||
165 | // cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | ||
166 | // // Config cfg( "VMemo" ); | ||
167 | // // cfg.setGroup( "Defaults" ); | ||
168 | // // cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked()); | ||
169 | // qDebug("QDialog::accept();"); | ||
170 | // ::exit(0); | ||
171 | // } | ||
172 | |||
173 | void SoundSettings::setVolume(int v) | ||
174 | { | ||
175 | Config config( "qpe" ); | ||
176 | config.setGroup( "Volume" ); | ||
177 | config.writeEntry("VolumePercent",100-v); | ||
178 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | ||
179 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | ||
180 | #endif | ||
181 | } | ||
182 | |||
183 | void SoundSettings::setMic(int m) | ||
184 | { | ||
185 | Config config( "qpe" ); | ||
186 | config.setGroup( "Volume" ); | ||
187 | config.writeEntry("Mic",100-m); | ||
188 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | ||
189 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; | ||
190 | #endif | ||
191 | } | ||
192 | |||
193 | void SoundSettings::volumeChanged( bool ) | ||
194 | { | ||
195 | Config config( "qpe" ); | ||
196 | config.setGroup( "Volume" ); | ||
197 | volume->setValue(100-config.readNumEntry("VolumePercent")); | ||
198 | } | ||
199 | |||
200 | void SoundSettings::micChanged( bool ) | ||
201 | { | ||
202 | Config config( "qpe" ); | ||
203 | config.setGroup( "Volume" ); | ||
204 | mic->setValue(100-config.readNumEntry("Mic")); | ||
205 | } | ||
206 | |||
207 | void SoundSettings::updateStorageCombo() { | 110 | void SoundSettings::updateStorageCombo() { |
208 | 111 | ||
209 | Config config( "Vmemo" ); | 112 | Config config( "Vmemo" ); |
@@ -244,18 +147,8 @@ void SoundSettings::setLocation(const QString & string) { | |||
244 | } | 147 | } |
245 | 148 | ||
246 | void SoundSettings::cleanUp() { | 149 | void SoundSettings::cleanUp() { |
247 | qDebug("cleanup"); | ||
248 | Config config( "qpe" ); | ||
249 | config.setGroup( "Volume" ); | ||
250 | config.writeEntry("VolumePercent",100-volume->value()); | ||
251 | config.writeEntry("Mic",100-mic->value()); | ||
252 | // config.writeEntry("TouchSound",touchsound->isChecked()); | ||
253 | // config.writeEntry("KeySound",keysound->isChecked()); | ||
254 | |||
255 | Config cfg("Vmemo"); | 150 | Config cfg("Vmemo"); |
256 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | 151 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); |
257 | setVolume(volume->value()); | ||
258 | setMic(mic->value()); | ||
259 | 152 | ||
260 | cfg.setGroup("Record"); | 153 | cfg.setGroup("Record"); |
261 | cfg.writeEntry("SampleRate",sampleRate->currentText()); | 154 | cfg.writeEntry("SampleRate",sampleRate->currentText()); |