contactengine/main.cpp
changeset 49 d9d4ea56179a
parent 34 93c5a58496b6
--- a/contactengine/main.cpp	Fri Sep 10 09:00:20 2010 -0700
+++ b/contactengine/main.cpp	Thu Sep 16 10:59:11 2010 -0700
@@ -1,9 +1,18 @@
 #include <QtGui/QApplication>
 #include <QDesktopServices>
 #include <QDir>
+#include <QDebug>
+#include <QLabel>
+
+#ifdef USE_ORANGE_FW
+#include <OLApplication.h>
+#include <OLPixmapWidget.h>
+#include "mainview.h"
+#include "contactlist.h"
+#else
 #include "mainwindow.h"
 #include "dbtools.h"
-#include <QDebug>
+#endif
 
 // Tech Tip: By default, Actions is added to the Options menu. The
 // idea is to support context menus on non-touch mobiles.
@@ -17,12 +26,34 @@
     }
 }
 
-
+#ifdef USE_ORANGE_FW
 int main(int argc, char *argv[])
 {
+    OLApplication a(argc, argv);
+
+    MainView *mainView = new MainView(NULL);
+
+    disableContextMenu();
+
+    a.setWindowTitle("(OL)Contact App");
+    mainView->resize(a.viewSize());
+//    QLabel* test = new QLabel("main base view", mainView);
+//    Q_UNUSED(test);
+    ContactList *cl = new ContactList(mainView);
+    Q_UNUSED(cl)
+    mainView->connect(&a, SIGNAL(appStarted()), mainView, SLOT(startApp()));
+
+    return a.exec();
+}
+#else
+int main(int argc, char *argv[])
+{
+
     QApplication a(argc, argv);
     MainWindow w;
 
+
+
     DBTools dbt;
     QString dbLocation(":/contacts.csv");
 
@@ -31,12 +62,12 @@
 
     disableContextMenu();
 
-    w.setWindowTitle("Qt Study App");
+    w.setWindowTitle("Contact App");
 #if defined(Q_WS_S60)
     w.showMaximized();
 #else
     w.show();
 #endif
-
     return a.exec();
 }
+#endif