screensaver/snsrplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp
changeset 98 e6f74eb7f69f
parent 97 66b5fe3c07fd
--- a/screensaver/snsrplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp	Wed Oct 06 16:06:24 2010 +0300
+++ b/screensaver/snsrplugins/snsrbigclockscreensaverplugin/src/snsrdigitalclockcontainer.cpp	Mon Oct 18 10:20:15 2010 +0300
@@ -23,8 +23,8 @@
 
 #include <HbExtendedLocale>
 #include <HbMainWindow>
+#include <HbPushButton>
 
-#include "snsrswipewidget.h"
 #include "snsrindicatorwidget.h"
 #include "snsrlabel.h"
 
@@ -35,7 +35,7 @@
  */
 
 const char *gDigitalLayoutDocml = ":/xml/snsrbigclockscreensaverdigital.docml";
-const char *gSwipeDigitalLayoutDocml = ":/xml/snsrbigclockscreensaverdigitalswipe.docml";
+const char *gUnlockDigitalLayoutDocml = ":/xml/snsrbigclockscreensaverdigitalunlockbutton.docml";
 
 extern const char *gPortraitSectionName;
 extern const char *gLandscapeSectionName;
@@ -53,7 +53,7 @@
 const char *gTimeFormatStr = "%:0%J%:1%T%:3";
 
 extern const char *gIndicatorWidgetName;
-extern const char *gSwipeWidgetName;
+extern const char *gUnlockButtonName;
 
 
 /*!
@@ -64,7 +64,7 @@
     mTimeLabel(0),
     mAmPmLabel(0),
     mDateLabel(0),
-    mSwipeWidget(0)
+    mUnlockButton(0)
 {
     SCREENSAVER_TEST_FUNC_ENTRY("SnsrDigitalClockContainer::SnsrDigitalClockContainer")
     SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::SnsrDigitalClockContainer")
@@ -110,10 +110,6 @@
     mDateLabel->setPlainText(
         locale.format(QDate::currentDate(), gDateFormatStr)
         );
-    
-    if (mSwipeWidget) {
-        mSwipeWidget->setCurrentOrientation(mCurrentOrientation);
-    }
 
     SCREENSAVER_TEST_FUNC_EXIT("SnsrDigitalClockContainer::update")
 }
@@ -131,11 +127,12 @@
  */
 void SnsrDigitalClockContainer::loadWidgets()
 {
-    //if swipe is used we load the docml file containing it
-    if ( swipeToUnlockSupported() ) {
-        loadWidgets(gSwipeDigitalLayoutDocml);
-        Q_ASSERT_X( mSwipeWidget, gSwipeDigitalLayoutDocml, "Swipe widget not found in DocML file.");
-        connect( mSwipeWidget, SIGNAL(swipeDownDetected()), SIGNAL(unlockRequested()) );
+    //if unlockbutton is used we load the docml file containing it
+    if ( unlockButtonSupported() ) {
+        loadWidgets(gUnlockDigitalLayoutDocml);
+        Q_ASSERT_X( mUnlockButton, gUnlockDigitalLayoutDocml, "Unlock button not found in DocML file.");
+        mUnlockButton->setText("Unlock");
+        connect( mUnlockButton, SIGNAL(clicked()), SIGNAL(unlockRequested()) );
     }
     else {
         loadWidgets(gDigitalLayoutDocml);
@@ -155,7 +152,7 @@
     mTimeLabel = 0;
     mAmPmLabel = 0;
     mIndicatorWidget = 0;
-    mSwipeWidget = 0;
+    mUnlockButton = 0;
     // load widgets from docml
     qDebug() << docmlName;
     mDocumentObjects = mDocumentLoader.load(docmlName, &ok);
@@ -170,8 +167,8 @@
                 mDocumentLoader.findWidget(gAmPmLabelName));
         mIndicatorWidget = qobject_cast<SnsrIndicatorWidget *>(
                 mDocumentLoader.findWidget(gIndicatorWidgetName));
-        mSwipeWidget = qobject_cast<SnsrSwipeWidget *>(
-            mDocumentLoader.findWidget(gSwipeWidgetName));
+        mUnlockButton = qobject_cast<HbPushButton *>(
+            mDocumentLoader.findWidget(gUnlockButtonName));
         
         Q_ASSERT_X(
             mMainView && mDateLabel && mTimeLabel && mAmPmLabel &&