author | llornkcor <llornkcor> | 2002-05-26 23:20:26 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-26 23:20:26 (UTC) |
commit | f0d0d53759436686f7f15fcd55a6706b1ecaa1cc (patch) (side-by-side diff) | |
tree | e40e731fecf6c629799e6d264c47dc05528f21da | |
parent | 845ed24db904e0842f1557e185174c52d3d93092 (diff) | |
download | opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.zip opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.tar.gz opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.tar.bz2 |
fixed location not remembering setting. added record key combo
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 39 | ||||
-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, 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 @@ -36,4 +36,6 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) : SoundSettingsBase( parent, name, TRUE, fl ) { + keyReset=FALSE; + Config config( "qpe"); config.setGroup( "Volume" ); @@ -62,5 +64,9 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 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))); @@ -68,4 +74,5 @@ 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( keyComboBox,SIGNAL(activated(const QString &)),this,SLOT(setKeyButton(const QString &))); // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); } @@ -158,4 +165,9 @@ 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; @@ -168,7 +180,12 @@ void SoundSettings::updateStorageCombo() { 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); } @@ -177,10 +194,11 @@ void SoundSettings::setLocation(const QString & string) { 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()); @@ -198,3 +216,18 @@ void SoundSettings::cleanUp() { 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 @@ -36,6 +36,8 @@ protected: /* void reject(); */ void updateStorageCombo(); + void updateLocationCombo(); private slots: + void setKeyButton(const QString &); void setLocation(const QString &); void cleanUp(); 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 @@ -227,11 +227,35 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m 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" ) ); @@ -241,6 +265,4 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m // // 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 @@ -48,5 +48,6 @@ public: QLabel* TextLabel1; QComboBox* LocationComboBox; - + QComboBox* keyComboBox; + bool keyReset; protected: QGridLayout* SoundSettingsBaseLayout; |