-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 39 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.h | 2 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.h | 3 |
4 files changed, 66 insertions, 8 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 40b8b87..f417b79 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -1,200 +1,233 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "soundsettings.h" | 21 | #include "soundsettings.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
26 | #include <qpe/storage.h> | 26 | #include <qpe/storage.h> |
27 | 27 | ||
28 | #include <qapplication.h> | 28 | #include <qapplication.h> |
29 | #include <qslider.h> | 29 | #include <qslider.h> |
30 | #include <qcheckbox.h> | 30 | #include <qcheckbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | 33 | ||
34 | 34 | ||
35 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | 35 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) |
36 | : SoundSettingsBase( parent, name, TRUE, fl ) | 36 | : SoundSettingsBase( parent, name, TRUE, fl ) |
37 | { | 37 | { |
38 | keyReset=FALSE; | ||
39 | |||
38 | Config config( "qpe"); | 40 | Config config( "qpe"); |
39 | config.setGroup( "Volume" ); | 41 | config.setGroup( "Volume" ); |
40 | volume->setValue(100-config.readNumEntry("VolumePercent")); | 42 | volume->setValue(100-config.readNumEntry("VolumePercent")); |
41 | mic->setValue(100-config.readNumEntry("Mic")); | 43 | mic->setValue(100-config.readNumEntry("Mic")); |
42 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); | 44 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); |
43 | // keysound->setChecked(config.readBoolEntry("KeySound")); | 45 | // keysound->setChecked(config.readBoolEntry("KeySound")); |
44 | Config cfg("Vmemo"); | 46 | Config cfg("Vmemo"); |
45 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 47 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
46 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); | 48 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); |
47 | 49 | ||
48 | cfg.setGroup("Record"); | 50 | cfg.setGroup("Record"); |
49 | int rate=config.readNumEntry("SampleRate", 22050); | 51 | int rate=config.readNumEntry("SampleRate", 22050); |
50 | if(rate == 8000) | 52 | if(rate == 8000) |
51 | sampleRate->setCurrentItem(0); | 53 | sampleRate->setCurrentItem(0); |
52 | else if(rate == 11025) | 54 | else if(rate == 11025) |
53 | sampleRate->setCurrentItem(1); | 55 | sampleRate->setCurrentItem(1); |
54 | else if(rate == 22050) | 56 | else if(rate == 22050) |
55 | sampleRate->setCurrentItem(2); | 57 | sampleRate->setCurrentItem(2); |
56 | else if(rate == 33075) | 58 | else if(rate == 33075) |
57 | sampleRate->setCurrentItem(3); | 59 | sampleRate->setCurrentItem(3); |
58 | else if(rate==44100) | 60 | else if(rate==44100) |
59 | sampleRate->setCurrentItem(4); | 61 | sampleRate->setCurrentItem(4); |
60 | 62 | ||
61 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); | 63 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); |
62 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); | 64 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); |
63 | 65 | ||
66 | cfg.setGroup("Defaults"); | ||
67 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); | ||
68 | |||
64 | updateStorageCombo(); | 69 | updateStorageCombo(); |
70 | |||
65 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); | 71 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); |
66 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); | 72 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); |
67 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 73 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
68 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); | 74 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); |
69 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); | 75 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); |
76 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT(setKeyButton(const QString &))); | ||
70 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 77 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
71 | } | 78 | } |
72 | 79 | ||
73 | // void SoundSettings::reject() | 80 | // void SoundSettings::reject() |
74 | // { | 81 | // { |
75 | // qDebug("reject"); | 82 | // qDebug("reject"); |
76 | // Config config( "qpe"); | 83 | // Config config( "qpe"); |
77 | // config.setGroup( "Volume"); | 84 | // config.setGroup( "Volume"); |
78 | 85 | ||
79 | // setVolume(100-config.readNumEntry("VolumePercent")); | 86 | // setVolume(100-config.readNumEntry("VolumePercent")); |
80 | // setMic(100-config.readNumEntry("Mic")); | 87 | // setMic(100-config.readNumEntry("Mic")); |
81 | 88 | ||
82 | // // config.setGroup("Record"); | 89 | // // config.setGroup("Record"); |
83 | // // int rate=config.readNumEntry("SampleRate", 11025); | 90 | // // int rate=config.readNumEntry("SampleRate", 11025); |
84 | // // if(rate == 11025) | 91 | // // if(rate == 11025) |
85 | // // sampleRate->setCurrentItem(0); | 92 | // // sampleRate->setCurrentItem(0); |
86 | // // else if(rate == 22050) | 93 | // // else if(rate == 22050) |
87 | // // sampleRate->setCurrentItem(1); | 94 | // // sampleRate->setCurrentItem(1); |
88 | // // else if(rate == 32000) | 95 | // // else if(rate == 32000) |
89 | // // sampleRate->setCurrentItem(2); | 96 | // // sampleRate->setCurrentItem(2); |
90 | // // else if(rate==44100) | 97 | // // else if(rate==44100) |
91 | // // sampleRate->setCurrentItem(3); | 98 | // // sampleRate->setCurrentItem(3); |
92 | // // stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 99 | // // stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); |
93 | // // sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | 100 | // // sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); |
94 | // qDebug("QDialog::reject();"); | 101 | // qDebug("QDialog::reject();"); |
95 | // ::exit(-1); | 102 | // ::exit(-1); |
96 | // } | 103 | // } |
97 | 104 | ||
98 | // void SoundSettings::accept() | 105 | // void SoundSettings::accept() |
99 | // { | 106 | // { |
100 | // qDebug("accept"); | 107 | // qDebug("accept"); |
101 | // Config config( "qpe" ); | 108 | // Config config( "qpe" ); |
102 | // config.setGroup( "Volume" ); | 109 | // config.setGroup( "Volume" ); |
103 | // config.writeEntry("VolumePercent",100-volume->value()); | 110 | // config.writeEntry("VolumePercent",100-volume->value()); |
104 | // config.writeEntry("Mic",100-mic->value()); | 111 | // config.writeEntry("Mic",100-mic->value()); |
105 | // // config.writeEntry("TouchSound",touchsound->isChecked()); | 112 | // // config.writeEntry("TouchSound",touchsound->isChecked()); |
106 | // // config.writeEntry("KeySound",keysound->isChecked()); | 113 | // // config.writeEntry("KeySound",keysound->isChecked()); |
107 | 114 | ||
108 | // Config cfg("Vmemo"); | 115 | // Config cfg("Vmemo"); |
109 | // cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | 116 | // cfg.writeEntry("Alert",AlertCheckBox->isChecked()); |
110 | // setVolume(volume->value()); | 117 | // setVolume(volume->value()); |
111 | // setMic(mic->value()); | 118 | // setMic(mic->value()); |
112 | 119 | ||
113 | // cfg.setGroup("Record"); | 120 | // cfg.setGroup("Record"); |
114 | // cfg.writeEntry("SampleRate",sampleRate->currentText()); | 121 | // cfg.writeEntry("SampleRate",sampleRate->currentText()); |
115 | // cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); | 122 | // cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); |
116 | // cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 123 | // cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
117 | // // Config cfg( "VMemo" ); | 124 | // // Config cfg( "VMemo" ); |
118 | // // cfg.setGroup( "Defaults" ); | 125 | // // cfg.setGroup( "Defaults" ); |
119 | // // cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked()); | 126 | // // cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked()); |
120 | // qDebug("QDialog::accept();"); | 127 | // qDebug("QDialog::accept();"); |
121 | // ::exit(0); | 128 | // ::exit(0); |
122 | // } | 129 | // } |
123 | 130 | ||
124 | void SoundSettings::setVolume(int v) | 131 | void SoundSettings::setVolume(int v) |
125 | { | 132 | { |
126 | Config config( "qpe" ); | 133 | Config config( "qpe" ); |
127 | config.setGroup( "Volume" ); | 134 | config.setGroup( "Volume" ); |
128 | config.writeEntry("VolumePercent",100-v); | 135 | config.writeEntry("VolumePercent",100-v); |
129 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 136 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
130 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | 137 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; |
131 | #endif | 138 | #endif |
132 | } | 139 | } |
133 | 140 | ||
134 | void SoundSettings::setMic(int m) | 141 | void SoundSettings::setMic(int m) |
135 | { | 142 | { |
136 | Config config( "qpe" ); | 143 | Config config( "qpe" ); |
137 | config.setGroup( "Volume" ); | 144 | config.setGroup( "Volume" ); |
138 | config.writeEntry("Mic",100-m); | 145 | config.writeEntry("Mic",100-m); |
139 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 146 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
140 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; | 147 | QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; |
141 | #endif | 148 | #endif |
142 | } | 149 | } |
143 | 150 | ||
144 | void SoundSettings::volumeChanged( bool ) | 151 | void SoundSettings::volumeChanged( bool ) |
145 | { | 152 | { |
146 | Config config( "qpe" ); | 153 | Config config( "qpe" ); |
147 | config.setGroup( "Volume" ); | 154 | config.setGroup( "Volume" ); |
148 | volume->setValue(100-config.readNumEntry("VolumePercent")); | 155 | volume->setValue(100-config.readNumEntry("VolumePercent")); |
149 | } | 156 | } |
150 | 157 | ||
151 | void SoundSettings::micChanged( bool ) | 158 | void SoundSettings::micChanged( bool ) |
152 | { | 159 | { |
153 | Config config( "qpe" ); | 160 | Config config( "qpe" ); |
154 | config.setGroup( "Volume" ); | 161 | config.setGroup( "Volume" ); |
155 | mic->setValue(100-config.readNumEntry("Mic")); | 162 | mic->setValue(100-config.readNumEntry("Mic")); |
156 | } | 163 | } |
157 | 164 | ||
158 | void SoundSettings::updateStorageCombo() { | 165 | void SoundSettings::updateStorageCombo() { |
159 | 166 | ||
167 | Config config( "Vmemo" ); | ||
168 | config.setGroup( "System" ); | ||
169 | QString loc = config.readEntry("RecLocation","/"); | ||
170 | int i=0; | ||
171 | int set=0; | ||
160 | StorageInfo storageInfo; | 172 | StorageInfo storageInfo; |
161 | QString sName, sPath; | 173 | QString sName, sPath; |
162 | QStringList list; | 174 | QStringList list; |
163 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 175 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
164 | QListIterator<FileSystem> it ( fs ); | 176 | QListIterator<FileSystem> it ( fs ); |
165 | for( ; it.current(); ++it ){ | 177 | for( ; it.current(); ++it ){ |
166 | const QString name = (*it)->name(); | 178 | const QString name = (*it)->name(); |
167 | const QString path = (*it)->path(); | 179 | const QString path = (*it)->path(); |
168 | qDebug("storage name "+name +" storage path is "+path); | 180 | qDebug("storage name "+name +" storage path is "+path); |
169 | list << name + ": " +path; | 181 | list << name + ": " +path; |
182 | if( loc.find( path,0,TRUE) != -1) | ||
183 | set = i; | ||
170 | // if(dit.current()->file().find(path) != -1 ) storage=name; | 184 | // if(dit.current()->file().find(path) != -1 ) storage=name; |
185 | i++; | ||
171 | } | 186 | } |
172 | LocationComboBox->insertStringList(list); | 187 | LocationComboBox->insertStringList(list); |
188 | qDebug("set item %d", set); | ||
189 | LocationComboBox->setCurrentItem(set); | ||
173 | } | 190 | } |
174 | 191 | ||
175 | void SoundSettings::setLocation(const QString & string) { | 192 | void SoundSettings::setLocation(const QString & string) { |
176 | Config config( "Vmemo" ); | 193 | Config config( "Vmemo" ); |
177 | config.setGroup( "System" ); | 194 | config.setGroup( "System" ); |
178 | config.writeEntry("RecLocation",string); | 195 | config.writeEntry("RecLocation",string); |
179 | 196 | qDebug("set location "+string); | |
197 | config.write(); | ||
180 | } | 198 | } |
181 | 199 | ||
182 | void SoundSettings::cleanUp() { | 200 | void SoundSettings::cleanUp() { |
183 | qDebug("cleanup"); | 201 | qDebug("cleanup"); |
184 | Config config( "qpe" ); | 202 | Config config( "qpe" ); |
185 | config.setGroup( "Volume" ); | 203 | config.setGroup( "Volume" ); |
186 | config.writeEntry("VolumePercent",100-volume->value()); | 204 | config.writeEntry("VolumePercent",100-volume->value()); |
187 | config.writeEntry("Mic",100-mic->value()); | 205 | config.writeEntry("Mic",100-mic->value()); |
188 | // config.writeEntry("TouchSound",touchsound->isChecked()); | 206 | // config.writeEntry("TouchSound",touchsound->isChecked()); |
189 | // config.writeEntry("KeySound",keysound->isChecked()); | 207 | // config.writeEntry("KeySound",keysound->isChecked()); |
190 | 208 | ||
191 | Config cfg("Vmemo"); | 209 | Config cfg("Vmemo"); |
192 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | 210 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); |
193 | setVolume(volume->value()); | 211 | setVolume(volume->value()); |
194 | setMic(mic->value()); | 212 | setMic(mic->value()); |
195 | 213 | ||
196 | cfg.setGroup("Record"); | 214 | cfg.setGroup("Record"); |
197 | cfg.writeEntry("SampleRate",sampleRate->currentText()); | 215 | cfg.writeEntry("SampleRate",sampleRate->currentText()); |
198 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); | 216 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); |
199 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 217 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
218 | |||
219 | if(keyReset) QCopEnvelope ("QPE/System", "restart()"); | ||
220 | |||
221 | } | ||
222 | |||
223 | void SoundSettings::setKeyButton(const QString &name) { | ||
224 | Config cfg("Vmemo"); | ||
225 | cfg.setGroup("Defaults"); | ||
226 | cfg.writeEntry( "toggleKey", keyComboBox->currentItem() ); | ||
227 | keyReset = TRUE; | ||
228 | cfg.write(); | ||
229 | } | ||
230 | |||
231 | void SoundSettings::updateLocationCombo() { | ||
232 | |||
200 | } | 233 | } |
diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h index cbec724..0676e12 100644 --- a/noncore/settings/sound/soundsettings.h +++ b/noncore/settings/sound/soundsettings.h | |||
@@ -1,51 +1,53 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef SOUNDSETTINGS_H | 20 | #ifndef SOUNDSETTINGS_H |
21 | #define SOUNDSETTINGS_H | 21 | #define SOUNDSETTINGS_H |
22 | 22 | ||
23 | 23 | ||
24 | #include "soundsettingsbase.h" | 24 | #include "soundsettingsbase.h" |
25 | 25 | ||
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 | void updateStorageCombo(); | 37 | void updateStorageCombo(); |
38 | void updateLocationCombo(); | ||
38 | 39 | ||
39 | private slots: | 40 | private slots: |
41 | void setKeyButton(const QString &); | ||
40 | void setLocation(const QString &); | 42 | void setLocation(const QString &); |
41 | void cleanUp(); | 43 | void cleanUp(); |
42 | void setVolume(int); | 44 | void setVolume(int); |
43 | void setMic(int); | 45 | void setMic(int); |
44 | 46 | ||
45 | void volumeChanged( bool muted ); | 47 | void volumeChanged( bool muted ); |
46 | void micChanged( bool muted ); | 48 | void micChanged( bool muted ); |
47 | }; | 49 | }; |
48 | 50 | ||
49 | 51 | ||
50 | #endif // SOUNDSETTINGS_H | 52 | #endif // SOUNDSETTINGS_H |
51 | 53 | ||
diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp index 727d202..6cb4f89 100644 --- a/noncore/settings/sound/soundsettingsbase.cpp +++ b/noncore/settings/sound/soundsettingsbase.cpp | |||
@@ -181,75 +181,97 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m | |||
181 | TextLabel2_2->setText( tr( "Silent" ) ); | 181 | TextLabel2_2->setText( tr( "Silent" ) ); |
182 | Layout17->addWidget( TextLabel2_2 ); | 182 | Layout17->addWidget( TextLabel2_2 ); |
183 | QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); | 183 | QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); |
184 | Layout17->addItem( spacer_8 ); | 184 | Layout17->addItem( spacer_8 ); |
185 | Layout10->addLayout( Layout17 ); | 185 | Layout10->addLayout( Layout17 ); |
186 | GroupBox3Layout->addLayout( Layout10 ); | 186 | GroupBox3Layout->addLayout( Layout10 ); |
187 | 187 | ||
188 | SoundSettingsBaseLayout->addWidget( GroupBox3, 0, 0 ); | 188 | SoundSettingsBaseLayout->addWidget( GroupBox3, 0, 0 ); |
189 | 189 | ||
190 | Layout12_2 = new QVBoxLayout; | 190 | Layout12_2 = new QVBoxLayout; |
191 | Layout12_2->setSpacing( 2 ); | 191 | Layout12_2->setSpacing( 2 ); |
192 | Layout12_2->setMargin( 2 ); | 192 | Layout12_2->setMargin( 2 ); |
193 | 193 | ||
194 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); | 194 | GroupBox1 = new QGroupBox( this, "GroupBox1" ); |
195 | GroupBox1->setTitle( tr( "Vmemo" ) ); | 195 | GroupBox1->setTitle( tr( "Vmemo" ) ); |
196 | 196 | ||
197 | QWidget* privateLayoutWidget = new QWidget( GroupBox1, "Layout11" ); | 197 | QWidget* privateLayoutWidget = new QWidget( GroupBox1, "Layout11" ); |
198 | privateLayoutWidget->setGeometry( QRect( 5, 16, 96, 169 ) ); | 198 | privateLayoutWidget->setGeometry( QRect( 5, 16, 96, 169 ) ); |
199 | Layout11 = new QVBoxLayout( privateLayoutWidget ); | 199 | Layout11 = new QVBoxLayout( privateLayoutWidget ); |
200 | Layout11->setSpacing( 2 ); | 200 | Layout11->setSpacing( 2 ); |
201 | Layout11->setMargin( 0 ); | 201 | Layout11->setMargin( 0 ); |
202 | 202 | ||
203 | sampleRateLabel = new QLabel( privateLayoutWidget, "sampleRateLabel" ); | 203 | sampleRateLabel = new QLabel( privateLayoutWidget, "sampleRateLabel" ); |
204 | sampleRateLabel->setText( tr( "Sample Rate" ) ); | 204 | sampleRateLabel->setText( tr( "Sample Rate" ) ); |
205 | Layout11->addWidget( sampleRateLabel ); | 205 | Layout11->addWidget( sampleRateLabel ); |
206 | 206 | ||
207 | sampleRate = new QComboBox( FALSE, privateLayoutWidget, "sampleRate" ); | 207 | sampleRate = new QComboBox( FALSE, privateLayoutWidget, "sampleRate" ); |
208 | sampleRate->insertItem( tr( "8000" ) ); | 208 | sampleRate->insertItem( tr( "8000" ) ); |
209 | sampleRate->insertItem( tr( "11025" ) ); | 209 | sampleRate->insertItem( tr( "11025" ) ); |
210 | sampleRate->insertItem( tr( "22050" ) ); | 210 | sampleRate->insertItem( tr( "22050" ) ); |
211 | sampleRate->insertItem( tr( "33075" ) ); | 211 | sampleRate->insertItem( tr( "33075" ) ); |
212 | sampleRate->insertItem( tr( "44100" ) ); | 212 | sampleRate->insertItem( tr( "44100" ) ); |
213 | sampleRate->setFixedWidth(90); | 213 | sampleRate->setFixedWidth(90); |
214 | Layout11->addWidget( sampleRate ); | 214 | Layout11->addWidget( sampleRate ); |
215 | 215 | ||
216 | stereoCheckBox = new QCheckBox( privateLayoutWidget, "stereoCheckBox" ); | 216 | stereoCheckBox = new QCheckBox( privateLayoutWidget, "stereoCheckBox" ); |
217 | stereoCheckBox->setText( tr( "Stereo" ) ); | 217 | stereoCheckBox->setText( tr( "Stereo" ) ); |
218 | Layout11->addWidget( stereoCheckBox ); | 218 | Layout11->addWidget( stereoCheckBox ); |
219 | 219 | ||
220 | sixteenBitCheckBox = new QCheckBox( privateLayoutWidget, "sixteenBitCheckBox" ); | 220 | sixteenBitCheckBox = new QCheckBox( privateLayoutWidget, "sixteenBitCheckBox" ); |
221 | sixteenBitCheckBox->setText( tr( "16 bit" ) ); | 221 | sixteenBitCheckBox->setText( tr( "16 bit" ) ); |
222 | Layout11->addWidget( sixteenBitCheckBox ); | 222 | Layout11->addWidget( sixteenBitCheckBox ); |
223 | 223 | ||
224 | AlertCheckBox = new QCheckBox( privateLayoutWidget, "AlertCheckBox" ); | 224 | AlertCheckBox = new QCheckBox( privateLayoutWidget, "AlertCheckBox" ); |
225 | AlertCheckBox->setText( tr( "Visual Alerts" ) ); | 225 | AlertCheckBox->setText( tr( "Visual Alerts" ) ); |
226 | Layout11->addWidget( AlertCheckBox ); | 226 | Layout11->addWidget( AlertCheckBox ); |
227 | 227 | ||
228 | TextLabel1 = new QLabel( privateLayoutWidget, "TextLabel1" ); | 228 | TextLabel1 = new QLabel( privateLayoutWidget, "TextLabel1" ); |
229 | TextLabel1->setText( tr( "Location" ) ); | 229 | TextLabel1->setText( tr( "Location:" ) ); |
230 | Layout11->addWidget( TextLabel1 ); | 230 | Layout11->addWidget( TextLabel1 ); |
231 | 231 | ||
232 | |||
232 | LocationComboBox = new QComboBox( FALSE, privateLayoutWidget, "LocationComboBox" ); | 233 | LocationComboBox = new QComboBox( FALSE, privateLayoutWidget, "LocationComboBox" ); |
233 | Layout11->addWidget( LocationComboBox ); | 234 | Layout11->addWidget( LocationComboBox ); |
234 | Layout12_2->addWidget( GroupBox1 ); | ||
235 | 235 | ||
236 | QLabel *TextLabelKey; | ||
237 | TextLabelKey = new QLabel( privateLayoutWidget, "TextLabelKey" ); | ||
238 | TextLabelKey->setText( tr( "Record Key:" ) ); | ||
239 | |||
240 | keyComboBox = new QComboBox( FALSE, privateLayoutWidget, "keyComboBox" ); | ||
241 | keyComboBox->insertItem( tr( "" ) ); | ||
242 | keyComboBox->insertItem( tr( "Taskbar Icon" ) ); | ||
243 | keyComboBox->insertItem( tr( "Key_Escape" ) ); | ||
244 | keyComboBox->insertItem( tr( "Key_Space" ) ); | ||
245 | keyComboBox->insertItem( tr( "Key_Home" ) ); | ||
246 | keyComboBox->insertItem( tr( "Key_Calender" ) ); | ||
247 | keyComboBox->insertItem( tr( "Key_Contacts" ) ); | ||
248 | keyComboBox->insertItem( tr( "Key_Menu" ) ); | ||
249 | keyComboBox->insertItem( tr( "Key_Mail" ) ); | ||
250 | |||
251 | Layout11->addWidget( TextLabelKey ); | ||
252 | |||
253 | Layout11->addWidget( keyComboBox ); | ||
254 | |||
255 | QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); | ||
256 | Layout11->addItem( spacer_9 ); | ||
257 | |||
258 | |||
259 | Layout12_2->addWidget( GroupBox1 ); | ||
236 | // // touchsound = new QCheckBox( this, "touchsound" ); | 260 | // // touchsound = new QCheckBox( this, "touchsound" ); |
237 | // // touchsound->setText( tr( "Screen sounds" ) ); | 261 | // // touchsound->setText( tr( "Screen sounds" ) ); |
238 | // // Layout12_2->addWidget( touchsound ); | 262 | // // Layout12_2->addWidget( touchsound ); |
239 | 263 | ||
240 | // // keysound = new QCheckBox( this, "keysound" ); | 264 | // // keysound = new QCheckBox( this, "keysound" ); |
241 | // // keysound->setText( tr( "Keyboard sounds" ) ); | 265 | // // keysound->setText( tr( "Keyboard sounds" ) ); |
242 | // // Layout12_2->addWidget( keysound ); | 266 | // // Layout12_2->addWidget( keysound ); |
243 | QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); | ||
244 | Layout12_2->addItem( spacer_9 ); | ||
245 | 267 | ||
246 | SoundSettingsBaseLayout->addLayout( Layout12_2, 0, 1 ); | 268 | SoundSettingsBaseLayout->addLayout( Layout12_2, 0, 1 ); |
247 | } | 269 | } |
248 | 270 | ||
249 | /* | 271 | /* |
250 | * Destroys the object and frees any allocated resources | 272 | * Destroys the object and frees any allocated resources |
251 | */ | 273 | */ |
252 | SoundSettingsBase::~SoundSettingsBase() | 274 | SoundSettingsBase::~SoundSettingsBase() |
253 | { | 275 | { |
254 | // no need to delete child widgets, Qt does it all for us | 276 | // no need to delete child widgets, Qt does it all for us |
255 | } | 277 | } |
diff --git a/noncore/settings/sound/soundsettingsbase.h b/noncore/settings/sound/soundsettingsbase.h index 7a939ea..20d1c2c 100644 --- a/noncore/settings/sound/soundsettingsbase.h +++ b/noncore/settings/sound/soundsettingsbase.h | |||
@@ -2,64 +2,65 @@ | |||
2 | ** Form interface generated from reading ui file 'soundsettingsbase.ui' | 2 | ** Form interface generated from reading ui file 'soundsettingsbase.ui' |
3 | ** | 3 | ** |
4 | ** Created: Thu May 23 11:23:38 2002 | 4 | ** Created: Thu May 23 11:23:38 2002 |
5 | ** by: The User Interface Compiler (uic) | 5 | ** by: The User Interface Compiler (uic) |
6 | ** | 6 | ** |
7 | ** WARNING! All changes made in this file will be lost! | 7 | ** WARNING! All changes made in this file will be lost! |
8 | ****************************************************************************/ | 8 | ****************************************************************************/ |
9 | #ifndef SOUNDSETTINGSBASE_H | 9 | #ifndef SOUNDSETTINGSBASE_H |
10 | #define SOUNDSETTINGSBASE_H | 10 | #define SOUNDSETTINGSBASE_H |
11 | 11 | ||
12 | #include <qvariant.h> | 12 | #include <qvariant.h> |
13 | #include <qdialog.h> | 13 | #include <qdialog.h> |
14 | #include <qmainwindow.h> | 14 | #include <qmainwindow.h> |
15 | 15 | ||
16 | class QVBoxLayout; | 16 | class QVBoxLayout; |
17 | class QHBoxLayout; | 17 | class QHBoxLayout; |
18 | class QGridLayout; | 18 | class QGridLayout; |
19 | class QCheckBox; | 19 | class QCheckBox; |
20 | class QComboBox; | 20 | class QComboBox; |
21 | class QGroupBox; | 21 | class QGroupBox; |
22 | class QLabel; | 22 | class QLabel; |
23 | class QSlider; | 23 | class QSlider; |
24 | 24 | ||
25 | class SoundSettingsBase : public QMainWindow | 25 | class SoundSettingsBase : public QMainWindow |
26 | { | 26 | { |
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | 28 | ||
29 | public: | 29 | public: |
30 | SoundSettingsBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 30 | SoundSettingsBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
31 | ~SoundSettingsBase(); | 31 | ~SoundSettingsBase(); |
32 | 32 | ||
33 | QGroupBox* GroupBox3; | 33 | QGroupBox* GroupBox3; |
34 | QLabel* PixmapLabel1_2; | 34 | QLabel* PixmapLabel1_2; |
35 | QLabel* TextLabel1_2; | 35 | QLabel* TextLabel1_2; |
36 | QLabel* volLabel; | 36 | QLabel* volLabel; |
37 | QLabel* micLabel; | 37 | QLabel* micLabel; |
38 | QSlider* volume; | 38 | QSlider* volume; |
39 | QSlider* mic; | 39 | QSlider* mic; |
40 | QLabel* PixmapLabel2_2; | 40 | QLabel* PixmapLabel2_2; |
41 | QLabel* TextLabel2_2; | 41 | QLabel* TextLabel2_2; |
42 | QGroupBox* GroupBox1; | 42 | QGroupBox* GroupBox1; |
43 | QLabel* sampleRateLabel; | 43 | QLabel* sampleRateLabel; |
44 | QComboBox* sampleRate; | 44 | QComboBox* sampleRate; |
45 | QCheckBox* stereoCheckBox; | 45 | QCheckBox* stereoCheckBox; |
46 | QCheckBox* sixteenBitCheckBox; | 46 | QCheckBox* sixteenBitCheckBox; |
47 | QCheckBox* AlertCheckBox; | 47 | QCheckBox* AlertCheckBox; |
48 | QLabel* TextLabel1; | 48 | QLabel* TextLabel1; |
49 | QComboBox* LocationComboBox; | 49 | QComboBox* LocationComboBox; |
50 | 50 | QComboBox* keyComboBox; | |
51 | bool keyReset; | ||
51 | protected: | 52 | protected: |
52 | QGridLayout* SoundSettingsBaseLayout; | 53 | QGridLayout* SoundSettingsBaseLayout; |
53 | QVBoxLayout* GroupBox3Layout; | 54 | QVBoxLayout* GroupBox3Layout; |
54 | QVBoxLayout* Layout10; | 55 | QVBoxLayout* Layout10; |
55 | QHBoxLayout* Layout16; | 56 | QHBoxLayout* Layout16; |
56 | QHBoxLayout* Layout13; | 57 | QHBoxLayout* Layout13; |
57 | QHBoxLayout* Layout12; | 58 | QHBoxLayout* Layout12; |
58 | QHBoxLayout* Layout17; | 59 | QHBoxLayout* Layout17; |
59 | QVBoxLayout* Layout12_2; | 60 | QVBoxLayout* Layout12_2; |
60 | QVBoxLayout* Layout11; | 61 | QVBoxLayout* Layout11; |
61 | protected slots: | 62 | protected slots: |
62 | 63 | ||
63 | }; | 64 | }; |
64 | 65 | ||
65 | #endif // SOUNDSETTINGSBASE_H | 66 | #endif // SOUNDSETTINGSBASE_H |