[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kajongg/sid] src: move scoring game related code from Board to ScoringHandBoard: focusTile.setter
From: Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date: 2013-10-31 21:21:14
Message-ID: E1Vbzg2-0002lj-5s () scm ! kde ! org
[Download RAW message or body]
Git commit 3a1c8c40fbe6acae5389063668c969ef0191bf69 by Wolfgang Rohdewald.
Committed on 31/10/2013 at 15:07.
Pushed by wrohdewald into branch 'sid'.
move scoring game related code from Board to ScoringHandBoard: focusTile.setter
M +1 -6 src/board.py
M +6 -0 src/handboard.py
http://commits.kde.org/kajongg/3a1c8c40fbe6acae5389063668c969ef0191bf69
diff --git a/src/board.py b/src/board.py
index 7943c48..93aa02b 100644
--- a/src/board.py
+++ b/src/board.py
@@ -229,14 +229,9 @@ class Board(QGraphicsRectItem):
self._focusTile = uiTile
if self._focusTile and self._focusTile.tile in Debug.focusable:
logDebug('%s: new focus uiTile %s from %s' % (
- self.name(), self._focusTile.tile if self._focusTile else 'None', stack('')[-1]))
- if (self.isHandBoard and self.player
- and not self.player.game.isScoringGame()
- and Internal.field.clientDialog):
- Internal.field.clientDialog.focusTileChanged()
+ self.name, self._focusTile.tile if self._focusTile else 'None', stack('')[-1]))
if self.hasFocus:
self.scene().focusBoard = self
- assert uiTile is self._focusTile
def setEnabled(self, enabled):
"""enable/disable this board"""
diff --git a/src/handboard.py b/src/handboard.py
index 464f8e9..1275954 100644
--- a/src/handboard.py
+++ b/src/handboard.py
@@ -147,6 +147,12 @@ class HandBoard(Board):
# playing game: always make only single tiles selectable
return 1
+ @Board.focusTile.setter
+ def focusTile(self, uiTile): # pylint: disable=arguments-differ
+ Board.focusTile.fset(self, uiTile)
+ if self.player and Internal.field.clientDialog:
+ Internal.field.clientDialog.focusTileChanged()
+
def __str__(self):
return self.player.scoringString()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic