From 2ecd7d8f4e2abed38607676a600cf47b407674c8 Mon Sep 17 00:00:00 2001 From: Adriano Rezende Date: Tue, 17 Nov 2009 13:25:23 -0300 Subject: HyperUI: Changed code to use System class from shared Signed-off-by: Adriano Rezende --- hyperui/hyperui.pro | 2 ++ hyperui/main.cpp | 2 ++ hyperui/mainwindow.cpp | 27 --------------------------- hyperui/mainwindow.h | 4 ---- 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/hyperui/hyperui.pro b/hyperui/hyperui.pro index 63a21c6..e6da0dc 100644 --- a/hyperui/hyperui.pro +++ b/hyperui/hyperui.pro @@ -25,6 +25,7 @@ HEADERS += mainwindow.h \ clockwidget.h \ ../shared/button.h \ ../shared/label.h \ + ../shared/system.h \ ../shared/resource.h SOURCES += main.cpp \ @@ -38,6 +39,7 @@ SOURCES += main.cpp \ clockwidget.cpp \ ../shared/button.cpp \ ../shared/label.cpp \ + ../shared/system.cpp \ ../shared/resource.cpp isEmpty(RESOLUTION) { diff --git a/hyperui/main.cpp b/hyperui/main.cpp index afeb479..21ab3e4 100644 --- a/hyperui/main.cpp +++ b/hyperui/main.cpp @@ -33,6 +33,7 @@ #include #include +#include "system.h" #include "resource.h" #include "mainwindow.h" @@ -69,6 +70,7 @@ int main(int argc, char **argv) #ifdef Q_OS_SYMBIAN view.showFullScreen(); + System::setViewMode(System::PortraitMode); #else view.setFixedSize(width, height); view.show(); diff --git a/hyperui/mainwindow.cpp b/hyperui/mainwindow.cpp index e759003..0449168 100644 --- a/hyperui/mainwindow.cpp +++ b/hyperui/mainwindow.cpp @@ -40,12 +40,6 @@ #include "clockwidget.h" #include "draggablepreview.h" -#ifdef Q_OS_SYMBIAN -#include -#include -#include -#endif - MainWindow::MainWindow(QGraphicsItem *parent) : QGraphicsWidget(parent), @@ -96,12 +90,6 @@ MainWindow::MainWindow(QGraphicsItem *parent) iconBattery->setPos(Resource::value("topbar/icon-battery-pos").toPoint()); createDummyDailyEvents(); - -#ifdef Q_OS_SYMBIAN - // The line below is necessary, since CAknAppUi object is only - // available in the main loop. - QTimer::singleShot(0, this, SLOT(lockPortraitMode())); -#endif } void MainWindow::onDragModeIn() @@ -156,18 +144,3 @@ void MainWindow::paint(QPainter *painter, const QStyleOptionGraphicsItem *option painter->drawPixmap(0, 0, m_background); } - -/*! - Lock the screen in portrait mode. - - \todo Add support to maemo portrait mode. -*/ -#ifdef Q_OS_SYMBIAN -void MainWindow::lockPortraitMode() -{ - CAknAppUi *aknAppUi = dynamic_cast(CEikonEnv::Static()->AppUi()); - - if (aknAppUi) - aknAppUi->SetOrientationL(CAknAppUi::EAppUiOrientationPortrait); -} -#endif diff --git a/hyperui/mainwindow.h b/hyperui/mainwindow.h index f8c7756..e085214 100644 --- a/hyperui/mainwindow.h +++ b/hyperui/mainwindow.h @@ -60,10 +60,6 @@ private slots: void onDragModeOut(); void onMaximizeFinished(); -#ifdef Q_OS_SYMBIAN - void lockPortraitMode(); -#endif - private: void createDummyDailyEvents(); -- cgit v1.2.3