author | ar <ar> | 2004-06-03 18:50:11 (UTC) |
---|---|---|
committer | ar <ar> | 2004-06-03 18:50:11 (UTC) |
commit | f9d940da940c8d42dc072f60ad72e69025650cf8 (patch) (side-by-side diff) | |
tree | d27646ceea53d25f68bc53f770424a3b3c434994 /libopie2 | |
parent | 75922e8dd0f7390932471b5a611d94076a8472f3 (diff) | |
download | opie-f9d940da940c8d42dc072f60ad72e69025650cf8.zip opie-f9d940da940c8d42dc072f60ad72e69025650cf8.tar.gz opie-f9d940da940c8d42dc072f60ad72e69025650cf8.tar.bz2 |
- convert to odebug framework
9 files changed, 165 insertions, 71 deletions
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp index 0b8e1fe..c0369ef 100644 --- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp +++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp @@ -1,142 +1,142 @@ /* QT */ #include <qvbox.h> #include <qhbox.h> #include <qvbuttongroup.h> #include <qhbuttongroup.h> #include <qlineedit.h> #include <qradiobutton.h> #include <qpushbutton.h> /* OPIE */ #include <qpe/config.h> #include <opie2/odebug.h> #include <opie2/oapplication.h> #include <opie2/oglobal.h> #include <opie2/oglobalsettings.h> using namespace Opie::Core; class DemoApp : public OApplication { Q_OBJECT public: DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" ) { // you have access to your OApplication object via oApp - qDebug( "Process-wide OApplication object @ %0x", oApp ); + odebug << "Process-wide OApplication object @ " << oApp << "" << oendl; // you have access to global settings via OGlobalSettings int mode = OGlobalSettings::debugMode(); QVBox* vbox = new QVBox(); setMainWidget( vbox ); g = new QVButtonGroup( "Output Strategy", vbox ); QRadioButton* r0 = new QRadioButton( "file", g ); QRadioButton* r1 = new QRadioButton( "messagebox", g ); QRadioButton* r2 = new QRadioButton( "stderr", g ); QRadioButton* r3 = new QRadioButton( "syslog", g ); QRadioButton* r4 = new QRadioButton( "socket", g ); g->insert( r0, 0 ); g->insert( r1, 1 ); g->insert( r2, 2 ); g->insert( r3, 3 ); g->insert( r4, 4 ); g->setRadioButtonExclusive( true ); connect( g, SIGNAL( clicked(int) ), this, SLOT( chooseMethod(int) ) ); if ( mode != -1 ) g->setButton( mode ); QHButtonGroup* hbox = new QHButtonGroup( "Extra Output Information", vbox ); e = new QLineEdit( hbox ); QPushButton* pb = new QPushButton( hbox ); connect( e, SIGNAL( returnPressed() ), this, SLOT( updateDebugOutput() ) ); connect( pb, SIGNAL( clicked() ), this, SLOT( updateDebugOutput() ) ); // show the additional debug mode dependent output information e->setText( OGlobalSettings::debugOutput() ); // buttos QPushButton* info = new QPushButton( "Emit Debug(Info) Output!", vbox ); connect( info, SIGNAL( clicked() ), this, SLOT( emitInfoOutput() ) ); QPushButton* warn = new QPushButton( "Emit a Warning Output!", vbox ); connect( warn, SIGNAL( clicked() ), this, SLOT( emitWarningOutput() ) ); QPushButton* error = new QPushButton( "Emit an Error Output!", vbox ); connect( error, SIGNAL( clicked() ), this, SLOT( emitErrorOutput() ) ); QPushButton* fatal = new QPushButton( "Emit a Fatal Output!", vbox ); connect( fatal, SIGNAL( clicked() ), this, SLOT( emitFatalOutput() ) ); QPushButton* tb = new QPushButton( "Emit a Fatal Backtrace!", vbox ); connect( tb, SIGNAL( clicked() ), this, SLOT( emitTBOutput() ) ); info->show(); warn->show(); error->show(); fatal->show(); tb->show(); g->show(); hbox->show(); e->show(); vbox->show(); showMainWidget( vbox ); } public slots: void chooseMethod(int method) { m = method; - qDebug( "choosing method: %d", method ); + odebug << "choosing method: " << method << "" << oendl; OConfig* g = OGlobal::config(); g->setGroup( "General" ); g->writeEntry( "debugMode", m ); e->setText( OGlobalSettings::debugOutput() ); g->write(); } void updateDebugOutput() { OConfig* g = OGlobal::config(); g->setGroup( "General" ); g->writeEntry( "debugOutput"+QString::number(OGlobalSettings::debugMode()), e->text() ); g->write(); } void emitInfoOutput() { odebug << "This is a debug message" << oendl; } void emitWarningOutput() { owarn << "This is a warning message" << oendl; } void emitErrorOutput() { oerr << "This is an errror message" << oendl; } void emitFatalOutput() { ofatal << "This is a fatal message" << oendl; } void emitTBOutput() { ofatal << "This is a fatal message + backtrace\n" + odBacktrace(); // odBacktrace includes \n } private: QButtonGroup* g; int m; QLineEdit* e; }; int main( int argc, char** argv ) { DemoApp* app = new DemoApp( argc, argv ); app->exec(); return 0; } #include "moc/odebugdemo.moc" diff --git a/libopie2/examples/opiedb/sqltest/main.cpp b/libopie2/examples/opiedb/sqltest/main.cpp index adca5fd..24b7b21 100644 --- a/libopie2/examples/opiedb/sqltest/main.cpp +++ b/libopie2/examples/opiedb/sqltest/main.cpp @@ -1,30 +1,62 @@ -#include <qdir.h> +/* + =. This file is part of the Opie Project + .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> + .>+-= + _;:, .> :=|. This library 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 library 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 <qpe/qpeapplication.h> +*/ + +/* OPIE */ #include <opie2/osqlmanager.h> #include <opie2/osqlquery.h> #include <opie2/osqldriver.h> #include <opie2/osqlresult.h> +#include <opie2/odebug.h> + +#include <qpe/qpeapplication.h> + +/* QT */ +#include <qdir.h> using namespace Opie::DB; int main( int argc, char* argv[] ) { QPEApplication app( argc, argv ); OSQLManager man; man.registerPath( QDir::currentDirPath() ); OSQLBackEnd::ValueList list = man.queryBackEnd(); OSQLDriver *driver = man.standard(); - qWarning("testmain" + driver->id() ); + owarn << "testmain" + driver->id() << oendl; driver->setUrl("/home/ich/test2vhgytry"); if ( driver->open() ) { - qWarning("could open"); + owarn << "could open" << oendl; }else - qWarning("wasn't able to open"); + owarn << "wasn't able to open" << oendl; OSQLRawQuery raw("select * from t2" ); OSQLResult res = driver->query( &raw ); OSQLRawQuery raw2( "insert into t2 VALUES(ROWID,'Meine Mutter') "); res = driver->query(&raw2); }; diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp index e1a4d5d..c11724c 100644 --- a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp +++ b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp @@ -1,43 +1,43 @@ #include <qdir.h> #include <qpe/qpeapplication.h> #include <opie2/osqlmanager.h> #include <opie2/osqlquery.h> #include <opie2/osqldriver.h> #include <opie2/osqlresult.h> using namespace Opie::DB; int main( int argc, char* argv[] ) { QPEApplication app( argc, argv ); OSQLManager man; man.registerPath( QDir::currentDirPath() ); OSQLBackEnd::ValueList list = man.queryBackEnd(); OSQLDriver *driver = man.standard(); - qWarning("testmain" + driver->id() ); + owarn << "testmain" + driver->id() << oendl; driver->setUrl("/home/ich/spaltenweise"); if ( driver->open() ) { - qWarning("could open"); + owarn << "could open" << oendl; }else - qWarning("wasn't able to open"); + owarn << "wasn't able to open" << oendl; OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" "uid,categories,completed," "progress,summary,HasDate," "DateDay,DateMonth,DateYear," "priority,description)" ); OSQLResult res = driver->query( raw ); delete raw; for (int i = 0; i< 10000; i++ ) { int uid = i; OSQLRawQuery raw("insert into todolist VALUES("+ QString::number(uid)+ ",'-122324;-12132',1,100,"+ "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ "'Description\n12344')"); OSQLResult res = driver->query( &raw ); } return 0; }; diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp index 2d11ac5..126e797 100644 --- a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp +++ b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp @@ -1,86 +1,86 @@ #include <qdir.h> #include <qpe/qpeapplication.h> #include <opie2/osqlmanager.h> #include <opie2/osqlquery.h> #include <opie2/osqldriver.h> #include <opie2/osqlresult.h> using namespace Opie::DB; int main( int argc, char* argv[] ) { QPEApplication app( argc, argv ); OSQLManager man; man.registerPath( QDir::currentDirPath() ); OSQLBackEnd::ValueList list = man.queryBackEnd(); OSQLDriver *driver = man.standard(); - qWarning("testmain" + driver->id() ); + owarn << "testmain" + driver->id() << oendl; driver->setUrl("/home/ich/zeilenweise"); if ( driver->open() ) { - qWarning("could open"); + owarn << "could open" << oendl; }else - qWarning("wasn't able to open"); + owarn << "wasn't able to open" << oendl; OSQLRawQuery raw2("BEGIN TRANSACTION"); OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); OSQLResult res = driver->query( &raw2 ); res = driver->query( raw ); delete raw; for (int i = 0; i< 10000; i++ ) { int uid = i; OSQLRawQuery *raw; raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')"); OSQLResult res = driver->query(raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid) + ",'Completed',1)" ); res = driver->query(raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'Progress',100)" ); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'Summary',"+ "'Summary234-"+ QString::number(uid) + "')"); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'HasDate',1)"); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'DateDay',5)"); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'DateMonth',8)"); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'DateYear',2002)"); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'Priority',1)"); res = driver->query( raw ); delete raw; raw = new OSQLRawQuery("insert into todolist VALUES("+ QString::number(uid)+",'Description','" + QString::number(uid) + "Description\n12344')"); res = driver->query( raw ); delete raw; } OSQLRawQuery raw3("COMMIT"); res = driver->query(&raw3 ); }; diff --git a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp index 8d421fd..bdf2149 100644 --- a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp +++ b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp @@ -1,34 +1,65 @@ +/* + =. This file is part of the Opie Project + .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> + .>+-= + _;:, .> :=|. This library 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 library 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. + +*/ + +/* OPIE */ #include <opie2/osoundsystem.h> +#include <opie2/odebug.h> using namespace Opie::MM; int main( int argc, char** argv ) { - qDebug( "OPIE Sound System Demo" ); + odebug << "OPIE Sound System Demo" << oendl; OSoundSystem* sound = OSoundSystem::instance(); OSoundSystem::CardIterator it = sound->iterator(); /* while ( it.current() ) { - qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() ); + odebug << "DEMO: OSoundSystem contains Interface '" << it.current()->name() << "'" << oendl; ++it; } */ OSoundCard* card = it.current(); OMixerInterface* mixer = card->mixer(); QStringList channels = mixer->allChannels(); for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) { - qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it ); - qDebug( "OSSDEMO: +--- volume %d (left) | %d (right)", mixer->volume( *it ) & 0xff, mixer->volume( *it ) >> 8 ); + odebug << "OSSDEMO: Mixer has channel " << *it << "" << oendl; + odebug << "OSSDEMO: +--- volume " << ( mixer->volume( *it ) & 0xff ) + << " (left) | " << ( mixer->volume( *it ) >> 8 ) << " (right)" << oendl; } return 0; } diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp index 4f8af60..65866af 100644 --- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp +++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp @@ -1,145 +1,176 @@ +/* + =. This file is part of the Opie Project + .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> + .>+-= + _;:, .> :=|. This library 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 library 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. + +*/ + +/* OPIE */ #include <opie2/onetwork.h> #include <opie2/ostation.h> #include <opie2/omanufacturerdb.h> +#include <opie2/odebug.h> +/* STD */ #include <unistd.h> using namespace Opie::Net; int main( int argc, char** argv ) { - qDebug( "OPIE Network Demo" ); + odebug << "OPIE Network Demo" << oendl; ONetwork* net = ONetwork::instance(); ONetwork::InterfaceIterator it = net->iterator(); while ( it.current() ) { - qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); - qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); - qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); - qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); - qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); - qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); - qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); - qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); + odebug << "DEMO: ONetwork contains Interface '" << it.current()->name() << "'" << oendl; + odebug << "DEMO: Datalink code is '" << it.current()->dataLinkType() << "'" << oendl; + odebug << "DEMO: MAC Address is '" << it.current()->macAddress().toString() << "'" << oendl; + odebug << "DEMO: MAC Address is '" << it.current()->macAddress().toString(true) << "'" << oendl; + odebug << "DEMO: MAC Manufacturer seems to be '" << it.current()->macAddress().manufacturer() << "'" << oendl; + odebug << "DEMO: Manufacturertest1 = '" << OManufacturerDB::instance()->lookupExt( "08:00:87" ) << "'" << oendl; + odebug << "DEMO: Manufacturertest2 = '" << OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) << "'" << oendl; + odebug << "Demo: IPv4 Address is '" << it.current()->ipV4Address() << "'" << oendl; if ( it.current()->isWireless() ) { OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); - qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); - qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); - qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); + odebug << "DEMO: '" << iface->name() << "' seems to feature the wireless extensions." << oendl; + odebug << "DEMO: Current SSID is '" << iface->SSID() << "'" << oendl; + odebug << "DEMO: Antenna is tuned to '" << iface->frequency() << "', that is channel " << iface->channel() << "" << oendl; //if ( iface->mode() == OWirelessNetworkInterface::adhoc ) //{ - //qDebug( "DEMO: Associated AP has MAC Address '%s'", (const char*) iface->associatedAP().toString() ); + //odebug << "DEMO: Associated AP has MAC Address '" << iface->associatedAP().toString() << "'" << oendl; //} /* // nickname - qDebug( "DEMO: Current NickName is '%s'", (const char*) iface->nickName() ); + odebug << "DEMO: Current NickName is '" << iface->nickName() << "'" << oendl; iface->setNickName( "MyNickName" ); if ( iface->nickName() != "MyNickName" ) - qDebug( "DEMO: Warning! Can't change nickname" ); + odebug << "DEMO: Warning! Can't change nickname" << oendl; else - qDebug( "DEMO: Nickname change successful." ); + odebug << "DEMO: Nickname change successful." << oendl; /* // operation mode - qDebug( "DEMO: Current OperationMode is '%s'", (const char*) iface->mode() ); + odebug << "DEMO: Current OperationMode is '" << iface->mode() << "'" << oendl; iface->setMode( "adhoc" ); if ( iface->mode() != "adhoc" ) - qDebug( "DEMO: Warning! Can't change operation mode" ); + odebug << "DEMO: Warning! Can't change operation mode" << oendl; else - qDebug( "DEMO: Operation Mode change successful." ); + odebug << "DEMO: Operation Mode change successful." << oendl; // RF channel - qDebug( "DEMO: Current Channel is '%d'", iface->channel() ); + odebug << "DEMO: Current Channel is '" << iface->channel() << "'" << oendl; iface->setChannel( 1 ); if ( iface->channel() != 1 ) - qDebug( "DEMO: Warning! Can't change RF channel" ); + odebug << "DEMO: Warning! Can't change RF channel" << oendl; else - qDebug( "DEMO: RF channel change successful." ); + odebug << "DEMO: RF channel change successful." << oendl; iface->setMode( "managed" ); */ /* // network scan OStationList* stations = iface->scanNetwork(); if ( stations ) { - qDebug( "DEMO: # of stations around = %d", stations->count() ); + odebug << "DEMO: # of stations around = " << stations->count() << "" << oendl; OStation* station; for ( station = stations->first(); station != 0; station = stations->next() ) { - qDebug( "DEMO: station dump following..." ); + odebug << "DEMO: station dump following..." << oendl; station->dump(); } } else { - qDebug( "DEMO: Warning! Scan didn't work!" ); + odebug << "DEMO: Warning! Scan didn't work!" << oendl; } /* // first some wrong calls to check if this is working iface->setPrivate( "seppel", 10 ); iface->setPrivate( "monitor", 0 ); // now the real deal iface->setPrivate( "monitor", 2, 2, 3 ); // trying to set hw address to 12:34:56:AB:CD:EF /* OMacAddress addr = OMacAddress::fromString( "12:34:56:AB:CD:EF" ); iface->setUp( false ); iface->setMacAddress( addr ); iface->setUp( true ); - qDebug( "DEMO: MAC Address now is '%s'", (const char*) iface->macAddress().toString() ); + odebug << "DEMO: MAC Address now is '" << iface->macAddress().toString() << "'" << oendl; */ // monitor test - - qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); + + odebug << "DEMO: current interface mode is '" << iface->mode() << "'" << oendl; iface->setMode( "monitor" ); - qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); + odebug << "DEMO: current interface mode is '" << iface->mode() << "'" << oendl; sleep( 1 ); iface->setChannel( 1 ); iface->setMode( "managed" ); //sleep( 1 ); - qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); + odebug << "DEMO: current interface mode is '" << iface->mode() << "'" << oendl; /*iface->setMode( "adhoc" ); sleep( 1 ); - qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); + odebug << "DEMO: current interface mode is '" << iface->mode() << "'" << oendl; iface->setMode( "managed" ); sleep( 1 ); - qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() ); + odebug << "DEMO: current interface mode is '" << iface->mode() << "'" << oendl; iface->setMode( "master" ); sleep( 1 ); - qDebug( "DEMO: current interface mode is '%s'", (const char*) iface->mode() );*/ + odebug << "DEMO: current interface mode is '" << iface->mode() << "'" << oendl; */ } ++it; } return 0; } diff --git a/libopie2/examples/opieui/oversatileviewdemo/main.cpp b/libopie2/examples/opieui/oversatileviewdemo/main.cpp index bcda14c..e48395a 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/main.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/main.cpp @@ -1,32 +1,32 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie 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. ** **********************************************************************/ #include "opieuidemo.h" #include <opie2/oapplication.h> using namespace Opie::Core; using namespace Opie::Ui; int main( int argc, char **argv ) { OApplication a( argc, argv, "Opie UI Demo" ); - qDebug( "." ); + odebug << "." << oendl; OpieUIDemo e; - qDebug( "." ); + odebug << "." << oendl; a.showMainWidget(&e); - qDebug( "." ); + odebug << "." << oendl; return a.exec(); } diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp index 754a744..a2cdd5a 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp @@ -1,203 +1,203 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie 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. ** ***********************************************************************/ // Qt #include <qcolor.h> #include <qpopupmenu.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qvbox.h> #include <qstring.h> #include <qstringlist.h> // Qtopia #include <qpe/qpeapplication.h> #include <qpe/global.h> // Opie #include <opie2/odevice.h> #include <opie2/ocompletionbox.h> #include <opie2/olineedit.h> #include <opie2/ocombobox.h> #include <opie2/oeditlistbox.h> #include <opie2/oselector.h> #include <opie2/opopupmenu.h> #include <qtabwidget.h> #include "oversatileviewdemo.h" // Local #include "opieuidemo.h" using namespace Opie::Core; using namespace Opie::Ui; enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector }; OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) : QMainWindow( parent, name, fl ) { QMenuBar* mbar = this->menuBar(); OPopupMenu* demo = new OPopupMenu( this ); demo->setTitle( "Title" ); demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox ); demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit ); demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); mbar->insertItem( "Demonstrate", demo ); build(); } OpieUIDemo::~OpieUIDemo() { } void OpieUIDemo::build() { main = new QTabWidget( this, "tabwidget" ); setCentralWidget( main ); main->show(); main->addTab( new OVersatileViewDemo( main ), "VersatileView" ); } void OpieUIDemo::demo( int d ) { switch (d) { case ocompletionbox: demoOCompletionBox(); break; case olineedit: demoOLineEdit(); break; case ocombobox: demoOComboBox(); break; case oeditlistbox: demoOEditListBox(); break; case oselector: demoOSelector(); break; } } void OpieUIDemo::demoOCompletionBox() { - qDebug( "ocompletionbox" ); + odebug << "ocompletionbox" << oendl; OCompletionBox* box = new OCompletionBox( 0 ); box->insertItem( "This CompletionBox" ); box->insertItem( "Says 'Hello World'" ); box->insertItem( "Here are some" ); box->insertItem( "Additional Items" ); box->insertItem( "Complete Completion Box" ); connect( box, SIGNAL( activated(const QString&) ), this, SLOT( messageBox(const QString&) ) ); box->popup(); } void OpieUIDemo::demoOLineEdit() { - qDebug( "olineedit" ); + odebug << "olineedit" << oendl; OLineEdit *edit = new OLineEdit( 0, "lineedit" ); edit->setCompletionMode( OGlobalSettings::CompletionPopup ); OCompletion* comp = edit->completionObject(); QStringList list; list << "mickeyl@handhelds.org"; list << "mickey@tm.informatik.uni-frankfurt.de"; list << "mickey@vanille.de"; comp->setItems( list ); edit->show(); } void OpieUIDemo::demoOComboBox() { - qDebug( "ocombobox" ); + odebug << "ocombobox" << oendl; OComboBox *combo = new OComboBox( true, 0, "combobox" ); combo->setCompletionMode( OGlobalSettings::CompletionPopup ); OCompletion* comp = combo->completionObject(); QStringList ilist; ilist << "kergoth@handhelds.org"; ilist << "harlekin@handhelds.org"; ilist << "groucho@handhelds.org"; combo->insertStringList( ilist ); QStringList clist; clist << "mickeyl@handhelds.org"; clist << "mickey@tm.informatik.uni-frankfurt.de"; clist << "mickey@vanille.de"; comp->setItems( clist ); combo->show(); } void OpieUIDemo::demoOEditListBox() { - qDebug( "oeditlistbox" ); + odebug << "oeditlistbox" << oendl; OEditListBox* edit = new OEditListBox( "OEditListBox", 0, "editlistbox" ); edit->lineEdit()->setCompletionMode( OGlobalSettings::CompletionPopup ); OCompletion* comp = edit->lineEdit()->completionObject(); QStringList clist; clist << "Completion everywhere"; clist << "Cool Completion everywhere"; clist << "History History History"; comp->setItems( clist ); QStringList list; list << "kergoth@handhelds.org"; list << "harlekin@handhelds.org"; list << "groucho@handhelds.org"; list << "mickeyl@handhelds.org"; edit->insertStringList( list ); edit->show(); } void OpieUIDemo::demoOSelector() { - qDebug( "oselector" ); + odebug << "oselector" << oendl; OHSSelector* sel = new OHSSelector( 0, "gradientselector" ); //#sel->resize( QSize( 200, 30 ) ); //#sel->setColors( QColor( 90, 190, 60 ), QColor( 200, 55, 255 ) ); //#sel->setText( "Dark", "Light" ); sel->show(); } void OpieUIDemo::messageBox( const QString& text ) { QString info; info = "You have selected '" + text + "'"; QMessageBox::information( this, "OpieUIDemo", info ); } diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp index b6d59aa..e8bbdb1 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp @@ -1,160 +1,160 @@ /* This file is part of the Opie Project Copyright (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. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "oversatileviewdemo.h" #include <opie2/oversatileview.h> #include <opie2/oversatileviewitem.h> #include <qstring.h> #include <qpixmap.h> #include <qlistview.h> using namespace Opie::Ui; OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) :QVBox( parent, name, f ) { vv = new OVersatileView( this ); vv->addColumn( "First" ); vv->addColumn( "2nd" ); vv->addColumn( "IIIrd" ); QString counter; QPixmap leaf( "leaf.png" ); QPixmap opened( "folder_opened.png" ); QPixmap closed( "folder_closed.png" ); QPixmap leaf32( "leaf32.png" ); QPixmap opened32( "folder_opened32.png" ); QPixmap closed32( "folder_closed32.png" ); vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); OVersatileViewItem* item; OVersatileViewItem* item2; for ( int i = 0; i < 5; ++i ) { counter.sprintf( "%d", i ); item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); item->setRenameEnabled( true ); item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); item2->setRenameEnabled( true ); } connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); connect( vv, SIGNAL( selectionChanged(OVersatileViewItem*) ), this, SLOT( selectionChanged(OVersatileViewItem*) ) ); connect( vv, SIGNAL( currentChanged(OVersatileViewItem*) ), this, SLOT( currentChanged(OVersatileViewItem*) ) ); connect( vv, SIGNAL( clicked(OVersatileViewItem*) ), this, SLOT( clicked(OVersatileViewItem*) ) ); connect( vv, SIGNAL( pressed(OVersatileViewItem*) ), this, SLOT( pressed(OVersatileViewItem*) ) ); connect( vv, SIGNAL( doubleClicked(OVersatileViewItem*) ), this, SLOT( doubleClicked(OVersatileViewItem*) ) ); connect( vv, SIGNAL( returnPressed(OVersatileViewItem*) ), this, SLOT( returnPressed(OVersatileViewItem*) ) ); connect( vv, SIGNAL( onItem(OVersatileViewItem*) ), this, SLOT( onItem(OVersatileViewItem*) ) ); connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); connect( vv, SIGNAL( expanded(OVersatileViewItem*) ), this, SLOT( expanded(OVersatileViewItem*) ) ); connect( vv, SIGNAL( collapsed(OVersatileViewItem*) ), this, SLOT( collapsed(OVersatileViewItem*) ) ); connect( vv, SIGNAL( moved() ), this, SLOT( moved() ) ); connect( vv, SIGNAL( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ) ); } OVersatileViewDemo::~OVersatileViewDemo() { } void OVersatileViewDemo::selectionChanged() { - qDebug( "received signal selectionChanged()" ); + odebug << "received signal selectionChanged()" << oendl; } void OVersatileViewDemo::selectionChanged( OVersatileViewItem * item ) { - qDebug( "received signal selectionChanged(OVersatileViewItem*)" ); + odebug << "received signal selectionChanged(OVersatileViewItem*)" << oendl; } void OVersatileViewDemo::currentChanged( OVersatileViewItem * item ) { - qDebug( "received signal currentChanged( OVersatileViewItem * )" ); + odebug << "received signal currentChanged( OVersatileViewItem * )" << oendl; } void OVersatileViewDemo::clicked( OVersatileViewItem * item ) { - qDebug( "received signal clicked( OVersatileViewItem * )" ); + odebug << "received signal clicked( OVersatileViewItem * )" << oendl; } void OVersatileViewDemo::pressed( OVersatileViewItem * item ) { - qDebug( "received signal pressed( OVersatileViewItem * )" ); + odebug << "received signal pressed( OVersatileViewItem * )" << oendl; } void OVersatileViewDemo::doubleClicked( OVersatileViewItem *item ) { - qDebug( "received signal doubleClicked( OVersatileViewItem *item )" ); + odebug << "received signal doubleClicked( OVersatileViewItem *item )" << oendl; } void OVersatileViewDemo::returnPressed( OVersatileViewItem *item ) { - qDebug( "received signal returnPressed( OVersatileViewItem *item )" ); + odebug << "received signal returnPressed( OVersatileViewItem *item )" << oendl; } void OVersatileViewDemo::onItem( OVersatileViewItem *item ) { - qDebug( "received signal onItem( OVersatileViewItem *item )" ); + odebug << "received signal onItem( OVersatileViewItem *item )" << oendl; } void OVersatileViewDemo::onViewport() { - qDebug( "received signal onViewport()" ); + odebug << "received signal onViewport()" << oendl; } void OVersatileViewDemo::expanded( OVersatileViewItem *item ) { - qDebug( "received signal expanded( OVersatileViewItem *item )" ); + odebug << "received signal expanded( OVersatileViewItem *item )" << oendl; } void OVersatileViewDemo::collapsed( OVersatileViewItem *item ) { - qDebug( "received signal collapsed( OVersatileViewItem *item )" ); + odebug << "received signal collapsed( OVersatileViewItem *item )" << oendl; } void OVersatileViewDemo::moved() { - qDebug( "received signal moved( OVersatileViewItem *item )" ); + odebug << "received signal moved( OVersatileViewItem *item )" << oendl; } void OVersatileViewDemo::contextMenuRequested( OVersatileViewItem *item, const QPoint& pos, int col ) { - qDebug( "received signal contextMenuRequested( OVersatileViewItem *item )" ); + odebug << "received signal contextMenuRequested( OVersatileViewItem *item )" << oendl; } |