From 743adf3ed3032feb15e71002613a4643d059aa09 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 05 Apr 2004 13:30:36 +0000 Subject: convert helpbrowser, taboapp and textedit to Opie debugging framework qcop and embeddedkonsole needs more work. the diagnostics part uses printf --- (limited to 'core/apps/taboapp') diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp index e46c71f..e43f118 100644 --- a/core/apps/taboapp/main.cpp +++ b/core/apps/taboapp/main.cpp @@ -1,17 +1,21 @@ -#include - -#include -#include +/* OPIE */ #include #include - +#include #include +#include +#include +using namespace Opie::Core; +using namespace Opie::Ui; + +/* QT */ +#include int main( int argc, char **argv ) { QPEApplication a( argc, argv ); - Opie::Ui::OTabWidget *tabwidget = new Opie::Ui::OTabWidget(0, "tab widget"); + OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); QString path = QPEApplication::qpeDir() + "/plugins/app"; QDir dir( path, "lib*.so" ); @@ -23,29 +27,29 @@ int main( int argc, char **argv ) for ( it = list.begin(); it != list.end(); ++it ) { QLibrary *lib = new QLibrary( path + "/" + *it ); - qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); + odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl; if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { - qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); + odebug << "accepted: " << QString( path + "/" + *it ) << "" << oendl; - QList list = iface->widgets(); + QList list = iface->widgets(); QWidget *widget; for ( widget = list.first(); widget != 0; widget = list.next() ) tabwidget->addTab(widget, QString(*it), QString(*it)); QString lang = getenv( "LANG" ); - if (lang.isNull()) - lang = "en"; - QTranslator *trans = new QTranslator(qApp); - QString type = (*it).left( (*it).find(".") ); - if (type.left(3) == "lib") - type = type.mid(3); - type = type.right( type.find("lib") ); - QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; - if ( trans->load( tfn )) - qApp->installTranslator( trans ); - else - delete trans; - } + if (lang.isNull()) + lang = "en"; + QTranslator *trans = new QTranslator(qApp); + QString type = (*it).left( (*it).find(".") ); + if (type.left(3) == "lib") + type = type.mid(3); + type = type.right( type.find("lib") ); + QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; + if ( trans->load( tfn )) + qApp->installTranslator( trans ); + else + delete trans; + } } a.showMainDocumentWidget(tabwidget); -- cgit v0.9.0.2