-rw-r--r-- | noncore/settings/sound/sound.pro | 2 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 21 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.h | 1 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.cpp | 26 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.h | 1 |
5 files changed, 44 insertions, 7 deletions
diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro index 28c8b0d..a5c6cea 100644 --- a/noncore/settings/sound/sound.pro +++ b/noncore/settings/sound/sound.pro @@ -1,25 +1,25 @@ TEMPLATE = app CONFIG += qt warn_on release DESTDIR = $(OPIEDIR)/bin HEADERS = soundsettings.h soundsettingsbase.h SOURCES = soundsettings.cpp soundsettingsbase.cpp main.cpp #INTERFACES = soundsettingsbase.ui INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += ../$(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe TARGET = sound TRANSLATIONS = ../../i18n/pt_BR/sound.ts TRANSLATIONS += ../../i18n/es/sound.ts TRANSLATIONS += ../../i18n/pt/sound.ts TRANSLATIONS += ../../i18n/de/sound.ts TRANSLATIONS += ../../i18n/en/sound.ts TRANSLATIONS += ../../i18n/hu/sound.ts TRANSLATIONS += ../../i18n/sl/sound.ts TRANSLATIONS += ../../i18n/pl/sound.ts TRANSLATIONS += ../../i18n/ja/sound.ts TRANSLATIONS += ../../i18n/ko/sound.ts TRANSLATIONS += ../../i18n/no/sound.ts TRANSLATIONS += ../../i18n/zh_CN/sound.ts TRANSLATIONS += ../../i18n/zh_TW/sound.ts TRANSLATIONS += ../../i18n/fr/sound.ts diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 672548f..3ceaf0c 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp @@ -31,111 +31,124 @@ #include <qlineedit.h> #include <qcombobox.h> #include <sys/utsname.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <sys/stat.h> SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) : SoundSettingsBase( parent, objname, 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")); Config cfg("Vmemo"); connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); cfg.setGroup("Record"); int rate=config.readNumEntry("SampleRate", 22050); if(rate == 8000) sampleRate->setCurrentItem(0); else if(rate == 11025) sampleRate->setCurrentItem(1); else if(rate == 22050) sampleRate->setCurrentItem(2); else if(rate == 33075) sampleRate->setCurrentItem(3); else if(rate==44100) sampleRate->setCurrentItem(4); stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0)); //TODO hide if zaurus- mono only struct utsname name; /* check for embedix kernel running on the zaurus*/ if (uname(&name) != -1) { QString release=name.release; if( release.find("embedix",0,TRUE) !=-1) stereoCheckBox->hide(); } // else // stereoCheckBox->hide(); + int sRate=config.readNumEntry("SizeLimit", 30); + if(sRate ==30) + timeLimitComboBox->setCurrentItem(0); + else if(sRate==20) + timeLimitComboBox->setCurrentItem(1); + else if(sRate == 15) + timeLimitComboBox->setCurrentItem(2); + else if(sRate == 10) + + timeLimitComboBox->setCurrentItem(3); + else + timeLimitComboBox->setCurrentItem(4); 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( timeLimitComboBox,SIGNAL(activated( const QString &)),this,SLOT(setSizeLimitButton(const QString &))); // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); } // void SoundSettings::reject() // { // qDebug("reject"); // Config config( "qpe"); // config.setGroup( "Volume"); // setVolume(100-config.readNumEntry("VolumePercent")); // setMic(100-config.readNumEntry("Mic")); // // config.setGroup("Record"); // // int rate=config.readNumEntry("SampleRate", 11025); // // if(rate == 11025) // // sampleRate->setCurrentItem(0); // // else if(rate == 22050) // // sampleRate->setCurrentItem(1); // // else if(rate == 32000) // // sampleRate->setCurrentItem(2); // // else if(rate==44100) // // sampleRate->setCurrentItem(3); // // stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); // // sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); // qDebug("QDialog::reject();"); // ::exit(-1); // } // void SoundSettings::accept() // { // qDebug("accept"); // 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()); // Config cfg("Vmemo"); // cfg.writeEntry("Alert",AlertCheckBox->isChecked()); // setVolume(volume->value()); // setMic(mic->value()); // cfg.setGroup("Record"); // cfg.writeEntry("SampleRate",sampleRate->currentText()); // cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); // cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); // // Config cfg( "VMemo" ); @@ -203,48 +216,56 @@ int set=0; } 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" ); 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()); Config cfg("Vmemo"); cfg.writeEntry("Alert",AlertCheckBox->isChecked()); setVolume(volume->value()); 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() { } + +void SoundSettings::setSizeLimitButton(const QString &index) { + + Config cfg("Vmemo"); + cfg.setGroup("Record"); + cfg.writeEntry("SizeLimit", index); + cfg.write(); +} diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h index 0676e12..94d5d48 100644 --- a/noncore/settings/sound/soundsettings.h +++ b/noncore/settings/sound/soundsettings.h @@ -1,53 +1,54 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef SOUNDSETTINGS_H #define SOUNDSETTINGS_H #include "soundsettingsbase.h" class SoundSettings : public SoundSettingsBase { Q_OBJECT public: SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); protected: /* void accept(); */ /* void reject(); */ void updateStorageCombo(); void updateLocationCombo(); private slots: void setKeyButton(const QString &); + void setSizeLimitButton(const QString &); void setLocation(const QString &); void cleanUp(); void setVolume(int); void setMic(int); void volumeChanged( bool muted ); void micChanged( bool muted ); }; #endif // SOUNDSETTINGS_H diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp index 6cb4f89..8be1b3d 100644 --- a/noncore/settings/sound/soundsettingsbase.cpp +++ b/noncore/settings/sound/soundsettingsbase.cpp @@ -150,128 +150,142 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m volume->setValue( 50 ); volume->setOrientation( QSlider::Vertical ); volume->setTickmarks( QSlider::Right ); volume->setTickInterval( 5 ); Layout12->addWidget( volume ); QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout12->addItem( spacer_5 ); mic = new QSlider( GroupBox3, "mic" ); mic->setMaxValue( 100 ); mic->setValue( 50 ); mic->setOrientation( QSlider::Vertical ); mic->setTickmarks( QSlider::Right ); mic->setTickInterval( 5 ); Layout12->addWidget( mic ); QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout12->addItem( spacer_6 ); Layout10->addLayout( Layout12 ); Layout17 = new QHBoxLayout; Layout17->setSpacing( 2 ); Layout17->setMargin( 2 ); QSpacerItem* spacer_7 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout17->addItem( spacer_7 ); PixmapLabel2_2 = new QLabel( GroupBox3, "PixmapLabel2_2" ); PixmapLabel2_2->setPixmap( image1 ); PixmapLabel2_2->setScaledContents( FALSE ); Layout17->addWidget( PixmapLabel2_2 ); TextLabel2_2 = new QLabel( GroupBox3, "TextLabel2_2" ); TextLabel2_2->setText( tr( "Silent" ) ); Layout17->addWidget( TextLabel2_2 ); QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); Layout17->addItem( spacer_8 ); Layout10->addLayout( Layout17 ); GroupBox3Layout->addLayout( Layout10 ); SoundSettingsBaseLayout->addWidget( GroupBox3, 0, 0 ); Layout12_2 = new QVBoxLayout; Layout12_2->setSpacing( 2 ); Layout12_2->setMargin( 2 ); GroupBox1 = new QGroupBox( this, "GroupBox1" ); GroupBox1->setTitle( tr( "Vmemo" ) ); QWidget* privateLayoutWidget = new QWidget( GroupBox1, "Layout11" ); - privateLayoutWidget->setGeometry( QRect( 5, 16, 96, 169 ) ); + privateLayoutWidget->setGeometry( QRect( 5, 16, 96, 230 ) ); + Layout11 = new QVBoxLayout( privateLayoutWidget ); Layout11->setSpacing( 2 ); Layout11->setMargin( 0 ); sampleRateLabel = new QLabel( privateLayoutWidget, "sampleRateLabel" ); sampleRateLabel->setText( tr( "Sample Rate" ) ); Layout11->addWidget( sampleRateLabel ); sampleRate = new QComboBox( FALSE, privateLayoutWidget, "sampleRate" ); sampleRate->insertItem( tr( "8000" ) ); sampleRate->insertItem( tr( "11025" ) ); sampleRate->insertItem( tr( "22050" ) ); sampleRate->insertItem( tr( "33075" ) ); sampleRate->insertItem( tr( "44100" ) ); sampleRate->setFixedWidth(90); Layout11->addWidget( sampleRate ); stereoCheckBox = new QCheckBox( privateLayoutWidget, "stereoCheckBox" ); stereoCheckBox->setText( tr( "Stereo" ) ); Layout11->addWidget( stereoCheckBox ); sixteenBitCheckBox = new QCheckBox( privateLayoutWidget, "sixteenBitCheckBox" ); sixteenBitCheckBox->setText( tr( "16 bit" ) ); Layout11->addWidget( sixteenBitCheckBox ); AlertCheckBox = new QCheckBox( privateLayoutWidget, "AlertCheckBox" ); AlertCheckBox->setText( tr( "Visual Alerts" ) ); Layout11->addWidget( AlertCheckBox ); TextLabel1 = new QLabel( privateLayoutWidget, "TextLabel1" ); TextLabel1->setText( tr( "Location:" ) ); Layout11->addWidget( TextLabel1 ); LocationComboBox = new QComboBox( FALSE, privateLayoutWidget, "LocationComboBox" ); Layout11->addWidget( LocationComboBox ); QLabel *TextLabelKey; TextLabelKey = new QLabel( privateLayoutWidget, "TextLabelKey" ); TextLabelKey->setText( tr( "Record Key:" ) ); + Layout11->addWidget( TextLabelKey ); 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 ); - + QLabel *timeLimitLabel; + timeLimitLabel= new QLabel( privateLayoutWidget, "timeLimitLabel" ); + timeLimitLabel->setText( tr( "Recording Limit:" ) ); + Layout11->addWidget( timeLimitLabel ); + + timeLimitComboBox = new QComboBox( FALSE, privateLayoutWidget, "timeLimitComboBox" ); + timeLimitComboBox->insertItem( tr( "30" ) ); + timeLimitComboBox->insertItem( tr( "20" ) ); + timeLimitComboBox->insertItem( tr( "15" ) ); + timeLimitComboBox->insertItem( tr( "10" ) ); + timeLimitComboBox->insertItem( tr( "5" ) ); + + Layout11->addWidget(timeLimitComboBox); + QLabel *timeLimitLabel2; + timeLimitLabel2= new QLabel( privateLayoutWidget, "timeLimitLabel2" ); + timeLimitLabel2->setText( tr( "seconds" ) ); + Layout11->addWidget( timeLimitLabel2 ); 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 ); SoundSettingsBaseLayout->addLayout( Layout12_2, 0, 1 ); } /* * Destroys the object and frees any allocated resources */ SoundSettingsBase::~SoundSettingsBase() { // no need to delete child widgets, Qt does it all for us } diff --git a/noncore/settings/sound/soundsettingsbase.h b/noncore/settings/sound/soundsettingsbase.h index 20d1c2c..5622b70 100644 --- a/noncore/settings/sound/soundsettingsbase.h +++ b/noncore/settings/sound/soundsettingsbase.h @@ -3,64 +3,65 @@ ** ** Created: Thu May 23 11:23:38 2002 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef SOUNDSETTINGSBASE_H #define SOUNDSETTINGSBASE_H #include <qvariant.h> #include <qdialog.h> #include <qmainwindow.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; class QCheckBox; class QComboBox; class QGroupBox; class QLabel; class QSlider; class SoundSettingsBase : public QMainWindow { Q_OBJECT public: SoundSettingsBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~SoundSettingsBase(); QGroupBox* GroupBox3; QLabel* PixmapLabel1_2; QLabel* TextLabel1_2; QLabel* volLabel; QLabel* micLabel; QSlider* volume; QSlider* mic; QLabel* PixmapLabel2_2; QLabel* TextLabel2_2; QGroupBox* GroupBox1; QLabel* sampleRateLabel; QComboBox* sampleRate; QCheckBox* stereoCheckBox; QCheckBox* sixteenBitCheckBox; QCheckBox* AlertCheckBox; QLabel* TextLabel1; QComboBox* LocationComboBox; QComboBox* keyComboBox; + QComboBox* timeLimitComboBox; bool keyReset; protected: QGridLayout* SoundSettingsBaseLayout; QVBoxLayout* GroupBox3Layout; QVBoxLayout* Layout10; QHBoxLayout* Layout16; QHBoxLayout* Layout13; QHBoxLayout* Layout12; QHBoxLayout* Layout17; QVBoxLayout* Layout12_2; QVBoxLayout* Layout11; protected slots: }; #endif // SOUNDSETTINGSBASE_H |