The unified diff between revisions [7ab22dd1..] and [888c98d8..] is displayed below. It can also be downloaded as a raw diff.
#
#
# patch "InterApplet.server"
# from [24cadf6bfc9e68b0439c7e6d15ce011c4204b5f1]
# to [d8289e02e64317476fecf2da44048b1b00023336]
#
# patch "debian/changelog"
# from [7871ef08296be945720c500701688971a5b4a679]
# to [b2277f259ffcdb24def5a7e58816473cc014d957]
#
# patch "debian/files"
# from [854e671a5064b50e4b1f1d26100397b9c23cb4b0]
# to [8bc7f994e85549f07e2a9ee1a53a0b695cc023c2]
#
# patch "debian/rules"
# from [bff7564f5d01a903e7b09dfbcae690ec8413e1c5]
# to [dddffb2ebabbc43a1064cc56009adea90d27c1b2]
#
# patch "interapplet.py"
# from [663dda2fd27005467c1ded02eaee035e9409b9b4]
# to [cba2df27c7627d95d3a89b4276dcaa93c8f7f8b7]
#
============================================================
--- InterApplet.server 24cadf6bfc9e68b0439c7e6d15ce011c4204b5f1
+++ InterApplet.server d8289e02e64317476fecf2da44048b1b00023336
@@ -18,8 +18,8 @@
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Bonobo/Unknown:1.0"/>
</oaf_attribute>
- <oaf_attribute name="name" type="string" value="Network Location Applet"/>
- <oaf_attribute name="description" type="string" value="Applet allowing you to change your network configuration using profiles" />
+ <oaf_attribute name="name" type="string" value="InterApplet"/>
+ <oaf_attribute name="description" type="string" value="Change your network configuration using profiles" />
<oaf_attribute name="panel:category" type="string" value="Internet"/>
<oaf_attribute name="panel:icon" type="string" value="bug-buddy.png"/>
============================================================
--- debian/changelog 7871ef08296be945720c500701688971a5b4a679
+++ debian/changelog b2277f259ffcdb24def5a7e58816473cc014d957
@@ -1,6 +1,6 @@
-interapplet (0.1-1) unstable; urgency=low
+interapplet (0.01-1) unstable; urgency=low
* Initial Release.
- -- Grahame Bowland <grahame@anduril.uwa.edu.au> Tue, 12 Apr 2005 10:14:23 +0800
+ -- Grahame Bowland <grahame@angrygoats.net> Tue, 12 Apr 2005 10:14:23 +0800
============================================================
--- debian/files 854e671a5064b50e4b1f1d26100397b9c23cb4b0
+++ debian/files 8bc7f994e85549f07e2a9ee1a53a0b695cc023c2
@@ -1 +1 @@
-interapplet_0.1-1_all.deb net optional
+interapplet_0.01-1_all.deb net optional
============================================================
--- debian/rules bff7564f5d01a903e7b09dfbcae690ec8413e1c5
+++ debian/rules dddffb2ebabbc43a1064cc56009adea90d27c1b2
@@ -69,7 +69,7 @@ binary-indep: build install
dh_testdir
dh_testroot
dh_installchangelogs
- dh_installdocs
+ dh_installdocs interfaces.sample
dh_installexamples
# dh_install
# dh_installmenu
============================================================
--- interapplet.py 663dda2fd27005467c1ded02eaee035e9409b9b4
+++ interapplet.py cba2df27c7627d95d3a89b4276dcaa93c8f7f8b7
@@ -40,6 +40,16 @@ class InterfaceInfo:
self.dialups = set()
self.interfaces = set()
self.mappings = set()
+ self.mappable = set()
+
+ # FIXME this will never update, which is awful
+ exclude = set(('gre0', 'lo', 'tunl0', 'dummy0'))
+ for line in open('/proc/net/dev'):
+ m = re.match(r' *([^:]+):', line)
+ if m:
+ ifname = m.groups()[0].strip()
+ if ifname not in exclude: self.mappable.add(ifname)
+
fd = open(file)
mapping = re.compile(r'^\s?mapping\s+([\w_:]+)')
@@ -47,6 +57,7 @@ class InterfaceInfo:
auto = re.compile(r'^\s?auto[\s^]')
iface = re.compile(r'^\s?iface\s+([\w_]+)\s+([\w_]+)\s+([\w_]+)')
+
current_mapping = None
for line in fd:
@@ -218,8 +229,9 @@ class InterfaceApplet(gnomeapplet.Applet
def disable_interface(self, int):
command = '/sbin/ifdown %s' % (pipes.quote(int))
self.run_command("/usr/bin/gksudo %s" % (pipes.quote(command)))
- def enable_interface(self, int):
- command = '/sbin/ifup %s' % (pipes.quote(int))
+ def enable_interface(self, int, mapping=None):
+ command = '/sbin/ifup ' + pipes.quote(int)
+ if mapping != None: command += "=" + pipes.quote(mapping)
self.run_command("/usr/bin/gksudo %s" % (pipes.quote(command)))
def init_state_files(self):
for mapping in self.if_state.state:
@@ -264,7 +276,7 @@ class InterfaceApplet(gnomeapplet.Applet
if new_interface == current_interface: return
self.disable_interface(apply_to)
self.update_state(apply_to, params[0])
- self.enable_interface(apply_to)
+ self.enable_interface(apply_to, params[0])
def build_mapping_menu(self, mapping):
menu = gtk.Menu()
explicit = map(lambda x: x[0], self.if_info.maps.get(mapping, []))
@@ -317,11 +329,11 @@ class InterfaceApplet(gnomeapplet.Applet
return menu
def build_menu(self):
menu = gtk.Menu()
- mappings = list(self.if_info.mappings)
+ mappings = list(self.if_info.mappable)
mappings.sort()
nin = gtk.Image()
if len(mappings) == 0:
- item = gtk.ImageMenuItem("No mappings defined. See README file.")
+ item = gtk.ImageMenuItem("No mapable interfaces found.")
item.set_sensitive(False)
item.show()
menu.append(item)