-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 35 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.h | 2 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.h | 3 |
4 files changed, 64 insertions, 6 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 @@ -34,8 +34,10 @@ 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")); @@ -60,14 +62,19 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 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() @@ -156,8 +163,13 @@ void SoundSettings::micChanged( bool ) } 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(); @@ -166,18 +178,24 @@ void SoundSettings::updateStorageCombo() { 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"); @@ -196,5 +214,20 @@ void SoundSettings::cleanUp() { 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() { + } 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 @@ -34,10 +34,12 @@ public: protected: /* void accept(); */ /* void reject(); */ void updateStorageCombo(); + void updateLocationCombo(); private slots: + void setKeyButton(const QString &); void setLocation(const QString &); void cleanUp(); void setVolume(int); void setMic(int); 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 @@ -225,24 +225,46 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m AlertCheckBox->setText( tr( "Visual Alerts" ) ); Layout11->addWidget( AlertCheckBox ); TextLabel1 = new QLabel( privateLayoutWidget, "TextLabel1" ); - TextLabel1->setText( tr( "Location" ) ); + TextLabel1->setText( tr( "Location:" ) ); Layout11->addWidget( TextLabel1 ); + LocationComboBox = new QComboBox( FALSE, privateLayoutWidget, "LocationComboBox" ); Layout11->addWidget( LocationComboBox ); - Layout12_2->addWidget( GroupBox1 ); + QLabel *TextLabelKey; + TextLabelKey = new QLabel( privateLayoutWidget, "TextLabelKey" ); + TextLabelKey->setText( tr( "Record Key:" ) ); + + keyComboBox = new QComboBox( FALSE, privateLayoutWidget, "keyComboBox" ); + keyComboBox->insertItem( tr( "" ) ); + keyComboBox->insertItem( tr( "Taskbar Icon" ) ); + keyComboBox->insertItem( tr( "Key_Escape" ) ); + keyComboBox->insertItem( tr( "Key_Space" ) ); + keyComboBox->insertItem( tr( "Key_Home" ) ); + keyComboBox->insertItem( tr( "Key_Calender" ) ); + keyComboBox->insertItem( tr( "Key_Contacts" ) ); + keyComboBox->insertItem( tr( "Key_Menu" ) ); + keyComboBox->insertItem( tr( "Key_Mail" ) ); + + Layout11->addWidget( TextLabelKey ); + + Layout11->addWidget( keyComboBox ); + + QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + Layout11->addItem( spacer_9 ); + + + Layout12_2->addWidget( GroupBox1 ); // // touchsound = new QCheckBox( this, "touchsound" ); // // touchsound->setText( tr( "Screen sounds" ) ); // // Layout12_2->addWidget( touchsound ); // // keysound = new QCheckBox( this, "keysound" ); // // keysound->setText( tr( "Keyboard sounds" ) ); // // Layout12_2->addWidget( keysound ); - QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); - Layout12_2->addItem( spacer_9 ); SoundSettingsBaseLayout->addLayout( Layout12_2, 0, 1 ); } 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 @@ -46,9 +46,10 @@ public: QCheckBox* sixteenBitCheckBox; QCheckBox* AlertCheckBox; QLabel* TextLabel1; QComboBox* LocationComboBox; - + QComboBox* keyComboBox; + bool keyReset; protected: QGridLayout* SoundSettingsBaseLayout; QVBoxLayout* GroupBox3Layout; QVBoxLayout* Layout10; |