author | llornkcor <llornkcor> | 2002-06-29 14:00:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-29 14:00:23 (UTC) |
commit | ffc8b4587d6070abc82b22d03f0819d78c1ff9b0 (patch) (unidiff) | |
tree | 44957940b51225710f924c4c7c811f6d86e85a65 | |
parent | ab5e280b6fd7349c8aa81ba0b235601a7559d3de (diff) | |
download | opie-ffc8b4587d6070abc82b22d03f0819d78c1ff9b0.zip opie-ffc8b4587d6070abc82b22d03f0819d78c1ff9b0.tar.gz opie-ffc8b4587d6070abc82b22d03f0819d78c1ff9b0.tar.bz2 |
disable combos for devices that dont have this ability
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 5cb59c5..6fea3ed 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -6,137 +6,147 @@ | |||
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 | #include <sys/utsname.h> | 34 | #include <sys/utsname.h> |
35 | #include <sys/time.h> | 35 | #include <sys/time.h> |
36 | #include <sys/types.h> | 36 | #include <sys/types.h> |
37 | #include <unistd.h> | 37 | #include <unistd.h> |
38 | #include <stdio.h> | 38 | #include <stdio.h> |
39 | #include <sys/stat.h> | 39 | #include <sys/stat.h> |
40 | 40 | ||
41 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | 41 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) |
42 | : SoundSettingsBase( parent, objname, TRUE, fl ) | 42 | : SoundSettingsBase( parent, objname, TRUE, fl ) |
43 | { | 43 | { |
44 | keyReset=FALSE; | 44 | keyReset=FALSE; |
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")); | 48 | volume->setValue(100-config.readNumEntry("VolumePercent")); |
49 | mic->setValue(100-config.readNumEntry("Mic")); | 49 | mic->setValue(100-config.readNumEntry("Mic")); |
50 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); | 50 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); |
51 | // keysound->setChecked(config.readBoolEntry("KeySound")); | 51 | // keysound->setChecked(config.readBoolEntry("KeySound")); |
52 | Config cfg("Vmemo"); | 52 | Config cfg("Vmemo"); |
53 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 53 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
54 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); | 54 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); |
55 | 55 | ||
56 | cfg.setGroup("Record"); | 56 | cfg.setGroup("Record"); |
57 | int rate=config.readNumEntry("SampleRate", 22050); | 57 | int rate=config.readNumEntry("SampleRate", 22050); |
58 | if(rate == 8000) | 58 | if(rate == 8000) |
59 | sampleRate->setCurrentItem(0); | 59 | sampleRate->setCurrentItem(0); |
60 | else if(rate == 11025) | 60 | else if(rate == 11025) |
61 | sampleRate->setCurrentItem(1); | 61 | sampleRate->setCurrentItem(1); |
62 | else if(rate == 22050) | 62 | else if(rate == 22050) |
63 | sampleRate->setCurrentItem(2); | 63 | sampleRate->setCurrentItem(2); |
64 | else if(rate == 33075) | 64 | else if(rate == 33075) |
65 | sampleRate->setCurrentItem(3); | 65 | sampleRate->setCurrentItem(3); |
66 | else if(rate==44100) | 66 | else if(rate==44100) |
67 | sampleRate->setCurrentItem(4); | 67 | sampleRate->setCurrentItem(4); |
68 | 68 | ||
69 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); //TODO hide if zaurus- mono only | 69 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); //TODO hide if zaurus- mono only |
70 | |||
71 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) //since ipaq and zaurus have particular | ||
72 | //devices | ||
73 | bool systemZaurus=FALSE; | ||
70 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 74 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
71 | if (uname(&name) != -1) { | 75 | if (uname(&name) != -1) {// TODO change this here,... |
72 | QString release=name.release; | 76 | QString release=name.release; |
73 | 77 | if( release.find("embedix",0,TRUE) != -1) { | |
74 | if( release.find("embedix",0,TRUE) !=-1) | 78 | qDebug("IS System Zaurus"); |
75 | stereoCheckBox->hide(); | 79 | systemZaurus=TRUE; |
80 | } | ||
76 | } | 81 | } |
77 | // else | 82 | if(!systemZaurus) { |
78 | // stereoCheckBox->hide(); | 83 | stereoCheckBox->setChecked(TRUE); |
84 | } | ||
85 | stereoCheckBox->setEnabled(FALSE); | ||
86 | sixteenBitCheckBox->setEnabled(FALSE); | ||
87 | #else | ||
88 | #endif | ||
79 | int sRate=cfg.readNumEntry("SizeLimit", 30); | 89 | int sRate=cfg.readNumEntry("SizeLimit", 30); |
80 | qDebug("%d",sRate); | 90 | qDebug("%d",sRate); |
81 | 91 | ||
82 | if(sRate ==30) | 92 | if(sRate ==30) |
83 | timeLimitComboBox->setCurrentItem(0); | 93 | timeLimitComboBox->setCurrentItem(0); |
84 | else if(sRate==20) | 94 | else if(sRate==20) |
85 | timeLimitComboBox->setCurrentItem(1); | 95 | timeLimitComboBox->setCurrentItem(1); |
86 | else if(sRate == 15) | 96 | else if(sRate == 15) |
87 | timeLimitComboBox->setCurrentItem(2); | 97 | timeLimitComboBox->setCurrentItem(2); |
88 | else if(sRate == 10) | 98 | else if(sRate == 10) |
89 | timeLimitComboBox->setCurrentItem(3); | 99 | timeLimitComboBox->setCurrentItem(3); |
90 | else | 100 | else |
91 | timeLimitComboBox->setCurrentItem(4); | 101 | timeLimitComboBox->setCurrentItem(4); |
92 | 102 | ||
93 | 103 | ||
94 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); | 104 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); |
95 | 105 | ||
96 | cfg.setGroup("Defaults"); | 106 | cfg.setGroup("Defaults"); |
97 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); | 107 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); |
98 | 108 | ||
99 | updateStorageCombo(); | 109 | updateStorageCombo(); |
100 | 110 | ||
101 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); | 111 | connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); |
102 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); | 112 | connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); |
103 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 113 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
104 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); | 114 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); |
105 | 115 | ||
106 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); | 116 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); |
107 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); | 117 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); |
108 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); | 118 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); |
109 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 119 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
110 | } | 120 | } |
111 | 121 | ||
112 | // void SoundSettings::reject() | 122 | // void SoundSettings::reject() |
113 | // { | 123 | // { |
114 | // qDebug("reject"); | 124 | // qDebug("reject"); |
115 | // Config config( "qpe"); | 125 | // Config config( "qpe"); |
116 | // config.setGroup( "Volume"); | 126 | // config.setGroup( "Volume"); |
117 | 127 | ||
118 | // setVolume(100-config.readNumEntry("VolumePercent")); | 128 | // setVolume(100-config.readNumEntry("VolumePercent")); |
119 | // setMic(100-config.readNumEntry("Mic")); | 129 | // setMic(100-config.readNumEntry("Mic")); |
120 | 130 | ||
121 | // // config.setGroup("Record"); | 131 | // // config.setGroup("Record"); |
122 | // // int rate=config.readNumEntry("SampleRate", 11025); | 132 | // // int rate=config.readNumEntry("SampleRate", 11025); |
123 | // // if(rate == 11025) | 133 | // // if(rate == 11025) |
124 | // // sampleRate->setCurrentItem(0); | 134 | // // sampleRate->setCurrentItem(0); |
125 | // // else if(rate == 22050) | 135 | // // else if(rate == 22050) |
126 | // // sampleRate->setCurrentItem(1); | 136 | // // sampleRate->setCurrentItem(1); |
127 | // // else if(rate == 32000) | 137 | // // else if(rate == 32000) |
128 | // // sampleRate->setCurrentItem(2); | 138 | // // sampleRate->setCurrentItem(2); |
129 | // // else if(rate==44100) | 139 | // // else if(rate==44100) |
130 | // // sampleRate->setCurrentItem(3); | 140 | // // sampleRate->setCurrentItem(3); |
131 | // // stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 141 | // // stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); |
132 | // // sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | 142 | // // sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); |
133 | // qDebug("QDialog::reject();"); | 143 | // qDebug("QDialog::reject();"); |
134 | // ::exit(-1); | 144 | // ::exit(-1); |
135 | // } | 145 | // } |
136 | 146 | ||
137 | // void SoundSettings::accept() | 147 | // void SoundSettings::accept() |
138 | // { | 148 | // { |
139 | // qDebug("accept"); | 149 | // qDebug("accept"); |
140 | // Config config( "qpe" ); | 150 | // Config config( "qpe" ); |
141 | // config.setGroup( "Volume" ); | 151 | // config.setGroup( "Volume" ); |
142 | // config.writeEntry("VolumePercent",100-volume->value()); | 152 | // config.writeEntry("VolumePercent",100-volume->value()); |