summaryrefslogtreecommitdiff
authordrw <drw>2005-04-29 00:12:13 (UTC)
committer drw <drw>2005-04-29 00:12:13 (UTC)
commitcaedcea372fd99c7fae116ac3d0d1625f88bf138 (patch) (side-by-side diff)
tree7f9de6acc31e510bddae7a56eacfe6f17befedc8
parent0d940522f5d849dd480bd2785d592f3d787e0941 (diff)
downloadopie-caedcea372fd99c7fae116ac3d0d1625f88bf138.zip
opie-caedcea372fd99c7fae116ac3d0d1625f88bf138.tar.gz
opie-caedcea372fd99c7fae116ac3d0d1625f88bf138.tar.bz2
Resource -> OResource
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/volumeapplet/opie-volumeapplet.control2
-rw-r--r--core/applets/volumeapplet/volume.cpp13
2 files changed, 5 insertions, 10 deletions
diff --git a/core/applets/volumeapplet/opie-volumeapplet.control b/core/applets/volumeapplet/opie-volumeapplet.control
index 3056520..731692a 100644
--- a/core/applets/volumeapplet/opie-volumeapplet.control
+++ b/core/applets/volumeapplet/opie-volumeapplet.control
@@ -1,10 +1,10 @@
Package: opie-volumeapplet
Files: plugins/applets/libvolumeapplet.so*
Priority: optional
Section: opie/applets
Maintainer: L.J. Potter <lpotter@trolltech.com>
Architecture: arm
-Depends: task-opie-minimal
+Depends: task-opie-minimal, libopiecore2, libopieui2
Description: Volume applet
Volume applet for the Opie environment taskbar.
Version: $QPE_VERSION$EXTRAVERSION
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index 7f0aca5..7d67311 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -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.
**
**********************************************************************/
#include "volume.h"
/* OPIE */
#include <opie2/oledbox.h>
#include <opie2/odevice.h>
#include <opie2/otaskbarapplet.h>
-#include <qpe/resource.h>
+#include <opie2/oresource.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/qcopenvelope_qws.h>
using namespace Opie::Core;
using namespace Opie::Ui;
/* QT */
#include <qpainter.h>
#include <qcheckbox.h>
#include <qslider.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qtimer.h>
/* STD */
#include <stdio.h>
#define RATE_TIMER_INTERVAL 100
// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time
// results in "hanging" buttons on the iPAQ due to quite high CPU consumption.
@@ -251,59 +251,56 @@ VolumeControl::VolumeControl ( VolumeApplet *icon, bool /*showMic*/, QWidget *pa
default:
break;
}
if ( !ODevice::inst()->modelString().contains( "Model_iPAQ" )) {
has_bass = false;
has_treble = false;
}
setFrameStyle ( QFrame::PopupPanel | QFrame::Raised );
QGridLayout *grid = new QGridLayout ( this, 1, 1, 6, 4 );
grid-> setSpacing ( 4 );
grid-> setMargin ( 6 );
QVBoxLayout *vbox;
QLabel *l;
vbox = new QVBoxLayout ( );
vbox-> setSpacing ( 4 );
grid-> addLayout ( vbox, 1, 0 );
upButton = new QPushButton ( this );
upButton-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding ));
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- upButton-> setPixmap ( pic );
+ upButton-> setPixmap ( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
upButton-> setFocusPolicy ( QWidget::NoFocus );
vbox-> addWidget ( upButton );
downButton = new QPushButton ( this );
downButton-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding ));
- pic.convertFromImage( Resource::loadImage( "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- downButton-> setPixmap ( pic );
+ downButton-> setPixmap ( Opie::Core::OResource::loadPixmap( "down", Opie::Core::OResource::SmallIcon ) );
downButton-> setFocusPolicy ( QWidget::NoFocus );
vbox-> addWidget ( downButton );
volSlider = new QSlider ( this );
volSlider-> setRange ( 0, 100 );
volSlider-> setTickmarks ( QSlider::Both );
volSlider-> setTickInterval ( 20 );
volSlider-> setFocusPolicy ( QWidget::NoFocus );
l = new QLabel ( this );
l-> setPixmap ( QPixmap ( vol_xpm ));
grid-> addWidget ( l, 0, 1, AlignCenter );
grid-> addWidget ( volSlider, 1, 1, AlignCenter );
volLed = new OLedBox ( green, this );
volLed-> setFocusPolicy ( QWidget::NoFocus );
volLed-> setFixedSize ( 16, 16 );
grid-> addWidget ( volLed, 2, 1, AlignCenter );
QVBox *basstrebleBox = new QVBox( this );
@@ -706,51 +703,49 @@ void VolumeControl::writeConfigEntry ( const char *entry, int val, eUpdate upd )
}
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 );
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( "volume" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- m_pixmap = new QPixmap ( pic );
+ m_pixmap = new QPixmap ( Opie::Core::OResource::loadPixmap( "volume", Opie::Core::OResource::SmallIcon ) );
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)));
}
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 );
}