summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp6
-rw-r--r--noncore/applets/networkapplet/networkapplet.cpp54
-rw-r--r--noncore/applets/notesapplet/notes.cpp4
-rw-r--r--noncore/applets/pyquicklaunch/pyquicklaunch.cpp6
-rw-r--r--noncore/applets/zkbapplet/applet/zkbwidget.cpp8
5 files changed, 39 insertions, 39 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp
index 34802fb..28b631b 100644
--- a/noncore/applets/autorotateapplet/autorotate.cpp
+++ b/noncore/applets/autorotateapplet/autorotate.cpp
@@ -1,56 +1,56 @@
/*
* copyright : (c) 2003 by Greg Gilbert
* email : greg@treke.net
* based on the cardmon applet by Max Reiss
* *
* 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 "autorotate.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/otaskbarapplet.h>
+#include <opie2/oresource.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
-#include <qpe/resource.h>
using namespace Opie::Core;
/* QT */
#include <qpainter.h>
AutoRotate::AutoRotate(QWidget * parent):QWidget(parent)
{
setFixedWidth( AppLnk::smallIconSize() );
setFixedHeight( AppLnk::smallIconSize() );
- enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) );
- disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) );
+ enabledPm = Opie::Core::OResource::loadImage("autorotate/rotate", Opie::Core::OResource::SmallIcon);
+ disabledPm = Opie::Core::OResource::loadImage("autorotate/norotate", Opie::Core::OResource::SmallIcon);
repaint(true);
popupMenu = 0;
show();
}
AutoRotate::~AutoRotate()
{
if (popupMenu) {
delete popupMenu;
}
}
int AutoRotate::position()
{
return 7;
}
void AutoRotate::mousePressEvent(QMouseEvent *)
{
QPopupMenu *menu = new QPopupMenu(this);
menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 );
QPoint p = mapToGlobal(QPoint(0, 0));
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp
index bd6ca66..10c2b34 100644
--- a/noncore/applets/networkapplet/networkapplet.cpp
+++ b/noncore/applets/networkapplet/networkapplet.cpp
@@ -1,86 +1,86 @@
/*
-                 This file is part of the Opie Project
+ This file is part of the Opie Project
=. (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
.=l.
-           .>+-=
- _;:,     .>    :=|. This program 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 program 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.
+ .>+-=
+_;:, .> :=|. This program 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 program 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 "networkapplet.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/onetwork.h>
+#include <opie2/oresource.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/applnk.h>
-#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
using namespace Opie::Core;
using namespace Opie::Ui;
using namespace Opie::Net;
/* QT */
#include <qpainter.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qobjectlist.h>
/* STD */
#include <assert.h>
IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name )
:QToolButton( parent, name )
{
_iface = ONetwork::instance()->interface( name );
assert( _iface );
setToggleButton( true );
- //setAutoRaise( true );
- setOnIconSet( QIconSet( Resource::loadPixmap( "up" ) ) );
- setOffIconSet( QIconSet( Resource::loadPixmap( "down" ) ) );
+ setUsesBigPixmap( qApp->desktop()->size().width() > 330 );
+ setOnIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ) );
+ setOffIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "down", Opie::Core::OResource::SmallIcon ) ) );
setOn( _iface->isUp() );
- //setFixedWidth( 16 );
connect( this, SIGNAL( clicked() ), this, SLOT( clicked() ) );
}
IfaceUpDownButton::~IfaceUpDownButton()
{
}
void IfaceUpDownButton::clicked()
{
_iface->setUp( isOn() );
setOn( _iface->isUp() ); // it might not have worked...
repaint();
}
IfaceIPAddress::IfaceIPAddress( QWidget* parent, const char* name )
:QLineEdit( parent, name )
{
setFont( QFont( "fixed" ) );
_iface = ONetwork::instance()->interface( name );
setFixedWidth( 105 );
setText( _iface->ipV4Address().toString() );
@@ -100,49 +100,49 @@ void IfaceIPAddress::returnPressed()
QHostAddress mask;
mask.setAddress( _iface->ipV4Netmask().toString() ); // setIPV4Address destroys the netmask...
_iface->setIPV4Address( a );
_iface->setIPV4Netmask( mask ); // recover the old netmask
setText( _iface->ipV4Address().toString() );
repaint();
}
NetworkAppletControl::NetworkAppletControl( OTaskbarApplet* parent, const char* name )
:QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), l(0)
{
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
l = new QVBoxLayout( this, 4, 2 );
}
void NetworkAppletControl::build()
{
ONetwork::InterfaceIterator it = ONetwork::instance()->iterator();
while ( it.current() )
{
QHBoxLayout* h = new QHBoxLayout( l );
QLabel* symbol = new QLabel( this );
- symbol->setPixmap( Resource::loadPixmap( guessDevice( it.current() ) ) );
+ symbol->setPixmap( Opie::Core::OResource::loadPixmap( guessDevice( it.current() ), Opie::Core::OResource::SmallIcon ) );
h->addWidget( symbol );
symbol->show();
QLabel* name = new QLabel( it.current()->name(), this );
name->setFixedWidth( 35 );
h->addWidget( name );
name->show();
IfaceIPAddress* ip = new IfaceIPAddress( this, it.current()->name() );
h->addWidget( ip );
ip->show();
IfaceUpDownButton* tb = new IfaceUpDownButton( this, it.current()->name() );
tb->show();
h->addWidget( tb );
++it;
}
}
NetworkAppletControl::~NetworkAppletControl()
{
@@ -194,49 +194,49 @@ void NetworkAppletControl::hideEvent( QHideEvent* e )
list = const_cast<QObjectList*>( children() );
if ( list )
owarn << "D'oh! We still have " << list->count() << " children..." << oendl;
// renew layout
l = new QVBoxLayout( this, 4, 2 );
resize( 0, 0 );
}
QSize NetworkAppletControl::sizeHint() const
{
ONetwork::instance()->synchronize(); // rebuild interface database
odebug << "sizeHint (#ifaces=" << ONetwork::instance()->count() << ")" << oendl;
return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 );
}
NetworkApplet::NetworkApplet( QWidget *parent, const char *name )
:OTaskbarApplet( parent, name )
{
setFixedHeight( AppLnk::smallIconSize() );
setFixedWidth( AppLnk::smallIconSize() );
- _pixmap.convertFromImage( Resource::loadImage( "networkapplet/network" ).smoothScale( height(), width() ) );
+ _pixmap = Opie::Core::OResource::loadPixmap( "networkapplet/network", Opie::Core::OResource::SmallIcon );
_control = new NetworkAppletControl( this, "control" );
}
NetworkApplet::~NetworkApplet()
{
}
int NetworkApplet::position()
{
return 4;
}
void NetworkApplet::paintEvent( QPaintEvent* )
{
QPainter p(this);
p.drawPixmap(0, 2, _pixmap );
}
void NetworkApplet::mousePressEvent( QMouseEvent* )
{
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index d06672a..13f297e 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -1,51 +1,51 @@
/**********************************************************************
** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
** 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 "notes.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/otaskbarapplet.h>
+#include <opie2/oresource.h>
#include <qpe/filemanager.h>
#include <qpe/qpeapplication.h>
#include <qpe/timestring.h>
#include <qpe/applnk.h>
#include <qpe/ir.h>
#include <qpe/config.h>
-#include <qpe/resource.h>
using namespace Opie::Core;
using namespace Opie::Ui;
/* QT */
#include <qmultilineedit.h>
#include <qlistbox.h>
#include <qpopupmenu.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include <qdir.h>
#include <qfile.h>
#include <qpoint.h>
#include <qpushbutton.h>
#include <qpainter.h>
#include <qlayout.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qtimer.h>
/* STD */
#include <stdlib.h>
@@ -411,49 +411,49 @@ void NotesControl::slotSearch() {
// QString text;
// // Copy text from the clipboard (paste)
// text = cb->text();
// }
// if(e->key() == Key_X) { //cut
// }
// if(e->key() == Key_V) { //paste
// QClipboard *cb = QApplication::clipboard();
// QString text;
// //view
// cb->setText();
// }
// break;
// };
// QWidget::keyReleaseEvent(e);
// }
//===========================================================================
NotesApplet::NotesApplet( QWidget *parent, const char *name )
: QWidget( parent, name ) {
setFixedHeight( AppLnk::smallIconSize() );
setFixedWidth( AppLnk::smallIconSize() );
- notesPixmap.convertFromImage( Resource::loadImage( "edit" ).smoothScale( height(), width() ) );
+ notesPixmap = Opie::Core::OResource::loadImage( "edit", Opie::Core::OResource::SmallIcon );
vc = new NotesControl;
}
NotesApplet::~NotesApplet() {
delete vc;
}
int NotesApplet::position()
{
return 6;
}
void NotesApplet::mousePressEvent( QMouseEvent *) {
if( !vc->isHidden()) {
vc->doPopulate=false;
vc->save();
vc->close();
} else {
// vc = new NotesControl;
// QPoint curPos = mapToGlobal( rect().topLeft() );
if(vc->showMax) {
odebug << "show max" << oendl;
vc->showMaximized();
} else {
diff --git a/noncore/applets/pyquicklaunch/pyquicklaunch.cpp b/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
index bcd2f0d..45eda4e 100644
--- a/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
+++ b/noncore/applets/pyquicklaunch/pyquicklaunch.cpp
@@ -1,46 +1,46 @@
/**********************************************************************
** Copyright (C) 2004 Michael 'Mickey' Lauer <mickey@vanille.de>
** 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 "pyquicklaunch.h"
/* OPIE */
#include <opie2/odebug.h>
+#include <opie2/oresource.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
using namespace Opie::Core;
/* QT */
#include <qcopchannel_qws.h>
#include <qpainter.h>
#include <qframe.h>
#include <qfile.h>
#include <qtimer.h>
/* STD */
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
PyQuicklaunchControl::PyQuicklaunchControl( PyQuicklaunchApplet *applet, QWidget *parent, const char *name )
: QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet )
{
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
setFixedSize( sizeHint() );
setFocusPolicy( QWidget::NoFocus );
}
@@ -61,50 +61,50 @@ void PyQuicklaunchControl::show( bool )
void PyQuicklaunchControl::readConfig()
{
Config cfg( "qpe" );
cfg.setGroup( "PyQuicklaunch" );
// ...
}
void PyQuicklaunchControl::writeConfigEntry( const char *entry, int val )
{
Config cfg( "qpe" );
cfg.setGroup( "PyQuicklaunch" );
cfg.writeEntry( entry, val );
}
//===========================================================================
PyQuicklaunchApplet::PyQuicklaunchApplet( QWidget *parent, const char *name )
: QWidget( parent, name ), online( false )
{
setFixedHeight( 18 );
setFixedWidth( 14 );
status = new PyQuicklaunchControl( this, this, "Python Quicklaunch Status" );
- _online = Resource::loadPixmap( "pyquicklaunch/online" );
- _offline = Resource::loadPixmap( "pyquicklaunch/offline" );
+ _online = Opie::Core::OResource::loadPixmap( "pyquicklaunch/online", Opie::Core::OResource::SmallIcon );
+ _offline = Opie::Core::OResource::loadPixmap( "pyquicklaunch/offline", Opie::Core::OResource::SmallIcon );
_fifoName = QString().sprintf( "/tmp/mickeys-quicklauncher-%s", ::getpwuid( ::getuid() )->pw_name );
odebug << "PyQuicklaunchApplet fifo name = '" << _fifoName << "'" << oendl;
_fifo.setName( _fifoName );
_control = new QCopChannel( "QPE/PyLauncher", parent, "PyLauncher QCop Control Channel" );
connect( _control, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(receivedMessage(const QCString&,const QByteArray&) ) );
}
PyQuicklaunchApplet::~PyQuicklaunchApplet()
{
}
void PyQuicklaunchApplet::receivedMessage( const QCString& msg, const QByteArray& data )
{
odebug << "receivedMessage = '" << msg << "' " << oendl;
if ( msg == "setOnline()" )
{
online = true;
diff --git a/noncore/applets/zkbapplet/applet/zkbwidget.cpp b/noncore/applets/zkbapplet/applet/zkbwidget.cpp
index 55c08b3..324ccdc 100644
--- a/noncore/applets/zkbapplet/applet/zkbwidget.cpp
+++ b/noncore/applets/zkbapplet/applet/zkbwidget.cpp
@@ -1,39 +1,39 @@
#include <opie2/otaskbarapplet.h>
#include <opie2/okeyfilter.h>
+#include <opie2/oresource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/applnk.h>
#include <qpe/qpeapplication.h>
-#include <qpe/resource.h>
-#include <stdio.h>
-#include <unistd.h>
+//#include <stdio.h>
+//#include <unistd.h>
#include "zkbwidget.h"
#include "zkbcfg.h"
using namespace Opie::Ui;
ZkbWidget::ZkbWidget(QWidget* parent)
- :QLabel(parent),keymap(0),disabled(Resource::loadPixmap("zkb-disabled")) {
+ :QLabel(parent),keymap(0),disabled(Opie::Core::OResource::loadPixmap("zkb-disabled", Opie::Core::OResource::SmallIcon)) {
labels = new QPopupMenu();
connect(labels, SIGNAL(activated(int)), this,
SLOT(labelChanged(int)));
loadKeymap();
channel = new QCopChannel("QPE/zkb", this);
connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(signalReceived(const QCString&,const QByteArray&)));
setFixedWidth ( AppLnk::smallIconSize() );
setFixedHeight ( AppLnk::smallIconSize() );
}
ZkbWidget::~ZkbWidget()
{
delete keymap;
keymap = 0;
}
int ZkbWidget::position()
{
return 8;
}