summaryrefslogtreecommitdiff
path: root/libopie2/examples
Unidiff
Diffstat (limited to 'libopie2/examples') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp2
-rw-r--r--libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp2
-rw-r--r--libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp4
-rw-r--r--libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp4
-rw-r--r--libopie2/examples/opiedb/sqltest/spaltenweise.cpp10
-rw-r--r--libopie2/examples/opiedb/sqltest/spaltenweise.pro2
-rw-r--r--libopie2/examples/opiedb/sqltest/zeilenweise.cpp10
-rw-r--r--libopie2/examples/opiedb/sqltest/zeilenweise.pro2
-rw-r--r--libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp2
-rw-r--r--libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp2
-rw-r--r--libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp2
-rw-r--r--libopie2/examples/opieui/olistviewdemo/main.cpp3
-rw-r--r--libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp2
-rw-r--r--libopie2/examples/opieui/olistviewdemo/olistviewdemo.h2
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_example.cpp3
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_example.h1
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp8
-rw-r--r--libopie2/examples/opieui/osplitter_example/osplitter_mail.h6
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/main.cpp3
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp8
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h6
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp2
-rw-r--r--libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h26
-rw-r--r--libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp2
-rw-r--r--libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h3
25 files changed, 75 insertions, 42 deletions
diff --git a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp
index a3f8e10..6712870 100644
--- a/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp
+++ b/libopie2/examples/opiecore/oconfigdemo/oconfigdemo.cpp
@@ -1,28 +1,30 @@
1#include <opie2/oapplication.h> 1#include <opie2/oapplication.h>
2#include <opie2/oconfig.h> 2#include <opie2/oconfig.h>
3#include <qpe/config.h> 3#include <qpe/config.h>
4 4
5using namespace Opie::Core;
6
5int main( int argc, char** argv ) 7int main( int argc, char** argv )
6{ 8{
7 OApplication* app = new OApplication( argc, argv, "MyConfigDemoApplication" ); 9 OApplication* app = new OApplication( argc, argv, "MyConfigDemoApplication" );
8 10
9 OConfigGroupSaver c1( app->config(), "MyGroup" ); 11 OConfigGroupSaver c1( app->config(), "MyGroup" );
10 app->config()->writeEntry( "AnEntry", "InMyGroup" ); 12 app->config()->writeEntry( "AnEntry", "InMyGroup" );
11 { 13 {
12 OConfigGroupSaver c2( c1.config(), "AnotherGroup" ); 14 OConfigGroupSaver c2( c1.config(), "AnotherGroup" );
13 app->config()->writeEntry( "AnEntry", "InAnotherGroup" ); 15 app->config()->writeEntry( "AnEntry", "InAnotherGroup" );
14 } // closing the scope returns to the last group 16 } // closing the scope returns to the last group
15 17
16 app->config()->writeEntry( "AnotherEntry", "InMyGroup" ); 18 app->config()->writeEntry( "AnotherEntry", "InMyGroup" );
17 19
18 // do more stuff ... 20 // do more stuff ...
19 21
20 // in this (special) case it is necessary to manually call OConfig::write() (see below) 22 // in this (special) case it is necessary to manually call OConfig::write() (see below)
21 app->config()->write(); 23 app->config()->write();
22 24
23 // can't delete the app when using the OConfigGroupSaver on top level scope, 25 // can't delete the app when using the OConfigGroupSaver on top level scope,
24 // because the destructor of the OConfigGroupSaver needs an application object 26 // because the destructor of the OConfigGroupSaver needs an application object
25 //delete app; // destructor deletes config which writes changes back to disk 27 //delete app; // destructor deletes config which writes changes back to disk
26 28
27 return 0; 29 return 0;
28 30
diff --git a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp
index e8bf04f..0b8e1fe 100644
--- a/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp
+++ b/libopie2/examples/opiecore/odebugdemo/odebugdemo.cpp
@@ -1,43 +1,45 @@
1/* QT */ 1/* QT */
2 2
3#include <qvbox.h> 3#include <qvbox.h>
4#include <qhbox.h> 4#include <qhbox.h>
5#include <qvbuttongroup.h> 5#include <qvbuttongroup.h>
6#include <qhbuttongroup.h> 6#include <qhbuttongroup.h>
7#include <qlineedit.h> 7#include <qlineedit.h>
8#include <qradiobutton.h> 8#include <qradiobutton.h>
9#include <qpushbutton.h> 9#include <qpushbutton.h>
10 10
11/* OPIE */ 11/* OPIE */
12 12
13#include <qpe/config.h> 13#include <qpe/config.h>
14 14
15#include <opie2/odebug.h> 15#include <opie2/odebug.h>
16#include <opie2/oapplication.h> 16#include <opie2/oapplication.h>
17#include <opie2/oglobal.h> 17#include <opie2/oglobal.h>
18#include <opie2/oglobalsettings.h> 18#include <opie2/oglobalsettings.h>
19 19
20using namespace Opie::Core;
21
20class DemoApp : public OApplication 22class DemoApp : public OApplication
21{ 23{
22Q_OBJECT 24Q_OBJECT
23public: 25public:
24 DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" ) 26 DemoApp( int argc, char** argv ) : OApplication( argc, argv, "libopie2 debug demo" )
25 { 27 {
26 // you have access to your OApplication object via oApp 28 // you have access to your OApplication object via oApp
27 qDebug( "Process-wide OApplication object @ %0x", oApp ); 29 qDebug( "Process-wide OApplication object @ %0x", oApp );
28 30
29 // you have access to global settings via OGlobalSettings 31 // you have access to global settings via OGlobalSettings
30 int mode = OGlobalSettings::debugMode(); 32 int mode = OGlobalSettings::debugMode();
31 33
32 QVBox* vbox = new QVBox(); 34 QVBox* vbox = new QVBox();
33 setMainWidget( vbox ); 35 setMainWidget( vbox );
34 36
35 g = new QVButtonGroup( "Output Strategy", vbox ); 37 g = new QVButtonGroup( "Output Strategy", vbox );
36 QRadioButton* r0 = new QRadioButton( "file", g ); 38 QRadioButton* r0 = new QRadioButton( "file", g );
37 QRadioButton* r1 = new QRadioButton( "messagebox", g ); 39 QRadioButton* r1 = new QRadioButton( "messagebox", g );
38 QRadioButton* r2 = new QRadioButton( "stderr", g ); 40 QRadioButton* r2 = new QRadioButton( "stderr", g );
39 QRadioButton* r3 = new QRadioButton( "syslog", g ); 41 QRadioButton* r3 = new QRadioButton( "syslog", g );
40 QRadioButton* r4 = new QRadioButton( "socket", g ); 42 QRadioButton* r4 = new QRadioButton( "socket", g );
41 g->insert( r0, 0 ); 43 g->insert( r0, 0 );
42 g->insert( r1, 1 ); 44 g->insert( r1, 1 );
43 g->insert( r2, 2 ); 45 g->insert( r2, 2 );
diff --git a/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp b/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp
index 2f5220b..56f1a0b 100644
--- a/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp
+++ b/libopie2/examples/opiecore/oglobalsettingsdemo/oglobalsettingsdemo.cpp
@@ -1,13 +1,15 @@
1#include <opie2/oglobalsettings.h> 1#include <opie2/oglobalsettings.h>
2#include <iostream.h> 2#include <iostream>
3
4using namespace Opie::Core;
3 5
4int main( int argc, char** argv ) 6int main( int argc, char** argv )
5{ 7{
6 printf( "current debugmode seems to be '%d'\n", OGlobalSettings::debugMode() ); 8 printf( "current debugmode seems to be '%d'\n", OGlobalSettings::debugMode() );
7 printf( "output information for this mode is '%s'\n", (const char*) OGlobalSettings::debugOutput() ); 9 printf( "output information for this mode is '%s'\n", (const char*) OGlobalSettings::debugOutput() );
8 10
9 return 0; 11 return 0;
10 12
11} 13}
12 14
13//#include "moc/oconfigdemo.moc" 15//#include "moc/oconfigdemo.moc"
diff --git a/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp b/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp
index 0abf53e..2193565 100644
--- a/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp
+++ b/libopie2/examples/opiecore/oprocessdemo/oprocessdemo.cpp
@@ -1,11 +1,13 @@
1#include <opie2/oprocess.h> 1#include <opie2/oprocess.h>
2#include <iostream.h> 2#include <iostream>
3
4using namespace Opie::Core;
3 5
4int main( int argc, char** argv ) 6int main( int argc, char** argv )
5{ 7{
6 printf( "my own PID seems to be '%d'\n", OProcess::processPID( "oprocessdemo" ) ); 8 printf( "my own PID seems to be '%d'\n", OProcess::processPID( "oprocessdemo" ) );
7 printf( "the PID of process 'Mickey' seems to be '%d'\n\n", OProcess::processPID( "Mickey" ) ); 9 printf( "the PID of process 'Mickey' seems to be '%d'\n\n", OProcess::processPID( "Mickey" ) );
8 10
9 return 0; 11 return 0;
10} 12}
11 13
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp
index 8790cdd..e1a4d5d 100644
--- a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp
+++ b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp
@@ -1,31 +1,33 @@
1#include <qdir.h> 1#include <qdir.h>
2 2
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#include "../osqlmanager.h" 4#include <opie2/osqlmanager.h>
5#include "../osqlquery.h" 5#include <opie2/osqlquery.h>
6#include "../osqldriver.h" 6#include <opie2/osqldriver.h>
7#include "../osqlresult.h" 7#include <opie2/osqlresult.h>
8
9using namespace Opie::DB;
8 10
9int main( int argc, char* argv[] ) { 11int main( int argc, char* argv[] ) {
10 12
11 QPEApplication app( argc, argv ); 13 QPEApplication app( argc, argv );
12 OSQLManager man; 14 OSQLManager man;
13 man.registerPath( QDir::currentDirPath() ); 15 man.registerPath( QDir::currentDirPath() );
14 OSQLBackEnd::ValueList list = man.queryBackEnd(); 16 OSQLBackEnd::ValueList list = man.queryBackEnd();
15 17
16 OSQLDriver *driver = man.standard(); 18 OSQLDriver *driver = man.standard();
17 qWarning("testmain" + driver->id() ); 19 qWarning("testmain" + driver->id() );
18 driver->setUrl("/home/ich/spaltenweise"); 20 driver->setUrl("/home/ich/spaltenweise");
19 if ( driver->open() ) { 21 if ( driver->open() ) {
20 qWarning("could open"); 22 qWarning("could open");
21 }else 23 }else
22 qWarning("wasn't able to open"); 24 qWarning("wasn't able to open");
23 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" 25 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist("
24 "uid,categories,completed," 26 "uid,categories,completed,"
25 "progress,summary,HasDate," 27 "progress,summary,HasDate,"
26 "DateDay,DateMonth,DateYear," 28 "DateDay,DateMonth,DateYear,"
27 "priority,description)" ); 29 "priority,description)" );
28 30
29 OSQLResult res = driver->query( raw ); 31 OSQLResult res = driver->query( raw );
30 delete raw; 32 delete raw;
31 for (int i = 0; i< 10000; i++ ) { 33 for (int i = 0; i< 10000; i++ ) {
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.pro b/libopie2/examples/opiedb/sqltest/spaltenweise.pro
index f54fada..3cab802 100644
--- a/libopie2/examples/opiedb/sqltest/spaltenweise.pro
+++ b/libopie2/examples/opiedb/sqltest/spaltenweise.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = 3 HEADERS =
4 SOURCES = spaltenweise.cpp 4 SOURCES = spaltenweise.cpp
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 6 DEPENDPATH+= $(OPIEDIR)/include
7LIBS += -lqpe -lopiesql 7LIBS += -lqpe -lopiedb2
8 TARGET = spaltenweise 8 TARGET = spaltenweise
9 9
10 10
11 11
12 12
13include ( $(OPIEDIR)/include.pro ) 13include ( $(OPIEDIR)/include.pro )
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp
index e538c9f..2d11ac5 100644
--- a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp
+++ b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp
@@ -1,31 +1,33 @@
1#include <qdir.h> 1#include <qdir.h>
2 2
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#include "../osqlmanager.h" 4#include <opie2/osqlmanager.h>
5#include "../osqlquery.h" 5#include <opie2/osqlquery.h>
6#include "../osqldriver.h" 6#include <opie2/osqldriver.h>
7#include "../osqlresult.h" 7#include <opie2/osqlresult.h>
8
9using namespace Opie::DB;
8 10
9int main( int argc, char* argv[] ) { 11int main( int argc, char* argv[] ) {
10 12
11QPEApplication app( argc, argv ); 13QPEApplication app( argc, argv );
12OSQLManager man; 14OSQLManager man;
13man.registerPath( QDir::currentDirPath() ); 15man.registerPath( QDir::currentDirPath() );
14OSQLBackEnd::ValueList list = man.queryBackEnd(); 16OSQLBackEnd::ValueList list = man.queryBackEnd();
15 17
16OSQLDriver *driver = man.standard(); 18OSQLDriver *driver = man.standard();
17 qWarning("testmain" + driver->id() ); 19 qWarning("testmain" + driver->id() );
18 driver->setUrl("/home/ich/zeilenweise"); 20 driver->setUrl("/home/ich/zeilenweise");
19 if ( driver->open() ) { 21 if ( driver->open() ) {
20 qWarning("could open"); 22 qWarning("could open");
21 }else 23 }else
22 qWarning("wasn't able to open"); 24 qWarning("wasn't able to open");
23 OSQLRawQuery raw2("BEGIN TRANSACTION"); 25 OSQLRawQuery raw2("BEGIN TRANSACTION");
24 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); 26 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)");
25 OSQLResult res = driver->query( &raw2 ); 27 OSQLResult res = driver->query( &raw2 );
26 res = driver->query( raw ); 28 res = driver->query( raw );
27 delete raw; 29 delete raw;
28 for (int i = 0; i< 10000; i++ ) { 30 for (int i = 0; i< 10000; i++ ) {
29 int uid = i; 31 int uid = i;
30 OSQLRawQuery *raw; 32 OSQLRawQuery *raw;
31 raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')"); 33 raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')");
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.pro b/libopie2/examples/opiedb/sqltest/zeilenweise.pro
index e5cfcc7..6952921 100644
--- a/libopie2/examples/opiedb/sqltest/zeilenweise.pro
+++ b/libopie2/examples/opiedb/sqltest/zeilenweise.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = 3 HEADERS =
4 SOURCES = zeilenweise.cpp 4 SOURCES = zeilenweise.cpp
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 6 DEPENDPATH+= $(OPIEDIR)/include
7LIBS += -lqpe -lopiesql 7LIBS += -lqpe -lopiedb2
8 TARGET = zeilenweise 8 TARGET = zeilenweise
9 9
10 10
11 11
12 12
13include ( $(OPIEDIR)/include.pro ) 13include ( $(OPIEDIR)/include.pro )
diff --git a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
index 79bf327..8d421fd 100644
--- a/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
+++ b/libopie2/examples/opiemm/osoundsystemdemo/osoundsystemdemo.cpp
@@ -1,26 +1,28 @@
1#include <opie2/osoundsystem.h> 1#include <opie2/osoundsystem.h>
2 2
3using namespace Opie::MM;
4
3int main( int argc, char** argv ) 5int main( int argc, char** argv )
4{ 6{
5 qDebug( "OPIE Sound System Demo" ); 7 qDebug( "OPIE Sound System Demo" );
6 8
7 OSoundSystem* sound = OSoundSystem::instance(); 9 OSoundSystem* sound = OSoundSystem::instance();
8 10
9 OSoundSystem::CardIterator it = sound->iterator(); 11 OSoundSystem::CardIterator it = sound->iterator();
10/* 12/*
11 while ( it.current() ) 13 while ( it.current() )
12 { 14 {
13 qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() ); 15 qDebug( "DEMO: OSoundSystem contains Interface '%s'", (const char*) it.current()->name() );
14 ++it; 16 ++it;
15 } 17 }
16 18
17*/ 19*/
18 OSoundCard* card = it.current(); 20 OSoundCard* card = it.current();
19 21
20 OMixerInterface* mixer = card->mixer(); 22 OMixerInterface* mixer = card->mixer();
21 23
22 QStringList channels = mixer->allChannels(); 24 QStringList channels = mixer->allChannels();
23 25
24 for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it ) 26 for ( QStringList::Iterator it = channels.begin(); it != channels.end(); ++it )
25 { 27 {
26 qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it ); 28 qDebug( "OSSDEMO: Mixer has channel %s", (const char*) *it );
diff --git a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
index eb2e8e8..f1966c1 100644
--- a/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
+++ b/libopie2/examples/opienet/miniwellenreiter/miniwellenreiter.cpp
@@ -1,35 +1,37 @@
1#include <qdict.h> 1#include <qdict.h>
2#include <qsocketnotifier.h> 2#include <qsocketnotifier.h>
3#include <qstring.h> 3#include <qstring.h>
4#include <opie2/onetwork.h> 4#include <opie2/onetwork.h>
5#include <qapplication.h> 5#include <qapplication.h>
6#include <opie2/opcap.h> 6#include <opie2/opcap.h>
7#include <cerrno> 7#include <cerrno>
8#include <cstdio> 8#include <cstdio>
9#include <cstdlib> 9#include <cstdlib>
10#include <cstring> 10#include <cstring>
11 11
12
13using namespace Opie::Net;
12//======================== Station help class =============================== 14//======================== Station help class ===============================
13 15
14class Station 16class Station
15{ 17{
16 public: 18 public:
17 Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {}; 19 Station( QString t, int c, bool w ) : type(t), channel(c), wep(w), beacons(1) {};
18 ~Station() {}; 20 ~Station() {};
19 21
20 QString type; 22 QString type;
21 int channel; 23 int channel;
22 bool wep; 24 bool wep;
23 int beacons; 25 int beacons;
24}; 26};
25 27
26QDict<Station> stations; 28QDict<Station> stations;
27 29
28//======================== Application class =============================== 30//======================== Application class ===============================
29 31
30class Wellenreiter : public QApplication 32class Wellenreiter : public QApplication
31{ 33{
32Q_OBJECT 34Q_OBJECT
33public: 35public:
34 Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 ) 36 Wellenreiter( int argc, char** argv ) : QApplication( argc, argv ), channel( 1 )
35 { 37 {
diff --git a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
index 4763316..4f8af60 100644
--- a/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
+++ b/libopie2/examples/opienet/onetworkdemo/onetworkdemo.cpp
@@ -1,30 +1,32 @@
1#include <opie2/onetwork.h> 1#include <opie2/onetwork.h>
2#include <opie2/ostation.h> 2#include <opie2/ostation.h>
3#include <opie2/omanufacturerdb.h> 3#include <opie2/omanufacturerdb.h>
4 4
5#include <unistd.h> 5#include <unistd.h>
6 6
7using namespace Opie::Net;
8
7int main( int argc, char** argv ) 9int main( int argc, char** argv )
8{ 10{
9 qDebug( "OPIE Network Demo" ); 11 qDebug( "OPIE Network Demo" );
10 12
11 ONetwork* net = ONetwork::instance(); 13 ONetwork* net = ONetwork::instance();
12 14
13 ONetwork::InterfaceIterator it = net->iterator(); 15 ONetwork::InterfaceIterator it = net->iterator();
14 16
15 while ( it.current() ) 17 while ( it.current() )
16 { 18 {
17 qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() ); 19 qDebug( "DEMO: ONetwork contains Interface '%s'", (const char*) it.current()->name() );
18 qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() ); 20 qDebug( "DEMO: Datalink code is '%d'", it.current()->dataLinkType() );
19 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() ); 21 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString() );
20 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) ); 22 qDebug( "DEMO: MAC Address is '%s'", (const char*) it.current()->macAddress().toString(true) );
21 qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() ); 23 qDebug( "DEMO: MAC Manufacturer seems to be '%s'", (const char*) it.current()->macAddress().manufacturer() );
22 qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) ); 24 qDebug( "DEMO: Manufacturertest1 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "08:00:87" ) );
23 qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) ); 25 qDebug( "DEMO: Manufacturertest2 = '%s'", (const char*) OManufacturerDB::instance()->lookupExt( "E2:0C:0F" ) );
24 qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() ); 26 qDebug( "Demo: IPv4 Address is '%s'", (const char*) it.current()->ipV4Address() );
25 if ( it.current()->isWireless() ) 27 if ( it.current()->isWireless() )
26 { 28 {
27 OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() ); 29 OWirelessNetworkInterface* iface = static_cast<OWirelessNetworkInterface*>( it.current() );
28 qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() ); 30 qDebug( "DEMO: '%s' seems to feature the wireless extensions.", (const char*) iface->name() );
29 qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() ); 31 qDebug( "DEMO: Current SSID is '%s'", (const char*) iface->SSID() );
30 qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() ); 32 qDebug( "DEMO: Antenna is tuned to '%f', that is channel %d", iface->frequency(), iface->channel() );
diff --git a/libopie2/examples/opieui/olistviewdemo/main.cpp b/libopie2/examples/opieui/olistviewdemo/main.cpp
index a93f361..cd49c28 100644
--- a/libopie2/examples/opieui/olistviewdemo/main.cpp
+++ b/libopie2/examples/opieui/olistviewdemo/main.cpp
@@ -1,26 +1,29 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "olistviewdemo.h" 16#include "olistviewdemo.h"
17#include <opie2/oapplication.h> 17#include <opie2/oapplication.h>
18 18
19using namespace Opie::Ui;
20using namespace Opie::Core;
21
19int main( int argc, char **argv ) 22int main( int argc, char **argv )
20{ 23{
21 OApplication a( argc, argv, "OListViewDemo" ); 24 OApplication a( argc, argv, "OListViewDemo" );
22 OListViewDemo e; 25 OListViewDemo e;
23 a.showMainWidget(&e); 26 a.showMainWidget(&e);
24 return a.exec(); 27 return a.exec();
25} 28}
26 29
diff --git a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp
index 5ba7b69..7834b3b 100644
--- a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp
+++ b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.cpp
@@ -16,48 +16,50 @@
16    .i_,=:_.      -<s. This program is distributed in the hope that 16    .i_,=:_.      -<s. This program is distributed in the hope that
17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
18    : ..    .:,     . . . without even the implied warranty of 18    : ..    .:,     . . . without even the implied warranty of
19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
21..}^=.=       =       ; Library General Public License for more 21..}^=.=       =       ; Library General Public License for more
22++=   -.     .`     .: details. 22++=   -.     .`     .: details.
23 :     =  ...= . :.=- 23 :     =  ...= . :.=-
24 -.   .:....=;==+<; You should have received a copy of the GNU 24 -.   .:....=;==+<; You should have received a copy of the GNU
25  -_. . .   )=.  = Library General Public License along with 25  -_. . .   )=.  = Library General Public License along with
26    --        :-=` this library; see the file COPYING.LIB. 26    --        :-=` this library; see the file COPYING.LIB.
27 If not, write to the Free Software Foundation, 27 If not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330, 28 Inc., 59 Temple Place - Suite 330,
29 Boston, MA 02111-1307, USA. 29 Boston, MA 02111-1307, USA.
30 30
31*/ 31*/
32 32
33#include "olistviewdemo.h" 33#include "olistviewdemo.h"
34#include <opie2/olistview.h> 34#include <opie2/olistview.h>
35 35
36#include <qstring.h> 36#include <qstring.h>
37#include <qpixmap.h> 37#include <qpixmap.h>
38#include <qlistview.h> 38#include <qlistview.h>
39 39
40using namespace Opie::Ui;
41
40OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f ) 42OListViewDemo::OListViewDemo( QWidget* parent, const char* name, WFlags f )
41 :QVBox( parent, name, f ) 43 :QVBox( parent, name, f )
42{ 44{
43 lv = new ONamedListView( this ); 45 lv = new ONamedListView( this );
44 lv->setRootIsDecorated( true ); 46 lv->setRootIsDecorated( true );
45 lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) ); 47 lv->addColumns( QStringList::split( ' ', "Column1 Column2 Column3 Column4" ) );
46 48
47 ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); 49 ONamedListViewItem* item = new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
48 item->setText( "Column2", "ModifiedText" ); 50 item->setText( "Column2", "ModifiedText" );
49 item->setText( "Column5", "ThisColumnDoesNotExits" ); 51 item->setText( "Column5", "ThisColumnDoesNotExits" );
50 52
51 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); 53 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
52 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); 54 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
53 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) ); 55 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Minni" ) );
54 item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) ); 56 item = new ONamedListViewItem( lv, QStringList::split( ' ', "XXX YYY ZZZ ***" ) );
55 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); 57 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
56 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) ); 58 new ONamedListViewItem( lv, QStringList::split( ' ', "Text1 Text2 Text3 Text4" ) );
57 59
58 new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); 60 new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) );
59 new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); 61 new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) );
60 new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) ); 62 new ONamedListViewItem( item, QStringList::split( ' ', "SubText1 Text2 Text3 Text4" ) );
61 item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) ); 63 item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComes" ) );
62 item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) ); 64 item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 HereItComesSoon" ) );
63 item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) ); 65 item = new ONamedListViewItem( item, QStringList::split( ' ', "Text1 Text2 Text3 Mickey" ) );
diff --git a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h
index 8a5986a..0b5c498 100644
--- a/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h
+++ b/libopie2/examples/opieui/olistviewdemo/olistviewdemo.h
@@ -23,29 +23,29 @@
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef OLISTVIEWDEMO_H 32#ifndef OLISTVIEWDEMO_H
33#define OLISTVIEWDEMO_H 33#define OLISTVIEWDEMO_H
34 34
35#include <qvbox.h> 35#include <qvbox.h>
36#include <opie2/olistview.h> 36#include <opie2/olistview.h>
37 37
38class OListViewDemo: public QVBox 38class OListViewDemo: public QVBox
39{ 39{
40 Q_OBJECT 40 Q_OBJECT
41 41
42 public: 42 public:
43 OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); 43 OListViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 );
44 virtual ~OListViewDemo(); 44 virtual ~OListViewDemo();
45 45
46 private: 46 private:
47 ONamedListView* lv; 47 Opie::Ui::ONamedListView* lv;
48 48
49}; 49};
50 50
51#endif 51#endif
diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp b/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp
index 7ba0f0d..4a1468d 100644
--- a/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp
+++ b/libopie2/examples/opieui/osplitter_example/osplitter_example.cpp
@@ -1,32 +1,33 @@
1#include "osplitter_example.h" 1#include "osplitter_example.h"
2 2
3/* OPIE */ 3/* OPIE */
4 4
5#include <opie2/osplitter.h> 5#include <opie2/osplitter.h>
6#include <opie2/ofileselector.h>
6#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
7#include <opie2/oapplicationfactory.h> 8#include <opie2/oapplicationfactory.h>
8 9
9/* QT*/ 10/* QT*/
10#include <qdir.h> 11#include <qdir.h>
11#include <qlayout.h> 12#include <qlayout.h>
12 13
13using namespace Opie; 14using namespace Opie::Ui;
14 15
15OPIE_EXPORT_APP( OApplicationFactory<OSplitterExample> ) 16OPIE_EXPORT_APP( OApplicationFactory<OSplitterExample> )
16 17
17OSplitterExample::OSplitterExample( QWidget *w,const char* n,WFlags f ) 18OSplitterExample::OSplitterExample( QWidget *w,const char* n,WFlags f )
18 : QWidget( w, n, f ){ 19 : QWidget( w, n, f ){
19 QVBoxLayout * lay = new QVBoxLayout(this); 20 QVBoxLayout * lay = new QVBoxLayout(this);
20 OSplitter * splitter = new OSplitter( Horizontal, this ); 21 OSplitter * splitter = new OSplitter( Horizontal, this );
21 lay->addWidget( splitter ); 22 lay->addWidget( splitter );
22 23
23 OFileSelector *selector = new OFileSelector( splitter, OFileSelector::FileSelector, 24 OFileSelector *selector = new OFileSelector( splitter, OFileSelector::FileSelector,
24 OFileSelector::Normal, QDir::homeDirPath(), 25 OFileSelector::Normal, QDir::homeDirPath(),
25 QString::null ); 26 QString::null );
26 splitter->addWidget( selector, "zoom", tr("Selector 1") ); 27 splitter->addWidget( selector, "zoom", tr("Selector 1") );
27 28
28 selector = new OFileSelector( splitter, OFileSelector::FileSelector, OFileSelector::Normal, 29 selector = new OFileSelector( splitter, OFileSelector::FileSelector, OFileSelector::Normal,
29 QDir::homeDirPath(), QString::null ); 30 QDir::homeDirPath(), QString::null );
30 splitter->addWidget( selector, "zoom", tr("Selector 2") ); 31 splitter->addWidget( selector, "zoom", tr("Selector 2") );
31 32
32} 33}
diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_example.h b/libopie2/examples/opieui/osplitter_example/osplitter_example.h
index 176ad62..0cf28aa 100644
--- a/libopie2/examples/opieui/osplitter_example/osplitter_example.h
+++ b/libopie2/examples/opieui/osplitter_example/osplitter_example.h
@@ -1,20 +1,19 @@
1/* 1/*
2 * May be used, copied and modified wihtout any limitation 2 * May be used, copied and modified wihtout any limitation
3 */ 3 */
4 4
5#ifndef OSPlitter_EXAMPLE_H 5#ifndef OSPlitter_EXAMPLE_H
6#define OSPlitter_EXAMPLE_H 6#define OSPlitter_EXAMPLE_H
7 7
8#include <qvbox.h> 8#include <qvbox.h>
9#include <opie2/ofileselector.h>
10 9
11class OSplitterExample : public QWidget { 10class OSplitterExample : public QWidget {
12 Q_OBJECT 11 Q_OBJECT
13public: 12public:
14 static QString appName() { return QString::fromLatin1("osplitter_example"); } 13 static QString appName() { return QString::fromLatin1("osplitter_example"); }
15 OSplitterExample( QWidget *parent, const char* name, WFlags fl ); 14 OSplitterExample( QWidget *parent, const char* name, WFlags fl );
16 15
17}; 16};
18 17
19 18
20#endif 19#endif
diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp b/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp
index 789496c..6443dc0 100644
--- a/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp
+++ b/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp
@@ -1,58 +1,60 @@
1 1
2#include <qstring.h> 2#include <qstring.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qheader.h> 4#include <qheader.h>
5#include <qlayout.h> 5#include <qlayout.h>
6 6
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8 8
9#include <opie2/oapplicationfactory.h> 9#include <opie2/oapplicationfactory.h>
10#include "osplitter_mail.h" 10#include "osplitter_mail.h"
11 11
12using namespace Opie::Ui;
13
12OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) 14OPIE_EXPORT_APP( OApplicationFactory<ListViews> )
13 15
14class Folder { 16class Folder {
15 int dummy; 17 int dummy;
16}; 18};
17 19
18// ----------------------------------------------------------------- 20// -----------------------------------------------------------------
19 21
20ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) 22ListViews::ListViews( QWidget* p, const char* name, WFlags fl )
21 : QWidget( p, name, fl ) { 23 : QWidget( p, name, fl ) {
22 qApp->installEventFilter( this ); 24 qApp->installEventFilter( this );
23 m_lstFolders.setAutoDelete( true ); 25 m_lstFolders.setAutoDelete( true );
24 QHBoxLayout *lay = new QHBoxLayout(this); 26 QHBoxLayout *lay = new QHBoxLayout(this);
25 27
26 m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); 28 m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" );
27 lay->addWidget( m_splitter ); 29 lay->addWidget( m_splitter );
28 connect(m_splitter, SIGNAL(sizeChange(bool,const QSize&) ), 30 connect(m_splitter, SIGNAL(sizeChanged(bool,Orientation) ),
29 this, SLOT(slotSizeChange(bool,const QSize&) ) ); 31 this, SLOT(slotSizeChange(bool,Orientation) ) );
30 32
31 m_overview = new QListView( m_splitter ); 33 m_overview = new QListView( m_splitter );
32 m_overview->header()->setClickEnabled( FALSE ); 34 m_overview->header()->setClickEnabled( FALSE );
33 m_overview->addColumn( tr("Folder") ); 35 m_overview->addColumn( tr("Folder") );
34 m_overview->setMaximumWidth( 200 ); 36// m_overview->setMaximumWidth( 200 );
35 m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); 37 m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") );
36 m_splitter->setSizeChange( 300 ); 38 m_splitter->setSizeChange( 300 );
37 39
38 /* OSplitter starts with the small mode */ 40 /* OSplitter starts with the small mode */
39 m_messages = 0; 41 m_messages = 0;
40 m_message = m_attach = 0; 42 m_message = m_attach = 0;
41 43
42 splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); 44 splitti = new OSplitter( Vertical, m_splitter, "Splitti2" );
43 splitti->setSizeChange( 300 ); 45 splitti->setSizeChange( 300 );
44 splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); 46 splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
45 47
46 QLabel *lbl = new QLabel(splitti); 48 QLabel *lbl = new QLabel(splitti);
47 lbl->setTextFormat ( Qt::RichText ); 49 lbl->setTextFormat ( Qt::RichText );
48 lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>"); 50 lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>");
49 51
50 m_messages = new QListView( splitti ); 52 m_messages = new QListView( splitti );
51 m_messages->addColumn(" Messages "); 53 m_messages->addColumn(" Messages ");
52 54
53 folder1 = new QListView( splitti ); 55 folder1 = new QListView( splitti );
54 folder1->addColumn( "Messages 2 " ); 56 folder1->addColumn( "Messages 2 " );
55 57
56 splitti->addWidget(m_messages, "mail", tr("Mails") ); 58 splitti->addWidget(m_messages, "mail", tr("Mails") );
57 splitti->addWidget(folder1, "folder", tr("Folder") ); 59 splitti->addWidget(folder1, "folder", tr("Folder") );
58 splitti->addWidget( lbl, "logo", tr("Label") ); 60 splitti->addWidget( lbl, "logo", tr("Label") );
diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_mail.h b/libopie2/examples/opieui/osplitter_example/osplitter_mail.h
index 1447a92..67961fb 100644
--- a/libopie2/examples/opieui/osplitter_example/osplitter_mail.h
+++ b/libopie2/examples/opieui/osplitter_example/osplitter_mail.h
@@ -1,53 +1,51 @@
1/* 1/*
2 * You may use, modify and distribute this code without any limitation 2 * You may use, modify and distribute this code without any limitation
3 */ 3 */
4 4
5/* 5/*
6 * Header file for a more complete email client like 6 * Header file for a more complete email client like
7 * layout 7 * layout
8 */ 8 */
9 9
10#ifndef OPIE_SPLITTER_MAIL_EXAMPLE_H 10#ifndef OPIE_SPLITTER_MAIL_EXAMPLE_H
11#define OPIE_SPLITTER_MAIL_EXAMPLE_H 11#define OPIE_SPLITTER_MAIL_EXAMPLE_H
12 12
13#include <qwidget.h> 13#include <qwidget.h>
14#include <qlist.h> 14#include <qlist.h>
15#include <qlistview.h> 15#include <qlistview.h>
16 16
17#include <opie2/osplitter.h> 17#include <opie2/osplitter.h>
18 18
19using Opie::OSplitter;
20 19
21class Folder; 20class Folder;
22class QLabel; 21class QLabel;
23 22
24class OSplitter;
25class ListViews : public QWidget { 23class ListViews : public QWidget {
26 Q_OBJECT 24 Q_OBJECT
27public: 25public:
28 static QString appName() { return QString::fromLatin1("osplitter-mail"); } 26 static QString appName() { return QString::fromLatin1("osplitter-mail"); }
29 ListViews( QWidget* parent, const char * name, WFlags fl ); 27 ListViews( QWidget* parent, const char * name, WFlags fl );
30 ~ListViews(); 28 ~ListViews();
31 29
32 bool eventFilter( QObject* , QEvent* ); 30 bool eventFilter( QObject* , QEvent* );
33private: 31private:
34 void initFolders(); 32 void initFolders();
35 void initFolder( Folder *folder, unsigned int &count ); 33 void initFolder( Folder *folder, unsigned int &count );
36 34
37 QListView *m_messages, *m_overview; 35 QListView *m_messages, *m_overview;
38 QLabel *m_message, *m_attach; 36 QLabel *m_message, *m_attach;
39 QList<QListView> m_folders; // used in tab mode 37 QList<QListView> m_folders; // used in tab mode
40 QList<Folder> m_lstFolders; 38 QList<Folder> m_lstFolders;
41 bool m_mode : 1; // bitfield 39 bool m_mode : 1; // bitfield
42 OSplitter *m_splitter; 40 Opie::Ui::OSplitter *m_splitter;
43 OSplitter *splitti; 41 Opie::Ui::OSplitter *splitti;
44 QListView *folder1; 42 QListView *folder1;
45#if 0 43#if 0
46//private slots: 44//private slots:
47// void slotFolderChanged( QListViewItem* ); 45// void slotFolderChanged( QListViewItem* );
48// void slotMessageChanged(); 46// void slotMessageChanged();
49// void slotSizeChange( bool, const QSize& ); 47// void slotSizeChange( bool, const QSize& );
50#endif 48#endif
51}; 49};
52 50
53#endif 51#endif
diff --git a/libopie2/examples/opieui/oversatileviewdemo/main.cpp b/libopie2/examples/opieui/oversatileviewdemo/main.cpp
index d8c01a4..bcda14c 100644
--- a/libopie2/examples/opieui/oversatileviewdemo/main.cpp
+++ b/libopie2/examples/opieui/oversatileviewdemo/main.cpp
@@ -1,29 +1,32 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "opieuidemo.h" 16#include "opieuidemo.h"
17 17
18#include <opie2/oapplication.h> 18#include <opie2/oapplication.h>
19 19
20using namespace Opie::Core;
21using namespace Opie::Ui;
22
20int main( int argc, char **argv ) 23int main( int argc, char **argv )
21{ 24{
22 OApplication a( argc, argv, "Opie UI Demo" ); 25 OApplication a( argc, argv, "Opie UI Demo" );
23 qDebug( "." ); 26 qDebug( "." );
24 OpieUIDemo e; 27 OpieUIDemo e;
25 qDebug( "." ); 28 qDebug( "." );
26 a.showMainWidget(&e); 29 a.showMainWidget(&e);
27 qDebug( "." ); 30 qDebug( "." );
28 return a.exec(); 31 return a.exec();
29} 32}
diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp
index 0d8bc9f..754a744 100644
--- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp
+++ b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp
@@ -4,74 +4,72 @@
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14***********************************************************************/ 14***********************************************************************/
15 15
16// Qt 16// Qt
17 17
18#include <qcolor.h> 18#include <qcolor.h>
19#include <qpopupmenu.h> 19#include <qpopupmenu.h>
20#include <qmenubar.h> 20#include <qmenubar.h>
21#include <qmessagebox.h> 21#include <qmessagebox.h>
22#include <qvbox.h> 22#include <qvbox.h>
23#include <qstring.h> 23#include <qstring.h>
24#include <qstringlist.h> 24#include <qstringlist.h>
25 25
26// Qtopia 26// Qtopia
27 27
28#ifdef QWS
29#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
30#include <qpe/global.h> 29#include <qpe/global.h>
31#endif
32 30
33// Opie 31// Opie
34 32
35#ifdef QWS
36#include <opie2/odevice.h> 33#include <opie2/odevice.h>
37using namespace Opie;
38#endif
39 34
40#include <opie2/ocompletionbox.h> 35#include <opie2/ocompletionbox.h>
41#include <opie2/olineedit.h> 36#include <opie2/olineedit.h>
42#include <opie2/ocombobox.h> 37#include <opie2/ocombobox.h>
43#include <opie2/oeditlistbox.h> 38#include <opie2/oeditlistbox.h>
44#include <opie2/oselector.h> 39#include <opie2/oselector.h>
45#include <opie2/opopupmenu.h> 40#include <opie2/opopupmenu.h>
46 41
47#include <qtabwidget.h> 42#include <qtabwidget.h>
48#include "oversatileviewdemo.h" 43#include "oversatileviewdemo.h"
49 44
50// Local 45// Local
51 46
52#include "opieuidemo.h" 47#include "opieuidemo.h"
53 48
49using namespace Opie::Core;
50using namespace Opie::Ui;
51
54enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector }; 52enum Demos { ocompletionbox, olineedit, ocombobox, oeditlistbox, oselector };
55 53
56OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) 54OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl )
57 : QMainWindow( parent, name, fl ) 55 : QMainWindow( parent, name, fl )
58{ 56{
59 57
60 QMenuBar* mbar = this->menuBar(); 58 QMenuBar* mbar = this->menuBar();
61 OPopupMenu* demo = new OPopupMenu( this ); 59 OPopupMenu* demo = new OPopupMenu( this );
62 demo->setTitle( "Title" ); 60 demo->setTitle( "Title" );
63 demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox ); 61 demo->setItemParameter( demo->insertItem( "OCompletionBox", this, SLOT( demo(int) ) ), ocompletionbox );
64 demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit ); 62 demo->setItemParameter( demo->insertItem( "OLineEdit", this, SLOT( demo(int) ) ), olineedit );
65 demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); 63 demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox );
66 demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); 64 demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox );
67 demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); 65 demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector );
68 mbar->insertItem( "Demonstrate", demo ); 66 mbar->insertItem( "Demonstrate", demo );
69 67
70 build(); 68 build();
71 69
72} 70}
73 71
74OpieUIDemo::~OpieUIDemo() 72OpieUIDemo::~OpieUIDemo()
75{ 73{
76} 74}
77 75
diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h
index 0519ae6..382885f 100644
--- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h
+++ b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.h
@@ -1,56 +1,60 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#ifndef OPIEUIDEMO_H 16#ifndef OPIEUIDEMO_H
17#define OPIEUIDEMO_H 17#define OPIEUIDEMO_H
18 18
19#include <qmainwindow.h> 19#include <qmainwindow.h>
20 20
21namespace Opie {
22namespace Ui {
21class OVersatileView; 23class OVersatileView;
24}
25}
22class QTabWidget; 26class QTabWidget;
23class QVBox; 27class QVBox;
24 28
25class OpieUIDemo : public QMainWindow { 29class OpieUIDemo : public QMainWindow {
26 Q_OBJECT 30 Q_OBJECT
27 31
28public: 32public:
29 33
30 OpieUIDemo( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel ); 34 OpieUIDemo( QWidget* parent = 0, const char* name = 0, WFlags fl = WType_TopLevel );
31 ~OpieUIDemo(); 35 ~OpieUIDemo();
32 36
33 void demoOCompletionBox(); 37 void demoOCompletionBox();
34 void demoOLineEdit(); 38 void demoOLineEdit();
35 void demoOComboBox(); 39 void demoOComboBox();
36 void demoOEditListBox(); 40 void demoOEditListBox();
37 void demoOSelector(); 41 void demoOSelector();
38 42
39public slots: 43public slots:
40 void demo( int ); 44 void demo( int );
41 void messageBox( const QString& text ); 45 void messageBox( const QString& text );
42 46
43protected: 47protected:
44 void build(); 48 void build();
45 void buildVV( QVBox* b ); 49 void buildVV( QVBox* b );
46 50
47private: 51private:
48 QTabWidget* main; 52 QTabWidget* main;
49 53
50 OVersatileView* vv; 54 Opie::Ui::OVersatileView* vv;
51 55
52}; 56};
53 57
54 58
55 59
56#endif 60#endif
diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp
index 9db4e62..b6d59aa 100644
--- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp
+++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp
@@ -17,48 +17,50 @@
17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
18    : ..    .:,     . . . without even the implied warranty of 18    : ..    .:,     . . . without even the implied warranty of
19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
21..}^=.=       =       ; Library General Public License for more 21..}^=.=       =       ; Library General Public License for more
22++=   -.     .`     .: details. 22++=   -.     .`     .: details.
23 :     =  ...= . :.=- 23 :     =  ...= . :.=-
24 -.   .:....=;==+<; You should have received a copy of the GNU 24 -.   .:....=;==+<; You should have received a copy of the GNU
25  -_. . .   )=.  = Library General Public License along with 25  -_. . .   )=.  = Library General Public License along with
26    --        :-=` this library; see the file COPYING.LIB. 26    --        :-=` this library; see the file COPYING.LIB.
27 If not, write to the Free Software Foundation, 27 If not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330, 28 Inc., 59 Temple Place - Suite 330,
29 Boston, MA 02111-1307, USA. 29 Boston, MA 02111-1307, USA.
30 30
31*/ 31*/
32 32
33#include "oversatileviewdemo.h" 33#include "oversatileviewdemo.h"
34#include <opie2/oversatileview.h> 34#include <opie2/oversatileview.h>
35#include <opie2/oversatileviewitem.h> 35#include <opie2/oversatileviewitem.h>
36 36
37#include <qstring.h> 37#include <qstring.h>
38#include <qpixmap.h> 38#include <qpixmap.h>
39#include <qlistview.h> 39#include <qlistview.h>
40 40
41using namespace Opie::Ui;
42
41OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) 43OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f )
42 :QVBox( parent, name, f ) 44 :QVBox( parent, name, f )
43{ 45{
44 vv = new OVersatileView( this ); 46 vv = new OVersatileView( this );
45 47
46 vv->addColumn( "First" ); 48 vv->addColumn( "First" );
47 vv->addColumn( "2nd" ); 49 vv->addColumn( "2nd" );
48 vv->addColumn( "IIIrd" ); 50 vv->addColumn( "IIIrd" );
49 51
50 QString counter; 52 QString counter;
51 53
52 QPixmap leaf( "leaf.png" ); 54 QPixmap leaf( "leaf.png" );
53 QPixmap opened( "folder_opened.png" ); 55 QPixmap opened( "folder_opened.png" );
54 QPixmap closed( "folder_closed.png" ); 56 QPixmap closed( "folder_closed.png" );
55 57
56 QPixmap leaf32( "leaf32.png" ); 58 QPixmap leaf32( "leaf32.png" );
57 QPixmap opened32( "folder_opened32.png" ); 59 QPixmap opened32( "folder_opened32.png" );
58 QPixmap closed32( "folder_closed32.png" ); 60 QPixmap closed32( "folder_closed32.png" );
59 61
60 vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); 62 vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed );
61 vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); 63 vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 );
62 64
63 OVersatileViewItem* item; 65 OVersatileViewItem* item;
64 OVersatileViewItem* item2; 66 OVersatileViewItem* item2;
diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h
index 79318d0..35e2c3c 100644
--- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h
+++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.h
@@ -13,61 +13,65 @@
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_. 14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This program is distributed in the hope that 15    .i_,=:_.      -<s. This program is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef OVERSATILEVIEWDEMO_H 32#ifndef OVERSATILEVIEWDEMO_H
33#define OVERSATILEVIEWDEMO_H 33#define OVERSATILEVIEWDEMO_H
34 34
35#include <qvbox.h> 35#include <qvbox.h>
36 36
37namespace Opie {
38namespace Ui {
37class OVersatileView; 39class OVersatileView;
38class OVersatileViewItem; 40class OVersatileViewItem;
41}
42}
39 43
40class OVersatileViewDemo: public QVBox 44class OVersatileViewDemo: public QVBox
41{ 45{
42 Q_OBJECT 46 Q_OBJECT
43 47
44 public: 48 public:
45 OVersatileViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 ); 49 OVersatileViewDemo( QWidget* parent=0, const char* name=0, WFlags f=0 );
46 virtual ~OVersatileViewDemo(); 50 virtual ~OVersatileViewDemo();
47 51
48 public slots: 52 public slots:
49 void selectionChanged(); 53 void selectionChanged();
50 void selectionChanged( OVersatileViewItem * ); 54 void selectionChanged( Opie::Ui::OVersatileViewItem * );
51 void currentChanged( OVersatileViewItem * ); 55 void currentChanged( Opie::Ui::OVersatileViewItem * );
52 void clicked( OVersatileViewItem * ); 56 void clicked( Opie::Ui::OVersatileViewItem * );
53 void pressed( OVersatileViewItem * ); 57 void pressed( OPie::Ui::OVersatileViewItem * );
54 58
55 void doubleClicked( OVersatileViewItem *item ); 59 void doubleClicked( Opie::Ui::OVersatileViewItem *item );
56 void returnPressed( OVersatileViewItem *item ); 60 void returnPressed( Opie::Ui::OVersatileViewItem *item );
57 61
58 void onItem( OVersatileViewItem *item ); 62 void onItem( Opie::Ui::OVersatileViewItem *item );
59 void onViewport(); 63 void onViewport();
60 64
61 void expanded( OVersatileViewItem *item ); 65 void expanded( Opie::Ui::OVersatileViewItem *item );
62 void collapsed( OVersatileViewItem *item ); 66 void collapsed( Opie::Ui::OVersatileViewItem *item );
63 67
64 void moved(); 68 void moved();
65 69
66 void contextMenuRequested( OVersatileViewItem *item, const QPoint&, int col ); 70 void contextMenuRequested( Opie::Ui::OVersatileViewItem *item, const QPoint&, int col );
67 71
68 private: 72 private:
69 OVersatileView* vv; 73 Opie::Ui::OVersatileView* vv;
70 74
71}; 75};
72 76
73#endif 77#endif
diff --git a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp
index b1c5e70..50cc11b 100644
--- a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp
+++ b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.cpp
@@ -1,46 +1,46 @@
1/* 1/*
2 * You may use, modify and distribute this example without any limitation 2 * You may use, modify and distribute this example without any limitation
3 */ 3 */
4 4
5#include "owidgetstack_example.h" 5#include "owidgetstack_example.h"
6 6
7/* OPIE */ 7/* OPIE */
8#include <opie2/oapplicationfactory.h> 8#include <opie2/oapplicationfactory.h>
9#include <opie2/owidgetstack.h> 9#include <opie2/owidgetstack.h>
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12/* QT */ 12/* QT */
13#include <qaction.h> 13#include <qaction.h>
14#include <qtoolbar.h> 14#include <qtoolbar.h>
15#include <qpopupmenu.h> 15#include <qpopupmenu.h>
16#include <qmenubar.h> 16#include <qmenubar.h>
17#include <qlayout.h> 17#include <qlayout.h>
18#include <qlabel.h> 18#include <qlabel.h>
19#include <qpushbutton.h> 19#include <qpushbutton.h>
20#include <qsignalmapper.h> 20#include <qsignalmapper.h>
21 21
22using namespace Opie; 22using namespace Opie::Ui;
23 23
24OPIE_EXPORT_APP( OApplicationFactory<StackExample> ) 24OPIE_EXPORT_APP( OApplicationFactory<StackExample> )
25 25
26StackExample::StackExample( QWidget* parent, const char* name, WFlags fl ) 26StackExample::StackExample( QWidget* parent, const char* name, WFlags fl )
27 : QMainWindow( parent, name, fl ) 27 : QMainWindow( parent, name, fl )
28{ 28{
29 m_stack = new OWidgetStack( this ); 29 m_stack = new OWidgetStack( this );
30 setCentralWidget( m_stack ); 30 setCentralWidget( m_stack );
31 31
32 /* nice Signal Mapper ;) */ 32 /* nice Signal Mapper ;) */
33 QSignalMapper *sm = new QSignalMapper(this); 33 QSignalMapper *sm = new QSignalMapper(this);
34 connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) ); 34 connect(sm, SIGNAL(mapped(int) ), m_stack, SLOT(raiseWidget(int)) );
35 35
36 /* toolbar first but this should be known from the other examples */ 36 /* toolbar first but this should be known from the other examples */
37 setToolBarsMovable( false ); 37 setToolBarsMovable( false );
38 38
39 /* only a menubar here */ 39 /* only a menubar here */
40 QToolBar* holder = new QToolBar( this ); 40 QToolBar* holder = new QToolBar( this );
41 holder->setHorizontalStretchable( true ); 41 holder->setHorizontalStretchable( true );
42 42
43 QMenuBar *bar = new QMenuBar( holder ); 43 QMenuBar *bar = new QMenuBar( holder );
44 QPopupMenu *menu = new QPopupMenu( this ); 44 QPopupMenu *menu = new QPopupMenu( this );
45 45
46 QAction* a = new QAction( tr("Show MainWidget"), Resource::loadPixmap("zoom"), 46 QAction* a = new QAction( tr("Show MainWidget"), Resource::loadPixmap("zoom"),
diff --git a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h
index aea85cb..c9b70cb 100644
--- a/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h
+++ b/libopie2/examples/opieui/owidgetstack_example/owidgetstack_example.h
@@ -1,28 +1,27 @@
1/* 1/*
2 * You may use, modify and distribute this example without any limitation 2 * You may use, modify and distribute this example without any limitation
3 */ 3 */
4 4
5#ifndef O_STACK_EXAMPLE_SIMPLE_H 5#ifndef O_STACK_EXAMPLE_SIMPLE_H
6#define O_STACK_EXAMPLE_SIMPLE_H 6#define O_STACK_EXAMPLE_SIMPLE_H
7 7
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#include <opie2/owidgetstack.h> 9#include <opie2/owidgetstack.h>
10 10
11using namespace Opie;
12 11
13class StackExample : public QMainWindow { 12class StackExample : public QMainWindow {
14 Q_OBJECT 13 Q_OBJECT
15public: 14public:
16 StackExample( QWidget* paren, const char* name, WFlags fl ); 15 StackExample( QWidget* paren, const char* name, WFlags fl );
17 ~StackExample(); 16 ~StackExample();
18 static QString appName() { return QString::fromLatin1("owidgetstack-example"); } 17 static QString appName() { return QString::fromLatin1("owidgetstack-example"); }
19 18
20protected: 19protected:
21 void closeEvent( QCloseEvent* e ); 20 void closeEvent( QCloseEvent* e );
22private: 21private:
23 OWidgetStack* m_stack; 22 Opie::Ui::OWidgetStack* m_stack;
24 QWidget* m_main; 23 QWidget* m_main;
25 24
26}; 25};
27 26
28#endif 27#endif