Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 56 |
1 files changed, 43 insertions, 13 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 @@ -23,2 +23,4 @@ #include <qpe/qcopenvelope_qws.h> +#include <qpe/storage.h> + #include <qapplication.h> @@ -41,3 +43,3 @@ 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) @@ -54,2 +56,3 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) + updateStorageCombo(); connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); @@ -58,2 +61,4 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 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()) ); } @@ -64,2 +69,3 @@ void SoundSettings::reject() config.setGroup( "System" ); + setVolume(100-config.readNumEntry("Volume")); @@ -67,14 +73,14 @@ void SoundSettings::reject() - 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)); +// 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)); @@ -136 +142,25 @@ void SoundSettings::micChanged( bool ) } + +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); + +} |