summaryrefslogtreecommitdiff
path: root/core/applets/volumeapplet/volume.cpp
authorllornkcor <llornkcor>2002-06-16 17:22:40 (UTC)
committer llornkcor <llornkcor>2002-06-16 17:22:40 (UTC)
commit0a92e4f6ac0f3f288dbd0b83489366eb0760975a (patch) (unidiff)
tree6487150faec5f13472606dfcd98fd58bcdb151a8 /core/applets/volumeapplet/volume.cpp
parentf63c4f952daeeda9787b8b700a9d50f20cdff88c (diff)
downloadopie-0a92e4f6ac0f3f288dbd0b83489366eb0760975a.zip
opie-0a92e4f6ac0f3f288dbd0b83489366eb0760975a.tar.gz
opie-0a92e4f6ac0f3f288dbd0b83489366eb0760975a.tar.bz2
default is now moot.. err rather mute d
Diffstat (limited to 'core/applets/volumeapplet/volume.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/volumeapplet/volume.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index e8921f0..069f8ab 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -1,96 +1,97 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21 21
22#include "volume.h" 22#include "volume.h"
23 23
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 27#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
28#include <qpe/qcopenvelope_qws.h> 28#include <qpe/qcopenvelope_qws.h>
29#endif 29#endif
30 30
31#include <qpainter.h> 31#include <qpainter.h>
32#include <qcheckbox.h> 32#include <qcheckbox.h>
33#include <qslider.h> 33#include <qslider.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qframe.h> 35#include <qframe.h>
36#include <qpixmap.h> 36#include <qpixmap.h>
37#include <qlabel.h> 37#include <qlabel.h>
38 38
39#include <qpushbutton.h> 39#include <qpushbutton.h>
40#include <qtimer.h> 40#include <qtimer.h>
41 41
42#define RATE_TIMER_INTERVAL 100 42#define RATE_TIMER_INTERVAL 100
43// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time 43// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time
44// results in "hanging" buttons on the iPAQ due to quite high CPU consumption. 44// results in "hanging" buttons on the iPAQ due to quite high CPU consumption.
45 45
46VolumeControl::VolumeControl( bool showMic, QWidget *parent, const char *name ) 46VolumeControl::VolumeControl( bool showMic, QWidget *parent, const char *name )
47 : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) 47 : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
48{ 48{
49 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute
49 setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); 50 setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
50 createView(showMic); 51 createView(showMic);
51} 52}
52 53
53void VolumeControl::createView(bool showMic) 54void VolumeControl::createView(bool showMic)
54{ 55{
55 Config cfg("qpe"); 56 Config cfg("qpe");
56 cfg.setGroup("Volume"); 57 cfg.setGroup("Volume");
57//showMic = TRUE; 58//showMic = TRUE;
58 QHBoxLayout *hboxLayout = new QHBoxLayout(this); 59 QHBoxLayout *hboxLayout = new QHBoxLayout(this);
59 hboxLayout->setMargin( 3 ); 60 hboxLayout->setMargin( 3 );
60 hboxLayout->setSpacing( 0); 61 hboxLayout->setSpacing( 0);
61 62
62 QVBoxLayout *vboxButtons = new QVBoxLayout(this); 63 QVBoxLayout *vboxButtons = new QVBoxLayout(this);
63 upButton = new QPushButton( this ); 64 upButton = new QPushButton( this );
64 upButton->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 65 upButton->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
65 upButton->setPixmap( Resource::loadPixmap( "up" ) ); 66 upButton->setPixmap( Resource::loadPixmap( "up" ) );
66 downButton = new QPushButton( this ); 67 downButton = new QPushButton( this );
67 downButton->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 68 downButton->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
68 downButton->setPixmap( Resource::loadPixmap( "down" ) ); 69 downButton->setPixmap( Resource::loadPixmap( "down" ) );
69 vboxButtons->setSpacing( 2 ); 70 vboxButtons->setSpacing( 2 );
70 71
71 upButton->setFixedHeight(26); 72 upButton->setFixedHeight(26);
72 downButton->setFixedHeight(26); 73 downButton->setFixedHeight(26);
73 74
74 vboxButtons->addWidget( upButton ); 75 vboxButtons->addWidget( upButton );
75 vboxButtons->addWidget( downButton ); 76 vboxButtons->addWidget( downButton );
76 77
77 QVBoxLayout *vbox = new QVBoxLayout( this ); 78 QVBoxLayout *vbox = new QVBoxLayout( this );
78 QHBoxLayout *hbox = NULL; 79 QHBoxLayout *hbox = NULL;
79 80
80 slider = new QSlider( this ); 81 slider = new QSlider( this );
81 slider->setRange( 0, 100 ); 82 slider->setRange( 0, 100 );
82 slider->setTickmarks( QSlider::Both ); 83 slider->setTickmarks( QSlider::Both );
83 slider->setTickInterval( 20 ); 84 slider->setTickInterval( 20 );
84 slider->setFocusPolicy( QWidget::NoFocus ); 85 slider->setFocusPolicy( QWidget::NoFocus );
85 slider->setValue(cfg.readNumEntry("VolumePercent")); 86 slider->setValue(cfg.readNumEntry("VolumePercent"));
86 87
87 QVBoxLayout *sbox = new QVBoxLayout(this); 88 QVBoxLayout *sbox = new QVBoxLayout(this);
88 sbox->setMargin( 3 ); 89 sbox->setMargin( 3 );
89 sbox->setSpacing( 3 ); 90 sbox->setSpacing( 3 );
90 sbox->addWidget( new QLabel("Vol", this) , 0, Qt::AlignVCenter | Qt::AlignHCenter ); 91 sbox->addWidget( new QLabel("Vol", this) , 0, Qt::AlignVCenter | Qt::AlignHCenter );
91 sbox->addWidget( slider, 0, Qt::AlignVCenter | Qt::AlignHCenter ); 92 sbox->addWidget( slider, 0, Qt::AlignVCenter | Qt::AlignHCenter );
92 93
93// if (showMic == TRUE) { 94// if (showMic == TRUE) {
94 mic = new QSlider(this); 95 mic = new QSlider(this);
95 mic->setRange( 0, 100 ); 96 mic->setRange( 0, 100 );
96 mic->setTickmarks( QSlider::Both ); 97 mic->setTickmarks( QSlider::Both );