From: <umg...@us...> - 2007-06-18 11:55:02
|
Revision: 424 http://svn.sourceforge.net/pybridge/?rev=424&view=rev Author: umgangee Date: 2007-06-18 04:55:03 -0700 (Mon, 18 Jun 2007) Log Message: ----------- Display disconnect confirm dialog only when user is playing at a table, switch to ConfigObj configuration management. Modified Paths: -------------- trunk/pybridge/pybridge/ui/window_main.py Modified: trunk/pybridge/pybridge/ui/window_main.py =================================================================== --- trunk/pybridge/pybridge/ui/window_main.py 2007-06-18 11:53:43 UTC (rev 423) +++ trunk/pybridge/pybridge/ui/window_main.py 2007-06-18 11:55:03 UTC (rev 424) @@ -28,7 +28,6 @@ from eventhandler import SimpleEventHandler from manager import WindowManager, wm -from pybridge.ui import settings from dialog_connection import DialogConnection from dialog_newtable import DialogNewtable @@ -82,9 +81,7 @@ wm.close(window) client.disconnect() - settings.save() # Save configuration. - def quit(self): """Shut down gracefully.""" wm.close(self) @@ -244,16 +241,15 @@ def on_disconnect_activate(self, widget, *args): do_disconnect = True - #if len([True for table in self.tables if table.player]) > 0: - if self.tables: + if len([True for table in self.tables.values() if table.player]) > 0: dialog = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_MODAL, type=gtk.MESSAGE_QUESTION) - dialog.set_title(_('Disconnect from Server')) + dialog.set_title(_('Disconnect from server')) dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL) dialog.add_button(gtk.STOCK_DISCONNECT, gtk.RESPONSE_OK) dialog.set_markup(_('Are you sure you wish to disconnect?')) - dialog.format_secondary_text(_('You are playing a game. Disconnecting may forfeit the game, or incur penalties.')) + dialog.format_secondary_text(_('You are playing at a table. Disconnecting may forfeit the game, or incur penalties.')) do_disconnect = (dialog.run() == gtk.RESPONSE_OK) dialog.destroy() @@ -292,7 +288,10 @@ logo_path = env.find_pixmap('pybridge.png') logo = gtk.gdk.pixbuf_new_from_file(logo_path) about.set_logo(logo) - - about.run() - about.destroy() + def dialog_response_cb(dialog, response_id): + dialog.destroy() + + about.connect('response', dialog_response_cb) + about.show() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |