AClocksWidgets' public slots usable trough WrappedClocksWidget
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 12 Aug 2011 19:24:01 +0000 (22:24 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Fri, 12 Aug 2011 19:25:01 +0000 (22:25 +0300)
classes/wrappedclockswidget.cpp
classes/wrappedclockswidget.h

index 0861f66..65c0e13 100644 (file)
@@ -87,3 +87,21 @@ void WrappedClocksWidget::deleteOldWidgets()
     }
 }
 
+void WrappedClocksWidget::pause()
+{
+    if (pClocksWidget_)
+        pClocksWidget_->pause();
+}
+
+void WrappedClocksWidget::stopPlay()
+{
+    if (pClocksWidget_)
+        pClocksWidget_->stopPlay();
+}
+
+void WrappedClocksWidget::saveScreen()
+{
+    if (pClocksWidget_)
+        pClocksWidget_->saveScreen();
+}
+
index 35450af..b8f9f4e 100644 (file)
 /*! A proxy for ClocksWidget for using it from QML
 
     @author Heli Hyvättinen
-    @date 2011-08-11
-
-
-    SOLVE:
-    Needed to create new ClocksWidget to
-    every new game.
+    @date 2011-08-12
 
   */
 
@@ -45,14 +40,21 @@ public:
     explicit WrappedClocksWidget(QObject *parent = 0);
     virtual ~WrappedClocksWidget();
 
-    Q_INVOKABLE void startGame(QString timeControl, int whiteInitialTime, int whiteAdditionalTime, int whiteTurnsPerAddition, int blackInitialTime, int blackAdditionalTime, int blackTurnsPerAddition);
-
     bool isPlayStarted();
 
 signals:
 
 public slots:
 
+    /*! Start a new game */
+     void startGame(QString timeControl, int whiteInitialTime, int whiteAdditionalTime, int whiteTurnsPerAddition, int blackInitialTime, int blackAdditionalTime, int blackTurnsPerAddition);
+    /*! Pause game */
+     void pause();
+     /*! End the game */
+     void stopPlay();
+     /*! Not to keep screen lit */
+     void saveScreen();
+
 private:
 
     void deleteOldWidgets();