--- deluge-1.1.0/deluge/ui/gtkui/peers_tab.py.policy	2009-01-11 11:24:14.000000000 +0900
+++ deluge-1.1.0/deluge/ui/gtkui/peers_tab.py	2009-01-13 02:23:51.000000000 +0900
@@ -45,6 +45,19 @@
     cell.set_property("value", value * 100)
     cell.set_property("text", "%.2f%%" % (value * 100))
 
+# Use national flags if national flags are installed
+def use_national_flags():
+    pixmap_dir = pkg_resources.resource_filename(
+        "deluge", os.path.join("data", "pixmaps", "flags"))
+    try:
+        pixmap_number = len(os.listdir(pixmap_dir))
+        if pixmap_number > 3 :
+            return True
+        else :
+            return False
+    except OSError:
+        return False
+
 class PeersTab(Tab):
     def __init__(self):
         Tab.__init__(self)
@@ -71,10 +84,17 @@
         self.peers = {}
 
         # Country column
-        column = gtk.TreeViewColumn()
-        render = gtk.CellRendererPixbuf()
-        column.pack_start(render, False)
-        column.add_attribute(render, "pixbuf", 0)
+        self.use_national_flags = use_national_flags()
+        if self.use_national_flags:
+            column = gtk.TreeViewColumn()
+            render = gtk.CellRendererPixbuf()
+            column.pack_start(render, False)
+            column.add_attribute(render, "pixbuf", 0)
+        else:
+            column = gtk.TreeViewColumn("Country")
+            render = gtk.CellRendererText()
+            column.pack_start(render, False)
+            column.add_attribute(render, "text", 5)
         column.set_sort_column_id(5)
         column.set_clickable(True)
         column.set_resizable(True)
@@ -249,6 +269,8 @@
     def get_flag_pixbuf(self, country):
         if country == "  ":
             return None
+        if not self.use_national_flags :
+            return None
 
         if not self.cached_flag_pixbufs.has_key(country):
             # We haven't created a pixbuf for this country yet
--- deluge-1.1.0/setup.py.policy	2009-01-11 11:24:16.000000000 +0900
+++ deluge-1.1.0/setup.py	2009-01-13 02:24:41.000000000 +0900
@@ -33,6 +33,7 @@
 import msgfmt
 import os
 import platform
+import sys
 
 python_version = platform.python_version()[0:3]
 
@@ -202,6 +203,20 @@
 
     _ext_modules = [libtorrent]
 
+# Some distribution has a policy that national flags cannot
+# be installed.
+# This part parses the argument --without-national-flags
+# and if it is found set use_national_flags as False
+#
+use_national_flags = True
+for argc in range(1, len(sys.argv)):
+    str = sys.argv[argc]
+    if str == '--without-national-flags' :
+        use_national_flags = False
+        # Remove this argument
+        del sys.argv[argc]
+        break
+
 class build_trans(cmd.Command):
     description = 'Compile .po files into .mo files'
 
@@ -342,6 +357,48 @@
     ('share/man/man1', ['deluge/docs/man/deluge.1', 'deluge/docs/man/deluged.1'])
 ]
 
+_package_data = [
+    "ui/gtkui/glade/*.glade",
+    "data/pixmaps/*.png",
+    "data/pixmaps/*.svg",
+    "data/pixmaps/*.ico",
+    "data/revision",
+    "data/GeoIP.dat",
+    "plugins/*.egg",
+    "i18n/*.pot",
+    "i18n/*/LC_MESSAGES/*.mo",
+    "ui/webui/scripts/*",
+    "ui/webui/ssl/*",
+    "ui/webui/static/*.css",
+    "ui/webui/static/*.js",
+    "ui/webui/static/images/*.png",
+    "ui/webui/static/images/*.jpg",
+    "ui/webui/static/images/*.gif",
+    "ui/webui/static/images/16/*.png",
+    "ui/webui/templates/deluge/*",
+    "ui/webui/templates/classic/*",
+    "ui/webui/templates/white/*",
+    "ui/webui/templates/ajax/*.cfg",
+    "ui/webui/templates/ajax/*.js",
+    "ui/webui/templates/ajax/*.html",
+    "ui/webui/templates/ajax/*.css",
+    "ui/webui/templates/ajax/render/html/*.html",
+    "ui/webui/templates/ajax/render/js/*",
+    "ui/webui/templates/ajax/static/css/*.css",
+    "ui/webui/templates/ajax/static/icons/16/*.png",
+    "ui/webui/templates/ajax/static/icons/32/*.png",
+    "ui/webui/templates/ajax/static/images/*.gif",
+    "ui/webui/templates/ajax/static/js/*.js",
+    "ui/webui/templates/ajax/static/themes/classic/*.png",
+    "ui/webui/templates/ajax/static/themes/classic/*.css",
+    "ui/webui/templates/ajax/static/themes/classic/mime_icons/*.png",
+    "ui/webui/templates/ajax/static/themes/white/*.png",
+    "ui/webui/templates/ajax/static/themes/white/*.css",
+    "ui/webui/templates/ajax/static/themes/white/mime_icons/*.png",
+]
+if use_national_flags :
+    _package_data.append("data/pixmaps/flags/*.png")
+
 # Main setup
 setup(
     author = "Andrew Resch, Marcos Pinto, Martijn Voncken, Damien Churchill",
@@ -365,45 +422,7 @@
     include_package_data = True,
     license = "GPLv3",
     name = "deluge",
-    package_data = {"deluge": ["ui/gtkui/glade/*.glade",
-                                "data/pixmaps/*.png",
-                                "data/pixmaps/*.svg",
-                                "data/pixmaps/*.ico",
-                                "data/pixmaps/flags/*.png",
-                                "data/revision",
-                                "data/GeoIP.dat",
-                                "plugins/*.egg",
-                                "i18n/*.pot",
-                                "i18n/*/LC_MESSAGES/*.mo",
-                                "ui/webui/scripts/*",
-                                "ui/webui/ssl/*",
-                                "ui/webui/static/*.css",
-                                "ui/webui/static/*.js",
-                                "ui/webui/static/images/*.png",
-                                "ui/webui/static/images/*.jpg",
-                                "ui/webui/static/images/*.gif",
-                                "ui/webui/static/images/16/*.png",
-                                "ui/webui/templates/deluge/*",
-                                "ui/webui/templates/classic/*",
-                                "ui/webui/templates/white/*",
-                                "ui/webui/templates/ajax/*.cfg",
-                                "ui/webui/templates/ajax/*.js",
-                                "ui/webui/templates/ajax/*.html",
-                                "ui/webui/templates/ajax/*.css",
-                                "ui/webui/templates/ajax/render/html/*.html",
-                                "ui/webui/templates/ajax/render/js/*",
-                                "ui/webui/templates/ajax/static/css/*.css",
-                                "ui/webui/templates/ajax/static/icons/16/*.png",
-                                "ui/webui/templates/ajax/static/icons/32/*.png",
-                                "ui/webui/templates/ajax/static/images/*.gif",
-                                "ui/webui/templates/ajax/static/js/*.js",
-                                "ui/webui/templates/ajax/static/themes/classic/*.png",
-                                "ui/webui/templates/ajax/static/themes/classic/*.css",
-                                "ui/webui/templates/ajax/static/themes/classic/mime_icons/*.png",
-                                "ui/webui/templates/ajax/static/themes/white/*.png",
-                                "ui/webui/templates/ajax/static/themes/white/*.css",
-                                "ui/webui/templates/ajax/static/themes/white/mime_icons/*.png",
-                                ]},
+    package_data = {"deluge": _package_data},
     packages = find_packages(exclude=["plugins"]),
     url = "http://deluge-torrent.org",
     version = "1.1.0",
