1
0
mirror of https://github.com/gryf/wicd.git synced 2026-03-09 11:05:48 +01:00

Don't try to set properties in the advanced dialog before it exists.

This commit is contained in:
Dan O'Reilly
2009-01-25 16:40:26 -05:00
parent c92efc5279
commit 613215f033

View File

@@ -551,8 +551,6 @@ class WiredNetworkEntry(NetworkEntry):
self.button_delete = gtk.Button(stock=gtk.STOCK_DELETE) self.button_delete = gtk.Button(stock=gtk.STOCK_DELETE)
self.profile_help = gtk.Label(language['wired_network_instructions']) self.profile_help = gtk.Label(language['wired_network_instructions'])
self.chkbox_default_profile = gtk.CheckButton(language['default_wired']) self.chkbox_default_profile = gtk.CheckButton(language['default_wired'])
# Build the profile list.
self.combo_profile_names = gtk.combo_box_new_text() self.combo_profile_names = gtk.combo_box_new_text()
# Format the profile help label. # Format the profile help label.
@@ -591,10 +589,11 @@ class WiredNetworkEntry(NetworkEntry):
print "no wired profiles found" print "no wired profiles found"
self.profile_help.show() self.profile_help.show()
self.advanced_dialog = WiredSettingsDialog(self.combo_profile_names.get_active_text())
# Show everything, but hide the profile help label. # Show everything, but hide the profile help label.
self.show_all() self.show_all()
self.profile_help.hide() self.profile_help.hide()
self.advanced_dialog = WiredSettingsDialog(self.combo_profile_names.get_active_text())
# Toggle the default profile checkbox to the correct state. # Toggle the default profile checkbox to the correct state.
if to_bool(wired.GetWiredProperty("default")): if to_bool(wired.GetWiredProperty("default")):
@@ -704,8 +703,9 @@ class WiredNetworkEntry(NetworkEntry):
profile_name = self.combo_profile_names.get_active_text() profile_name = self.combo_profile_names.get_active_text()
wired.ReadWiredNetworkProfile(profile_name) wired.ReadWiredNetworkProfile(profile_name)
self.advanced_dialog.prof_name = profile_name if self.advanced_dialog:
self.advanced_dialog.set_values() self.advanced_dialog.prof_name = profile_name
self.advanced_dialog.set_values()
is_default = wired.GetWiredProperty("default") is_default = wired.GetWiredProperty("default")
self.chkbox_default_profile.set_active(to_bool(is_default)) self.chkbox_default_profile.set_active(to_bool(is_default))