author | mickeyl <mickeyl> | 2004-04-05 13:30:36 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-05 13:30:36 (UTC) |
commit | 743adf3ed3032feb15e71002613a4643d059aa09 (patch) (unidiff) | |
tree | da8c0549515f694775a1cd169cdc5abe615a3847 /core/apps/taboapp | |
parent | b136b4d55c810c35c54b18b435aa4172b7f6b9fe (diff) | |
download | opie-743adf3ed3032feb15e71002613a4643d059aa09.zip opie-743adf3ed3032feb15e71002613a4643d059aa09.tar.gz opie-743adf3ed3032feb15e71002613a4643d059aa09.tar.bz2 |
convert helpbrowser, taboapp and textedit to Opie debugging framework
qcop and embeddedkonsole needs more work. the diagnostics part uses printf
-rw-r--r-- | core/apps/taboapp/main.cpp | 48 |
1 files changed, 26 insertions, 22 deletions
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 @@ | |||
1 | #include <qdir.h> | 1 | /* OPIE */ |
2 | |||
3 | #include <qpe/qpeapplication.h> | ||
4 | #include <qpe/qlibrary.h> | ||
5 | #include <oappinterface.h> | 2 | #include <oappinterface.h> |
6 | #include <oappplugin.h> | 3 | #include <oappplugin.h> |
7 | 4 | #include <opie2/odebug.h> | |
8 | #include <opie2/otabwidget.h> | 5 | #include <opie2/otabwidget.h> |
6 | #include <qpe/qpeapplication.h> | ||
7 | #include <qpe/qlibrary.h> | ||
8 | using namespace Opie::Core; | ||
9 | using namespace Opie::Ui; | ||
10 | |||
11 | /* QT */ | ||
12 | #include <qdir.h> | ||
9 | 13 | ||
10 | int main( int argc, char **argv ) | 14 | int main( int argc, char **argv ) |
11 | { | 15 | { |
12 | QPEApplication a( argc, argv ); | 16 | QPEApplication a( argc, argv ); |
13 | 17 | ||
14 | Opie::Ui::OTabWidget *tabwidget = new Opie::Ui::OTabWidget(0, "tab widget"); | 18 | OTabWidget *tabwidget = new OTabWidget(0, "tab widget"); |
15 | 19 | ||
16 | QString path = QPEApplication::qpeDir() + "/plugins/app"; | 20 | QString path = QPEApplication::qpeDir() + "/plugins/app"; |
17 | QDir dir( path, "lib*.so" ); | 21 | QDir dir( path, "lib*.so" ); |
@@ -23,29 +27,29 @@ int main( int argc, char **argv ) | |||
23 | for ( it = list.begin(); it != list.end(); ++it ) { | 27 | for ( it = list.begin(); it != list.end(); ++it ) { |
24 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 28 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
25 | 29 | ||
26 | qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); | 30 | odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl; |
27 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 31 | if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
28 | qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); | 32 | odebug << "accepted: " << QString( path + "/" + *it ) << "" << oendl; |
29 | 33 | ||
30 | QList<QWidget> list = iface->widgets(); | 34 | QList<QWidget> list = iface->widgets(); |
31 | QWidget *widget; | 35 | QWidget *widget; |
32 | for ( widget = list.first(); widget != 0; widget = list.next() ) | 36 | for ( widget = list.first(); widget != 0; widget = list.next() ) |
33 | tabwidget->addTab(widget, QString(*it), QString(*it)); | 37 | tabwidget->addTab(widget, QString(*it), QString(*it)); |
34 | 38 | ||
35 | QString lang = getenv( "LANG" ); | 39 | QString lang = getenv( "LANG" ); |
36 | if (lang.isNull()) | 40 | if (lang.isNull()) |
37 | lang = "en"; | 41 | lang = "en"; |
38 | QTranslator *trans = new QTranslator(qApp); | 42 | QTranslator *trans = new QTranslator(qApp); |
39 | QString type = (*it).left( (*it).find(".") ); | 43 | QString type = (*it).left( (*it).find(".") ); |
40 | if (type.left(3) == "lib") | 44 | if (type.left(3) == "lib") |
41 | type = type.mid(3); | 45 | type = type.mid(3); |
42 | type = type.right( type.find("lib") ); | 46 | type = type.right( type.find("lib") ); |
43 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 47 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
44 | if ( trans->load( tfn )) | 48 | if ( trans->load( tfn )) |
45 | qApp->installTranslator( trans ); | 49 | qApp->installTranslator( trans ); |
46 | else | 50 | else |
47 | delete trans; | 51 | delete trans; |
48 | } | 52 | } |
49 | } | 53 | } |
50 | 54 | ||
51 | a.showMainDocumentWidget(tabwidget); | 55 | a.showMainDocumentWidget(tabwidget); |