summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2002-05-26 23:20:26 (UTC)
committer llornkcor <llornkcor>2002-05-26 23:20:26 (UTC)
commitf0d0d53759436686f7f15fcd55a6706b1ecaa1cc (patch) (side-by-side diff)
treee40e731fecf6c629799e6d264c47dc05528f21da /noncore
parent845ed24db904e0842f1557e185174c52d3d93092 (diff)
downloadopie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.zip
opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.tar.gz
opie-f0d0d53759436686f7f15fcd55a6706b1ecaa1cc.tar.bz2
fixed location not remembering setting. added record key combo
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp35
-rw-r--r--noncore/settings/sound/soundsettings.h2
-rw-r--r--noncore/settings/sound/soundsettingsbase.cpp30
-rw-r--r--noncore/settings/sound/soundsettingsbase.h3
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
@@ -35,6 +35,8 @@
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"));
@@ -61,12 +63,17 @@ 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()) );
}
@@ -157,6 +164,11 @@ 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;
@@ -167,16 +179,22 @@ void SoundSettings::updateStorageCombo() {
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() {
@@ -197,4 +215,19 @@ void SoundSettings::cleanUp() {
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
@@ -35,8 +35,10 @@ protected:
/* void accept(); */
/* void reject(); */
void updateStorageCombo();
+ void updateLocationCombo();
private slots:
+ void setKeyButton(const QString &);
void setLocation(const QString &);
void cleanUp();
void setVolume(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
@@ -226,13 +226,37 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m
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 );
@@ -240,8 +264,6 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m
// // 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
@@ -47,7 +47,8 @@ public:
QCheckBox* AlertCheckBox;
QLabel* TextLabel1;
QComboBox* LocationComboBox;
-
+ QComboBox* keyComboBox;
+ bool keyReset;
protected:
QGridLayout* SoundSettingsBaseLayout;
QVBoxLayout* GroupBox3Layout;