[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/kmj
From:       Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date:       2009-07-31 21:54:15
Message-ID: 1249077255.420089.1488.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1005372 by wrohdewald:

only show scoring dialog when wanted


 M  +8 -0      Changelog  
 M  +8 -11     src/playfield.py  


--- trunk/playground/games/kmj/Changelog #1005371:1005372
@@ -1,5 +1,13 @@
 25 Jul 2009 Release 0.3.2
+- only show the scoring dialog (enter hand results) if asked for. This
+  dialog can now be closed and reopened without losing its content. This
+  is as a preparation for a real playing mode where this dialog is not
+  wanted during the game.
+- player and games dialog: refine the GUI: Icons on buttons, better button
+  order, accept INS key
 - do not require sipconfig module anymore
+- remove patterns from manual
+- many pylintifications
 
 21 Jul 2009 Release 0.3.1
 - convert all rules to regular expressions and remove Pattern code.
--- trunk/playground/games/kmj/src/playfield.py #1005371:1005372
@@ -572,10 +572,6 @@
     """a dialog for entering the scores"""
     def __init__(self, game):
         QWidget.__init__(self, None)
-        if qVersion() >= '4.5.0' and PYQT_VERSION_STR >='4.5.0':
-            flags = self.windowFlags()
-            flags = flags & ~  Qt.WindowCloseButtonHint
-            self.setWindowFlags(flags)
         self.setWindowTitle(m18n('Enter the Hand Results') + ' - kmj')
         self._winner = None
         self.game = game
@@ -677,10 +673,9 @@
         """called when the last tile changes"""
         self.fillLastMeldCombo()
 
-#TODO: QAction 'scoring' and kill this method
     def closeEvent(self, event):
         """the user pressed ALT-F4"""
-        assert self or True # quieten pylint
+        self.hide()
         event.ignore()
 
     def __getWinner(self):
@@ -1235,6 +1230,9 @@
         self.actionQuit = self.kmjAction("quit", "application-exit", self.quit)
         self.actionQuit.setShortcut( Qt.CTRL + Qt.Key_Q)
         self.actionPlayers = self.kmjAction("players",  "personal",  self.slotPlayers)
+        self.actionScoring = self.kmjAction("scoring", "draw-freehand", self.enterHand)
+        self.actionScoring.setShortcut( Qt.CTRL + Qt.Key_S)
+        self.actionScoring.setEnabled(False)
         self.actionAngle = self.kmjAction("angle",  "object-rotate-left",  self.changeAngle)
         self.actionAngle.setShortcut( Qt.CTRL + Qt.Key_A)
         self.actionFullscreen = KToggleFullScreenAction(self.actionCollection())
@@ -1305,6 +1303,7 @@
         self.actionPlayers.setText(m18n("&Players"))
         self.actionAngle.setText(m18n("&Change Visual Angle"))
         self.actionGames.setText(m18n("&Load"))
+        self.actionScoring.setText(m18n("&Scoring"))
         self.actionScoreTable.setText(m18nc('kmj', "&Score Table"))
         self.actionExplain.setText(m18n("&Explain Scores"))
 
@@ -1498,15 +1497,13 @@
         self.showBalance()
         if self.explainView:
             self.explainView.refresh()
-        self.enterHand()
+        self.actionScoring.setEnabled(True)
 
     def enterHand(self):
         """compute and save the scores. Makes player names immutable."""
         if not self.handDialog:
             self.handDialog = EnterHand(self)
             self.connect(self.handDialog.btnSave, SIGNAL('clicked(bool)'), self.saveHand)
-        else:
-            self.handDialog.clear()
         self.handDialog.show()
         self.handDialog.raise_()
 
@@ -1617,8 +1614,7 @@
         self.showScoreTable()
         self.showBalance()
         self.rotate()
-        if self.roundsFinished < 4:
-            self.enterHand()
+        self.actionScoring.setEnabled(self.roundsFinished < 4)
         if self.explainView:
             self.explainView.refresh()
 
@@ -1640,6 +1636,7 @@
         result = self.roundsFinished == 4
         if result:
             self.selectorBoard.setEnabled(False)
+            self.actionScoring.setEnabled(False)
             if self.handDialog:
                 self.handDialog.hide()
         return  result
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic