-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 @@ + config TABOAPP + boolean "TabOApp" + default "n" + 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 @@ +#include <qdir.h> + +#include <qpe/global.h> +#include <qpe/qpeapplication.h> +#include <qpe/qlibrary.h> +#include <oappinterface.h> +#include <oappplugin.h> + +#include <opie/otabwidget.h> + +int main( int argc, char **argv ) +{ + QPEApplication a( argc, argv ); + int ret = 0; + + OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); + + QString path = QPEApplication::qpeDir() + "/plugins/app"; + QDir dir( path, "lib*.so" ); + + QStringList list = dir.entryList(); + QStringList::Iterator it; + + QInterfacePtr<OAppInterface> iface; + for ( it = list.begin(); it != list.end(); ++it ) { + QLibrary *lib = new QLibrary( path + "/" + *it ); + + qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); + if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { + qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); + + QList<QWidget> list = iface->widgets(); + + QWidget *widget; + for ( widget = list.first(); widget != 0; widget = list.next() ) + tabwidget->addTab(widget, QString(*it), QString(*it)); + } + } + + a.showMainDocumentWidget(tabwidget); + return a.exec(); +} 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 @@ +TEMPLATE = app +CONFIG = qt warn_on release +DESTDIR = $(OPIEDIR)/bin + +SOURCES = main.cpp + +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include . +TARGET = taboapp +LIBS += -lqpe -lopie -loapp +INCLUDEPATH += $(OPIEDIR)/core/apps/oapp +DEPENDPATH += $(OPIEDIR)/core/apps/oapp +MOC_DIR = .build +OBJECTS_DIR = .build +UI_DIR = .build + +include ( $(OPIEDIR)/include.pro ) |