-rw-r--r-- | noncore/settings/sound/opie-sound.control | 2 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 44 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.h | 20 |
3 files changed, 54 insertions, 12 deletions
diff --git a/noncore/settings/sound/opie-sound.control b/noncore/settings/sound/opie-sound.control index a1fe50f..a03c834 100644 --- a/noncore/settings/sound/opie-sound.control +++ b/noncore/settings/sound/opie-sound.control | |||
@@ -4,7 +4,7 @@ Section: opie/settings | |||
4 | Maintainer: Warwick Allison <warwick@trolltech.com> | 4 | Maintainer: Warwick Allison <warwick@trolltech.com> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Arch: iPAQ | 6 | Arch: iPAQ |
7 | Version: $QPE_VERSION-$SUB_VERSION | 7 | Version: $QPE_VERSION-$SUB_VERSION.1 |
8 | Depends: opie-base ($QPE_VERSION) | 8 | Depends: opie-base ($QPE_VERSION) |
9 | Description: Sound settings dialog | 9 | Description: Sound settings dialog |
10 | For the Opie environment. | 10 | For the Opie environment. |
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 92281f8..1143e82 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -21,21 +21,27 @@ | |||
21 | 21 | ||
22 | #include <qpe/config.h> | 22 | #include <qpe/config.h> |
23 | #include <qpe/qcopenvelope_qws.h> | 23 | #include <qpe/qcopenvelope_qws.h> |
24 | 24 | #include <qapplication.h> | |
25 | #include <qslider.h> | 25 | #include <qslider.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qlineedit.h> | ||
27 | 28 | ||
28 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | 29 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) |
29 | : SoundSettingsBase( parent, name, TRUE, fl ) | 30 | : SoundSettingsBase( parent, name, TRUE, fl ) |
30 | { | 31 | { |
31 | Config config( "Sound" ); | 32 | Config config( "Sound" ); |
32 | |||
33 | config.setGroup( "System" ); | 33 | config.setGroup( "System" ); |
34 | volume->setValue(100-config.readNumEntry("Volume")); | 34 | volume->setValue(100-config.readNumEntry("Volume")); |
35 | mic->setValue(100-config.readNumEntry("Mic")); | ||
35 | touchsound->setChecked(config.readBoolEntry("Touch")); | 36 | touchsound->setChecked(config.readBoolEntry("Touch")); |
36 | keysound->setChecked(config.readBoolEntry("Key")); | 37 | keysound->setChecked(config.readBoolEntry("Key")); |
38 | dblClickRuns->setText(config.readEntry("DblClickVolumeRuns", | ||
39 | "/opt/QtPalmtop/bin/vmemomanager")); | ||
37 | 40 | ||
38 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); | 41 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); |
42 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); | ||
43 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | ||
44 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); | ||
39 | } | 45 | } |
40 | 46 | ||
41 | void SoundSettings::reject() | 47 | void SoundSettings::reject() |
@@ -43,6 +49,7 @@ void SoundSettings::reject() | |||
43 | Config config( "Sound" ); | 49 | Config config( "Sound" ); |
44 | config.setGroup( "System" ); | 50 | config.setGroup( "System" ); |
45 | setVolume(100-config.readNumEntry("Volume")); | 51 | setVolume(100-config.readNumEntry("Volume")); |
52 | setMic(100-config.readNumEntry("Mic")); | ||
46 | 53 | ||
47 | QDialog::reject(); | 54 | QDialog::reject(); |
48 | } | 55 | } |
@@ -52,13 +59,44 @@ void SoundSettings::accept() | |||
52 | Config config( "Sound" ); | 59 | Config config( "Sound" ); |
53 | config.setGroup( "System" ); | 60 | config.setGroup( "System" ); |
54 | config.writeEntry("Volume",100-volume->value()); | 61 | config.writeEntry("Volume",100-volume->value()); |
62 | config.writeEntry("Mic",100-mic->value()); | ||
55 | config.writeEntry("Touch",touchsound->isChecked()); | 63 | config.writeEntry("Touch",touchsound->isChecked()); |
56 | config.writeEntry("Key",keysound->isChecked()); | 64 | config.writeEntry("Key",keysound->isChecked()); |
65 | config.writeEntry("DblClickVolumeRuns", dblClickRuns->text()); | ||
57 | setVolume(volume->value()); | 66 | setVolume(volume->value()); |
58 | QDialog::accept(); | 67 | QDialog::accept(); |
59 | } | 68 | } |
60 | 69 | ||
61 | void SoundSettings::setVolume(int v) | 70 | void SoundSettings::setVolume(int v) |
62 | { | 71 | { |
63 | QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0 << 100-v; | 72 | Config config( "Sound" ); |
73 | config.setGroup( "System" ); | ||
74 | config.writeEntry("Volume",100-v); | ||
75 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | ||
76 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | ||
77 | #endif | ||
78 | } | ||
79 | |||
80 | void SoundSettings::setMic(int m) | ||
81 | { | ||
82 | Config config( "Sound" ); | ||
83 | config.setGroup( "System" ); | ||
84 | config.writeEntry("Mic",100-m); | ||
85 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | ||
86 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; | ||
87 | #endif | ||
88 | } | ||
89 | |||
90 | void SoundSettings::volumeChanged( bool ) | ||
91 | { | ||
92 | Config config( "Sound" ); | ||
93 | config.setGroup( "System" ); | ||
94 | volume->setValue(100-config.readNumEntry("Volume")); | ||
95 | } | ||
96 | |||
97 | void SoundSettings::micChanged( bool ) | ||
98 | { | ||
99 | Config config( "Sound" ); | ||
100 | config.setGroup( "System" ); | ||
101 | mic->setValue(100-config.readNumEntry("Mic")); | ||
64 | } | 102 | } |
diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h index b5c8cee..7679c1e 100644 --- a/noncore/settings/sound/soundsettings.h +++ b/noncore/settings/sound/soundsettings.h | |||
@@ -26,17 +26,21 @@ | |||
26 | 26 | ||
27 | class SoundSettings : public SoundSettingsBase | 27 | class SoundSettings : public SoundSettingsBase |
28 | { | 28 | { |
29 | Q_OBJECT | 29 | Q_OBJECT |
30 | 30 | ||
31 | public: | 31 | public: |
32 | SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 32 | SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
33 | 33 | ||
34 | protected: | 34 | protected: |
35 | void accept(); | 35 | void accept(); |
36 | void reject(); | 36 | void reject(); |
37 | 37 | ||
38 | private slots: | 38 | private slots: |
39 | void setVolume(int); | 39 | void setVolume(int); |
40 | void setMic(int); | ||
41 | |||
42 | void volumeChanged( bool muted ); | ||
43 | void micChanged( bool muted ); | ||
40 | }; | 44 | }; |
41 | 45 | ||
42 | 46 | ||