gnome-games r7746 - in trunk/glchess: glade src/lib/gtkui
- From: rancell svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-games r7746 - in trunk/glchess: glade src/lib/gtkui
- Date: Sun, 29 Jun 2008 10:36:04 +0000 (UTC)
Author: rancell
Date: Sun Jun 29 10:36:04 2008
New Revision: 7746
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7746&view=rev
Log:
Don't disable load button on load dialog as we cannot tell if the user has selected a valid file (Bug #540527)
Modified:
trunk/glchess/glade/load_game.glade
trunk/glchess/src/lib/gtkui/dialogs.py
Modified: trunk/glchess/glade/load_game.glade
==============================================================================
--- trunk/glchess/glade/load_game.glade (original)
+++ trunk/glchess/glade/load_game.glade Sun Jun 29 10:36:04 2008
@@ -63,7 +63,6 @@
<child>
<widget class="GtkButton" id="open_button">
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="can_focus">True</property>
@@ -182,7 +181,6 @@
<property name="select_multiple">False</property>
<property name="show_hidden">False</property>
<signal name="file_activated" handler="_on_file_activated" last_modification_time="Sat, 10 Feb 2007 12:22:54 GMT"/>
- <signal name="selection_changed" handler="_on_file_changed" last_modification_time="Sat, 10 Feb 2007 12:26:11 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
Modified: trunk/glchess/src/lib/gtkui/dialogs.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/dialogs.py (original)
+++ trunk/glchess/src/lib/gtkui/dialogs.py Sun Jun 29 10:36:04 2008
@@ -424,37 +424,26 @@
fileChooser.add_filter(allFilter)
self.window.present()
-
- def __getFilename(self):
- """Get the currently selected filename.
-
- Returns the filename (string) or None if none selected.
- """
- return self.__gui.get_widget('filechooserwidget').get_filename()
-
- def _on_file_changed(self, widget):
- """Gtk+ callback"""
- name = self.__getFilename()
- if name is None:
- isFile = False
- else:
- isFile = os.path.isfile(name)
- self.__gui.get_widget('properties_button').set_sensitive(isFile)
- self.__gui.get_widget('open_button').set_sensitive(isFile)
-
+
def _on_file_activated(self, widget):
"""Gtk+ callback"""
self._on_response(self.window, gtk.RESPONSE_OK)
def _on_response(self, dialog, responseId):
"""Gtk+ callback"""
- chooser= self.__gui.get_widget('filechooserwidget')
+ chooser = self.__gui.get_widget('filechooserwidget')
if responseId == gtk.RESPONSE_OK or responseId == gtk.RESPONSE_YES:
folder = chooser.get_current_folder()
if folder is not None:
glchess.config.set('load_directory', folder)
- error = self.__mainUI.feedback.loadGame(self.__getFilename(), responseId == gtk.RESPONSE_YES)
+
+ fileName = self.__gui.get_widget('filechooserwidget').get_filename()
+ if fileName is None:
+ error = _('Please select a file to load')
+ else:
+ error = self.__mainUI.feedback.loadGame(fileName, responseId == gtk.RESPONSE_YES)
+
if error is not None:
self.firstExpose = True
self.__gui.get_widget('error_box').show()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]