From: <umg...@us...> - 2007-07-11 13:56:12
|
Revision: 476 http://svn.sourceforge.net/pybridge/?rev=476&view=rev Author: umgangee Date: 2007-07-11 06:56:10 -0700 (Wed, 11 Jul 2007) Log Message: ----------- Change pybridge.bridge references to pybridge.games.bridge. Modified Paths: -------------- trunk/pybridge/pybridge/games/bridge/ui/window_bidbox.py trunk/pybridge/pybridge/ui/dialog_newtable.py trunk/pybridge/pybridge/ui/dialog_preferences.py trunk/pybridge/pybridge/ui/vocabulary.py trunk/pybridge/pybridge/ui/window_main.py Modified: trunk/pybridge/pybridge/games/bridge/ui/window_bidbox.py =================================================================== --- trunk/pybridge/pybridge/games/bridge/ui/window_bidbox.py 2007-07-11 13:54:14 UTC (rev 475) +++ trunk/pybridge/pybridge/games/bridge/ui/window_bidbox.py 2007-07-11 13:56:10 UTC (rev 476) @@ -22,7 +22,7 @@ from pybridge.ui.eventhandler import SimpleEventHandler from pybridge.ui.vocabulary import * -import pybridge.bridge.call as Call +import pybridge.games.bridge.call as Call class WindowBidbox(object): Modified: trunk/pybridge/pybridge/ui/dialog_newtable.py =================================================================== --- trunk/pybridge/pybridge/ui/dialog_newtable.py 2007-07-11 13:54:14 UTC (rev 475) +++ trunk/pybridge/pybridge/ui/dialog_newtable.py 2007-07-11 13:56:10 UTC (rev 476) @@ -20,6 +20,7 @@ from wrapper import GladeWrapper from pybridge.network.client import client +from pybridge.games import SUPPORTED_GAMES from manager import wm @@ -29,6 +30,7 @@ def setUp(self): + # TODO: display intersection of games supported by client and server. pass @@ -57,7 +59,8 @@ def on_okbutton_clicked(self, widget, *args): tableid = self.entry_tablename.get_text() - d = client.joinTable(tableid, host=True) + d = client.joinTable(tableid, gameclass=SUPPORTED_GAMES['Bridge'], + host=True) d.addCallbacks(self.createSuccess, self.createFailure) @@ -66,3 +69,7 @@ sensitive = self.entry_tablename.get_text() != "" self.okbutton.set_property('sensitive', sensitive) + + def on_window_delete_event(self, widget, *args): + wm.close(self) + Modified: trunk/pybridge/pybridge/ui/dialog_preferences.py =================================================================== --- trunk/pybridge/pybridge/ui/dialog_preferences.py 2007-07-11 13:54:14 UTC (rev 475) +++ trunk/pybridge/pybridge/ui/dialog_preferences.py 2007-07-11 13:56:10 UTC (rev 476) @@ -25,7 +25,7 @@ from manager import wm from vocabulary import * -from pybridge.bridge.symbols import Suit +from pybridge.games.bridge.symbols import Suit SUIT_LABEL_TEMPLATE = "<span color=\'%s\' size=\'x-large\'>%s</span>" Modified: trunk/pybridge/pybridge/ui/vocabulary.py =================================================================== --- trunk/pybridge/pybridge/ui/vocabulary.py 2007-07-11 13:54:14 UTC (rev 475) +++ trunk/pybridge/pybridge/ui/vocabulary.py 2007-07-11 13:56:10 UTC (rev 476) @@ -22,8 +22,8 @@ import gtk -from pybridge.bridge.symbols import * -import pybridge.bridge.call as Call +from pybridge.games.bridge.symbols import * +import pybridge.games.bridge.call as Call from config import config Modified: trunk/pybridge/pybridge/ui/window_main.py =================================================================== --- trunk/pybridge/pybridge/ui/window_main.py 2007-07-11 13:54:14 UTC (rev 475) +++ trunk/pybridge/pybridge/ui/window_main.py 2007-07-11 13:56:10 UTC (rev 476) @@ -23,6 +23,7 @@ import webbrowser from pybridge import __version__ as PYBRIDGE_VERSION +from pybridge.games import SUPPORTED_GAMES import pybridge.environment as env from pybridge.network.client import client @@ -34,7 +35,7 @@ from dialog_preferences import DialogPreferences # TODO: import all Window*Table classes automatically. -from pybridge.bridge.ui.window_bridgetable import WindowBridgeTable +from pybridge.games.bridge.ui.window_bridgetable import WindowBridgeTable TABLE_ICON = env.find_pixmap("table.png") USER_ICON = env.find_pixmap("user.png") @@ -164,7 +165,9 @@ def event_openTable(self, tableid, info): """Adds a table to the table listing.""" - self.tableview_model.append([tableid, self.tableview_icon]) + # Only display table if it supported by client. + if info['gamename'] in SUPPORTED_GAMES: + self.tableview_model.append([tableid, self.tableview_icon]) def event_closeTable(self, tableid): @@ -221,7 +224,7 @@ # Display information about table. self.frame_tableinfo.set_property('sensitive', True) self.label_tableid.set_text(tableid) - self.label_tabletype.set_text(client.tableRoster[tableid]['game']) + self.label_tabletype.set_text(client.tableRoster[tableid]['gamename']) else: self.frame_tableinfo.set_property('sensitive', False) self.label_tableid.set_text('') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |