1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-08 14:54:15 +01:00

Added support for recording dhcp hostnames in wicd-client.

This commit is contained in:
Andrew Psaltis
2009-08-23 14:08:31 -04:00
parent 33ae33e660
commit 8b1efca479

View File

@@ -8,6 +8,7 @@ contained within them.
#
# Copyright (C) 2008-2009 Adam Blackburn
# Copyright (C) 2008-2009 Dan O'Reilly
# Copyright (C) 2009 Andrew Psaltis
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
@@ -73,6 +74,7 @@ class AdvancedSettingsDialog(gtk.Dialog):
self.txt_dns_1 = LabelEntry(language['dns'] + ' 1')
self.txt_dns_2 = LabelEntry(language['dns'] + ' 2')
self.txt_dns_3 = LabelEntry(language['dns'] + ' 3')
self.txt_dhcp_hostname = LabelEntry("DHCP Hostname")
self.chkbox_static_ip = gtk.CheckButton(language['use_static_ip'])
self.chkbox_static_dns = gtk.CheckButton(language['use_static_dns'])
self.chkbox_global_dns = gtk.CheckButton(language['use_global_dns'])
@@ -104,6 +106,7 @@ class AdvancedSettingsDialog(gtk.Dialog):
self.vbox.pack_start(self.txt_dns_1, fill=False, expand=False)
self.vbox.pack_start(self.txt_dns_2, fill=False, expand=False)
self.vbox.pack_start(self.txt_dns_3, fill=False, expand=False)
self.vbox.pack_start(self.txt_dhcp_hostname, fill=False, expand=False)
self.vbox.pack_end(self.button_hbox, fill=False, expand=False, padding=5)
@@ -238,6 +241,7 @@ class AdvancedSettingsDialog(gtk.Dialog):
self.set_net_prop("dns1", '')
self.set_net_prop("dns2", '')
self.set_net_prop("dns3", '')
self.set_net_prop("dhcphostname",noneToString(self.txt_dhcp_hostname.get_text()))
class WiredSettingsDialog(AdvancedSettingsDialog):
@@ -279,6 +283,12 @@ class WiredSettingsDialog(AdvancedSettingsDialog):
self.txt_domain.set_text(self.format_entry("dns_domain"))
self.txt_search_dom.set_text(self.format_entry("search_domain"))
self.chkbox_global_dns.set_active(bool(wired.GetWiredProperty("use_global_dns")))
dhcphname = wired.GetWiredProperty("dhcphostname")
if dhcphname is None:
dhcphname = os.uname()[1]
self.txt_dhcp_hostname.set_text(dhcphname)
self.reset_static_checkboxes()
def save_settings(self):
@@ -395,6 +405,11 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
self.chkbox_global_settings.set_active(bool(wireless.GetWirelessProperty(networkID,
'use_settings_globally')))
dhcphname = wireless.GetWirelessProperty(networkID,"dhcphostname")
if dhcphname is None:
dhcphname = os.uname()[1]
self.txt_dhcp_hostname.set_text(dhcphname)
activeID = -1 # Set the menu to this item when we are done
user_enctype = wireless.GetWirelessProperty(networkID, "enctype")
for x, enc_type in enumerate(self.encrypt_types):