summaryrefslogtreecommitdiff
path: root/core/applets
Side-by-side diff
Diffstat (limited to 'core/applets') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp8
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp8
-rw-r--r--core/applets/clockapplet/clock.cpp6
-rw-r--r--core/applets/irdaapplet/irda.cpp4
-rw-r--r--core/applets/multikeyapplet/multikey.cpp4
-rw-r--r--core/applets/rotateapplet/rotate.cpp4
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp6
-rw-r--r--core/applets/vmemo/vmemo.cpp4
-rw-r--r--core/applets/volumeapplet/volume.cpp36
9 files changed, 40 insertions, 40 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index 7625545..e8072c6 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -7,103 +7,103 @@
* email : max.reiss@gmx.de
* based on two apps by Devin Butterfield
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "cardmon.h"
/* OPIE */
#include <opie2/odevice.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/applnk.h>
#include <qpe/resource.h>
/* QT */
#include <qcopchannel_qws.h>
#include <qpainter.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qsound.h>
#include <qtimer.h>
/* STD */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
#include <sys/vfs.h>
#include <mntent.h>
#endif
using namespace Opie;
CardMonitor::CardMonitor( QWidget * parent ) : QWidget( parent ),
pm( Resource::loadPixmap( "cardmon/pcmcia" ) )
{
QCopChannel * pcmciaChannel = new QCopChannel( "QPE/Card", this );
connect( pcmciaChannel,
- SIGNAL( received( const QCString &, const QByteArray & ) ), this,
- SLOT( cardMessage( const QCString &, const QByteArray & ) ) );
+ SIGNAL( received(const QCString&,const QByteArray&) ), this,
+ SLOT( cardMessage(const QCString&,const QByteArray&) ) );
QCopChannel *sdChannel = new QCopChannel( "QPE/Card", this );
connect( sdChannel,
- SIGNAL( received( const QCString &, const QByteArray & ) ), this,
- SLOT( cardMessage( const QCString &, const QByteArray & ) ) );
+ SIGNAL( received(const QCString&,const QByteArray&) ), this,
+ SLOT( cardMessage(const QCString&,const QByteArray&) ) );
cardInPcmcia0 = FALSE;
cardInPcmcia1 = FALSE;
cardInSd = FALSE;
setFocusPolicy( NoFocus );
setFixedWidth ( AppLnk::smallIconSize() );
setFixedHeight ( AppLnk::smallIconSize() );
getStatusPcmcia( TRUE );
getStatusSd( TRUE );
repaint( FALSE );
popupMenu = 0;
}
CardMonitor::~CardMonitor()
{
if ( popupMenu )
{
delete popupMenu;
}
}
void CardMonitor::popUp( QString message, QString icon )
{
if ( !popupMenu )
{
popupMenu = new QPopupMenu( this );
}
popupMenu->clear();
if ( icon.isEmpty() )
{
popupMenu->insertItem( message, 0 );
}
else
{
popupMenu->insertItem( QIconSet( Resource::loadPixmap( icon ) ),
message, 0 );
}
QPoint p = mapToGlobal( QPoint( 0, 0 ) );
QSize s = popupMenu->sizeHint();
popupMenu->popup( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ),
p.y() - s.height() ), 0 );
QTimer::singleShot( 2000, this, SLOT( popupTimeout() ) );
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index 34d151e..4fc8076 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -1,150 +1,150 @@
/**********************************************************************
** 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 "clipboard.h"
#include <opie2/otaskbarapplet.h>
#include <qpe/resource.h>
#include <qpe/applnk.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qwindowsystem_qws.h>
#include <qapplication.h>
#include <qclipboard.h>
#include <qtimer.h>
//===========================================================================
ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name )
{
setFixedWidth ( AppLnk::smallIconSize() );
setFixedHeight ( AppLnk::smallIconSize() );
QImage img = Resource::loadImage( "paste");
img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
m_clipboardPixmap.convertFromImage( img );
m_timer = new QTimer ( this );
- connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( )));
- connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( )));
- connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( )));
+ connect ( QApplication::clipboard ( ), SIGNAL( dataChanged()), this, SLOT( newData()));
+ connect ( m_timer, SIGNAL( timeout()), this, SLOT( newData()));
+ connect ( qApp, SIGNAL( aboutToQuit()), this, SLOT( shutdown()));
m_menu = 0;
m_dirty = true;
m_lasttext = QString::null;
m_timer-> start ( 0, true );
}
ClipboardApplet::~ClipboardApplet ( )
{
}
int ClipboardApplet::position()
{
return 6;
}
void ClipboardApplet::shutdown ( )
{
// the timer has to be stopped, or Qt/E will hang on quit()
// see launcher/desktop.cpp
m_timer-> stop ( );
}
void ClipboardApplet::mousePressEvent ( QMouseEvent *)
{
if ( m_dirty ) {
delete m_menu;
m_menu = new QPopupMenu ( this );
m_menu-> setCheckable ( true );
if ( m_history. count ( )) {
for ( unsigned int i = 0; i < m_history. count ( ); i++ ) {
QString str = m_history [i];
if ( str. length ( ) > 20 )
str = str. left ( 20 ) + "...";
m_menu-> insertItem ( QString ( "%1: %2" ). arg ( i + 1 ). arg ( str ), i );
m_menu-> setItemChecked ( i, false );
}
m_menu-> setItemChecked ( m_history. count ( ) - 1, true );
m_menu-> insertSeparator ( );
}
m_menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "cut" )), tr( "Cut" ), 100 );
m_menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "copy" )), tr( "Copy" ), 101 );
m_menu-> insertItem ( QIconSet ( Resource::loadPixmap ( "paste" )), tr( "Paste" ), 102 );
- connect ( m_menu, SIGNAL( activated ( int )), this, SLOT( action ( int )));
+ connect ( m_menu, SIGNAL( activated(int)), this, SLOT( action(int)));
m_dirty = false;
}
QPoint p = mapToGlobal ( QPoint ( 0, 0 ));
QSize s = m_menu-> sizeHint ( );
m_menu-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ), p. y ( ) - s. height ( )));
}
void ClipboardApplet::action(int id)
{
ushort unicode = 0;
int scan = 0;
switch ( id ) {
case 100:
unicode = 'X' - '@';
scan = Key_X; // Cut
break;
case 101:
unicode = 'C' - '@';
scan = Key_C; // Copy
break;
case 102:
unicode = 'V' - '@';
scan = Key_V; // Paste
break;
default:
if (( id >= 0 ) && ( uint( id ) < m_history. count ( ))) {
QApplication::clipboard ( )-> setText ( m_history [id] );
for ( uint i = 0; i < m_history. count ( ); i++ )
m_menu-> setItemChecked ( i, i == uint( id ));
unicode = 'V' - '@';
scan = Key_V;
}
break;
}
if ( scan ) {
qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false );
qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, false, false );
}
}
void ClipboardApplet::paintEvent ( QPaintEvent* )
diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp
index 9fead03..120a019 100644
--- a/core/applets/clockapplet/clock.cpp
+++ b/core/applets/clockapplet/clock.cpp
@@ -1,83 +1,83 @@
/**********************************************************************
** 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 "clock.h"
#include <opie2/otaskbarapplet.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent )
{
// If you want a sunken border around the clock do this:
// setFrameStyle( QFrame::Panel | QFrame::Sunken );
//setFont( QFont( "Helvetica", , QFont::Normal ) );
- connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime( ) ) );
- connect( qApp, SIGNAL( clockChanged( bool ) ),
- this, SLOT( slotClockChanged( bool ) ) );
+ connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) );
+ connect( qApp, SIGNAL( clockChanged(bool) ),
+ this, SLOT( slotClockChanged(bool) ) );
readConfig();
timerId = 0;
timerEvent( 0 );
show();
}
int LauncherClock::position()
{
return 10;
}
void LauncherClock::readConfig() {
Config config( "qpe" );
config.setGroup( "Time" );
ampmFormat = config.readBoolEntry( "AMPM", TRUE );
config.setGroup( "Date" );
format = config.readNumEntry("ClockApplet",0);
}
void LauncherClock::mouseReleaseEvent( QMouseEvent * )
{
QCString setTimeApp;
setTimeApp="systemtime";
QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()");
}
void LauncherClock::timerEvent( QTimerEvent *e )
{
if ( !e || e->timerId() == timerId ) {
killTimer( timerId );
changeTime();
QTime t = QTime::currentTime();
int ms = (60 - t.second())*1000 - t.msec();
timerId = startTimer( ms );
} else {
QLabel::timerEvent( e );
}
}
void LauncherClock::updateTime( void )
{
changeTime();
}
void LauncherClock::changeTime( void )
{
QTime tm = QDateTime::currentDateTime().time();
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index afc0592..dde8050 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
@@ -15,134 +15,134 @@
**********************************************************************/
#include "irda.h"
/* OPIE */
#include <opie2/otaskbarapplet.h>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
/* QT */
#include <qpainter.h>
#include <qfile.h>
#include <qtimer.h>
#include <qtextstream.h>
/* STD */
#include <unistd.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
//===========================================================================
IrdaApplet::IrdaApplet ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
setFixedHeight ( 18 );
setFixedWidth ( 14 );
m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP );
m_irdaOnPixmap = Resource::loadPixmap( "irdaapplet/irdaon" );
m_irdaOffPixmap = Resource::loadPixmap( "irdaapplet/irdaoff" );
m_irdaDiscoveryOnPixmap = Resource::loadPixmap( "irdaapplet/magglass" );
m_receiveActivePixmap = Resource::loadPixmap( "irdaapplet/receive" );
m_irda_active = false;
m_irda_discovery_active = false;
m_receive_active = false;
m_receive_state_changed = false;
m_popup = 0;
m_wasOn = false;
m_wasDiscover = false;
QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this );
connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
- this, SLOT(slotMessage(const QCString&, const QByteArray& ) ) );
+ this, SLOT(slotMessage(const QCString&,const QByteArray&) ) );
}
int IrdaApplet::position()
{
return 6;
}
void IrdaApplet::show()
{
QWidget::show ( );
startTimer ( 2000 );
}
IrdaApplet::~IrdaApplet()
{
if ( m_sockfd >= 0 )
::close ( m_sockfd );
}
void IrdaApplet::popup ( QString message, QString icon )
{
if ( !m_popup )
m_popup = new QPopupMenu ( this );
m_popup-> clear ( );
if ( icon. isEmpty ( ))
m_popup-> insertItem ( message, 0 );
else
m_popup-> insertItem ( QIconSet ( Resource::loadPixmap ( icon )), message, 0 );
QPoint p = mapToGlobal ( QPoint ( 0, 0 ));
QSize s = m_popup-> sizeHint ( );
m_popup-> popup ( QPoint ( p. x ( ) + ( width ( ) / 2 ) - ( s. width ( ) / 2 ),
p. y ( ) - s. height ( )));
- QTimer::singleShot ( 2000, this, SLOT( popupTimeout ( )));
+ QTimer::singleShot ( 2000, this, SLOT( popupTimeout()));
}
void IrdaApplet::popupTimeout ( )
{
m_popup-> hide ( );
}
bool IrdaApplet::checkIrdaStatus ( )
{
struct ifreq ifr;
strcpy ( ifr. ifr_name, "irda0" );
if ( ::ioctl ( m_sockfd, SIOCGIFFLAGS, &ifr ) < 0 )
return false;
return ( ifr. ifr_flags & IFF_UP );
}
bool IrdaApplet::setIrdaStatus ( bool b )
{
struct ifreq ifr;
strcpy ( ifr. ifr_name, "irda0" );
if ( ::ioctl ( m_sockfd, SIOCGIFFLAGS, &ifr ) < 0 )
return false;
if ( b ) {
ifr. ifr_flags |= IFF_UP;
}
else {
setIrdaDiscoveryStatus ( 0 );
setIrdaReceiveStatus ( 0 );
ifr. ifr_flags &= ~IFF_UP;
}
if ( ::ioctl ( m_sockfd, SIOCSIFFLAGS, &ifr ) < 0 )
return false;
return true;
}
bool IrdaApplet::checkIrdaDiscoveryStatus ( )
{
QFile discovery ( "/proc/sys/net/irda/discovery" );
QString streamIn = "0";
if ( discovery. open ( IO_ReadOnly )) {
diff --git a/core/applets/multikeyapplet/multikey.cpp b/core/applets/multikeyapplet/multikey.cpp
index b17498d..fc5f093 100644
--- a/core/applets/multikeyapplet/multikey.cpp
+++ b/core/applets/multikeyapplet/multikey.cpp
@@ -1,76 +1,76 @@
/**********************************************************************
** Copyright (C) 2004 Anton Kachalov mouse@altlinux.ru
** All rights reserved.
**
** 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.
**
**********************************************************************/
#include "multikey.h"
/* OPIE */
#include <opie2/otaskbarapplet.h>
#include <qpe/qcopenvelope_qws.h>
/* QT */
#include <qdir.h>
Multikey::Multikey(QWidget *parent) : QLabel(parent), popupMenu(this), current("EN")
{
QCopChannel* swChannel = new QCopChannel("MultiKey/Switcher", this);
- connect( swChannel, SIGNAL(received(const QCString &, const QByteArray &)),
- this, SLOT(message(const QCString &, const QByteArray &)));
+ connect( swChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(message(const QCString&,const QByteArray&)));
setFont( QFont( "Helvetica", 10, QFont::Normal ) );
QPEApplication::setStylusOperation(this, QPEApplication::RightOnHold);
lang = 0;
QCopEnvelope e("MultiKey/Keyboard", "getmultikey()");
setText("EN");
popupMenu.insertItem("EN", 0);
show();
}
void Multikey::mousePressEvent(QMouseEvent *ev)
{
if (!sw_maps.count())
return;
if (ev->button() == RightButton) {
QPoint p = mapToGlobal(QPoint(0, 0));
QSize s = popupMenu.sizeHint();
int opt = popupMenu.exec(QPoint(p.x() + (width() / 2) - (s.width() / 2),
p.y() - s.height()), 0);
if (opt == -1)
return;
lang = opt;
QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
e << sw_maps[lang];
setText(labels[lang]);
}
QWidget::mousePressEvent(ev);
}
void Multikey::mouseReleaseEvent(QMouseEvent *ev)
{
if (!sw_maps.count())
return;
lang = lang < sw_maps.count()-1 ? lang+1 : 0;
QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
//qDebug("Lang=%d, count=%d, lab=%s", lang, sw_maps.count(), labels[lang].ascii());
e << sw_maps[lang];
setText(labels[lang]);
}
void Multikey::message(const QCString &message, const QByteArray &data)
{
if ( message == "setsw(QString,QString)" ) {
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index dcbf809..0488c36 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -3,98 +3,98 @@
Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
Copyright (C) 2003 Greg Gilbert <ggilbert@treke.net>
               =. Copyright (C) 2004 Michael Lauer <mickey@Vanille.de>
             .=l.
           .>+-=
 _;:,     .>    :=|. This library is free software; you can
.> <,   >  .   <= redistribute it and/or modify it under
:=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%+i>       _;_.
    .i_,=:_.      -<s. This library is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=| MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-= this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "rotate.h"
/* OPIE */
#include <opie/odevice.h>
#include <qpe/config.h>
#include <qpe/power.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/resource.h>
using namespace Opie;
/* QT */
#include <time.h>
RotateApplet::RotateApplet()
:QObject( 0, "RotateApplet" ), m_flipped( false )
{
#if !defined(QT_NO_COP)
QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this );
- connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
- this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
+ connect ( rotateChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
+ this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) );
#endif
}
RotateApplet::~RotateApplet ( )
{}
/**
* Qcop receive method.
*/
void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data )
{
qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg );
if ( ODevice::inst()->hasHingeSensor() )
{
struct timespec interval;
struct timespec remain;
interval.tv_sec = 0;
interval.tv_nsec = 600000;
::nanosleep( &interval, &remain );
OHingeStatus status = ODevice::inst()->readHingeSensor();
qDebug( "RotateApplet::readHingeSensor = %d", (int) status );
Config cfg( "apm" );
cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" );
int action = cfg.readNumEntry( "CloseHingeAction", 0 );
if ( status == CASE_CLOSED )
{
switch ( action )
{
case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break;
case 2: /* SUSPEND */ ODevice::inst()->suspend(); break;
default: /* IGNORE */ break;
}
}
else /* status != CASE_CLOSED */
{
switch ( action )
{
case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break;
case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break;
default: /* IGNORE */ break;
}
}
qDebug( "RotateApplet::switchAction %d performed.", cfg.readNumEntry( "CloseHingeAction", 0 ) );
}
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 5d6bce4..20e1c9b 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -254,99 +254,99 @@ static char * snapshot_xpm[] = {
static const char *SCAP_hostname = "www.handhelds.org";
static const int SCAP_port = 80;
ScreenshotControl::ScreenshotControl( QWidget *parent, const char *name )
: QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
{
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
QVBoxLayout *vbox = new QVBoxLayout ( this, 5, 3 );
QHBoxLayout *hbox;
hbox = new QHBoxLayout ( vbox );
QLabel *l = new QLabel ( tr( "Delay" ), this );
hbox-> addWidget ( l );
delaySpin = new QSpinBox( 0, 60, 1, this, "Spinner" );
delaySpin-> setButtonSymbols ( QSpinBox::PlusMinus );
delaySpin-> setSuffix ( tr( "sec" ));
delaySpin-> setFocusPolicy( QWidget::NoFocus );
delaySpin-> setValue ( 1 );
hbox-> addWidget ( delaySpin );
saveNamedCheck = new QCheckBox ( tr( "Save named" ), this);
saveNamedCheck-> setFocusPolicy ( QWidget::NoFocus );
vbox->addWidget( saveNamedCheck);
vbox-> addSpacing ( 3 );
l = new QLabel ( tr( "Save screenshot as..." ), this );
vbox-> addWidget ( l, AlignCenter );
hbox = new QHBoxLayout ( vbox );
grabItButton = new QPushButton( tr( "File" ), this, "GrabButton" );
grabItButton ->setFocusPolicy( QWidget::TabFocus );
hbox-> addWidget ( grabItButton );
scapButton = new QPushButton( tr( "Scap" ), this, "ScapButton" );
scapButton ->setFocusPolicy( QWidget::TabFocus );
hbox-> addWidget ( scapButton );
setFixedSize ( sizeHint ( ));
setFocusPolicy ( QWidget::NoFocus );
grabTimer = new QTimer ( this, "grab timer");
- connect ( grabTimer, SIGNAL( timeout ( )), this, SLOT( performGrab ( )));
- connect ( grabItButton, SIGNAL( clicked ( )), SLOT( slotGrab ( )));
- connect ( scapButton, SIGNAL( clicked ( )), SLOT( slotScap ( )));
+ connect ( grabTimer, SIGNAL( timeout()), this, SLOT( performGrab()));
+ connect ( grabItButton, SIGNAL( clicked()), SLOT( slotGrab()));
+ connect ( scapButton, SIGNAL( clicked()), SLOT( slotScap()));
}
void ScreenshotControl::slotGrab()
{
buttonPushed = 1;
hide();
setFileName = FALSE;
if ( saveNamedCheck->isChecked()) {
setFileName = TRUE;
InputDialog *fileDlg;
fileDlg = new InputDialog( 0 , tr("Name of screenshot "), TRUE, 0);
fileDlg->exec();
fileDlg->raise();
QString fileName, list;
if ( fileDlg->result() == 1 ) {
fileName = fileDlg->LineEdit1->text();
if (fileName.find("/", 0, TRUE) == -1)
FileNamePath = QDir::homeDirPath() + "/Documents/image/png/" + fileName;
else
FileNamePath = fileName;
}
delete fileDlg;
}
if ( delaySpin->value() )
grabTimer->start( delaySpin->value() * 1000, true );
else
show();
}
void ScreenshotControl::slotScap()
{
buttonPushed = 2;
hide();
if ( delaySpin->value() )
grabTimer->start( delaySpin->value() * 1000, true );
else
show();
}
void ScreenshotControl::savePixmap()
{
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 563d110..27f6015 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -168,98 +168,98 @@ static char * vmemo_xpm[] = {
" . c #65656A",
".. c #999AA2",
"+. c #52535A",
"@. c #151B21",
"#. c #515257",
"$. c #B5B5BE",
"%. c #616167",
"&. c #1A1D22",
"*. c #000713",
"=. c #1F1F21",
" ",
" . + @ # ",
" $ % & * = - ",
" ; > , ' ) ! ~ ",
" { ] ^ / ( _ : ",
" < [ } | 1 2 3 ",
" 4 5 6 7 8 9 0 a b c ",
" d e f g h i j 3 k l m n ",
" o p q r s t u v w n ",
" o x y z A B C D E n ",
" F G H I J K L M N O ",
" P Q R S T U V W X ",
" Y Z ` b ...+. ",
" @.#.$.%.&. ",
" *.B =. ",
" n n n n n n n n n "};
VMemo::VMemo( QWidget *parent, const char *_name )
: QWidget( parent, _name ) {
setFixedHeight( 18 );
setFixedWidth( 14 );
t_timer = new QTimer( this );
connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) );
Config vmCfg("Vmemo");
vmCfg.setGroup("Defaults");
int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1));
useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0);
qDebug("toggleKey %d", toggleKey);
if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
systemZaurus=TRUE;
else
systemZaurus=FALSE;
myChannel = new QCopChannel( "QPE/VMemo", this );
- connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)),
- this, SLOT(receive(const QCString&, const QByteArray&)) );
+ connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)),
+ this, SLOT(receive(const QCString&,const QByteArray&)) );
if( toggleKey != -1 ) {
// keyRegister(key, channel, message)
QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)");
// e << 4096; // Key_Escape
// e << Key_F5; //4148
e << toggleKey;
e << QString("QPE/VMemo");
e << QString("toggleRecord()");
}
if(toggleKey == 1)
usingIcon=TRUE;
else
usingIcon=FALSE;
if( vmCfg.readNumEntry("hideIcon",0) == 1)
hide();
recording = FALSE;
// }
}
VMemo::~VMemo() {
}
int VMemo::position()
{
return 6;
}
void VMemo::receive( const QCString &msg, const QByteArray &data ) {
qDebug("receive");
QDataStream stream( data, IO_ReadOnly );
if (msg == "toggleRecord()") {
if (recording) {
fromToggle = TRUE;
stopRecording();
} else {
fromToggle = TRUE;
startRecording();
}
}
}
void VMemo::paintEvent( QPaintEvent* ) {
QPainter p(this);
p.drawPixmap( 0, 1,( const char** ) vmemo_xpm );
}
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index 8fd88f6..942cebb 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -363,117 +363,117 @@ VolumeControl::VolumeControl ( VolumeApplet *icon, bool /*showMic*/, QWidget *pa
alarmLabel-> setPixmap ( QPixmap ( alarm_xpm ));
grid-> addWidget ( alarmLabel, 0, 3, AlignCenter );
grid-> addWidget ( alarmSlider, 1, 3, AlignCenter );
alarmLed = new OLedBox ( yellow, this );
alarmLed-> setFocusPolicy ( QWidget::NoFocus );
alarmLed-> setFixedSize ( 16, 16 );
grid-> addWidget ( alarmLed, 2, 3, AlignCenter );
if ( !has_wav_alarm ) {
alarmSlider-> hide ( );
alarmLabel-> hide ( );
alarmLed-> hide ( );
}
grid-> addWidget ( new QLabel ( tr( "Enable Sounds for:" ), this ), 0, 6, AlignVCenter | AlignLeft );
vbox = new QVBoxLayout ( );
vbox-> setSpacing ( 4 );
grid-> addMultiCellLayout ( vbox, 1, 2, 6, 6 );
tapBox = new QCheckBox ( tr( "Screen Taps" ), this );
tapBox-> setFocusPolicy ( QWidget::NoFocus );
vbox-> addWidget ( tapBox, AlignVCenter | AlignLeft );
keyBox = new QCheckBox ( tr( "Key Clicks" ), this );
keyBox-> setFocusPolicy ( QWidget::NoFocus );
vbox-> addWidget ( keyBox, AlignVCenter | AlignLeft );
alarmBox = new QCheckBox ( tr( "Alarm Sound" ), this );
alarmBox-> setFocusPolicy ( QWidget::NoFocus );
vbox-> addWidget ( alarmBox, AlignVCenter | AlignLeft );
if ( has_wav_alarm ) {
alarmBox-> hide ( );
}
vbox-> addStretch ( 100 );
setFixedSize ( sizeHint ( ));
setFocusPolicy ( QWidget::NoFocus );
rateTimer = new QTimer( this );
- connect ( rateTimer, SIGNAL( timeout ( )), this, SLOT( rateTimerDone ( )));
+ connect ( rateTimer, SIGNAL( timeout()), this, SLOT( rateTimerDone()));
- connect ( upButton, SIGNAL( pressed ( )), this, SLOT( buttonChanged ( )));
- connect ( upButton, SIGNAL( released ( )), this, SLOT( buttonChanged ( )));
- connect ( downButton, SIGNAL( pressed ( )), this, SLOT( buttonChanged ( )));
- connect ( downButton, SIGNAL( released ( )), this, SLOT( buttonChanged ( )));
+ connect ( upButton, SIGNAL( pressed()), this, SLOT( buttonChanged()));
+ connect ( upButton, SIGNAL( released()), this, SLOT( buttonChanged()));
+ connect ( downButton, SIGNAL( pressed()), this, SLOT( buttonChanged()));
+ connect ( downButton, SIGNAL( released()), this, SLOT( buttonChanged()));
- connect ( micSlider, SIGNAL( valueChanged ( int )), this, SLOT( micMoved( int )));
- connect ( volSlider, SIGNAL( valueChanged ( int )), this, SLOT( volMoved( int )));
- connect ( alarmSlider, SIGNAL( valueChanged ( int )), this, SLOT( alarmMoved( int )));
- connect ( bassSlider, SIGNAL( valueChanged ( int )), this, SLOT( bassMoved( int )));
- connect ( trebleSlider, SIGNAL( valueChanged ( int )), this, SLOT( trebleMoved( int )));
+ connect ( micSlider, SIGNAL( valueChanged(int)), this, SLOT( micMoved(int)));
+ connect ( volSlider, SIGNAL( valueChanged(int)), this, SLOT( volMoved(int)));
+ connect ( alarmSlider, SIGNAL( valueChanged(int)), this, SLOT( alarmMoved(int)));
+ connect ( bassSlider, SIGNAL( valueChanged(int)), this, SLOT( bassMoved(int)));
+ connect ( trebleSlider, SIGNAL( valueChanged(int)), this, SLOT( trebleMoved(int)));
- connect ( volLed, SIGNAL( toggled ( bool )), this, SLOT( volMuteToggled ( bool )));
- connect ( micLed, SIGNAL( toggled ( bool )), this, SLOT( micMuteToggled ( bool )));
- connect ( alarmLed, SIGNAL( toggled ( bool )), this, SLOT( alarmSoundToggled ( bool )));
+ connect ( volLed, SIGNAL( toggled(bool)), this, SLOT( volMuteToggled(bool)));
+ connect ( micLed, SIGNAL( toggled(bool)), this, SLOT( micMuteToggled(bool)));
+ connect ( alarmLed, SIGNAL( toggled(bool)), this, SLOT( alarmSoundToggled(bool)));
- connect ( alarmBox, SIGNAL( toggled ( bool )), this, SLOT( alarmSoundToggled ( bool )));
- connect ( keyBox, SIGNAL( toggled ( bool )), this, SLOT( keyClickToggled ( bool )));
- connect ( tapBox, SIGNAL( toggled ( bool )), this, SLOT( screenTapToggled ( bool )));
+ connect ( alarmBox, SIGNAL( toggled(bool)), this, SLOT( alarmSoundToggled(bool)));
+ connect ( keyBox, SIGNAL( toggled(bool)), this, SLOT( keyClickToggled(bool)));
+ connect ( tapBox, SIGNAL( toggled(bool)), this, SLOT( screenTapToggled(bool)));
// initialize variables
readConfig ( true );
// initialize the config file, in case some entries are missing
writeConfigEntry ( "VolumePercent", m_vol_percent, UPD_None );
writeConfigEntry ( "BassPercent", m_vol_percent, UPD_None );
writeConfigEntry ( "TreblePercent", m_vol_percent, UPD_None );
writeConfigEntry ( "Mute", m_vol_muted, UPD_None );
writeConfigEntry ( "AlarmPercent", m_alarm_percent, UPD_None );
writeConfigEntry ( "TouchSound", m_snd_touch, UPD_None );
writeConfigEntry ( "KeySound", m_snd_key, UPD_None );
writeConfigEntry ( "AlarmSound", m_snd_alarm, UPD_Vol );
writeConfigEntry ( "Mic", m_mic_percent, UPD_None );
writeConfigEntry ( "MicMute", m_mic_muted, UPD_Mic );
}
bool VolumeControl::volMuted ( ) const
{
return m_vol_muted;
}
int VolumeControl::volPercent ( ) const
{
return m_vol_percent;
}
void VolumeControl::keyPressEvent ( QKeyEvent *e )
{
switch ( e-> key ( )) {
case Key_Up:
volSlider-> subtractStep ( );
break;
case Key_Down:
volSlider-> addStep ( );
break;
case Key_Space:
volLed-> toggle ( );
break;
case Key_Escape:
hide ( );
break;
}
}
@@ -679,98 +679,98 @@ void VolumeControl::trebleMoved ( int percent )
writeConfigEntry ( "TreblePercent", m_treble_percent, UPD_Treble );
}
void VolumeControl::writeConfigEntry ( const char *entry, int val, eUpdate upd )
{
Config cfg ( "qpe" );
cfg. setGroup ( "Volume" );
cfg. writeEntry ( entry, val );
// cfg. write ( );
#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
switch ( upd ) {
case UPD_Vol: {
QCopEnvelope ( "QPE/System", "volumeChange(bool)" ) << m_vol_muted;
break;
}
case UPD_Mic: {
QCopEnvelope ( "QPE/System", "micChange(bool)" ) << m_mic_muted;
break;
}
case UPD_Bass: {
QCopEnvelope ( "QPE/System", "bassChange(bool)" ) << true;
break;
}
case UPD_Treble: {
QCopEnvelope ( "QPE/System", "trebleChange(bool)" ) << true;
break;
}
case UPD_None:
break;
}
#endif
}
//===========================================================================
VolumeApplet::VolumeApplet( QWidget *parent, const char *name )
: QWidget( parent, name )
{
setFixedWidth ( AppLnk::smallIconSize() );
setFixedHeight ( AppLnk::smallIconSize()+4 );
m_pixmap = new QPixmap ( Resource::loadPixmap ( "volume" ));
m_dialog = new VolumeControl ( this, true, this, "volumecontrol" );
- connect ( qApp, SIGNAL( volumeChanged ( bool )), m_dialog, SLOT( volumeChanged( bool )));
- connect ( qApp, SIGNAL( micChanged ( bool )), m_dialog, SLOT ( micChanged( bool )));
+ connect ( qApp, SIGNAL( volumeChanged(bool)), m_dialog, SLOT( volumeChanged(bool)));
+ connect ( qApp, SIGNAL( micChanged(bool)), m_dialog, SLOT ( micChanged(bool)));
}
VolumeApplet::~VolumeApplet()
{
delete m_pixmap;
}
int VolumeApplet::position()
{
return 6;
}
void VolumeApplet::mousePressEvent ( QMouseEvent * )
{
if ( m_dialog-> isVisible ( ))
m_dialog-> hide ( );
else
m_dialog-> show ( true );
}
void VolumeApplet::redraw ( bool all )
{
if ( all )
repaint ( true );
else
repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false );
}
void VolumeApplet::paintEvent ( QPaintEvent * )
{
QPainter p ( this );
p. drawPixmap ( (width()- m_pixmap->width())/2, QMAX( (height()-4-m_pixmap->height() )/2, 1), *m_pixmap );
p. setPen ( darkGray );
p. drawRect ( 1, height() - 4, width() - 2, 4 );
int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100;
p. fillRect ( 2, height() - 3, pixelsWide, 2, red );
p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray );
if ( m_dialog-> volMuted ( )) {
p. setPen ( red );
p. drawLine ( 1, 2, width() - 2, height() - 5 );
p. drawLine ( 1, 3, width() - 2, height() - 4 );
p. drawLine ( width() - 2, 2, 1, height() - 5 );
p. drawLine ( width() - 2, 3, 1, height() - 4 );
}