summaryrefslogtreecommitdiff
path: root/noncore/applets
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/applets
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/applets') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp10
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp21
-rw-r--r--noncore/applets/networkapplet/networkapplet.cpp16
-rw-r--r--noncore/applets/notesapplet/config.in2
-rw-r--r--noncore/applets/notesapplet/notes.cpp54
-rw-r--r--noncore/applets/notesapplet/notesapplet.pro18
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp44
-rw-r--r--noncore/applets/zkbapplet/zkbwidget.cpp2
8 files changed, 89 insertions, 78 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp
index ae7fbd0..34802fb 100644
--- a/noncore/applets/autorotateapplet/autorotate.cpp
+++ b/noncore/applets/autorotateapplet/autorotate.cpp
@@ -13,16 +13,16 @@
#include "autorotate.h"
/* OPIE */
-#include <opie2/odevice.h>
+#include <opie2/odebug.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
#include <qpe/resource.h>
+using namespace Opie::Core;
/* QT */
#include <qpainter.h>
-using namespace Opie::Ui;
AutoRotate::AutoRotate(QWidget * parent):QWidget(parent)
{
setFixedWidth( AppLnk::smallIconSize() );
@@ -87,11 +87,11 @@ bool AutoRotate::isRotateEnabled()
bool res = cfg.readBoolEntry( "rotateEnabled" );
if (res )
- qDebug("Enabled");
+ odebug << "Enabled" << oendl;
else
- qDebug("Disabled");
+ odebug << "Disabled" << oendl;
return res;
}
-EXPORT_OPIE_APPLET_v1( AutoRotate )
+EXPORT_OPIE_APPLET_v1( AutoRotate )
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index 9416db3..a71078f 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -20,6 +20,12 @@
#include "swapfile.h"
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/resource.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qfile.h>
#include <qtextstream.h>
#include <qlabel.h>
@@ -34,13 +40,12 @@
#include <qvgroupbox.h>
#include <qhbox.h>
#include <qmessagebox.h>
+#include <qcopchannel_qws.h>
+
+/* STD */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#include <qcopchannel_qws.h>
-#include <qpe/resource.h>
-
#include <unistd.h>
#include <fcntl.h>
#include <sys/vfs.h>
@@ -54,11 +59,11 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
// are we running as root?
isRoot = geteuid() == 0;
- QVBoxLayout* vb = new QVBoxLayout(this, 5);
+ QVBoxLayout* vb = new QVBoxLayout(this, 5);
QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this);
cfsdRBG->setRadioButtonExclusive(true);
- vb->addWidget(cfsdRBG);
+ vb->addWidget(cfsdRBG);
ramRB = new QRadioButton(tr("RAM"), cfsdRBG);
cfRB = new QRadioButton(tr("CF Card"), cfsdRBG);
@@ -75,7 +80,7 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
vb->addWidget(hb1);
QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this);
- vb->addWidget(box1);
+ vb->addWidget(box1);
QHBox *hb2 = new QHBox(box1);
hb2->setSpacing(5);
@@ -213,7 +218,7 @@ void Swapfile::getStatusPcmcia()
}
} else {
// no file found
- qDebug("no file found");
+ odebug << "no file found" << oendl;
cardInPcmcia0 = FALSE;
cardInPcmcia1 = FALSE;
}
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp
index 5eb5ad2..534a8d0 100644
--- a/noncore/applets/networkapplet/networkapplet.cpp
+++ b/noncore/applets/networkapplet/networkapplet.cpp
@@ -36,17 +36,19 @@
#include <opie2/otaskbarapplet.h>
#include <qpe/applnk.h>
#include <qpe/resource.h>
-#include <qpainter.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>
-using namespace Opie::Ui;
-using namespace Opie::Net;
IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name )
:QToolButton( parent, name )
{
@@ -167,7 +169,7 @@ QString NetworkAppletControl::guessDevice( ONetworkInterface* iface )
void NetworkAppletControl::showEvent( QShowEvent* e )
{
- qDebug( "showEvent" );
+ odebug << "showEvent" << oendl;
build();
QWidget::showEvent( e );
}
@@ -175,7 +177,7 @@ void NetworkAppletControl::showEvent( QShowEvent* e )
void NetworkAppletControl::hideEvent( QHideEvent* e )
{
- qDebug( "hideEvent" );
+ odebug << "hideEvent" << oendl;
QWidget::hideEvent( e );
delete l;
@@ -192,7 +194,7 @@ void NetworkAppletControl::hideEvent( QHideEvent* e )
list = const_cast<QObjectList*>( children() );
if ( list )
- qWarning( "D'oh! We still have %d children...", list->count() );
+ owarn << "D'oh! We still have " << list->count() << " children..." << oendl;
// renew layout
l = new QVBoxLayout( this, 4, 2 );
@@ -203,7 +205,7 @@ void NetworkAppletControl::hideEvent( QHideEvent* e )
QSize NetworkAppletControl::sizeHint() const
{
ONetwork::instance()->synchronize(); // rebuild interface database
- qDebug( "sizeHint (#ifaces=%d)", ONetwork::instance()->count() );
+ odebug << "sizeHint (#ifaces=" << ONetwork::instance()->count() << ")" << oendl;
return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 );
}
diff --git a/noncore/applets/notesapplet/config.in b/noncore/applets/notesapplet/config.in
index 27a8187..c92c1d5 100644
--- a/noncore/applets/notesapplet/config.in
+++ b/noncore/applets/notesapplet/config.in
@@ -1,4 +1,4 @@
config NOTESAPPLET
boolean "opie-notesapplet (quick note taking applet)"
default "y"
- depends ( LIBQPE || LIBQPE-X11 )
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 13f7cf3..b3e72a7 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -15,10 +15,8 @@
#include "notes.h"
-#include <qapplication.h>
-#include <stdlib.h>
-#include <qstringlist.h>
-
+/* OPIE */
+#include <opie2/odebug.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/filemanager.h>
#include <qpe/qpeapplication.h>
@@ -26,14 +24,15 @@
#include <qpe/applnk.h>
#include <qpe/ir.h>
#include <qpe/config.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
-// #include <qsocket.h>
-// #include <qclipboard.h>
+/* 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>
@@ -43,10 +42,13 @@
#include <qframe.h>
#include <qpixmap.h>
#include <qstring.h>
+#include <qstringlist.h>
#include <qtimer.h>
+/* STD */
+#include <stdlib.h>
+
/* XPM */
-using namespace Opie::Ui;
static char * notes_xpm[] = {
"16 16 11 1",
" c None",
@@ -84,9 +86,9 @@ NotesControl::NotesControl( QWidget *, const char * )
{
QDir d( QDir::homeDirPath()+"/notes");
if( !d.exists()) {
- qDebug("make dir");
+ odebug << "make dir" << oendl;
if(!d.mkdir( QDir::homeDirPath()+"/notes", true))
- qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed");
+ odebug << "<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed" << oendl;
}
Config cfg("Notes");
cfg.setGroup("Options");
@@ -165,7 +167,7 @@ void NotesControl::slotDeleteButtonClicked() {
void NotesControl::slotDeleteButton() {
QString selectedText = box->currentText();
- qDebug("deleting "+selectedText);
+ odebug << "deleting "+selectedText << oendl;
if( !selectedText.isEmpty()) {
@@ -176,12 +178,12 @@ void NotesControl::slotDeleteButton() {
for ( int i = 0; i < noOfFiles; i++ ) {
entryName.sprintf( "File%i", i + 1 );
if(selectedText == cfg.readEntry( entryName )) {
- qDebug("removing %s, %d", selectedText.latin1(), i);
+ odebug << "removing " << selectedText.latin1() << ", " << i << "" << oendl;
for ( int j = i; j < noOfFiles; j++ ) {
entryName.sprintf( "File%i", i + 1 );
entryName2.sprintf( "File%i", i + 2 );
QString temp = cfg.readEntry(entryName2);
- qDebug("move "+temp);
+ odebug << "move "+temp << oendl;
cfg.writeEntry(entryName, temp);
i++;
}
@@ -192,10 +194,10 @@ void NotesControl::slotDeleteButton() {
DocLnk nf(selectedText);
nf.removeFiles();
QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop";
- qDebug(fi);
+ odebug << fi << oendl;
QFile f( fi);
- if( !f.remove()) qDebug(".desktop file not removed");
+ if( !f.remove()) odebug << ".desktop file not removed" << oendl;
}
}
@@ -283,7 +285,7 @@ void NotesControl::save() {
Config cfg("Notes");
cfg.setGroup("Docs");
if( edited) {
-// qDebug("is edited");
+// odebug << "is edited" << oendl;
QString rt = view->text();
if( rt.length()>1) {
QString pt = rt.simplifyWhiteSpace();
@@ -301,7 +303,7 @@ void NotesControl::save() {
docname = docname.left(40);
if ( docname.isEmpty() )
docname = "Empty Text";
-// qDebug(docname);
+// odebug << docname << oendl;
if( oldDocName != docname) {
int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
@@ -312,11 +314,11 @@ void NotesControl::save() {
cfg.write();
}
// else
-// qDebug("oldname equals docname");
+// odebug << "oldname equals docname" << oendl;
doc = new DocLnk(docname);
if(QFile(doc->linkFile()).exists())
- qDebug("puppie");
+ odebug << "puppie" << oendl;
doc->setType("text/plain");
doc->setName(docname);
QString temp = docname.replace( QRegExp(" "), "_" );
@@ -327,7 +329,7 @@ void NotesControl::save() {
oldDocName=docname;
edited=false;
-// qDebug("save");
+// odebug << "save" << oendl;
if (doPopulate)
populateBox();
}
@@ -339,7 +341,7 @@ void NotesControl::save() {
void NotesControl::populateBox() {
box->clear();
-// qDebug("populate");
+// odebug << "populate" << oendl;
Config cfg("Notes");
cfg.setGroup("Docs");
int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
@@ -374,7 +376,7 @@ void NotesControl::load() {
}
void NotesControl::load(const QString & file) {
- qDebug("loading "+file);
+ odebug << "loading "+file << oendl;
QString name = file;
QString temp;
if( !QFile( QDir::homeDirPath()+"/"+file).exists() )
@@ -401,7 +403,7 @@ void NotesControl::loadDoc( const DocLnk &f) {
FileManager fm;
QString txt;
if ( !fm.loadFile( f, txt ) ) {
- qDebug("could not load file "+f.file());
+ odebug << "could not load file "+f.file() << oendl;
return;
}
view->setText(txt);
@@ -435,7 +437,7 @@ void NotesControl::slotSearch() {
// switch ( e->state() ) {
// case ControlButton:
// if(e->key() == Key_C) { //copy
-// qDebug("copy");
+// odebug << "copy" << oendl;
// QClipboard *cb = QApplication::clipboard();
// QString text;
@@ -482,10 +484,10 @@ void NotesApplet::mousePressEvent( QMouseEvent *) {
// vc = new NotesControl;
// QPoint curPos = mapToGlobal( rect().topLeft() );
if(vc->showMax) {
- qDebug("show max");
+ odebug << "show max" << oendl;
vc->showMaximized();
} else {
- qDebug("no show max");
+ odebug << "no show max" << oendl;
QWidget *wid = QPEApplication::desktop();
QRect rect = QApplication::desktop()->geometry();
vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180);
diff --git a/noncore/applets/notesapplet/notesapplet.pro b/noncore/applets/notesapplet/notesapplet.pro
index 44e5b34..c3f9b1c 100644
--- a/noncore/applets/notesapplet/notesapplet.pro
+++ b/noncore/applets/notesapplet/notesapplet.pro
@@ -1,12 +1,12 @@
-TEMPLATE = lib
-CONFIG += qt plugin warn_on
-HEADERS = notes.h
-SOURCES = notes.cpp
-TARGET = notesapplet
-DESTDIR = $(OPIEDIR)/plugins/applets
+TEMPLATE = lib
+CONFIG += qt plugin warn_on
+HEADERS = notes.h
+SOURCES = notes.cpp
+TARGET = notesapplet
+DESTDIR = $(OPIEDIR)/plugins/applets
INCLUDEPATH += $(OPIEDIR)/include
-DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
-VERSION = 1.0.0
+DEPENDPATH += $(OPIEDIR)/include
+LIBS += -lqpe -lopiecore2
+VERSION = 1.0.1
include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp
index 0491a86..364f3ad 100644
--- a/noncore/applets/wirelessapplet/wireless.cpp
+++ b/noncore/applets/wirelessapplet/wireless.cpp
@@ -16,10 +16,14 @@
#include "advancedconfig.h"
/* OPIE */
+#include <opie2/odebug.h>
#include <opie2/onetwork.h>
#include <opie2/otaskbarapplet.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
+using namespace Opie::Net;
/* QT */
#include <qradiobutton.h>
@@ -43,8 +47,6 @@
//#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 )
{
@@ -207,14 +209,14 @@ void WirelessApplet::checkInterface()
if ( interface )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->name() );
+ odebug << "WIFIAPPLET: using interface '" << ( const char* ) interface->name() << "'" << oendl;
#endif
}
else
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: D'oh! No Wireless interface present... :(" );
+ odebug << "WIFIAPPLET: D'oh! No Wireless interface present... :(" << oendl;
#endif
hide();
}
@@ -223,7 +225,7 @@ void WirelessApplet::checkInterface()
void WirelessApplet::renewDHCP()
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: Going to request a DHCP configuration renew." );
+ odebug << "WIFIAPPLET: Going to request a DHCP configuration renew." << oendl;
#endif
QString pidfile;
@@ -235,7 +237,7 @@ void WirelessApplet::renewDHCP()
pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename );
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: dhcpcd pidfile is '%s'", ( const char* ) pidfile );
+ odebug << "WIFIAPPLET: dhcpcd pidfile is '" << ( const char* ) pidfile << "'" << oendl;
#endif
int pid;
QFile pfile( pidfile );
@@ -245,7 +247,7 @@ void WirelessApplet::renewDHCP()
{
s >> pid;
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: sent SIGALARM to pid %d", pid );
+ odebug << "WIFIAPPLET: sent SIGALARM to pid " << pid << "" << oendl;
#endif
kill( pid, SIGALRM );
return ;
@@ -253,11 +255,11 @@ void WirelessApplet::renewDHCP()
// No dhcpcd, so we are trying udhcpc
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: dhcpcd not available." );
+ odebug << "WIFIAPPLET: dhcpcd not available." << oendl;
#endif
pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename );
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: udhcpc pidfile is '%s'", ( const char* ) pidfile );
+ odebug << "WIFIAPPLET: udhcpc pidfile is '" << ( const char* ) pidfile << "'" << oendl;
#endif
QFile pfile2( pidfile );
hasFile = pfile2.open( IO_ReadOnly );
@@ -266,7 +268,7 @@ void WirelessApplet::renewDHCP()
{
s2 >> pid;
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: sent SIGUSR1 to pid %d", pid );
+ odebug << "WIFIAPPLET: sent SIGUSR1 to pid " << pid << "" << oendl;
#endif
kill( pid, SIGUSR1 );
return ;
@@ -303,14 +305,14 @@ WirelessApplet::~WirelessApplet()
void WirelessApplet::timerEvent( QTimerEvent* )
{
#ifdef MDEBUG
- qDebug( "WirelessApplet::timerEvent" );
+ odebug << "WirelessApplet::timerEvent" << oendl;
#endif
if ( interface )
{
if ( !ONetwork::instance()->isPresent( (const char*) interface->name() ) )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: Interface no longer present." );
+ odebug << "WIFIAPPLET: Interface no longer present." << oendl;
#endif
interface = 0L;
mustRepaint();
@@ -320,7 +322,7 @@ void WirelessApplet::timerEvent( QTimerEvent* )
if ( mustRepaint() )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: A value has changed -> repainting." );
+ odebug << "WIFIAPPLET: A value has changed -> repainting." << oendl;
#endif
repaint();
}
@@ -356,14 +358,14 @@ bool WirelessApplet::mustRepaint()
if ( interface )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: We had no interface but now we have one! :-)" );
+ odebug << "WIFIAPPLET: We had no interface but now we have one! :-)" << oendl;
#endif
show();
}
else
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: We had a interface but now we don't have one! ;-(" );
+ odebug << "WIFIAPPLET: We had a interface but now we don't have one! ;-(" << oendl;
#endif
hide();
return true;
@@ -395,28 +397,28 @@ bool WirelessApplet::mustRepaint()
if ( rocESSID && ( oldESSID != interface->SSID() ) )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: ESSID has changed." );
+ odebug << "WIFIAPPLET: ESSID has changed." << oendl;
#endif
renewDHCP();
}
else if ( rocFREQ && ( oldFREQ != interface->frequency() ) )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: FREQ has changed." );
+ odebug << "WIFIAPPLET: FREQ has changed." << oendl;
#endif
renewDHCP();
}
else if ( rocAP && ( oldAP != interface->associatedAP().toString() ) )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: AP has changed." );
+ odebug << "WIFIAPPLET: AP has changed." << oendl;
#endif
renewDHCP();
}
else if ( rocMODE && ( oldMODE != interface->mode() ) )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: MODE has changed." );
+ odebug << "WIFIAPPLET: MODE has changed." << oendl;
#endif
renewDHCP();
}
@@ -450,7 +452,7 @@ int WirelessApplet::numberOfRings()
{
if ( !interface ) return -1;
int qualityH = interface->signalStrength();
- qDebug( "quality = %d", qualityH );
+ odebug << "quality = " << qualityH << "" << oendl;
if ( qualityH < 1 ) return -1;
if ( qualityH < 20 ) return 0;
if ( qualityH < 40 ) return 1;
@@ -481,7 +483,7 @@ void WirelessApplet::paintEvent( QPaintEvent* )
return;
}
- qDebug( "WirelessApplet: painting %d rings", rings );
+ odebug << "WirelessApplet: painting " << rings << " rings" << oendl;
int radius = 2;
int rstep = 4;
int maxrings = w/rstep;
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp
index 3acff1e..13d554c 100644
--- a/noncore/applets/zkbapplet/zkbwidget.cpp
+++ b/noncore/applets/zkbapplet/zkbwidget.cpp
@@ -94,7 +94,7 @@ QSize ZkbWidget::sizeHint() const {
}
void ZkbWidget::stateChanged(const QString& s) {
-// qDebug("stateChanged: %s\n", (const char*) s.utf8());
+// odebug << "stateChanged: " << (const char*) s.utf8() << "\n" << oendl;
setText(s);
}