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.cpp39
1 files changed, 36 insertions, 3 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 @@
#include <qcombobox.h>
SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
: SoundSettingsBase( parent, name, TRUE, fl )
{
+ keyReset=FALSE;
+
Config config( "qpe");
config.setGroup( "Volume" );
volume->setValue(100-config.readNumEntry("VolumePercent"));
mic->setValue(100-config.readNumEntry("Mic"));
// touchsound->setChecked(config.readBoolEntry("TouchSound"));
// keysound->setChecked(config.readBoolEntry("KeySound"));
@@ -58,18 +60,23 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
else if(rate==44100)
sampleRate->setCurrentItem(4);
stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0));
sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1));
+ cfg.setGroup("Defaults");
+ keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") );
+
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( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &)));
+ connect( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT(setKeyButton(const QString &)));
// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
}
// void SoundSettings::reject()
// {
// qDebug("reject");
@@ -154,37 +161,48 @@ void SoundSettings::micChanged( bool )
config.setGroup( "Volume" );
mic->setValue(100-config.readNumEntry("Mic"));
}
void SoundSettings::updateStorageCombo() {
+ Config config( "Vmemo" );
+ config.setGroup( "System" );
+ QString loc = config.readEntry("RecLocation","/");
+int i=0;
+int set=0;
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( loc.find( path,0,TRUE) != -1)
+ set = i;
// if(dit.current()->file().find(path) != -1 ) storage=name;
+ i++;
}
LocationComboBox->insertStringList(list);
+ qDebug("set item %d", set);
+ LocationComboBox->setCurrentItem(set);
}
void SoundSettings::setLocation(const QString & string) {
Config config( "Vmemo" );
config.setGroup( "System" );
config.writeEntry("RecLocation",string);
-
+ qDebug("set location "+string);
+ config.write();
}
void SoundSettings::cleanUp() {
- qDebug("cleanup");
- Config config( "qpe" );
+ qDebug("cleanup");
+ Config config( "qpe" );
config.setGroup( "Volume" );
config.writeEntry("VolumePercent",100-volume->value());
config.writeEntry("Mic",100-mic->value());
// config.writeEntry("TouchSound",touchsound->isChecked());
// config.writeEntry("KeySound",keysound->isChecked());
@@ -194,7 +212,22 @@ void SoundSettings::cleanUp() {
setMic(mic->value());
cfg.setGroup("Record");
cfg.writeEntry("SampleRate",sampleRate->currentText());
cfg.writeEntry("Stereo",stereoCheckBox->isChecked());
cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
+
+ if(keyReset) QCopEnvelope ("QPE/System", "restart()");
+
+}
+
+void SoundSettings::setKeyButton(const QString &name) {
+ Config cfg("Vmemo");
+ cfg.setGroup("Defaults");
+ cfg.writeEntry( "toggleKey", keyComboBox->currentItem() );
+ keyReset = TRUE;
+ cfg.write();
+}
+
+void SoundSettings::updateLocationCombo() {
+
}