author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (side-by-side diff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /noncore/settings/sound | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
-rw-r--r-- | noncore/settings/sound/.cvsignore | 5 | ||||
-rw-r--r-- | noncore/settings/sound/Makefile.in | 135 | ||||
-rw-r--r-- | noncore/settings/sound/main.cpp | 36 | ||||
-rw-r--r-- | noncore/settings/sound/qpe-sound.control | 10 | ||||
-rw-r--r-- | noncore/settings/sound/sound.pro | 10 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 64 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettings.h | 44 | ||||
-rw-r--r-- | noncore/settings/sound/soundsettingsbase.ui | 281 |
8 files changed, 585 insertions, 0 deletions
diff --git a/noncore/settings/sound/.cvsignore b/noncore/settings/sound/.cvsignore new file mode 100644 index 0000000..ba1f2fe --- a/dev/null +++ b/noncore/settings/sound/.cvsignore @@ -0,0 +1,5 @@ +Makefile +moc_* +*.moc +soundsettingsbase.cpp +soundsettingsbase.h diff --git a/noncore/settings/sound/Makefile.in b/noncore/settings/sound/Makefile.in new file mode 100644 index 0000000..1772e12 --- a/dev/null +++ b/noncore/settings/sound/Makefile.in @@ -0,0 +1,135 @@ +############################################################################# + +####### Compiler, tools and options + +CXX = $(SYSCONF_CXX) $(QT_CXX_MT) +CXXFLAGS= $(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) +CC = $(SYSCONF_CC) $(QT_C_MT) +CFLAGS = $(SYSCONF_CFLAGS) +INCPATH = -I$(QPEDIR)/include +LFLAGS = $(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT) +LIBS = $(SUBLIBS) -lqpe $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP) +MOC = $(SYSCONF_MOC) +UIC = $(SYSCONF_UIC) + +####### Target + +DESTDIR = ../../bin/ +VER_MAJ = 1 +VER_MIN = 0 +VER_PATCH = 0 +TARGET = sound +TARGET1 = lib$(TARGET).so.$(VER_MAJ) + +####### Files + +HEADERS = soundsettings.h +SOURCES = soundsettings.cpp \ + main.cpp +OBJECTS = soundsettings.o \ + main.o \ + soundsettingsbase.o +INTERFACES = soundsettingsbase.ui +UICDECLS = soundsettingsbase.h +UICIMPLS = soundsettingsbase.cpp +SRCMOC = moc_soundsettings.cpp \ + moc_soundsettingsbase.cpp +OBJMOC = moc_soundsettings.o \ + moc_soundsettingsbase.o + + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(DESTDIR)$(TARGET) + +$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS) + $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake sound.pro + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) + -rm -f *~ core + -rm -f allmoc.cpp + +####### Extension Modules + +listpromodules: + @echo + +listallmodules: + @echo + +listaddonpromodules: + @echo + +listaddonentmodules: + @echo + + +REQUIRES= + +####### Sub-libraries + + +###### Combined headers + + + +####### Compile + +soundsettings.o: soundsettings.cpp \ + soundsettings.h \ + soundsettingsbase.h + +main.o: main.cpp \ + soundsettings.h \ + soundsettingsbase.h + +soundsettingsbase.h: soundsettingsbase.ui + $(UIC) soundsettingsbase.ui -o $(INTERFACE_DECL_PATH)/soundsettingsbase.h + +soundsettingsbase.cpp: soundsettingsbase.ui + $(UIC) soundsettingsbase.ui -i soundsettingsbase.h -o soundsettingsbase.cpp + +soundsettingsbase.o: soundsettingsbase.cpp \ + soundsettingsbase.h \ + soundsettingsbase.ui + +moc_soundsettings.o: moc_soundsettings.cpp \ + soundsettings.h \ + soundsettingsbase.h + +moc_soundsettingsbase.o: moc_soundsettingsbase.cpp \ + soundsettingsbase.h + +moc_soundsettings.cpp: soundsettings.h + $(MOC) soundsettings.h -o moc_soundsettings.cpp + +moc_soundsettingsbase.cpp: soundsettingsbase.h + $(MOC) soundsettingsbase.h -o moc_soundsettingsbase.cpp + + diff --git a/noncore/settings/sound/main.cpp b/noncore/settings/sound/main.cpp new file mode 100644 index 0000000..5d28a8c --- a/dev/null +++ b/noncore/settings/sound/main.cpp @@ -0,0 +1,36 @@ +/********************************************************************** +** 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> + + +int main(int argc, char** argv) +{ + QPEApplication a(argc,argv); + + SoundSettings dlg; + + a.showMainWidget(&dlg); + + return a.exec(); +} + diff --git a/noncore/settings/sound/qpe-sound.control b/noncore/settings/sound/qpe-sound.control new file mode 100644 index 0000000..f7f1c4f --- a/dev/null +++ b/noncore/settings/sound/qpe-sound.control @@ -0,0 +1,10 @@ +Files: bin/sound apps/Settings/Sound.desktop +Priority: optional +Section: qpe/settings +Maintainer: Warwick Allison <warwick@trolltech.com> +Architecture: arm +Arch: iPAQ +Version: $QPE_VERSION-1 +Depends: qpe-base ($QPE_VERSION) +Description: Sound settings dialog + For the Qtopia environment. diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro new file mode 100644 index 0000000..9028a44 --- a/dev/null +++ b/noncore/settings/sound/sound.pro @@ -0,0 +1,10 @@ +TEMPLATE = app +CONFIG += qt warn_on release +DESTDIR = ../../bin +HEADERS = soundsettings.h +SOURCES = soundsettings.cpp main.cpp +INTERFACES = soundsettingsbase.ui +INCLUDEPATH += $(QPEDIR)/include +DEPENDPATH += ../$(QPEDIR)/include +LIBS += -lqpe +TARGET = sound diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp new file mode 100644 index 0000000..92281f8 --- a/dev/null +++ b/noncore/settings/sound/soundsettings.cpp @@ -0,0 +1,64 @@ +/********************************************************************** +** 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/config.h> +#include <qpe/qcopenvelope_qws.h> + +#include <qslider.h> +#include <qcheckbox.h> + +SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) + : SoundSettingsBase( parent, name, TRUE, fl ) +{ + Config config( "Sound" ); + + config.setGroup( "System" ); + volume->setValue(100-config.readNumEntry("Volume")); + touchsound->setChecked(config.readBoolEntry("Touch")); + keysound->setChecked(config.readBoolEntry("Key")); + + connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); +} + +void SoundSettings::reject() +{ + Config config( "Sound" ); + config.setGroup( "System" ); + setVolume(100-config.readNumEntry("Volume")); + + QDialog::reject(); +} + +void SoundSettings::accept() +{ + Config config( "Sound" ); + config.setGroup( "System" ); + config.writeEntry("Volume",100-volume->value()); + config.writeEntry("Touch",touchsound->isChecked()); + config.writeEntry("Key",keysound->isChecked()); + setVolume(volume->value()); + QDialog::accept(); +} + +void SoundSettings::setVolume(int v) +{ + QCopEnvelope( "QPE/System", "setVolume(int,int)" ) << 0 << 100-v; +} diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h new file mode 100644 index 0000000..b5c8cee --- a/dev/null +++ b/noncore/settings/sound/soundsettings.h @@ -0,0 +1,44 @@ +/********************************************************************** +** 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(); + +private slots: + void setVolume(int); +}; + + +#endif // SOUNDSETTINGS_H + diff --git a/noncore/settings/sound/soundsettingsbase.ui b/noncore/settings/sound/soundsettingsbase.ui new file mode 100644 index 0000000..1aa4545 --- a/dev/null +++ b/noncore/settings/sound/soundsettingsbase.ui @@ -0,0 +1,281 @@ +<!DOCTYPE UI><UI> +<class>SoundSettingsBase</class> +<widget> + <class>QDialog</class> + <property stdset="1"> + <name>name</name> + <cstring>SoundSettingsBase</cstring> + </property> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>0</x> + <y>0</y> + <width>246</width> + <height>299</height> + </rect> + </property> + <property stdset="1"> + <name>caption</name> + <string>Sound Settings</string> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>7</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>1</number> + </property> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>keysound</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Keyboard sound</string> + </property> + </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>touchsound</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Screen sound</string> + </property> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout10</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QSlider</class> + <property stdset="1"> + <name>name</name> + <cstring>volume</cstring> + </property> + <property stdset="1"> + <name>maxValue</name> + <number>100</number> + </property> + <property stdset="1"> + <name>value</name> + <number>50</number> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>tickmarks</name> + <enum>Right</enum> + </property> + <property stdset="1"> + <name>tickInterval</name> + <number>5</number> + </property> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout9</cstring> + </property> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout10_2</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>PixmapLabel1_2</cstring> + </property> + <property stdset="1"> + <name>pixmap</name> + <pixmap>image0</pixmap> + </property> + <property stdset="1"> + <name>scaledContents</name> + <bool>false</bool> + </property> + </widget> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1_2</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Loud</string> + </property> + </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer3_2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer5_2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout9_2</cstring> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>PixmapLabel2_2</cstring> + </property> + <property stdset="1"> + <name>pixmap</name> + <pixmap>image1</pixmap> + </property> + <property stdset="1"> + <name>scaledContents</name> + <bool>false</bool> + </property> + </widget> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel2_2</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Silent</string> + </property> + </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer2_2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </vbox> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<images> + <image> + <name>image0</name> + <data format="XPM.GZ" length="409">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022630543251d2e253d856405bffcbc54103b11c856360003105719c44d4b8371f590803210638829a38b2983115c2c112a8224969808d60716868a2582c440aa94a1628960a00755a5ac8c2aa64c8118c23c6cf6c2dda787e23eb03f602af1fa17395c6aadb9008c9350cb</data> + </image> + <image> + <name>image1</name> + <data format="XPM.GZ" length="409">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523234530022630543251d2e253d856405bffcbc54105b19c856360003103711c44d4b8371f5d000c962ca9862ca9862ca60b1440806bb0a0c80dcc444304616030924a2a983a8d423a80ed93c6cf6e2701f567f100c835a6b2e0025ab4ee4</data> + </image> +</images> +</UI> |