author | llornkcor <llornkcor> | 2002-03-17 13:08:37 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-17 13:08:37 (UTC) |
commit | 2f18edca6cc3539298deccee89e6f4dd7a2570a2 (patch) (unidiff) | |
tree | 58eefa2b254a4c30a266681bd077e0e8029384e3 /noncore/settings/sound/soundsettings.cpp | |
parent | 578725ca25862c0b06b1991a7bc8ffc2ad8ae13e (diff) | |
download | opie-2f18edca6cc3539298deccee89e6f4dd7a2570a2.zip opie-2f18edca6cc3539298deccee89e6f4dd7a2570a2.tar.gz opie-2f18edca6cc3539298deccee89e6f4dd7a2570a2.tar.bz2 |
changed line edit to combo, and changed labels and layout
Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 17dbdc0..c2bf405 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <qslider.h> | 25 | #include <qslider.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | #include <qcombobox.h> | ||
29 | |||
28 | 30 | ||
29 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | 31 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) |
30 | : SoundSettingsBase( parent, name, TRUE, fl ) | 32 | : SoundSettingsBase( parent, name, TRUE, fl ) |
@@ -32,19 +34,26 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | |||
32 | Config config( "Sound" ); | 34 | Config config( "Sound" ); |
33 | config.setGroup( "System" ); | 35 | config.setGroup( "System" ); |
34 | volume->setValue(100-config.readNumEntry("Volume")); | 36 | volume->setValue(100-config.readNumEntry("Volume")); |
35 | mic->setValue(100-config.readNumEntry("Mic")); | 37 | mic->setValue(100-config.readNumEntry("Mic")); |
36 | touchsound->setChecked(config.readBoolEntry("Touch")); | 38 | touchsound->setChecked(config.readBoolEntry("Touch")); |
37 | keysound->setChecked(config.readBoolEntry("Key")); | 39 | keysound->setChecked(config.readBoolEntry("Key")); |
38 | 40 | ||
39 | config.setGroup("Record"); | 41 | config.setGroup("Record"); |
40 | sampleRate->setText(config.readEntry("SampleRate", "11025")); | 42 | int rate=config.readNumEntry("SampleRate", 11025); |
41 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 43 | if(rate == 11025) |
42 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | 44 | sampleRate->setCurrentItem(0); |
45 | else if(rate == 22050) | ||
46 | sampleRate->setCurrentItem(1); | ||
47 | else if(rate==44100) | ||
48 | sampleRate->setCurrentItem(2); | ||
49 | |||
50 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | ||
51 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | ||
43 | 52 | ||
44 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); | 53 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); |
45 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); | 54 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); |
46 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 55 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
47 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); | 56 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); |
48 | } | 57 | } |
49 | 58 | ||
50 | void SoundSettings::reject() | 59 | void SoundSettings::reject() |
@@ -52,12 +61,18 @@ void SoundSettings::reject() | |||
52 | Config config( "Sound" ); | 61 | Config config( "Sound" ); |
53 | config.setGroup( "System" ); | 62 | config.setGroup( "System" ); |
54 | setVolume(100-config.readNumEntry("Volume")); | 63 | setVolume(100-config.readNumEntry("Volume")); |
55 | setMic(100-config.readNumEntry("Mic")); | 64 | setMic(100-config.readNumEntry("Mic")); |
56 | 65 | ||
57 | config.setGroup("Record"); | 66 | config.setGroup("Record"); |
58 | sampleRate->setText(config.readEntry("SampleRate", "11025")); | 67 | int rate=config.readNumEntry("SampleRate", 11025); |
59 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 68 | if(rate == 11025) |
60 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | 69 | sampleRate->setCurrentItem(0); |
70 | else if(rate == 22050) | ||
71 | sampleRate->setCurrentItem(1); | ||
72 | else if(rate==44100) | ||
73 | sampleRate->setCurrentItem(2); | ||
74 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | ||
75 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | ||
61 | 76 | ||
62 | QDialog::reject(); | 77 | QDialog::reject(); |
63 | } | 78 | } |
@@ -72,13 +87,13 @@ void SoundSettings::accept() | |||
72 | config.writeEntry("Key",keysound->isChecked()); | 87 | config.writeEntry("Key",keysound->isChecked()); |
73 | 88 | ||
74 | setVolume(volume->value()); | 89 | setVolume(volume->value()); |
75 | setMic(mic->value()); | 90 | setMic(mic->value()); |
76 | 91 | ||
77 | config.setGroup("Record"); | 92 | config.setGroup("Record"); |
78 | config.writeEntry("SampleRate",sampleRate->text()); | 93 | config.writeEntry("SampleRate",sampleRate->currentText()); |
79 | config.writeEntry("Stereo",stereoCheckBox->isChecked()); | 94 | config.writeEntry("Stereo",stereoCheckBox->isChecked()); |
80 | config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 95 | config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
81 | 96 | ||
82 | QDialog::accept(); | 97 | QDialog::accept(); |
83 | } | 98 | } |
84 | 99 | ||
@@ -88,7 +103,7 @@ void SoundSettings::setVolume(int v) | |||
88 | config.setGroup( "System" ); | 103 | config.setGroup( "System" ); |
89 | config.writeEntry("Volume",100-v); | 104 | config.writeEntry("Volume",100-v); |
90 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 105 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
91 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | 106 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; |
92 | #endif | 107 | #endif |
93 | } | 108 | } |
94 | 109 | ||