author | zecke <zecke> | 2004-09-10 13:03:32 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-10 13:03:32 (UTC) |
commit | cc36d73926cf939cf754e31ea7ee87698e20a4bb (patch) (side-by-side diff) | |
tree | 1db911900129bc4fa551a92fa0b7c228cec6bc89 /noncore/apps/opie-console/main.cpp | |
parent | f9fb882141b4a519ae958e6332fb5a8ef717d88c (diff) | |
download | opie-cc36d73926cf939cf754e31ea7ee87698e20a4bb.zip opie-cc36d73926cf939cf754e31ea7ee87698e20a4bb.tar.gz opie-cc36d73926cf939cf754e31ea7ee87698e20a4bb.tar.bz2 |
-Disable Quick Launching as we need a special QApplication
to prevent filtering the escape key
-Update .pro and .control as we're no longer quicklaunchable
-Update PLANS as most of it is already finished
Diffstat (limited to 'noncore/apps/opie-console/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/main.cpp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index eafc9b2..58c9c57 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp @@ -1,8 +1,39 @@ -#include <opie2/oapplicationfactory.h> +#include <opie2/oapplication.h> +#include <qwsevent_qws.h> #include "mainwindow.h" +class OConsoleApplication : public Opie::Core::OApplication { +public: + OConsoleApplication(int argc, char* argv[]); +protected: + bool qwsEventFilter( QWSEvent * ); +}; -OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MainWindow> ); +OConsoleApplication::OConsoleApplication(int argc, char* argv[] ) + : Opie::Core::OApplication(argc, argv, "opie-console") +{} +bool OConsoleApplication::qwsEventFilter( QWSEvent *e) { + if( e->type == QWSEvent::Key ) { + QWSKeyEvent *key = static_cast<QWSKeyEvent*>(e); + + /* prevent QPEApplication to filter the key */ + if(key->simpleData.keycode == Qt::Key_Escape) + return QApplication::qwsEventFilter(e); + + } + + return Opie::Core::OApplication::qwsEventFilter( e); +} + + +int main(int argc, char* argv[]) { + OConsoleApplication app(argc, argv); + + MainWindow win; + app.showMainWidget(&win); + + return app.exec(); +} |