Pause button hidden when game paused
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 7 Oct 2011 11:30:37 +0000 (14:30 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 7 Oct 2011 11:30:37 +0000 (14:30 +0300)
classes/clockswidget.cpp
classes/clockswidget.h
classes/wrappedclockswidget.cpp
classes/wrappedclockswidget.h
qml/ClocksPage.qml

index 61e086e..de46005 100644 (file)
@@ -219,6 +219,7 @@ void ClocksWidget::mousePressEvent(QMouseEvent *event)
 //            pauseButton_->setVisible(true);
             white_->continueTurn();
             status_=WhiteTurn;
+            emit unPaused(); //For Harmattan, to inform QML
             break;
         case BlackPause:
             // Continue play
@@ -228,6 +229,7 @@ void ClocksWidget::mousePressEvent(QMouseEvent *event)
 //            pauseButton_->setVisible(true);
             black_->continueTurn();
             status_=BlackTurn;
+            emit unPaused(); //For Harmattan, to inform QML
             break;
         case Stopped:
             emit ClickedWhenStopped();
index 1d5015d..06e6372 100644 (file)
@@ -3,6 +3,7 @@
     Chess Clock
 
     Copyright (c) Arto Hyvättinen 2010
+    Changes for porting to Harmattan(c) Heli Hyvättinen 2011
 
     This file is part of Chess Clock software.
 
@@ -36,8 +37,10 @@ class ChessClock;
 
 /*! Widget with two clocks
 
-    @author Arto Hyvättinen
-    @date 2010-08-14
+    @author Arto Hyvättinen (& Heli Hyvättinen)
+    @date 2011-10-07
+
+
 
     Central widget of Chess Clock.
     Needed to create new ClocksWidget to
@@ -61,6 +64,7 @@ protected:
 signals:
    void TurnFinished(TurnInformation* turnInfo);
    void ClickedWhenStopped();
+   void unPaused(); //For Harmattan, to inform QML
 
 public slots:
    /*! Pause game */
index b2cf229..1d2783e 100644 (file)
@@ -131,6 +131,8 @@ void WrappedClocksWidget::startGame(TimeControlType timeControl, int whiteInitia
 
     pClocksWidget_ = new ClocksWidget(pWhiteClock_, pBlackClock_);
 
+    connect(pClocksWidget_,SIGNAL(unPaused()),this,(SIGNAL(unPaused())));
+
     pClocksWidget_->setAttribute(Qt::WA_NoSystemBackground);
     setWidget(pClocksWidget_);
 
index b9d03b7..e0956eb 100644 (file)
@@ -43,6 +43,7 @@ public:
 
     bool isPlayStarted();
 
+
     enum TimeControlType
     {
      NormalClock,
@@ -55,6 +56,8 @@ public:
 
 signals:
 
+    void unPaused();
+
 public slots:
 
     /*! Start a new game
index 739968e..2c2dcb8 100644 (file)
@@ -70,10 +70,12 @@ Page
 
         ToolIcon
         {
+            id: pauseButton
             iconId: "toolbar-mediacontrol-pause"
             onClicked:
                 {
                     wrappedClocksWidget.pause()
+                    visible = false
                 }
         }
 
@@ -88,6 +90,7 @@ Page
     WrappedClocksWidget
     {
         id: wrappedClocksWidget
+        onUnPaused: pauseButton.visible = true
     }