-rw-r--r-- | noncore/settings/sound/opie-vmemo-settings.control | 10 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 113 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 5 |
3 files changed, 73 insertions, 55 deletions
diff --git a/noncore/settings/sound/opie-vmemo-settings.control b/noncore/settings/sound/opie-vmemo-settings.control new file mode 100644 index 0000000..3d42ca0 --- a/dev/null +++ b/noncore/settings/sound/opie-vmemo-settings.control | |||
@@ -0,0 +1,10 @@ | |||
1 | Files: bin/sound apps/Settings/Sound.desktop | ||
2 | Priority: optional | ||
3 | Section: opie/settings | ||
4 | Maintainer: L.J. Potter | ||
5 | Architecture: arm | ||
6 | Arch: iPAQ | ||
7 | Version: $QPE_VERSION-$SUB_VERSION.2 | ||
8 | Depends: opie-base ($QPE_VERSION) | ||
9 | Description: Sound settings dialog | ||
10 | For the Opie environment. | ||
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index cddb478..8b97e4d 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -1,191 +1,200 @@ | |||
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 | // parts copyright 2002 L.J. Potter | ||
20 | 21 | ||
21 | #include "soundsettings.h" | 22 | #include "soundsettings.h" |
22 | 23 | ||
23 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/config.h> | 25 | #include <qpe/config.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 26 | #include <qpe/qcopenvelope_qws.h> |
26 | #include <qpe/storage.h> | 27 | #include <qpe/storage.h> |
27 | 28 | ||
28 | #include <qapplication.h> | 29 | #include <qapplication.h> |
29 | #include <qslider.h> | 30 | #include <qslider.h> |
30 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
31 | #include <qlineedit.h> | 32 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
33 | 34 | ||
34 | #include <sys/utsname.h> | 35 | #include <sys/utsname.h> |
35 | #include <sys/time.h> | 36 | #include <sys/time.h> |
36 | #include <sys/types.h> | 37 | #include <sys/types.h> |
37 | #include <unistd.h> | 38 | #include <unistd.h> |
38 | #include <stdio.h> | 39 | #include <stdio.h> |
39 | #include <sys/stat.h> | 40 | #include <sys/stat.h> |
40 | 41 | ||
41 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) | 42 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) |
42 | : SoundSettingsBase( parent, objname, TRUE, fl ) | 43 | : SoundSettingsBase( parent, objname, TRUE, fl ) |
43 | { | 44 | { |
44 | keyReset=FALSE; | 45 | keyReset=FALSE; |
45 | 46 | ||
46 | Config config( "qpe"); | 47 | Config config( "qpe"); |
47 | config.setGroup( "Volume" ); | 48 | config.setGroup( "Volume" ); |
48 | Config cfg("Vmemo"); | 49 | Config cfg("Vmemo"); |
49 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 50 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
50 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); | 51 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); |
51 | 52 | ||
52 | cfg.setGroup("Record"); | 53 | cfg.setGroup("Record"); |
53 | int rate=config.readNumEntry("SampleRate", 22050); | 54 | int rate=config.readNumEntry("SampleRate", 22050); |
54 | if(rate == 8000) | 55 | if(rate == 8000) |
55 | sampleRate->setCurrentItem(0); | 56 | sampleRate->setCurrentItem(0); |
56 | else if(rate == 11025) | 57 | else if(rate == 11025) |
57 | sampleRate->setCurrentItem(1); | 58 | sampleRate->setCurrentItem(1); |
58 | else if(rate == 22050) | 59 | else if(rate == 22050) |
59 | sampleRate->setCurrentItem(2); | 60 | sampleRate->setCurrentItem(2); |
60 | else if(rate == 33075) | 61 | else if(rate == 33075) |
61 | sampleRate->setCurrentItem(3); | 62 | sampleRate->setCurrentItem(3); |
62 | else if(rate==44100) | 63 | else if(rate==44100) |
63 | sampleRate->setCurrentItem(4); | 64 | sampleRate->setCurrentItem(4); |
64 | 65 | ||
65 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); //TODO hide if zaurus- mono only | 66 | stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); //TODO hide if zaurus- mono only |
66 | 67 | ||
67 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) //since ipaq and zaurus have particular | 68 | #if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX) //since ipaq and zaurus have particular |
68 | //devices | 69 | //devices |
69 | bool systemZaurus=FALSE; | 70 | bool systemZaurus=FALSE; |
70 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 71 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
71 | if (uname(&name) != -1) {// TODO change this here,... | 72 | if (uname(&name) != -1) {// TODO change this here,... |
72 | QString release=name.release; | 73 | QString release=name.release; |
73 | if( release.find("embedix",0,TRUE) != -1) { | 74 | if( release.find("embedix",0,TRUE) != -1) { |
74 | qDebug("IS System Zaurus"); | 75 | qDebug("IS System Zaurus"); |
75 | systemZaurus=TRUE; | 76 | systemZaurus=TRUE; |
76 | } | 77 | } |
77 | } | 78 | } |
78 | if(!systemZaurus) { | 79 | if(!systemZaurus) { |
79 | stereoCheckBox->setChecked(TRUE); | 80 | stereoCheckBox->setChecked(TRUE); |
80 | } | 81 | } |
81 | stereoCheckBox->setEnabled(FALSE); | 82 | stereoCheckBox->setEnabled(FALSE); |
82 | sixteenBitCheckBox->setEnabled(FALSE); | 83 | sixteenBitCheckBox->setEnabled(FALSE); |
83 | #else | 84 | #else |
84 | #endif | 85 | #endif |
85 | int sRate=cfg.readNumEntry("SizeLimit", 30); | 86 | int sRate=cfg.readNumEntry("SizeLimit", 30); |
86 | qDebug("%d",sRate); | 87 | qDebug("%d",sRate); |
87 | 88 | ||
88 | if(sRate ==30) | 89 | if(sRate ==30) |
89 | timeLimitComboBox->setCurrentItem(0); | 90 | timeLimitComboBox->setCurrentItem(0); |
90 | else if(sRate==20) | 91 | else if(sRate==20) |
91 | timeLimitComboBox->setCurrentItem(1); | 92 | timeLimitComboBox->setCurrentItem(1); |
92 | else if(sRate == 15) | 93 | else if(sRate == 15) |
93 | timeLimitComboBox->setCurrentItem(2); | 94 | timeLimitComboBox->setCurrentItem(2); |
94 | else if(sRate == 10) | 95 | else if(sRate == 10) |
95 | timeLimitComboBox->setCurrentItem(3); | 96 | timeLimitComboBox->setCurrentItem(3); |
96 | else if(sRate == 5) | 97 | else if(sRate == 5) |
97 | timeLimitComboBox->setCurrentItem(4); | 98 | timeLimitComboBox->setCurrentItem(4); |
98 | else | 99 | else |
99 | timeLimitComboBox->setCurrentItem(5); | 100 | timeLimitComboBox->setCurrentItem(5); |
100 | 101 | ||
101 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); | 102 | sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); |
102 | 103 | ||
103 | cfg.setGroup("Defaults"); | 104 | cfg.setGroup("Defaults"); |
104 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); | 105 | keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); |
105 | 106 | ||
106 | updateStorageCombo(); | 107 | updateStorageCombo(); |
107 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); | 108 | connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); |
108 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); | 109 | connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT( setKeyButton(const QString &))); |
109 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); | 110 | connect( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT( setSizeLimitButton(const QString &))); |
110 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 111 | // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
111 | } | 112 | } |
113 | |||
112 | void SoundSettings::updateStorageCombo() { | 114 | void SoundSettings::updateStorageCombo() { |
113 | 115 | ||
114 | Config config( "Vmemo" ); | 116 | Config config( "Vmemo" ); |
115 | config.setGroup( "System" ); | 117 | config.setGroup( "System" ); |
116 | QString loc = config.readEntry("RecLocation","/"); | 118 | QString loc = config.readEntry("RecLocation","/"); |
117 | int i=0; | 119 | int i=0; |
118 | int set=0; | 120 | int set=0; |
119 | StorageInfo storageInfo; | 121 | StorageInfo storageInfo; |
120 | QString sName, sPath; | 122 | QString sName, sPath; |
121 | QStringList list; | 123 | QStringList list; |
122 | list << "Documents : "+QPEApplication::documentDir(); | 124 | list << "Documents : "+QPEApplication::documentDir(); |
123 | list << "tmp : /tmp"; | 125 | list << "tmp : /tmp"; |
124 | 126 | ||
125 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 127 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
126 | QListIterator<FileSystem> it ( fs ); | 128 | QListIterator<FileSystem> it ( fs ); |
127 | for( ; it.current(); ++it ){ | 129 | for( ; it.current(); ++it ){ |
128 | const QString name = (*it)->name(); | 130 | const QString name = (*it)->name(); |
129 | const QString path = (*it)->path(); | 131 | const QString path = (*it)->path(); |
130 | qDebug("storage name "+name +" storage path is "+path); | 132 | qDebug("storage name "+name +" storage path is "+path); |
131 | list << name + ": " +path; | 133 | list << name + ": " +path; |
132 | if( loc.find( path,0,TRUE) != -1) | 134 | if( loc.find( path,0,TRUE) != -1) |
133 | set = i; | 135 | set = i; |
134 | // if(dit.current()->file().find(path) != -1 ) storage=name; | 136 | // if(dit.current()->file().find(path) != -1 ) storage=name; |
135 | i++; | 137 | i++; |
136 | } | 138 | } |
137 | 139 | ||
138 | LocationComboBox->insertStringList(list); | 140 | LocationComboBox->insertStringList(list); |
139 | qDebug("set item %d", set); | 141 | qDebug("set item %d", set); |
140 | LocationComboBox->setCurrentItem(set); | 142 | LocationComboBox->setCurrentItem(set); |
141 | } | 143 | } |
142 | 144 | ||
143 | void SoundSettings::setLocation(const QString & string) { | 145 | void SoundSettings::setLocation(const QString & string) { |
144 | Config config( "Vmemo" ); | 146 | Config config( "Vmemo" ); |
145 | config.setGroup( "System" ); | 147 | config.setGroup( "System" ); |
146 | config.writeEntry("RecLocation",string); | 148 | config.writeEntry("RecLocation",string); |
147 | qDebug("set location "+string); | 149 | qDebug("set location "+string); |
148 | config.write(); | 150 | config.write(); |
149 | } | 151 | } |
150 | 152 | ||
151 | void SoundSettings::cleanUp() { | 153 | void SoundSettings::cleanUp() { |
152 | Config cfg("Vmemo"); | 154 | Config cfg("Vmemo"); |
153 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); | 155 | cfg.writeEntry("Alert",AlertCheckBox->isChecked()); |
154 | 156 | ||
155 | cfg.setGroup("Record"); | 157 | cfg.setGroup("Record"); |
156 | cfg.writeEntry("SampleRate",sampleRate->currentText()); | 158 | cfg.writeEntry("SampleRate",sampleRate->currentText()); |
157 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); | 159 | cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); |
158 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 160 | cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
159 | 161 | ||
160 | if(keyReset) QCopEnvelope ("QPE/System", "restart()"); | 162 | if(keyReset) { |
161 | 163 | switch ( QMessageBox::warning(this,tr("Restart"), | |
164 | tr("To implement a new key switch\nOpie will have to be restarted./n<B>Restart</B> Opie now?"), | ||
165 | tr("Yes"),tr("No"),0,1,1) ) { | ||
166 | case 0: | ||
167 | QCopEnvelope ("QPE/System", "restart()"); | ||
168 | break; | ||
169 | }; | ||
170 | } | ||
162 | } | 171 | } |
163 | 172 | ||
164 | void SoundSettings::setKeyButton(const QString &name) { | 173 | void SoundSettings::setKeyButton(const QString &name) { |
165 | Config cfg("Vmemo"); | 174 | Config cfg("Vmemo"); |
166 | cfg.setGroup("Defaults"); | 175 | cfg.setGroup("Defaults"); |
167 | cfg.writeEntry( "toggleKey", keyComboBox->currentItem() ); | 176 | cfg.writeEntry( "toggleKey", keyComboBox->currentItem() ); |
168 | keyReset = TRUE; | 177 | keyReset = TRUE; |
169 | if(keyComboBox->currentItem() == 1) | 178 | if(keyComboBox->currentItem() == 1) |
170 | cfg.writeEntry( "hideIcon", 0 ); | 179 | cfg.writeEntry( "hideIcon", 0 ); |
171 | else | 180 | else |
172 | cfg.writeEntry( "hideIcon", 1); | 181 | cfg.writeEntry( "hideIcon", 1); |
173 | 182 | ||
174 | 183 | ||
175 | cfg.write(); | 184 | cfg.write(); |
176 | } | 185 | } |
177 | 186 | ||
178 | void SoundSettings::updateLocationCombo() { | 187 | void SoundSettings::updateLocationCombo() { |
179 | 188 | ||
180 | } | 189 | } |
181 | 190 | ||
182 | void SoundSettings::setSizeLimitButton(const QString &index) { | 191 | void SoundSettings::setSizeLimitButton(const QString &index) { |
183 | 192 | ||
184 | Config cfg("Vmemo"); | 193 | Config cfg("Vmemo"); |
185 | cfg.setGroup("Record"); | 194 | cfg.setGroup("Record"); |
186 | if(index.find("Unlimited",0,TRUE) != -1) | 195 | if(index.find("Unlimited",0,TRUE) != -1) |
187 | cfg.writeEntry("SizeLimit", -1); | 196 | cfg.writeEntry("SizeLimit", -1); |
188 | else | 197 | else |
189 | cfg.writeEntry("SizeLimit", index); | 198 | cfg.writeEntry("SizeLimit", index); |
190 | cfg.write(); | 199 | cfg.write(); |
191 | } | 200 | } |
diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp index 3c98362..05b4b7e 100644 --- a/noncore/settings/sound/soundsettingsbase.cpp +++ b/noncore/settings/sound/soundsettingsbase.cpp | |||
@@ -1,176 +1,175 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** Form implementation generated from reading ui file 'soundsettingsbase.ui' | 2 | ** Form implementation generated from reading ui file 'soundsettingsbase.ui' |
3 | ** | 3 | ** |
4 | ** Created: Sun May 19 12:11:35 2002 | 4 | ** Created: Sun May 19 12:11:35 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 | #include "soundsettingsbase.h" | 9 | #include "soundsettingsbase.h" |
10 | 10 | ||
11 | #include <qcheckbox.h> | 11 | #include <qcheckbox.h> |
12 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
13 | #include <qgroupbox.h> | 13 | #include <qgroupbox.h> |
14 | #include <qmainwindow.h> | 14 | #include <qmainwindow.h> |
15 | 15 | ||
16 | #include <qpe/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qpushbutton.h> | 18 | #include <qpushbutton.h> |
19 | #include <qslider.h> | 19 | #include <qslider.h> |
20 | #include <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qvariant.h> | 21 | #include <qvariant.h> |
22 | #include <qtooltip.h> | 22 | #include <qtooltip.h> |
23 | #include <qwhatsthis.h> | 23 | #include <qwhatsthis.h> |
24 | #include <qimage.h> | 24 | #include <qimage.h> |
25 | #include <qpixmap.h> | 25 | #include <qpixmap.h> |
26 | 26 | ||
27 | static const char* const image0_data[] = { | 27 | static const char* const image0_data[] = { |
28 | "16 16 3 1", | 28 | "16 16 3 1", |
29 | ". c None", | 29 | ". c None", |
30 | "a c #000000", | 30 | "a c #000000", |
31 | "# c #ff0000", | 31 | "# c #ff0000", |
32 | "............#...", | 32 | "............#...", |
33 | "............##..", | 33 | "............##..", |
34 | "..........#..#..", | 34 | "..........#..#..", |
35 | ".....a..#..#.#..", | 35 | ".....a..#..#.#..", |
36 | "....aa..##.#..#.", | 36 | "....aa..##.#..#.", |
37 | "...aaa...#.##.#.", | 37 | "...aaa...#.##.#.", |
38 | "aaaaaa.#.#..#.##", | 38 | "aaaaaa.#.#..#.##", |
39 | "aaaaaa.#.##.#.##", | 39 | "aaaaaa.#.##.#.##", |
40 | "aaaaaa.#.##.#.##", | 40 | "aaaaaa.#.##.#.##", |
41 | "aaaaaa.#.##.#.##", | 41 | "aaaaaa.#.##.#.##", |
42 | "aaaaaa.#.#..#.##", | 42 | "aaaaaa.#.#..#.##", |
43 | "...aaa...#.##.#.", | 43 | "...aaa...#.##.#.", |
44 | "....aa..#..#..#.", | 44 | "....aa..#..#..#.", |
45 | ".....a.....#.##.", | 45 | ".....a.....#.##.", |
46 | "..........#..#..", | 46 | "..........#..#..", |
47 | "............##.."}; | 47 | "............##.."}; |
48 | 48 | ||
49 | static const char* const image1_data[] = { | 49 | static const char* const image1_data[] = { |
50 | "16 16 3 1", | 50 | "16 16 3 1", |
51 | ". c None", | 51 | ". c None", |
52 | "# c #000000", | 52 | "# c #000000", |
53 | "a c #ff0000", | 53 | "a c #ff0000", |
54 | "................", | 54 | "................", |
55 | "................", | 55 | "................", |
56 | "................", | 56 | "................", |
57 | ".....#..........", | 57 | ".....#..........", |
58 | "....##..........", | 58 | "....##..........", |
59 | "...###...a...a..", | 59 | "...###...a...a..", |
60 | "######..aaa.aaa.", | 60 | "######..aaa.aaa.", |
61 | "######...aaaaa..", | 61 | "######...aaaaa..", |
62 | "######....aaa...", | 62 | "######....aaa...", |
63 | "######...aaaaa..", | 63 | "######...aaaaa..", |
64 | "######..aaa.aaa.", | 64 | "######..aaa.aaa.", |
65 | "...###...a...a..", | 65 | "...###...a...a..", |
66 | "....##..........", | 66 | "....##..........", |
67 | ".....#..........", | 67 | ".....#..........", |
68 | "................", | 68 | "................", |
69 | "................"}; | 69 | "................"}; |
70 | 70 | ||
71 | 71 | ||
72 | /* | 72 | /* |
73 | * Constructs a SoundSettingsBase which is a child of 'parent', with the | 73 | * Constructs a SoundSettingsBase which is a child of 'parent', with the |
74 | * name 'name' and widget flags set to 'f' | 74 | * name 'name' and widget flags set to 'f' |
75 | * | 75 | * |
76 | * The dialog will by default be modeless, unless you set 'modal' to | 76 | * The dialog will by default be modeless, unless you set 'modal' to |
77 | * TRUE to construct a modal dialog. | 77 | * TRUE to construct a modal dialog. |
78 | */ | 78 | */ |
79 | SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl ) | 79 | SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl ) |
80 | : QMainWindow( parent, name, fl ) | 80 | : QMainWindow( parent, name, fl ) |
81 | { | 81 | { |
82 | QPixmap image0( ( const char** ) image0_data ); | 82 | QPixmap image0( ( const char** ) image0_data ); |
83 | QPixmap image1( ( const char** ) image1_data ); | 83 | QPixmap image1( ( const char** ) image1_data ); |
84 | if ( !name ) | 84 | if ( !name ) |
85 | setName( "SoundSettingsBase" ); | 85 | setName( "SoundSettingsBase" ); |
86 | // resize(255,301); | 86 | // resize(255,301); |
87 | setCaption( tr( "Vmemo Settings" ) ); | 87 | setCaption( tr( "Vmemo Settings" ) ); |
88 | 88 | ||
89 | SoundSettingsBaseLayout = new QGridLayout( this ); | 89 | SoundSettingsBaseLayout = new QGridLayout( this ); |
90 | SoundSettingsBaseLayout->setSpacing( 4 ); | 90 | SoundSettingsBaseLayout->setSpacing( 4 ); |
91 | SoundSettingsBaseLayout->setMargin( 4 ); | 91 | SoundSettingsBaseLayout->setMargin( 4 ); |
92 | 92 | ||
93 | QHBoxLayout *Layout11; | 93 | QHBoxLayout *Layout11; |
94 | Layout11 = new QHBoxLayout; | 94 | Layout11 = new QHBoxLayout; |
95 | Layout11->setSpacing( 4 ); | 95 | Layout11->setSpacing( 4 ); |
96 | Layout11->setMargin( 0 ); | 96 | Layout11->setMargin( 0 ); |
97 | 97 | ||
98 | stereoCheckBox = new QCheckBox( this, "stereoCheckBox" ); | 98 | stereoCheckBox = new QCheckBox( this, "stereoCheckBox" ); |
99 | stereoCheckBox->setText( tr( "Stereo" ) ); | 99 | stereoCheckBox->setText( tr( "Stereo" ) ); |
100 | Layout11->addWidget( stereoCheckBox ); | 100 | Layout11->addWidget( stereoCheckBox ); |
101 | 101 | ||
102 | sixteenBitCheckBox = new QCheckBox( this, "sixteenBitCheckBox" ); | 102 | sixteenBitCheckBox = new QCheckBox( this, "sixteenBitCheckBox" ); |
103 | sixteenBitCheckBox->setText( tr( "16 bit" ) ); | 103 | sixteenBitCheckBox->setText( tr( "16 bit" ) ); |
104 | Layout11->addWidget( sixteenBitCheckBox ); | 104 | Layout11->addWidget( sixteenBitCheckBox ); |
105 | 105 | ||
106 | AlertCheckBox = new QCheckBox( this, "AlertCheckBox" ); | 106 | AlertCheckBox = new QCheckBox( this, "AlertCheckBox" ); |
107 | AlertCheckBox->setText( tr( "Visual Alerts" ) ); | 107 | AlertCheckBox->setText( tr( "Visual Alerts" ) ); |
108 | Layout11->addWidget( AlertCheckBox ); | 108 | Layout11->addWidget( AlertCheckBox ); |
109 | 109 | ||
110 | SoundSettingsBaseLayout->addLayout( Layout11, 0, 0); | 110 | SoundSettingsBaseLayout->addLayout( Layout11, 0, 0); |
111 | 111 | ||
112 | sampleRateLabel = new QLabel(this, "sampleRateLabel" ); | 112 | sampleRateLabel = new QLabel(this, "sampleRateLabel" ); |
113 | sampleRateLabel->setText( tr( "Sample Rate:" ) ); | 113 | sampleRateLabel->setText( tr( "Sample Rate:" ) ); |
114 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRateLabel , 1, 1, 0, 0, 1); | 114 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRateLabel , 1, 1, 0, 0, 1); |
115 | 115 | ||
116 | sampleRate = new QComboBox( FALSE,this, "sampleRate" ); | 116 | sampleRate = new QComboBox( FALSE,this, "sampleRate" ); |
117 | 117 | ||
118 | sampleRate->insertItem( tr( "8000" ) ); | 118 | sampleRate->insertItem( tr( "8000" ) ); |
119 | sampleRate->insertItem( tr( "11025" ) ); | 119 | sampleRate->insertItem( tr( "11025" ) ); |
120 | sampleRate->insertItem( tr( "22050" ) ); | 120 | sampleRate->insertItem( tr( "22050" ) ); |
121 | sampleRate->insertItem( tr( "33075" ) ); | 121 | sampleRate->insertItem( tr( "33075" ) ); |
122 | sampleRate->insertItem( tr( "44100" ) ); | 122 | sampleRate->insertItem( tr( "44100" ) ); |
123 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRate, 2, 2, 0, 0, 1 ); | 123 | SoundSettingsBaseLayout->addMultiCellWidget( sampleRate, 2, 2, 0, 0, 1 ); |
124 | 124 | ||
125 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 125 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
126 | TextLabel1->setText( tr( "Recording Directory:" ) ); | 126 | TextLabel1->setText( tr( "Recording Directory:" ) ); |
127 | SoundSettingsBaseLayout->addMultiCellWidget( TextLabel1, 3, 3, 0, 0, 1); | 127 | SoundSettingsBaseLayout->addMultiCellWidget( TextLabel1, 3, 3, 0, 0, 1); |
128 | 128 | ||
129 | 129 | ||
130 | LocationComboBox = new QComboBox( FALSE, this, "LocationComboBox" ); | 130 | LocationComboBox = new QComboBox( FALSE, this, "LocationComboBox" ); |
131 | SoundSettingsBaseLayout->addMultiCellWidget( LocationComboBox, 4, 4, 0, 8, 1); | 131 | SoundSettingsBaseLayout->addMultiCellWidget( LocationComboBox, 4, 4, 0, 8, 1); |
132 | 132 | ||
133 | QLabel *TextLabelKey; | 133 | QLabel *TextLabelKey; |
134 | TextLabelKey = new QLabel( this, "TextLabelKey" ); | 134 | TextLabelKey = new QLabel( this, "TextLabelKey" ); |
135 | TextLabelKey->setText( tr( "Recording Key:" ) ); | 135 | TextLabelKey->setText( tr( "Recording Key:" ) ); |
136 | SoundSettingsBaseLayout->addMultiCellWidget(TextLabelKey , 5, 5, 0, 0, 1); | 136 | SoundSettingsBaseLayout->addMultiCellWidget(TextLabelKey , 5, 5, 0, 0, 1); |
137 | 137 | ||
138 | keyComboBox = new QComboBox( FALSE, this, "keyComboBox" ); | 138 | keyComboBox = new QComboBox( FALSE, this, "keyComboBox" ); |
139 | keyComboBox->insertItem( tr( "" ) ); | 139 | keyComboBox->insertItem( tr( "" ) ); |
140 | keyComboBox->insertItem( tr( "Taskbar Icon" ) ); | 140 | keyComboBox->insertItem( tr( "Taskbar Icon" ) ); |
141 | keyComboBox->insertItem( tr( "Key_Escape" ) ); | 141 | keyComboBox->insertItem( tr( "Key_Escape" ) ); |
142 | keyComboBox->insertItem( tr( "Key_Space" ) ); | 142 | keyComboBox->insertItem( tr( "Key_Space" ) ); |
143 | keyComboBox->insertItem( tr( "Key_Home" ) ); | 143 | keyComboBox->insertItem( tr( "Key_Home" ) ); |
144 | keyComboBox->insertItem( tr( "Key_Calender" ) ); | 144 | keyComboBox->insertItem( tr( "Key_Calender" ) ); |
145 | keyComboBox->insertItem( tr( "Key_Contacts" ) ); | 145 | keyComboBox->insertItem( tr( "Key_Contacts" ) ); |
146 | keyComboBox->insertItem( tr( "Key_Menu" ) ); | 146 | keyComboBox->insertItem( tr( "Key_Menu" ) ); |
147 | keyComboBox->insertItem( tr( "Key_Mail" ) ); | 147 | keyComboBox->insertItem( tr( "Key_Mail" ) ); |
148 | SoundSettingsBaseLayout->addMultiCellWidget( keyComboBox , 6, 6, 0, 0 ,1); | 148 | SoundSettingsBaseLayout->addMultiCellWidget( keyComboBox , 6, 6, 0, 0 ,1); |
149 | 149 | ||
150 | QLabel *timeLimitLabel; | 150 | QLabel *timeLimitLabel; |
151 | timeLimitLabel= new QLabel( this, "timeLimitLabel" ); | 151 | timeLimitLabel= new QLabel( this, "timeLimitLabel" ); |
152 | timeLimitLabel->setText( tr( "Recording Limit in seconds:" ) ); | 152 | timeLimitLabel->setText( tr( "Recording Limit in seconds:" ) ); |
153 | SoundSettingsBaseLayout->addMultiCellWidget( timeLimitLabel , 7, 7, 0, 0, 1); | 153 | SoundSettingsBaseLayout->addMultiCellWidget( timeLimitLabel , 7, 7, 0, 0, 1); |
154 | 154 | ||
155 | timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); | 155 | timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); |
156 | timeLimitComboBox->insertItem( tr( "30" ) ); | 156 | timeLimitComboBox->insertItem( tr( "30" ) ); |
157 | timeLimitComboBox->insertItem( tr( "20" ) ); | 157 | timeLimitComboBox->insertItem( tr( "20" ) ); |
158 | timeLimitComboBox->insertItem( tr( "15" ) ); | 158 | timeLimitComboBox->insertItem( tr( "15" ) ); |
159 | timeLimitComboBox->insertItem( tr( "10" ) ); | 159 | timeLimitComboBox->insertItem( tr( "10" ) ); |
160 | timeLimitComboBox->insertItem( tr( "5" ) ); | 160 | timeLimitComboBox->insertItem( tr( "5" ) ); |
161 | timeLimitComboBox->insertItem( tr( "Unlimited" ) ); | 161 | timeLimitComboBox->insertItem( tr( "Unlimited" ) ); |
162 | 162 | ||
163 | SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); | 163 | SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); |
164 | 164 | ||
165 | 165 | QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | |
166 | QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); | 166 | SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); |
167 | SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); | ||
168 | } | 167 | } |
169 | 168 | ||
170 | /* | 169 | /* |
171 | * Destroys the object and frees any allocated resources | 170 | * Destroys the object and frees any allocated resources |
172 | */ | 171 | */ |
173 | SoundSettingsBase::~SoundSettingsBase() | 172 | SoundSettingsBase::~SoundSettingsBase() |
174 | { | 173 | { |
175 | // no need to delete child widgets, Qt does it all for us | 174 | // no need to delete child widgets, Qt does it all for us |
176 | } | 175 | } |