Alive on Symbian.
authorAkos Polster <akos@pipacs.com>
Sun, 5 Sep 2010 19:59:17 +0000 (21:59 +0200)
committerAkos Polster <akos@pipacs.com>
Sun, 5 Sep 2010 19:59:17 +0000 (21:59 +0200)
main.cpp
mainwindow.cpp
pkg/symbian/fixnokiaqtsdk.bat
pkg/symbian/howto.txt [new file with mode: 0644]
widgets/adopterwindow.cpp
widgets/adopterwindow.h

index c1c710d..fa8bbb0 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -12,12 +12,20 @@ static const char *DORIAN_VERSION =
 #include "pkg/version.txt"
 ;
 
+static const QtMsgType DORIAN_DEFAULT_TRACE_LEVEL =
+#ifdef Q_OS_SYMBIAN
+        QtDebugMsg
+#else
+        QtWarningMsg
+#endif
+        ;
+
 int main(int argc, char *argv[])
 {
     QApplication a(argc, argv);
 
     Trace::level = (QtMsgType)Settings::instance()->
-        value("tracelevel", (int)QtWarningMsg).toInt();
+        value("tracelevel", (int)DORIAN_DEFAULT_TRACE_LEVEL).toInt();
     qInstallMsgHandler(Trace::messageHandler);
 
     a.setApplicationName("Dorian");
@@ -25,16 +33,16 @@ int main(int argc, char *argv[])
     a.setOrganizationDomain("pipacs.com");
     a.setOrganizationName("Pipacs");
 
-#ifdef Q_OS_SYMBIAN
+    MainWindow w;
+    w.show();
+
+#if 0 // FIXME #ifdef Q_OS_SYMBIAN
     // Remove context menu from all widgets
     foreach (QWidget *w, QApplication::allWidgets()) {
         w->setContextMenuPolicy(Qt::NoContextMenu);
     }
 #endif // Q_OS_SYMBIAN
 
-    MainWindow w;
-    w.show();
-
     int ret = a.exec();
     if (ret == 1000) {
 #if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
index 28e9094..d565d4b 100755 (executable)
@@ -102,10 +102,7 @@ MainWindow::MainWindow(QWidget *parent):
     addToolBarAction(this, SLOT(about()), "about", tr("About"));
 #endif // Q_WS_MAEMO_5
 
-    QFrame *frame = new QFrame(toolBar);
-    frame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
-    toolBar->addWidget(frame);
-
+    addToolBarSpace();
     fullScreenAction = addToolBarAction(this, SLOT(showBig()),
                                         "view-fullscreen", tr("Full screen"));
 
@@ -187,14 +184,18 @@ void MainWindow::showRegular()
     otherChildren << progress << previousButton << nextButton;
     takeChildren(view, otherChildren);
     QRect geo = geometry();
-    qDebug() << "Geometry" << geo << "toolbar" << toolBar->height();
     progress->setGeometry(0, 0, geo.width(), PROGRESS_HEIGHT);
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5)
     previousButton->setGeometry(0,
         geo.height() - toolBar->height() - TranslucentButton::pixels,
         TranslucentButton::pixels, TranslucentButton::pixels);
     nextButton->setGeometry(geo.width() - TranslucentButton::pixels, 0,
         TranslucentButton::pixels, TranslucentButton::pixels);
+#elif defined(Q_OS_SYMBIAN)
+    previousButton->setGeometry(0, geo.height() - TranslucentButton::pixels,
+        TranslucentButton::pixels, TranslucentButton::pixels);
+    nextButton->setGeometry(geo.width() - TranslucentButton::pixels,
+        0, TranslucentButton::pixels, TranslucentButton::pixels);
 #else
     previousButton->setGeometry(0, geo.height() - TranslucentButton::pixels,
         TranslucentButton::pixels, TranslucentButton::pixels);
@@ -392,13 +393,17 @@ void MainWindow::resizeEvent(QResizeEvent *e)
 {
     Trace t("MainWindow::resizeEvent");
     progress->setGeometry(QRect(0, 0, e->size().width(), PROGRESS_HEIGHT));
-    qDebug() << "Toolbar height" << toolBar->height();
-#ifdef Q_WS_MAEMO_5
+#if defined(Q_WS_MAEMO_5)
     previousButton->setGeometry(0,
         e->size().height() - toolBar->height() - TranslucentButton::pixels,
         TranslucentButton::pixels, TranslucentButton::pixels);
     nextButton->setGeometry(e->size().width() - TranslucentButton::pixels, 0,
         TranslucentButton::pixels, TranslucentButton::pixels);
+#elif defined(Q_OS_SYMBIAN)
+    previousButton->setGeometry(0, e->size().height() - TranslucentButton::pixels,
+        TranslucentButton::pixels, TranslucentButton::pixels);
+    nextButton->setGeometry(e->size().width() - TranslucentButton::pixels,
+        0, TranslucentButton::pixels, TranslucentButton::pixels);
 #else
     previousButton->setGeometry(0, e->size().height() - TranslucentButton::pixels,
         TranslucentButton::pixels, TranslucentButton::pixels);
index 9dff88f..135fdde 100644 (file)
@@ -1,5 +1,6 @@
 @echo off\r
 rem Add directories to stop warnings during build\r
+rem Note: Apparently, this does not stops warnings at all\r
 c:\r
 cd \S60\devices\\r
 if not exist Nokia_N97_SDK_v1.0 goto sdkmissing\r
diff --git a/pkg/symbian/howto.txt b/pkg/symbian/howto.txt
new file mode 100644 (file)
index 0000000..cfbd683
--- /dev/null
@@ -0,0 +1,20 @@
+Install everything into default location on C:
+
+- Perl 5.8
+- N97 SDK
+- OpenC plugin
+- Qt for Symbian 4.6
+- Nokia Qt SDK 1.0
+- Nokia Ovi Suite
+
+My PATH is:
+
+C:\Perl\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Common Files\Symbian\tools;C:\NokiaQtSDK\Symbian\gcce\bin
+
+My test phone is a Nokia N97 mini
+
+Connect phone to PC via USB, using PC Suite mode. Add phone to Ovi Suite
+
+Install TRK to phone using Start/Programs/Nokia Qt SDK/Symbian/Install TRK
+to Symbian device/TRK S60 5th Edition
index 844ebf0..8ffb22d 100644 (file)
@@ -18,6 +18,8 @@
 AdopterWindow::AdopterWindow(QWidget *parent):
         QMainWindow(parent), grabbingZoomKeys(false), mainChild(0)
 {
+    Trace t("AdopterWindow::AdopterWindow");
+
 #ifdef Q_WS_MAEMO_5
     setAttribute(Qt::WA_Maemo5StackedWindow, true);
 #endif // Q_WS_MAEMO_5
@@ -125,6 +127,8 @@ QAction *AdopterWindow::addToolBarAction(QObject *receiver,
                                          const QString &iconName,
                                          const QString &text)
 {
+    Trace t("AdopterWindow::addToolBarAction");
+    qDebug() << "icon" << iconName << "text" << text;
 #ifndef Q_OS_SYMBIAN
     return toolBar->addAction(QIcon(ICON_PREFIX + iconName + ".png"), text,
                               receiver, member);
@@ -136,3 +140,12 @@ QAction *AdopterWindow::addToolBarAction(QObject *receiver,
     return action;
 #endif
 }
+
+void AdopterWindow::addToolBarSpace()
+{
+#ifndef Q_OS_SYMBIAN
+    QFrame *frame = new QFrame(toolBar);
+    frame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+    toolBar->addWidget(frame);
+#endif
+}
index 55a4011..0c8d210 100644 (file)
@@ -47,7 +47,9 @@ protected:
     void doGrabZoomKeys(bool grab);
     bool grabbingZoomKeys;
     QWidget *mainChild;
+#ifndef Q_OS_SYMBIAN
     QToolBar *toolBar;
+#endif
 };
 
 #endif // ADOPTERWINDOW_H