summaryrefslogtreecommitdiff
path: root/noncore/applets
Side-by-side diff
Diffstat (limited to 'noncore/applets') (more/less context) (show whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp8
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp15
-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.pro4
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp44
-rw-r--r--noncore/applets/zkbapplet/zkbwidget.cpp2
8 files changed, 78 insertions, 67 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
@@ -4,34 +4,34 @@
* 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/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() );
setFixedHeight( AppLnk::smallIconSize() );
enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) );
disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) );
repaint(true);
popupMenu = 0;
show();
}
@@ -78,20 +78,20 @@ void AutoRotate::setRotateEnabled(bool status)
cfg.setGroup( "Appearance" );
cfg.writeEntry( "rotateEnabled", status );
}
bool AutoRotate::isRotateEnabled()
{
Config cfg( "qpe" );
cfg.setGroup( "Appearance" );
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 )
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
@@ -11,45 +11,50 @@
** 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 "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>
#include <qtimer.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qhbuttongroup.h>
#include <qradiobutton.h>
#include <qlineedit.h>
#include <qprogressbar.h>
#include <qcombobox.h>
#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>
#include <mntent.h>
#include <unistd.h>
#include <sys/types.h>
Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
: QWidget( parent, name, f )
{
// are we running as root?
isRoot = geteuid() == 0;
@@ -204,25 +209,25 @@ void Swapfile::getStatusPcmcia()
if (cardWas1 != cardInPcmcia1) {
if (cardInPcmcia1) {
cfRB->setEnabled(TRUE);
} else {
cfRB->setChecked(FALSE);
cfRB->setEnabled(FALSE);
}
}
}
} else {
// no file found
- qDebug("no file found");
+ odebug << "no file found" << oendl;
cardInPcmcia0 = FALSE;
cardInPcmcia1 = FALSE;
}
Swapfile::cfsdchecked();
}
void Swapfile::getStatusSd()
{
bool cardWas = cardInSd; // remember last state
cardInSd = 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
@@ -27,35 +27,37 @@
Boston, MA 02111-1307, USA.
*/
#include "networkapplet.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/onetwork.h>
#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 )
{
_iface = ONetwork::instance()->interface( name );
assert( _iface );
setToggleButton( true );
//setAutoRaise( true );
setOnIconSet( QIconSet( Resource::loadPixmap( "up" ) ) );
setOffIconSet( QIconSet( Resource::loadPixmap( "down" ) ) );
setOn( _iface->isUp() );
//setFixedWidth( 16 );
connect( this, SIGNAL( clicked() ), this, SLOT( clicked() ) );
@@ -158,61 +160,61 @@ QString NetworkAppletControl::guessDevice( ONetworkInterface* iface )
if ( QString( iface->name() ).contains( "ir" ) )
return "networksettings/irda";
//TODO: Insert neat symbol and check for tunnel devices
return "networksettings/lan";
}
void NetworkAppletControl::showEvent( QShowEvent* e )
{
- qDebug( "showEvent" );
+ odebug << "showEvent" << oendl;
build();
QWidget::showEvent( e );
}
void NetworkAppletControl::hideEvent( QHideEvent* e )
{
- qDebug( "hideEvent" );
+ odebug << "hideEvent" << oendl;
QWidget::hideEvent( e );
delete l;
// delete all child widgets from this frame
QObjectList* list = const_cast<QObjectList*>( children() );
QObjectListIt it(*list);
QObject* obj;
while ( (obj=it.current()) )
{
++it;
delete obj;
}
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 );
resize( 0, 0 );
}
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 );
}
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() ) );
_control = new NetworkAppletControl( this, "control" );
}
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
@@ -6,56 +6,58 @@
** 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"
-#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>
#include <qpe/timestring.h>
#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>
#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>
+
/* 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",
"% c #FFFFFF",
"& c #00037F",
"* c #0006FF",
"= c #0005BF",
@@ -75,27 +77,27 @@ static char * notes_xpm[] = {
" ..=**=#&=&=.. ",
" ..=*=&=.. ",
" ..=.. ",
" . "};
NotesControl::NotesControl( QWidget *, const char * )
: QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop )
// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
{
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");
showMax = cfg.readBoolEntry("ShowMax", false);
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
loaded=false;
edited=false;
doPopulate=true;
isNew=false;
QVBox *vbox = new QVBox( this, "Vlayout" );
QHBox *hbox = new QHBox( this, "HLayout" );
@@ -156,55 +158,55 @@ void NotesControl::slotDeleteButtonClicked() {
switch ( QMessageBox::warning(this,tr("Delete?")
,tr("Do you really want to<BR><B> delete</B> this note ?")
,tr("Yes"),tr("No"),0,1,1) ) {
case 0:
slotDeleteButton();
break;
};
}
void NotesControl::slotDeleteButton() {
QString selectedText = box->currentText();
- qDebug("deleting "+selectedText);
+ odebug << "deleting "+selectedText << oendl;
if( !selectedText.isEmpty()) {
Config cfg("Notes");
cfg.setGroup("Docs");
int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
QString entryName, entryName2;;
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++;
}
cfg.writeEntry("NumberOfFiles", noOfFiles-1 );
entryName.sprintf( "File%i", noOfFiles );
cfg.removeEntry(entryName);
cfg.write();
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;
}
}
view->clear();
populateBox();
}
}
void NotesControl::slotNewButton() {
if(edited) save();
view->clear();
@@ -274,81 +276,81 @@ void NotesControl::focusOutEvent ( QFocusEvent * e) {
if(!loaded) {
populateBox();
load();
}
}
QWidget::focusOutEvent(e);
}
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();
int i = pt.find( ' ', pt.find( ' ' )+2 );
QString docname = pt;
if ( i > 0 )
docname = pt.left(i);
// remove "." at the beginning
while( docname.startsWith( "." ) )
docname = docname.mid( 1 );
docname.replace( QRegExp("/"), "_" );
// cut the length. filenames longer than that don't make sense
// and something goes wrong when they get too long.
if ( docname.length() > 40 )
docname = docname.left(40);
if ( docname.isEmpty() )
docname = "Empty Text";
-// qDebug(docname);
+// odebug << docname << oendl;
if( oldDocName != docname) {
int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
QString entryName;
entryName.sprintf( "File%i", noOfFiles + 1 );
cfg.writeEntry( entryName,docname );
cfg.writeEntry("NumberOfFiles", noOfFiles+1 );
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(" "), "_" );
doc->setFile( QDir::homeDirPath()+"/notes/"+temp);
FileManager fm;
if ( !fm.saveFile( *doc, rt ) ) {
}
oldDocName=docname;
edited=false;
-// qDebug("save");
+// odebug << "save" << oendl;
if (doPopulate)
populateBox();
}
cfg.writeEntry( "LastDoc",oldDocName );
cfg.write();
}
}
void NotesControl::populateBox() {
box->clear();
-// qDebug("populate");
+// odebug << "populate" << oendl;
Config cfg("Notes");
cfg.setGroup("Docs");
int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
QStringList list;
QString entryName;
for ( int i = 0; i < noOfFiles; i++ ) {
entryName.sprintf( "File%i", i + 1 );
list.append(cfg.readEntry( entryName ));
}
list.sort();
box->insertStringList(list,-1);
doPopulate=false;
@@ -365,25 +367,25 @@ void NotesControl::load() {
nf.setType("text/plain");
nf.setFile(lastDoc);
loadDoc(nf);
loaded=true;
oldDocName=lastDoc;
cfg.writeEntry( "LastDoc",oldDocName );
cfg.write();
}
}
void NotesControl::load(const QString & file) {
- qDebug("loading "+file);
+ odebug << "loading "+file << oendl;
QString name = file;
QString temp;
if( !QFile( QDir::homeDirPath()+"/"+file).exists() )
temp = QDir::homeDirPath()+"/notes/"+ name.replace( QRegExp(" "), "_" );
else
temp = name;
if(!loaded) {
DocLnk nf;
nf.setType("text/plain");
nf.setFile( temp);
if(!temp.isEmpty())
loadDoc(nf);
@@ -392,25 +394,25 @@ void NotesControl::load(const QString & file) {
// view->setFocus();
oldDocName=file;
Config cfg("Notes");
cfg.setGroup("Docs");
cfg.writeEntry( "LastDoc",oldDocName );
cfg.write();
}
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);
}
void NotesControl::slotViewEdited() {
if(loaded) {
edited=true;
}
}
@@ -426,25 +428,25 @@ void NotesControl::slotShowMax() {
void NotesControl::slotSearch() {
int boxCount = box->count();
for(int i=0;i< boxCount;i++) {
}
}
// void NotesControl::keyReleaseEvent( QKeyEvent *e) {
// switch ( e->state() ) {
// case ControlButton:
// if(e->key() == Key_C) { //copy
-// qDebug("copy");
+// odebug << "copy" << oendl;
// QClipboard *cb = QApplication::clipboard();
// 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
@@ -473,28 +475,28 @@ 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) {
- 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);
vc->move ( (rect.center()/2) - (vc->rect().center()/2));
// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28);
}
vc->show();
vc->doPopulate=true;
vc->populateBox();
vc->doPopulate=false;
vc->loaded=false;
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
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe
-VERSION = 1.0.0
+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
@@ -7,53 +7,55 @@
** 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 "wireless.h"
#include "mgraph.h"
#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>
#include <qpushbutton.h>
#include <qpainter.h>
#include <qlabel.h>
#include <qslider.h>
#include <qbuttongroup.h>
#include <qlayout.h>
#include <qfile.h>
#include <qtextstream.h>
/* STD */
#include <math.h>
#include <sys/types.h>
#include <signal.h>
#if defined (__GNUC__) && (__GNUC__ < 3)
#define round qRound
#endif
//#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 );
setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
QGridLayout *grid = new QGridLayout( this, 3, 2, 6, 2, "top layout" );
/* status label */
@@ -198,84 +200,84 @@ void WirelessApplet::checkInterface()
ONetwork* net = ONetwork::instance();
net->synchronize();
ONetwork::InterfaceIterator it = net->iterator();
while ( it.current() && !it.current()->isWireless() ) ++it;
if ( it.current() && it.current()->isWireless() )
interface = static_cast<OWirelessNetworkInterface*>( it.current() );
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();
}
}
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;
if ( !interface )
return ;
QString ifacename( interface->name() );
// At first we are trying dhcpcd
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 );
bool hasFile = pfile.open( IO_ReadOnly );
QTextStream s( &pfile );
if ( hasFile )
{
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 ;
}
// 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 );
QTextStream s2( &pfile2 );
if ( hasFile )
{
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 ;
}
}
void WirelessApplet::updateDHCPConfig( bool ESSID, bool FREQ, bool AP, bool MODE )
{
rocESSID = ESSID;
rocFREQ = FREQ;
rocAP = AP;
rocMODE = MODE;
@@ -294,42 +296,42 @@ void WirelessApplet::updateDelayChange( int delay )
void WirelessApplet::displayStyleChange( int style )
{
visualStyle = style;
repaint();
}
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();
return;
}
if ( mustRepaint() )
{
#ifdef MDEBUG
- qDebug( "WIFIAPPLET: A value has changed -> repainting." );
+ odebug << "WIFIAPPLET: A value has changed -> repainting." << oendl;
#endif
repaint();
}
if ( status->isVisible() )
{
updatePopupWindow();
}
}
else
{
checkInterface();
@@ -347,32 +349,32 @@ void WirelessApplet::mousePressEvent( QMouseEvent * )
bool WirelessApplet::mustRepaint()
{
// check if there are enough changes to justify a (flickering) repaint
// has the interface changed?
if ( interface != oldiface )
{
oldiface = interface;
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;
}
}
int rings = numberOfRings();
if ( rings != oldrings )
{
oldrings = rings;
return true;
@@ -386,46 +388,46 @@ bool WirelessApplet::mustRepaint()
|| ( signalH != oldsignalH )
|| ( qualityH != oldqualityH ) )
{
oldnoiseH = noiseH;
oldsignalH = signalH;
oldqualityH = qualityH;
return true;
}
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();
}
oldESSID = interface->SSID();
oldMODE = interface->mode();
oldFREQ = interface->frequency();
oldAP = interface->associatedAP().toString();
return false;
}
@@ -441,25 +443,25 @@ void WirelessApplet::updatePopupWindow()
freqString.sprintf( "%.3f GHz", interface->frequency() );
status->statusLabel->setText( "Station: " + interface->nickName() + "<br>" +
"ESSID: " + interface->SSID() + "<br>" +
"MODE: " + interface->mode() + "<br>" +
"FREQ: " + freqString + "<br>" +
cell + " " + interface->associatedAP().toString() );
}
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;
if ( qualityH < 60 ) return 2;
if ( qualityH < 65 ) return 3;
return 4;
}
void WirelessApplet::paintEvent( QPaintEvent* )
{
QPainter p( this );
int h = height();
@@ -472,25 +474,25 @@ void WirelessApplet::paintEvent( QPaintEvent* )
p.drawLine( w-m, h-m-1, m, h-m-1 );
int rings = numberOfRings();
if ( rings == -1 )
{
p.setPen( QPen( QColor( 200, 20, 20 ), 2 ) );
p.drawLine( w/2-m-m, h/2-m-m, w/2+m+m, h/2+m+m );
p.drawLine( w/2+m+m, h/2-m-m, w/2-m-m, h/2+m+m );
return;
}
- qDebug( "WirelessApplet: painting %d rings", rings );
+ odebug << "WirelessApplet: painting " << rings << " rings" << oendl;
int radius = 2;
int rstep = 4;
int maxrings = w/rstep;
p.setPen( QColor( 200, 20, 20 ) );
for ( int i = 0; i < rings; ++i )
{
p.drawEllipse( w/2 - radius/2, h/3 - radius/2, radius, radius );
radius += 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
@@ -85,25 +85,25 @@ bool ZkbWidget::loadKeymap() {
hide();
} else {
show();
}
return true;
}
QSize ZkbWidget::sizeHint() const {
return QSize(AppLnk::smallIconSize(),AppLnk::smallIconSize());
}
void ZkbWidget::stateChanged(const QString& s) {
-// qDebug("stateChanged: %s\n", (const char*) s.utf8());
+// odebug << "stateChanged: " << (const char*) s.utf8() << "\n" << oendl;
setText(s);
}
void ZkbWidget::labelChanged(int id) {
if (id == 0) {
keymap->disable();
setPixmap(disabled);
return;
}
keymap->enable();