home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / python2.4 / site-packages / AppInstall / DialogUnavailable.py < prev    next >
Encoding:
Python Source  |  2006-08-02  |  2.4 KB  |  54 lines

  1. # (c) 2005 Canonical, GPL
  2.  
  3. from SimpleGladeApp import SimpleGladeApp
  4. import gtk
  5. import os
  6. from gettext import gettext as _
  7. import gettext
  8. from BrowserView import GtkHtml2BrowserView as BrowserView
  9.  
  10. class DialogUnavailable(SimpleGladeApp):
  11.  
  12.     def __init__(self, datadir, parent, item):
  13.         SimpleGladeApp.__init__(self,
  14.                                 path=datadir+"/gnome-app-install.glade",
  15.                                 root="dialog_unavailable",
  16.                                 domain="gnome-app-install")
  17.         # Keep this strings in sync with the ones in the app description of the main window,
  18.         # to minimize the translation work
  19.         #FIXME: also mention the security updates
  20.         if item.component == "main":
  21.             header = _("Install supported Ubuntu software?")
  22.             msg = _("%s is part of the Ubuntu main distribution.") % item.name
  23.         elif item.component == "universe":
  24.             header = _("Install community maintained software?")
  25.             msg = _("%s is maintained by the Ubuntu community.") % item.name
  26.         elif item.component == "multiverse":
  27.             header = _("Install unsupported and restricted software?")
  28.             msg = _("The use, modification and distribution of %s "
  29.                     "is restricted by copyright or by legal terms in "
  30.                     "some countries.") % item.name
  31.         elif item.component:
  32.             # Only a fallback
  33.             header = _("Install software from the %s component of Ubuntu?") % item.component
  34.             msg = _("%s is not officially supported with security updates.") % item.name
  35.         elif item.channel:
  36.             header = _("Install software from %s?") % item.channel
  37.             msg = _("%s is provided by a third party vendor. The third party vendor "
  38.                     "is responsible for support and security updates.") % item.name
  39.         msg += "\n\n%s" % _("You need a working internet connection to continue.")
  40.         self.button_unavailable_add.set_label(_("_Install"))
  41.         self.dialog_unavailable.set_transient_for(parent)
  42.         self.dialog_unavailable.realize()
  43.         self.dialog_unavailable.window.set_functions(gtk.gdk.FUNC_MOVE)
  44.         self.unavailable_label.set_markup("<b><big>%s</big></b>\n\n%s" %
  45.                                           (header, msg))
  46.  
  47.     def run(self):
  48.         return self.dialog_unavailable.run()
  49.  
  50.     def hide(self):
  51.         self.dialog_unavailable.hide()
  52.  
  53.  
  54.