-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 14 | ||||
-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 168 | ||||
-rw-r--r-- | core/applets/volumeapplet/volume.h | 9 |
3 files changed, 130 insertions, 61 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index c27050d..7cc4062 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -270,5 +270,5 @@ bool VMemo::startRecording() { | |||
270 | if ( recording) | 270 | if ( recording) |
271 | return FALSE;; | 271 | return FALSE;; |
272 | Config config( "Sound" ); | 272 | Config config( "Vmemo" ); |
273 | config.setGroup( "System" ); | 273 | config.setGroup( "System" ); |
274 | useAlerts = config.readBoolEntry("Alert"); | 274 | useAlerts = config.readBoolEntry("Alert"); |
@@ -289,14 +289,12 @@ bool VMemo::startRecording() { | |||
289 | } | 289 | } |
290 | 290 | ||
291 | Config vmCfg("VMemo"); | 291 | config.setGroup("Defaults"); |
292 | vmCfg.setGroup("Defaults"); | ||
293 | 292 | ||
294 | QDateTime dt = QDateTime::currentDateTime(); | 293 | QDateTime dt = QDateTime::currentDateTime(); |
295 | 294 | ||
296 | QString fName; | 295 | QString fName; |
297 | Config cfg( "Sound" ); | 296 | config.setGroup( "System" ); |
298 | cfg.setGroup( "System" ); | ||
299 | fName = QPEApplication::documentDir() ; | 297 | fName = QPEApplication::documentDir() ; |
300 | fileName = cfg.readEntry("RecLocation", fName); | 298 | fileName = config.readEntry("RecLocation", fName); |
301 | 299 | ||
302 | int s; | 300 | int s; |
@@ -326,5 +324,5 @@ bool VMemo::startRecording() { | |||
326 | 324 | ||
327 | QArray<int> cats(1); | 325 | QArray<int> cats(1); |
328 | cats[0] = vmCfg.readNumEntry("Category", 0); | 326 | cats[0] = config.readNumEntry("Category", 0); |
329 | 327 | ||
330 | QString dlName("vm_"); | 328 | QString dlName("vm_"); |
@@ -347,5 +345,5 @@ void VMemo::stopRecording() { | |||
347 | int VMemo::openDSP() | 345 | int VMemo::openDSP() |
348 | { | 346 | { |
349 | Config cfg("Sound"); | 347 | Config cfg("Vmemo"); |
350 | cfg.setGroup("Record"); | 348 | cfg.setGroup("Record"); |
351 | 349 | ||
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index e393f0f..e8921f0 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp | |||
@@ -53,6 +53,6 @@ VolumeControl::VolumeControl( bool showMic, QWidget *parent, const char *name ) | |||
53 | void VolumeControl::createView(bool showMic) | 53 | void VolumeControl::createView(bool showMic) |
54 | { | 54 | { |
55 | Config cfg("Sound"); | 55 | Config cfg("qpe"); |
56 | cfg.setGroup("System"); | 56 | cfg.setGroup("Volume"); |
57 | //showMic = TRUE; | 57 | //showMic = TRUE; |
58 | QHBoxLayout *hboxLayout = new QHBoxLayout(this); | 58 | QHBoxLayout *hboxLayout = new QHBoxLayout(this); |
@@ -68,4 +68,7 @@ void VolumeControl::createView(bool showMic) | |||
68 | downButton->setPixmap( Resource::loadPixmap( "down" ) ); | 68 | downButton->setPixmap( Resource::loadPixmap( "down" ) ); |
69 | vboxButtons->setSpacing( 2 ); | 69 | vboxButtons->setSpacing( 2 ); |
70 | |||
71 | upButton->setFixedHeight(26); | ||
72 | downButton->setFixedHeight(26); | ||
70 | 73 | ||
71 | vboxButtons->addWidget( upButton ); | 74 | vboxButtons->addWidget( upButton ); |
@@ -80,5 +83,5 @@ void VolumeControl::createView(bool showMic) | |||
80 | slider->setTickInterval( 20 ); | 83 | slider->setTickInterval( 20 ); |
81 | slider->setFocusPolicy( QWidget::NoFocus ); | 84 | slider->setFocusPolicy( QWidget::NoFocus ); |
82 | slider->setValue(cfg.readNumEntry("Volume")); | 85 | slider->setValue(cfg.readNumEntry("VolumePercent")); |
83 | 86 | ||
84 | QVBoxLayout *sbox = new QVBoxLayout(this); | 87 | QVBoxLayout *sbox = new QVBoxLayout(this); |
@@ -88,41 +91,69 @@ void VolumeControl::createView(bool showMic) | |||
88 | sbox->addWidget( slider, 0, Qt::AlignVCenter | Qt::AlignHCenter ); | 91 | sbox->addWidget( slider, 0, Qt::AlignVCenter | Qt::AlignHCenter ); |
89 | 92 | ||
90 | if (showMic == TRUE) { | 93 | // if (showMic == TRUE) { |
91 | mic = new QSlider(this); | 94 | mic = new QSlider(this); |
92 | mic->setRange( 0, 100 ); | 95 | mic->setRange( 0, 100 ); |
93 | mic->setTickmarks( QSlider::Both ); | 96 | mic->setTickmarks( QSlider::Both ); |
94 | mic->setTickInterval( 20 ); | 97 | mic->setTickInterval( 20 ); |
95 | mic->setFocusPolicy( QWidget::NoFocus ); | 98 | mic->setFocusPolicy( QWidget::NoFocus ); |
96 | mic->setValue(cfg.readNumEntry("Mic")); | 99 | mic->setValue(cfg.readNumEntry("Mic")); |
97 | 100 | ||
98 | QVBoxLayout *mbox = new QVBoxLayout(this); | 101 | QVBoxLayout *mbox = new QVBoxLayout(this); |
99 | mbox->setMargin( 3 ); | 102 | mbox->setMargin( 3 ); |
100 | mbox->setSpacing( 3 ); | 103 | mbox->setSpacing( 3 ); |
101 | mbox->addWidget( new QLabel("Mic", this) , 0, Qt::AlignVCenter | Qt::AlignHCenter ); | 104 | mbox->addWidget( new QLabel("Mic", this) , 0, Qt::AlignVCenter | Qt::AlignHCenter ); |
102 | mbox->addWidget( mic, 0, Qt::AlignVCenter | Qt::AlignHCenter ); | 105 | mbox->addWidget( mic, 0, Qt::AlignVCenter | Qt::AlignHCenter ); |
103 | 106 | ||
104 | hbox = new QHBoxLayout( this ); | 107 | hbox = new QHBoxLayout( this ); |
105 | hbox->setMargin( 3 ); | 108 | hbox->setMargin( 3 ); |
106 | hbox->setSpacing( 3 ); | 109 | hbox->setSpacing( 3 ); |
107 | hbox->addLayout( sbox, 1); | 110 | hbox->addLayout( sbox, 1); |
108 | hbox->addLayout( mbox, 1); | 111 | hbox->addLayout( mbox, 1); |
109 | } | 112 | // } |
110 | 113 | ||
111 | muteBox = new QCheckBox( tr("Mute"), this ); | 114 | muteBox = new QCheckBox( tr("Mute"), this ); |
112 | muteBox->setFocusPolicy( QWidget::NoFocus ); | 115 | muteBox->setFocusPolicy( QWidget::NoFocus ); |
113 | 116 | ||
117 | QVBoxLayout *klbox = new QVBoxLayout(this); | ||
118 | |||
119 | QLabel *Label1; | ||
120 | Label1 = new QLabel( this, "Label1" ); | ||
121 | Label1->setText( tr( "Enable Sounds for:" )); | ||
122 | |||
123 | alarmSound = new QCheckBox( tr("Alarm Sound"), this ); | ||
124 | alarmSound->setFocusPolicy( QWidget::NoFocus ); | ||
125 | |||
126 | keyclicks = new QCheckBox( tr("Key Clicks"), this ); | ||
127 | keyclicks->setFocusPolicy( QWidget::NoFocus ); | ||
128 | |||
129 | screentaps = new QCheckBox( tr("Screen taps"), this ); | ||
130 | screentaps->setFocusPolicy( QWidget::NoFocus ); | ||
131 | |||
132 | |||
133 | keyclicks->setChecked( cfg.readBoolEntry("KeySound",0)); | ||
134 | screentaps->setChecked( cfg.readBoolEntry("TouchSound",0)); | ||
135 | alarmSound->setChecked( cfg.readBoolEntry("AlarmSound",1)); | ||
136 | |||
137 | klbox->setMargin( 3 ); | ||
138 | klbox->setSpacing( 0 ); | ||
139 | klbox->addWidget( Label1, 1); | ||
140 | klbox->addWidget( alarmSound, 1); | ||
141 | klbox->addWidget( keyclicks, 1); | ||
142 | klbox->addWidget( screentaps, 1); | ||
114 | vbox->setMargin( 3 ); | 143 | vbox->setMargin( 3 ); |
115 | vbox->setSpacing( 0 ); | 144 | vbox->setSpacing( 0 ); |
116 | if (showMic == TRUE) | 145 | // if (showMic == TRUE) |
117 | vbox->addLayout( hbox, 1 ); | 146 | vbox->addLayout( hbox, 1 ); |
118 | else | 147 | // else |
119 | vbox->addLayout( sbox, 1); | 148 | // vbox->addLayout( sbox, 1); |
120 | vbox->addWidget( muteBox, 0, Qt::AlignVCenter | Qt::AlignHCenter ); | 149 | vbox->addWidget( muteBox, 0, Qt::AlignVCenter | Qt::AlignHCenter ); |
121 | 150 | ||
122 | hboxLayout->addLayout( vboxButtons ); | 151 | hboxLayout->addLayout( vboxButtons ); |
123 | hboxLayout->addLayout(vbox); | 152 | hboxLayout->addLayout( vbox); |
153 | hboxLayout->addLayout( klbox); | ||
124 | 154 | ||
125 | setFixedHeight( 120 ); | 155 | |
126 | setFixedWidth( sizeHint().width() ); | 156 | setFixedHeight( 120); |
157 | // setFixedWidth( sizeHint().width() ); | ||
127 | setFocusPolicy(QWidget::NoFocus); | 158 | setFocusPolicy(QWidget::NoFocus); |
128 | connect( upButton, SIGNAL( pressed() ), this, SLOT( ButtonChanged() ) ); | 159 | connect( upButton, SIGNAL( pressed() ), this, SLOT( ButtonChanged() ) ); |
@@ -180,6 +211,6 @@ VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) | |||
180 | : QWidget( parent, name ) | 211 | : QWidget( parent, name ) |
181 | { | 212 | { |
182 | Config cfg("Sound"); | 213 | Config cfg("qpe"); |
183 | cfg.setGroup("System"); | 214 | cfg.setGroup("Volume"); |
184 | 215 | ||
185 | setFixedHeight( 18 ); | 216 | setFixedHeight( 18 ); |
@@ -188,5 +219,5 @@ VolumeApplet::VolumeApplet( QWidget *parent, const char *name ) | |||
188 | volumePixmap = Resource::loadPixmap( "volume" ); | 219 | volumePixmap = Resource::loadPixmap( "volume" ); |
189 | 220 | ||
190 | volumePercent = cfg.readNumEntry("Volume",50); | 221 | volumePercent = cfg.readNumEntry("VolumePercent",50); |
191 | micPercent = cfg.readNumEntry("Mic", 50); | 222 | micPercent = cfg.readNumEntry("Mic", 50); |
192 | muted = FALSE; // ### read from pref | 223 | muted = FALSE; // ### read from pref |
@@ -230,24 +261,35 @@ void VolumeApplet::advVolControl() | |||
230 | void VolumeApplet::showVolControl(bool showMic) | 261 | void VolumeApplet::showVolControl(bool showMic) |
231 | { | 262 | { |
232 | Config cfg("Sound"); | 263 | Config cfg("qpe"); |
233 | cfg.setGroup("System"); | 264 | cfg.setGroup("Volume"); |
234 | volumePercent = cfg.readNumEntry("Volume",50); | 265 | volumePercent = cfg.readNumEntry("VolumePercent",50); |
235 | micPercent = cfg.readNumEntry("Mic", 50); | 266 | micPercent = cfg.readNumEntry("Mic", 50); |
236 | QString show = cfg.readEntry("ShowMic", "FALSE"); | 267 | |
237 | if(show == "TRUE") showMic = TRUE; | ||
238 | // Create a small volume control window to adjust the volume with | 268 | // Create a small volume control window to adjust the volume with |
239 | VolumeControl *vc = new VolumeControl(showMic); | 269 | VolumeControl *vc = new VolumeControl(showMic); |
240 | vc->slider->setValue( 100 - volumePercent ); | 270 | vc->slider->setValue( 100 - volumePercent ); |
241 | if (showMic) | 271 | // if (showMic) |
242 | { | 272 | // { |
243 | vc->mic->setValue( 100 - micPercent ); | 273 | vc->mic->setValue( 100 - micPercent ); |
244 | connect( vc->mic, SIGNAL( valueChanged( int ) ), this, SLOT( micMoved( int ) ) ); | 274 | connect( vc->mic, SIGNAL( valueChanged( int ) ), this, SLOT( micMoved( int ) ) ); |
245 | } | 275 | // } |
246 | 276 | ||
247 | vc->muteBox->setChecked( muted ); | 277 | vc->muteBox->setChecked( muted ); |
248 | connect( vc->slider, SIGNAL( valueChanged( int ) ), this, SLOT( sliderMoved( int ) ) ); | 278 | connect( vc->slider, SIGNAL( valueChanged( int ) ), this, SLOT( sliderMoved( int ) ) ); |
249 | connect( vc->muteBox, SIGNAL( toggled( bool ) ), this, SLOT( mute( bool ) ) ); | 279 | connect( vc->muteBox, SIGNAL( toggled( bool ) ), this, SLOT( mute( bool ) ) ); |
280 | |||
281 | Config config("qpe"); | ||
282 | config.setGroup("Volume"); | ||
283 | |||
284 | vc->keyclicks->setChecked( config.readBoolEntry("KeySound",0)); | ||
285 | vc->screentaps->setChecked( config.readBoolEntry("TouchSound",0)); | ||
286 | vc->alarmSound->setChecked( config.readBoolEntry("AlarmSound",1)); | ||
287 | |||
288 | connect( vc->alarmSound, SIGNAL(toggled(bool)), this, SLOT( alarmSoundCheckToggled(bool))); | ||
289 | connect( vc->keyclicks, SIGNAL(toggled(bool)), this, SLOT( keyclicksCheckToggled(bool))); | ||
290 | connect( vc->screentaps, SIGNAL(toggled(bool)), this, SLOT( screentapsCheckToggled(bool))); | ||
291 | |||
250 | QPoint curPos = mapToGlobal( rect().topLeft() ); | 292 | QPoint curPos = mapToGlobal( rect().topLeft() ); |
251 | vc->move( curPos.x()-(vc->sizeHint().width()-width())/2, curPos.y() - 120 ); | 293 | vc->move( curPos.x()-(vc->sizeHint().width()/2+50), curPos.y() - 120 ); |
252 | vc->show(); | 294 | vc->show(); |
253 | 295 | ||
@@ -303,13 +345,13 @@ void VolumeApplet::micMoved( int percent ) | |||
303 | void VolumeApplet::readSystemVolume() | 345 | void VolumeApplet::readSystemVolume() |
304 | { | 346 | { |
305 | Config cfg("Sound"); | 347 | Config cfg("qpe"); |
306 | cfg.setGroup("System"); | 348 | cfg.setGroup("Volume"); |
307 | volumePercent = cfg.readNumEntry("Volume"); | 349 | volumePercent = cfg.readNumEntry("VolumePercent"); |
308 | } | 350 | } |
309 | 351 | ||
310 | void VolumeApplet::readSystemMic() | 352 | void VolumeApplet::readSystemMic() |
311 | { | 353 | { |
312 | Config cfg("Sound"); | 354 | Config cfg("qpe"); |
313 | cfg.setGroup("System"); | 355 | cfg.setGroup("Volume"); |
314 | micPercent = cfg.readNumEntry("Mic"); | 356 | micPercent = cfg.readNumEntry("Mic"); |
315 | } | 357 | } |
@@ -334,7 +376,7 @@ void VolumeApplet::writeSystemVolume() | |||
334 | { | 376 | { |
335 | { | 377 | { |
336 | Config cfg("Sound"); | 378 | Config cfg("qpe"); |
337 | cfg.setGroup("System"); | 379 | cfg.setGroup("Volume"); |
338 | cfg.writeEntry("Volume",volumePercent); | 380 | cfg.writeEntry("VolumePercent",volumePercent); |
339 | } | 381 | } |
340 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 382 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
@@ -347,6 +389,6 @@ void VolumeApplet::writeSystemMic() | |||
347 | { | 389 | { |
348 | { | 390 | { |
349 | Config cfg("Sound"); | 391 | Config cfg("qpe"); |
350 | cfg.setGroup("System"); | 392 | cfg.setGroup("Volume"); |
351 | cfg.writeEntry("Mic",micPercent); | 393 | cfg.writeEntry("Mic",micPercent); |
352 | } | 394 | } |
@@ -379,2 +421,24 @@ void VolumeApplet::paintEvent( QPaintEvent* ) | |||
379 | } | 421 | } |
380 | } | 422 | } |
423 | |||
424 | void VolumeApplet::screentapsCheckToggled(bool b) { | ||
425 | Config cfg("qpe"); | ||
426 | cfg.setGroup("Volume"); | ||
427 | cfg.writeEntry("TouchSound",b ); | ||
428 | cfg.write(); | ||
429 | } | ||
430 | |||
431 | void VolumeApplet::keyclicksCheckToggled(bool b) { | ||
432 | Config cfg("qpe"); | ||
433 | cfg.setGroup("Volume"); | ||
434 | cfg.writeEntry("KeySound",b); | ||
435 | cfg.write(); | ||
436 | } | ||
437 | |||
438 | void VolumeApplet::alarmSoundCheckToggled(bool b) { | ||
439 | Config cfg("qpe"); | ||
440 | cfg.setGroup("Volume"); | ||
441 | cfg.writeEntry("AlarmSound",b); | ||
442 | cfg.write(); | ||
443 | } | ||
444 | |||
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h index 3a2da43..6e631f2 100644 --- a/core/applets/volumeapplet/volume.h +++ b/core/applets/volumeapplet/volume.h | |||
@@ -24,5 +24,4 @@ | |||
24 | 24 | ||
25 | #include <qwidget.h> | 25 | #include <qwidget.h> |
26 | #include <qpushbutton.h> | ||
27 | #include <qframe.h> | 26 | #include <qframe.h> |
28 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
@@ -43,4 +42,8 @@ public: | |||
43 | QSlider *mic; | 42 | QSlider *mic; |
44 | QCheckBox *muteBox; | 43 | QCheckBox *muteBox; |
44 | QCheckBox *alarmSound; | ||
45 | QCheckBox *screentaps; | ||
46 | QCheckBox *keyclicks; | ||
47 | |||
45 | 48 | ||
46 | private: | 49 | private: |
@@ -95,4 +98,8 @@ private: | |||
95 | void writeSystemMic(); | 98 | void writeSystemMic(); |
96 | 99 | ||
100 | protected slots: | ||
101 | void alarmSoundCheckToggled(bool); | ||
102 | void keyclicksCheckToggled(bool); | ||
103 | void screentapsCheckToggled(bool); | ||
97 | }; | 104 | }; |
98 | 105 | ||