summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-05-23 18:57:58 (UTC)
committer llornkcor <llornkcor>2002-05-23 18:57:58 (UTC)
commit343f008ab9a6905ff6f9c953279e84cc581ea8b6 (patch) (side-by-side diff)
tree8372d7ca528d4895ae5b73100036f5a0a06170d6
parent80acaa41e768bf4492dacdaf0a2cf19dff89b500 (diff)
downloadopie-343f008ab9a6905ff6f9c953279e84cc581ea8b6.zip
opie-343f008ab9a6905ff6f9c953279e84cc581ea8b6.tar.gz
opie-343f008ab9a6905ff6f9c953279e84cc581ea8b6.tar.bz2
removed silly functions that arent called
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp121
-rw-r--r--noncore/settings/sound/soundsettings.h6
-rw-r--r--noncore/settings/sound/soundsettingsbase.cpp3
-rw-r--r--noncore/settings/sound/soundsettingsbase.h8
4 files changed, 82 insertions, 56 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index ed601cf..40b8b87 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -1,177 +1,200 @@
/**********************************************************************
** 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.
**
**********************************************************************/
#include "soundsettings.h"
+#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/storage.h>
#include <qapplication.h>
#include <qslider.h>
#include <qcheckbox.h>
#include <qlineedit.h>
#include <qcombobox.h>
SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
: SoundSettingsBase( parent, name, TRUE, fl )
{
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));
sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1));
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( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
}
-void SoundSettings::reject()
-{
- qDebug("here");
- 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));
- ::exit(-1);
-// QDialog::reject();
-}
-
-void SoundSettings::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" );
-// cfg.setGroup( "Defaults" );
-// cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked());
-// QDialog::accept();
- ::exit(0);
-}
+// 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" );
+// // cfg.setGroup( "Defaults" );
+// // cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked());
+// qDebug("QDialog::accept();");
+// ::exit(0);
+// }
void SoundSettings::setVolume(int v)
{
Config config( "qpe" );
config.setGroup( "Volume" );
config.writeEntry("VolumePercent",100-v);
#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
#endif
}
void SoundSettings::setMic(int m)
{
Config config( "qpe" );
config.setGroup( "Volume" );
config.writeEntry("Mic",100-m);
#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE;
#endif
}
void SoundSettings::volumeChanged( bool )
{
Config config( "qpe" );
config.setGroup( "Volume" );
volume->setValue(100-config.readNumEntry("VolumePercent"));
}
void SoundSettings::micChanged( bool )
{
Config config( "qpe" );
config.setGroup( "Volume" );
mic->setValue(100-config.readNumEntry("Mic"));
}
void SoundSettings::updateStorageCombo() {
StorageInfo storageInfo;
QString sName, sPath;
QStringList list;
const QList<FileSystem> &fs = storageInfo.fileSystems();
QListIterator<FileSystem> it ( fs );
for( ; it.current(); ++it ){
const QString name = (*it)->name();
const QString path = (*it)->path();
qDebug("storage name "+name +" storage path is "+path);
list << name + ": " +path;
// if(dit.current()->file().find(path) != -1 ) storage=name;
}
LocationComboBox->insertStringList(list);
}
void SoundSettings::setLocation(const QString & string) {
Config config( "Vmemo" );
config.setGroup( "System" );
config.writeEntry("RecLocation",string);
}
+
+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());
+}
diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h
index aec7614..cbec724 100644
--- a/noncore/settings/sound/soundsettings.h
+++ b/noncore/settings/sound/soundsettings.h
@@ -3,49 +3,49 @@
**
** 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 accept(); */
+/* void reject(); */
void updateStorageCombo();
private slots:
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 f86db78..727d202 100644
--- a/noncore/settings/sound/soundsettingsbase.cpp
+++ b/noncore/settings/sound/soundsettingsbase.cpp
@@ -1,47 +1,48 @@
/****************************************************************************
** Form implementation generated from reading ui file 'soundsettingsbase.ui'
**
** Created: Sun May 19 12:11:35 2002
** by: The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "soundsettingsbase.h"
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qgroupbox.h>
#include <qmainwindow.h>
+#include <qpe/qpeapplication.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qslider.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
static const char* const image0_data[] = {
"16 16 3 1",
". c None",
"a c #000000",
"# c #ff0000",
"............#...",
"............##..",
"..........#..#..",
".....a..#..#.#..",
"....aa..##.#..#.",
"...aaa...#.##.#.",
"aaaaaa.#.#..#.##",
"aaaaaa.#.##.#.##",
"aaaaaa.#.##.#.##",
"aaaaaa.#.##.#.##",
"aaaaaa.#.#..#.##",
"...aaa...#.##.#.",
"....aa..#..#..#.",
".....a.....#.##.",
"..........#..#..",
"............##.."};
@@ -55,64 +56,65 @@ static const char* const image1_data[] = {
"................",
".....#..........",
"....##..........",
"...###...a...a..",
"######..aaa.aaa.",
"######...aaaaa..",
"######....aaa...",
"######...aaaaa..",
"######..aaa.aaa.",
"...###...a...a..",
"....##..........",
".....#..........",
"................",
"................"};
/*
* Constructs a SoundSettingsBase which is a child of 'parent', with the
* name 'name' and widget flags set to 'f'
*
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl )
: QMainWindow( parent, name, fl )
{
QPixmap image0( ( const char** ) image0_data );
QPixmap image1( ( const char** ) image1_data );
if ( !name )
setName( "SoundSettingsBase" );
resize( 255, 301 );
setCaption( tr( "Vmemo Settings" ) );
+
SoundSettingsBaseLayout = new QGridLayout( this );
SoundSettingsBaseLayout->setSpacing( 6 );
SoundSettingsBaseLayout->setMargin( 11 );
GroupBox3 = new QGroupBox( this, "GroupBox3" );
GroupBox3->setFrameShape( QGroupBox::Box );
GroupBox3->setFrameShadow( QGroupBox::Sunken );
GroupBox3->setTitle( tr( "Levels" ) );
GroupBox3->setColumnLayout(0, Qt::Vertical );
GroupBox3->layout()->setSpacing( 0 );
GroupBox3->layout()->setMargin( 0 );
GroupBox3Layout = new QVBoxLayout( GroupBox3->layout() );
GroupBox3Layout->setAlignment( Qt::AlignTop );
GroupBox3Layout->setSpacing( 2 );
GroupBox3Layout->setMargin( 2 );
Layout10 = new QVBoxLayout;
Layout10->setSpacing( 2 );
Layout10->setMargin( 2 );
Layout16 = new QHBoxLayout;
Layout16->setSpacing( 2 );
Layout16->setMargin( 2 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
Layout16->addItem( spacer );
PixmapLabel1_2 = new QLabel( GroupBox3, "PixmapLabel1_2" );
PixmapLabel1_2->setPixmap( image0 );
PixmapLabel1_2->setScaledContents( FALSE );
Layout16->addWidget( PixmapLabel1_2 );
TextLabel1_2 = new QLabel( GroupBox3, "TextLabel1_2" );
@@ -222,33 +224,32 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m
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 );
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 );
}
/*
* 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 e65c813..7a939ea 100644
--- a/noncore/settings/sound/soundsettingsbase.h
+++ b/noncore/settings/sound/soundsettingsbase.h
@@ -1,63 +1,65 @@
/****************************************************************************
** Form interface generated from reading ui file 'soundsettingsbase.ui'
**
** 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 QDialog
+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;
-/* QCheckBox* touchsound; */
-/* QCheckBox* keysound; */
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