-rw-r--r-- | noncore/applets/autorotateapplet/autorotate.cpp | 8 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorymeter.cpp | 26 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorystatus.cpp | 1 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorystatus.h | 4 | ||||
-rw-r--r-- | noncore/applets/networkapplet/networkapplet.cpp | 7 | ||||
-rw-r--r-- | noncore/applets/networkapplet/networkapplet.h | 18 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 8 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 9 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.h | 9 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.cpp | 11 |
10 files changed, 51 insertions, 50 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp index 94be0ae..ae7fbd0 100644 --- a/noncore/applets/autorotateapplet/autorotate.cpp +++ b/noncore/applets/autorotateapplet/autorotate.cpp @@ -17,18 +17,17 @@ #include <opie2/otaskbarapplet.h> #include <qpe/applnk.h> #include <qpe/config.h> #include <qpe/resource.h> /* QT */ #include <qpainter.h> -using namespace Opie; - +using namespace Opie::Ui; 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() ) ); @@ -89,13 +88,10 @@ bool AutoRotate::isRotateEnabled() if (res ) qDebug("Enabled"); else qDebug("Disabled"); return res; } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<AutoRotate> ); -} +EXPORT_OPIE_APPLET_v1( AutoRotate ) diff --git a/noncore/applets/memoryapplet/memorymeter.cpp b/noncore/applets/memoryapplet/memorymeter.cpp index 9299f49..9cdeaf4 100644 --- a/noncore/applets/memoryapplet/memorymeter.cpp +++ b/noncore/applets/memoryapplet/memorymeter.cpp @@ -26,26 +26,27 @@ #include <qtopia/qcopenvelope_qws.h> #include <qpainter.h> #include <qtimer.h> #include <qapplication.h> #include <qtopia/applnk.h> +using namespace Opie::Ui; MemoryMeter::MemoryMeter( QWidget *parent ) : QWidget( parent ), memoryView(0) { bvsz = QSize(); - if ( qApp->desktop()->height() >= 300 ) + if ( qApp->desktop()->height() >= 300 ) { memoryView = new MemoryStatus( 0, WStyle_StaysOnTop | WType_Popup ); memoryView->setFrameStyle( QFrame::Panel | QFrame::Raised ); - } - else + } + else { memoryView = new MemoryStatus( 0 ); memoryView->showMaximized(); } Config config("MemoryPlugin"); config.setGroup("Warning levels"); low = config.readNumEntry("low", 40); @@ -74,42 +75,42 @@ QSize MemoryMeter::sizeHint() const return QSize(10, AppLnk::smallIconSize()); } bool MemoryMeter::updateMemoryViewGeometry() { if (memoryView != 0) { QSize sz = memoryView->sizeHint(); - if ( sz != bvsz ) + if ( sz != bvsz ) { bvsz = sz; QRect r(memoryView->pos(), memoryView->sizeHint()); - if ( qApp->desktop()->height() >= 300 ) + if ( qApp->desktop()->height() >= 300 ) { QPoint curPos = mapToGlobal( rect().topLeft() ); int lp = qApp->desktop()->width() - memoryView->sizeHint().width(); r.moveTopLeft( QPoint(lp, curPos.y() - memoryView->sizeHint().height()-1) ); } memoryView->setGeometry(r); return TRUE; } return FALSE; } return FALSE; } void MemoryMeter::mousePressEvent( QMouseEvent *) { - if ( memoryView->isVisible() ) + if ( memoryView->isVisible() ) { memoryView->hide(); - } - else + } + else { bvsz = QSize(); updateMemoryViewGeometry(); memoryView->raise(); memoryView->show(); } } @@ -201,47 +202,44 @@ void MemoryMeter::paintEvent( QPaintEvent* ) // used_height = percent * batt_height / 100; if (used_height < 0) used_height = 0; // // Drained section. // - if (used_height != 0) + if (used_height != 0) { p.setPen(NoPen); p.setBrush(gray); p.drawRect(batt_xoffset, batt_yoffset, band_width, used_height); p.drawRect(batt_xoffset + 2 * band_width, batt_yoffset, band_width, used_height); p.setBrush(gray/*.light(130)*/); p.drawRect(batt_xoffset + band_width, batt_yoffset, band_width, used_height); p.setBrush(gray/*.dark(120)*/); p.drawRect(batt_xoffset + 3 * band_width, batt_yoffset, band_width, used_height); } // // Unused section. // - if ( batt_height - used_height > 0 ) + if ( batt_height - used_height > 0 ) { int unused_offset = used_height + batt_yoffset; int unused_height = batt_height - used_height; p.setPen(NoPen); p.setBrush(c); p.drawRect(batt_xoffset, unused_offset, band_width, unused_height); p.drawRect(batt_xoffset + 2 * band_width, unused_offset, band_width, unused_height); p.setBrush(lightc); p.drawRect(batt_xoffset + band_width, unused_offset, band_width, unused_height); p.setBrush(darkc); p.drawRect(batt_xoffset + 3 * band_width, unused_offset, band_width, unused_height); } } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<MemoryMeter> ); -} +EXPORT_OPIE_APPLET_v1( MemoryMeter ) diff --git a/noncore/applets/memoryapplet/memorystatus.cpp b/noncore/applets/memoryapplet/memorystatus.cpp index c01ba28..95ae06b 100644 --- a/noncore/applets/memoryapplet/memorystatus.cpp +++ b/noncore/applets/memoryapplet/memorystatus.cpp @@ -23,16 +23,17 @@ #include <qpainter.h> #include <qpushbutton.h> #include <qdrawutil.h> #include <qlabel.h> #include <qlayout.h> +using namespace Opie::Ui; MemoryStatus::MemoryStatus(QWidget *parent, WFlags f ) : QFrame(parent, 0, f), mi(0), sf(0) { setCaption( tr("Memory Status") ); //resize( 220, 180 ); QVBoxLayout *lay = new QVBoxLayout( this ); tab = new OTabWidget( this, "tabwidget", OTabWidget::Global ); diff --git a/noncore/applets/memoryapplet/memorystatus.h b/noncore/applets/memoryapplet/memorystatus.h index c3926db..d16787b 100644 --- a/noncore/applets/memoryapplet/memorystatus.h +++ b/noncore/applets/memoryapplet/memorystatus.h @@ -21,29 +21,29 @@ #define MEMORY_STATUS_H #include <qframe.h> #include <opie2/otabwidget.h> class MemoryInfo; class Swapfile; -using Opie::OTabWidget; + class MemoryStatus : public QFrame { Q_OBJECT public: MemoryStatus(QWidget *parent = 0, WFlags f = 0); ~MemoryStatus(); QSize sizeHint() const; MemoryInfo* mi; Swapfile* sf; int percent(); private: - OTabWidget *tab; + Opie::Ui::OTabWidget *tab; }; #endif diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp index 955ed2e..5eb5ad2 100644 --- a/noncore/applets/networkapplet/networkapplet.cpp +++ b/noncore/applets/networkapplet/networkapplet.cpp @@ -40,16 +40,18 @@ /* QT */ #include <qlabel.h> #include <qlayout.h> #include <qobjectlist.h> #include <assert.h> +using namespace Opie::Ui; +using namespace Opie::Net; 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" ) ) ); @@ -241,14 +243,11 @@ void NetworkApplet::mousePressEvent( QMouseEvent* ) popup( _control ); } else { _control->hide(); } } +EXPORT_OPIE_APPLET_v1( NetworkApplet ) -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NetworkApplet> ); -} diff --git a/noncore/applets/networkapplet/networkapplet.h b/noncore/applets/networkapplet/networkapplet.h index 8022537..1e2cac8 100644 --- a/noncore/applets/networkapplet/networkapplet.h +++ b/noncore/applets/networkapplet/networkapplet.h @@ -33,73 +33,79 @@ #include <opie2/otaskbarapplet.h> #include <qframe.h> #include <qstring.h> #include <qtoolbutton.h> #include <qlineedit.h> #include <qpixmap.h> -class ONetworkInterface; + +namespace Opie { +namespace Net { + class ONetwork; + class ONetworkInterface; +} +} class QShowEvent; class QHideEvent; class QVBoxLayout; class IfaceUpDownButton : public QToolButton { Q_OBJECT public: IfaceUpDownButton( QWidget* parent, const char* name ); virtual ~IfaceUpDownButton(); public slots: virtual void clicked(); private: - ONetworkInterface* _iface; + Opie::Net::ONetworkInterface* _iface; }; class IfaceIPAddress : public QLineEdit { Q_OBJECT public: IfaceIPAddress( QWidget* parent, const char* name ); virtual ~IfaceIPAddress(); public slots: virtual void returnPressed(); private: - ONetworkInterface* _iface; + Opie::Net::ONetworkInterface* _iface; }; class NetworkAppletControl : public QFrame { public: - NetworkAppletControl( OTaskbarApplet* parent, const char* name = 0 ); + NetworkAppletControl( Opie::Ui::OTaskbarApplet* parent, const char* name = 0 ); ~NetworkAppletControl(); virtual QSize sizeHint() const; protected: virtual void showEvent( QShowEvent* ); virtual void hideEvent( QHideEvent* ); - QString guessDevice( ONetworkInterface* iface ); + QString guessDevice( Opie::Net::ONetworkInterface* iface ); void build(); private: QVBoxLayout* l; }; -class NetworkApplet : public OTaskbarApplet +class NetworkApplet : public Opie::Ui::OTaskbarApplet { public: NetworkApplet( QWidget* parent = 0, const char* name = 0 ); ~NetworkApplet(); static int position(); protected: virtual void paintEvent( QPaintEvent* ); diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 9b5e475..13f7cf3 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp @@ -41,16 +41,17 @@ #include <qpainter.h> #include <qlayout.h> #include <qframe.h> #include <qpixmap.h> #include <qstring.h> #include <qtimer.h> /* XPM */ +using namespace Opie::Ui; static char * notes_xpm[] = { "16 16 11 1", " c None", ". c #000000", "+ c #7F7F7F", "@ c #BFBFBF", "# c #BFC1FF", "$ c #FF0000", @@ -503,12 +504,11 @@ void NotesApplet::mousePressEvent( QMouseEvent *) { } } void NotesApplet::paintEvent( QPaintEvent* ) { QPainter p(this); p.drawPixmap( 0, 1, ( const char** ) notes_xpm ); } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NotesApplet> ); -} + +EXPORT_OPIE_APPLET_v1( NotesApplet ) + diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp index 6ef2e44..f244426 100644 --- a/noncore/applets/wirelessapplet/wireless.cpp +++ b/noncore/applets/wirelessapplet/wireless.cpp @@ -21,16 +21,17 @@ #include "connect4.xpm" #include "connect5.xpm" #include "nowireless.xpm" /* OPIE */ #include <opie2/onetwork.h> #include <opie2/otaskbarapplet.h> #include <qpe/config.h> +#include <qpe/qpeapplication.h> /* QT */ #include <qradiobutton.h> #include <qpushbutton.h> #include <qpainter.h> #include <qlabel.h> #include <qslider.h> #include <qbuttongroup.h> @@ -43,16 +44,18 @@ #include <signal.h> #define STYLE_BARS 0 #define STYLE_ANTENNA 1 //#define MDEBUG #undef MDEBUG +using namespace Opie::Ui; +using namespace Opie::Net; WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) { readConfig(); writeConfigEntry( "UpdateFrequency", updateFrequency ); writeConfigEntry( "DisplayStyle", displayStyle ); @@ -545,14 +548,10 @@ void WirelessApplet::paintEvent( QPaintEvent* ) } int WirelessApplet::position() { return 6; } - -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<WirelessApplet> ); -} +EXPORT_OPIE_APPLET_v1( WirelessApplet ) diff --git a/noncore/applets/wirelessapplet/wireless.h b/noncore/applets/wirelessapplet/wireless.h index 27f8c90..b475a46 100644 --- a/noncore/applets/wirelessapplet/wireless.h +++ b/noncore/applets/wirelessapplet/wireless.h @@ -14,17 +14,20 @@ #ifndef __WIRELESS_APPLET_H__ #define __WIRELESS_APPLET_H__ #include <qwidget.h> #include <qframe.h> #include <qpixmap.h> -class OWirelessNetworkInterface; +namespace Opie {namespace Net { + class OWirelessNetworkInterface; +} +} class Y; class QLabel; class WirelessApplet; class MGraph; class WirelessControl : public QFrame { Q_OBJECT @@ -81,21 +84,21 @@ class WirelessApplet : public QWidget void updatePopupWindow(); const char** getQualityPixmap(); private: QPixmap snapshotPixmap; int visualStyle; int timer; - OWirelessNetworkInterface* interface; + Opie::Net::OWirelessNetworkInterface* interface; private: const char** oldpixmap; - OWirelessNetworkInterface* oldiface; + Opie::Net::OWirelessNetworkInterface* oldiface; int oldqualityH; int oldsignalH; int oldnoiseH; QString oldESSID; QString oldAP; QString oldMODE; double oldFREQ; diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp index 0083e9b..3acff1e 100644 --- a/noncore/applets/zkbapplet/zkbwidget.cpp +++ b/noncore/applets/zkbapplet/zkbwidget.cpp @@ -3,21 +3,22 @@ #include <qpe/applnk.h> #include <qpe/qpeapplication.h> #include <qpe/resource.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")) { labels = new QPopupMenu(); - connect(labels, SIGNAL(activated(int)), this, + 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() ); @@ -63,17 +64,17 @@ bool ZkbWidget::loadKeymap() { setText(keymap->getCurrentLabel()); labels->clear(); QStringList l = keymap->listLabels(); labels->insertItem(disabled, 0, 0); int n = 1; w = 0; - for(QStringList::Iterator it = l.begin(); it != l.end(); + for(QStringList::Iterator it = l.begin(); it != l.end(); ++it, n++) { // printf("label: %s\n", (const char*) (*it).utf8()); labels->insertItem(*it, n, n); int lw = fm.width(*it); if (lw > w) { w = lw; @@ -150,13 +151,11 @@ void ZkbWidget::signalReceived(const QCString& msg, const QByteArray& data) { } } void ZkbWidget::reload() { loadKeymap(); QCopEnvelope("QPE/System", "notBusy()"); } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ZkbWidget> ); -} +EXPORT_OPIE_APPLET_v1( ZkbWidget ) + |