summaryrefslogtreecommitdiff
path: root/noncore/settings/sound/soundsettings.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp76
1 files changed, 53 insertions, 23 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 467f23e..51522b3 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -22,4 +22,6 @@
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
+#include <qpe/storage.h>
+
#include <qapplication.h>
#include <qslider.h>
@@ -40,5 +42,5 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
config.setGroup("Record");
- int rate=config.readNumEntry("SampleRate", 11025);
+ int rate=config.readNumEntry("SampleRate", 22050);
if(rate == 11025)
sampleRate->setCurrentItem(0);
@@ -50,11 +52,14 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
sampleRate->setCurrentItem(2);
- stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
- sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1));
+ stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
+ sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1));
+ updateStorageCombo();
connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int)));
connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int)));
connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
- connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
+ connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
+ connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &)));
+// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
}
@@ -63,19 +68,20 @@ void SoundSettings::reject()
Config config( "Sound" );
config.setGroup( "System" );
- setVolume(100-config.readNumEntry("Volume"));
- setMic(100-config.readNumEntry("Mic"));
- config.setGroup("Record");
- int rate=config.readNumEntry("SampleRate", 11025);
- if(rate == 11025)
- sampleRate->setCurrentItem(0);
- else if(rate == 22050)
- sampleRate->setCurrentItem(1);
- else if(rate == 32000)
- sampleRate->setCurrentItem(2);
- else if(rate==44100)
- sampleRate->setCurrentItem(3);
- stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
- sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0));
+ setVolume(100-config.readNumEntry("Volume"));
+ setMic(100-config.readNumEntry("Mic"));
+
+// config.setGroup("Record");
+// int rate=config.readNumEntry("SampleRate", 11025);
+// if(rate == 11025)
+// sampleRate->setCurrentItem(0);
+// else if(rate == 22050)
+// sampleRate->setCurrentItem(1);
+// else if(rate == 32000)
+// sampleRate->setCurrentItem(2);
+// else if(rate==44100)
+// sampleRate->setCurrentItem(3);
+// stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
+// sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0));
QDialog::reject();
@@ -92,10 +98,10 @@ void SoundSettings::accept()
setVolume(volume->value());
- setMic(mic->value());
+ setMic(mic->value());
- config.setGroup("Record");
- config.writeEntry("SampleRate",sampleRate->currentText());
- config.writeEntry("Stereo",stereoCheckBox->isChecked());
- config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
+ config.setGroup("Record");
+ config.writeEntry("SampleRate",sampleRate->currentText());
+ config.writeEntry("Stereo",stereoCheckBox->isChecked());
+ config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
QDialog::accept();
@@ -135,2 +141,26 @@ void SoundSettings::micChanged( bool )
mic->setValue(100-config.readNumEntry("Mic"));
}
+
+void SoundSettings::updateStorageCombo() {
+
+ StorageInfo storageInfo;
+ QString sName, sPath;
+ QStringList list;
+ const QList<FileSystem> &fs = storageInfo.fileSystems();
+ QListIterator<FileSystem> it ( fs );
+ for( ; it.current(); ++it ){
+ const QString name = (*it)->name();
+ const QString path = (*it)->path();
+ qDebug("storage name "+name +" storage path is "+path);
+ list << name + ": " +path;
+// if(dit.current()->file().find(path) != -1 ) storage=name;
+ }
+ LocationComboBox->insertStringList(list);
+}
+
+void SoundSettings::setLocation(const QString & string) {
+ Config config( "Sound" );
+ config.setGroup( "System" );
+ config.writeEntry("RecLocation",string);
+
+}