[rhythmbox] magnatune: Set names of radio buttons explicitly



commit be3bbc01c65632801a374cdf22c349672b4b5cda
Author: Adam Zimmerman <adamz src gnome org>
Date:   Thu Apr 15 16:23:15 2010 -0700

    magnatune: Set names of radio buttons explicitly
    
    In newer versions of pygtk(?), the name of a widget is not set from its id in
    the builder file. So we need to iterate over the radio buttons in the prefs
    dialog and set their name explicitly. We also need to use widget.get_name()
    instead of widget.props.name to access the name.
    
    Fixes bug #615658.

 plugins/magnatune/magnatune/__init__.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/magnatune/magnatune/__init__.py b/plugins/magnatune/magnatune/__init__.py
index 9602d49..bb9e47f 100644
--- a/plugins/magnatune/magnatune/__init__.py
+++ b/plugins/magnatune/magnatune/__init__.py
@@ -218,11 +218,11 @@ class Magnatune(rb.Plugin):
 				builder.get_object("account_changed_label").hide()
 
 			def account_type_toggled (button):
-				print "account type radiobutton toggled: " + button.props.name
+				print "account type radiobutton toggled: " + button.get_name()
 				account_type = {"no_account_radio": "none", "stream_account_radio": "stream", "download_account_radio": "download"}
 				if button.get_active():
-					self.client.set_string(self.gconf_keys['account_type'], account_type[button.props.name])
-					if account_type[button.props.name] == 'none':
+					self.client.set_string(self.gconf_keys['account_type'], account_type[button.get_name()])
+					if account_type[button.get_name()] == 'none':
 						builder.get_object("username_label").set_sensitive(False)
 						builder.get_object("username_entry").set_sensitive(False)
 						builder.get_object("password_label").set_sensitive(False)
@@ -270,6 +270,10 @@ class Magnatune(rb.Plugin):
 			# FIXME this bit should be in builder too  (what?)
 			dialog = builder.get_object('preferences_dialog')
 
+			# Set the names of the radio buttons so we can tell which one has been clicked
+			for name in ("no_account_radio", "stream_account_radio", "download_account_radio"):
+				builder.get_object(name).set_name(name)
+
 			builder.get_object("audio_combobox").set_active(self.format_list.index(self.client.get_string(self.gconf_keys['format'])))
 
 			builder.connect_signals(self.configure_callback_dic)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]