-rw-r--r-- | core/apps/taboapp/config.in | 4 | ||||
-rw-r--r-- | core/apps/taboapp/main.cpp | 42 | ||||
-rw-r--r-- | core/apps/taboapp/taboapp.pro | 17 |
3 files changed, 63 insertions, 0 deletions
diff --git a/core/apps/taboapp/config.in b/core/apps/taboapp/config.in new file mode 100644 index 0000000..043ed94 --- a/dev/null +++ b/core/apps/taboapp/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config TABOAPP | ||
2 | boolean "TabOApp" | ||
3 | default "n" | ||
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | ||
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp new file mode 100644 index 0000000..497e29f --- a/dev/null +++ b/core/apps/taboapp/main.cpp | |||
@@ -0,0 +1,42 @@ | |||
1 | #include <qdir.h> | ||
2 | |||
3 | #include <qpe/global.h> | ||
4 | #include <qpe/qpeapplication.h> | ||
5 | #include <qpe/qlibrary.h> | ||
6 | #include <oappinterface.h> | ||
7 | #include <oappplugin.h> | ||
8 | |||
9 | #include <opie/otabwidget.h> | ||
10 | |||
11 | int main( int argc, char **argv ) | ||
12 | { | ||
13 | QPEApplication a( argc, argv ); | ||
14 | int ret = 0; | ||
15 | |||
16 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); | ||
17 | |||
18 | QString path = QPEApplication::qpeDir() + "/plugins/app"; | ||
19 | QDir dir( path, "lib*.so" ); | ||
20 | |||
21 | QStringList list = dir.entryList(); | ||
22 | QStringList::Iterator it; | ||
23 | |||
24 | QInterfacePtr<OAppInterface> iface; | ||
25 | for ( it = list.begin(); it != list.end(); ++it ) { | ||
26 | QLibrary *lib = new QLibrary( path + "/" + *it ); | ||
27 | |||
28 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | ||
29 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | ||
30 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | ||
31 | |||
32 | QList<QWidget> list = iface->widgets(); | ||
33 | |||
34 | QWidget *widget; | ||
35 | for ( widget = list.first(); widget != 0; widget = list.next() ) | ||
36 | tabwidget->addTab(widget, QString(*it), QString(*it)); | ||
37 | } | ||
38 | } | ||
39 | |||
40 | a.showMainDocumentWidget(tabwidget); | ||
41 | return a.exec(); | ||
42 | } | ||
diff --git a/core/apps/taboapp/taboapp.pro b/core/apps/taboapp/taboapp.pro new file mode 100644 index 0000000..d915921 --- a/dev/null +++ b/core/apps/taboapp/taboapp.pro | |||
@@ -0,0 +1,17 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG = qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | |||
5 | SOURCES = main.cpp | ||
6 | |||
7 | INCLUDEPATH+= $(OPIEDIR)/include | ||
8 | DEPENDPATH+= $(OPIEDIR)/include . | ||
9 | TARGET = taboapp | ||
10 | LIBS += -lqpe -lopie -loapp | ||
11 | INCLUDEPATH+= $(OPIEDIR)/core/apps/oapp | ||
12 | DEPENDPATH+= $(OPIEDIR)/core/apps/oapp | ||
13 | MOC_DIR = .build | ||
14 | OBJECTS_DIR= .build | ||
15 | UI_DIR = .build | ||
16 | |||
17 | include ( $(OPIEDIR)/include.pro ) | ||