summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-26 23:20:26 (UTC)
committer llornkcor <llornkcor>2002-05-26 23:20:26 (UTC)
commitf0d0d53759436686f7f15fcd55a6706b1ecaa1cc (patch) (unidiff)
treee40e731fecf6c629799e6d264c47dc05528f21da
parent845ed24db904e0842f1557e185174c52d3d93092 (diff)
downloadopie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.zip
opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.tar.gz
opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.tar.bz2
fixed location not remembering setting. added record key combo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp39
-rw-r--r--noncore/settings/sound/soundsettings.h2
-rw-r--r--noncore/settings/sound/soundsettingsbase.cpp30
-rw-r--r--noncore/settings/sound/soundsettingsbase.h3
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
@@ -32,12 +32,14 @@
32#include <qcombobox.h> 32#include <qcombobox.h>
33 33
34 34
35SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 35SoundSettings::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"));
@@ -58,18 +60,23 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
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");
@@ -154,37 +161,48 @@ void SoundSettings::micChanged( bool )
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
158void SoundSettings::updateStorageCombo() { 165void SoundSettings::updateStorageCombo() {
159 166
167 Config config( "Vmemo" );
168 config.setGroup( "System" );
169 QString loc = config.readEntry("RecLocation","/");
170int i=0;
171int 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
175void SoundSettings::setLocation(const QString & string) { 192void 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
182void SoundSettings::cleanUp() { 200void 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
@@ -194,7 +212,22 @@ void SoundSettings::cleanUp() {
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
223void 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
231void 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
@@ -32,14 +32,16 @@ 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
34protected: 34protected:
35/* void accept(); */ 35/* void accept(); */
36/* void reject(); */ 36/* void reject(); */
37 void updateStorageCombo(); 37 void updateStorageCombo();
38 void updateLocationCombo();
38 39
39private slots: 40private 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 );
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
@@ -223,28 +223,50 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m
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
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
@@ -44,13 +44,14 @@ public:
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;
51protected: 52protected:
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;