author | llornkcor <llornkcor> | 2005-02-18 08:35:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-02-18 08:35:49 (UTC) |
commit | 0f1ae1478122e2f65f8d477d9baad8de15df1eb2 (patch) (side-by-side diff) | |
tree | 903fe5a875bfd9fda0fccf7d8ba4b8eda9a3a07c /noncore/settings/sound/soundsettings.cpp | |
parent | 436a26541402c85a24eaf9ffb3ab2e866631000c (diff) | |
download | opie-0f1ae1478122e2f65f8d477d9baad8de15df1eb2.zip opie-0f1ae1478122e2f65f8d477d9baad8de15df1eb2.tar.gz opie-0f1ae1478122e2f65f8d477d9baad8de15df1eb2.tar.bz2 |
change to dialog so user can cancel
Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 79 |
1 files changed, 45 insertions, 34 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index d55a751..df3def5 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp @@ -45,5 +45,5 @@ using namespace Opie::Core; SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) - : SoundSettingsBase( parent, objname, TRUE, fl ) + : SoundSettingsBase( parent, objname, true, fl ) { - keyReset=FALSE; + keyReset=false; noWarning=false; @@ -52,4 +52,7 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) Config cfg("Vmemo"); - connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); - AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); + + +// connect(qApp,SIGNAL(aboutToQuit()),SLOT(cleanUp())); + + AlertCheckBox->setChecked( cfg.readBoolEntry("Alert", 1)); @@ -74,3 +77,3 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) //devices - bool systemZaurus=FALSE; + bool systemZaurus=false; struct utsname name; /* check for embedix kernel running on the zaurus*/ @@ -78,5 +81,5 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) QString release=name.release; - if( release.find("embedix",0,TRUE) != -1) { + if( release.find("embedix",0,true) != -1) { odebug << "IS System Zaurus" << oendl; - systemZaurus=TRUE; + systemZaurus=true; } @@ -84,6 +87,6 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) if(!systemZaurus) { - stereoCheckBox->setChecked(TRUE); + stereoCheckBox->setChecked(true); } - stereoCheckBox->setEnabled(FALSE); - sixteenBitCheckBox->setEnabled(FALSE); + stereoCheckBox->setEnabled(false); + sixteenBitCheckBox->setEnabled(false); #else @@ -93,5 +96,5 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) - if(sRate ==30) + if(sRate == 30) timeLimitComboBox->setCurrentItem(0); - else if(sRate==20) + else if(sRate == 20) timeLimitComboBox->setCurrentItem(1); @@ -109,3 +112,4 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) cfg.setGroup("Defaults"); - keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); + recordKey = cfg.readNumEntry("toggleKey"); + keyComboBox->setCurrentItem( recordKey); @@ -117,12 +121,7 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) - connect( LocationComboBox,SIGNAL(activated(const QString&)), this, - SLOT( setLocation(const QString&))); - connect( keyComboBox,SIGNAL(activated(int)), this, - SLOT( setKeyButton(int))); - connect( timeLimitComboBox,SIGNAL(activated(const QString&)), this, - SLOT( setSizeLimitButton(const QString&))); - connect( restartCheckBox,SIGNAL( toggled(bool)), this, - SLOT( restartOpie(bool))); - connect( adpcmCheckBox,SIGNAL( toggled(bool)), this, - SLOT( slotAdpcm(bool))); + connect(LocationComboBox,SIGNAL(activated(const QString&)),this,SLOT(setLocation(const QString&))); + connect(keyComboBox,SIGNAL(activated(int)),this,SLOT(setKeyButton(int))); + connect(timeLimitComboBox,SIGNAL(activated(const QString&)),this,SLOT(setSizeLimitButton(const QString&))); + connect(restartCheckBox,SIGNAL( toggled(bool)),this,SLOT(restartOpie(bool))); + connect(adpcmCheckBox,SIGNAL( toggled(bool)),this,SLOT(slotAdpcm(bool))); @@ -136,4 +135,4 @@ void SoundSettings::updateStorageCombo() { QString loc = config.readEntry("RecLocation","/"); - int i=0; - int set=0; + int i = 0; + int set = 0; StorageInfo storageInfo; @@ -151,3 +150,3 @@ void SoundSettings::updateStorageCombo() { list << name + ": " +path; - if( loc.find( path,0,TRUE) != -1) + if( loc.find( path,0,true) != -1) set = i; @@ -170,3 +169,10 @@ void SoundSettings::setLocation(const QString & string) { + void SoundSettings::accept() { + cleanUp(); + qApp->quit(); +} + + void SoundSettings::cleanUp() { + Config cfg("Vmemo"); @@ -181,2 +187,11 @@ void SoundSettings::cleanUp() { } + cfg.setGroup("Defaults"); + cfg.writeEntry( "toggleKey", recordKey); + if( recordKey == 1) { + cfg.writeEntry( "hideIcon", 0 ); + } + else { + cfg.writeEntry( "hideIcon", 1); + } + cfg.write(); } @@ -184,8 +199,6 @@ void SoundSettings::cleanUp() { void SoundSettings::setKeyButton( int index) { - Config cfg("Vmemo"); - cfg.setGroup("Defaults"); - cfg.writeEntry( "toggleKey", index ); - keyReset = TRUE; + recordKey = index; + restartCheckBox->setChecked(true); + keyReset = true; if( index == 1) { - cfg.writeEntry( "hideIcon", 0 ); keyLabel->setText(tr("Shows icon")); @@ -193,6 +206,4 @@ void SoundSettings::setKeyButton( int index) { else { - cfg.writeEntry( "hideIcon", 1); keyLabel->setText(tr("Hides icon")); } - cfg.write(); } @@ -207,3 +218,3 @@ void SoundSettings::setSizeLimitButton(const QString &index) { cfg.setGroup("Record"); - if(index.find("Unlimited",0,TRUE) != -1) + if(index.find("Unlimited",0,true) != -1) cfg.writeEntry("SizeLimit", -1); |