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 / DialogProprietary.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2006-08-31  |  2.8 KB  |  63 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. from SimpleGladeApp import SimpleGladeApp
  5. import gtk
  6. import gobject
  7. import os
  8. from gettext import gettext as _
  9. import gettext
  10. from BrowserView import GtkHtml2BrowserView as BrowserView
  11.  
  12. class DialogProprietary(SimpleGladeApp):
  13.     
  14.     def __init__(self, datadir, parent, item):
  15.         SimpleGladeApp.__init__(self, path = datadir + '/gnome-app-install.glade', root = 'dialog_proprietary', domain = 'gnome-app-install')
  16.         msg = '<b><big>%s</big></b>\n\n%s\n\n%s' % (_('Install software from %s?') % item.channel, _('%s is provided by a third party vendor.') % item.name, _('You need a working internet connection to  continue.'))
  17.         self.dialog_proprietary.set_transient_for(parent)
  18.         self.dialog_proprietary.realize()
  19.         self.dialog_proprietary.window.set_functions(gtk.gdk.FUNC_MOVE)
  20.         self.label_proprietary.set_markup(msg)
  21.         self.item = item
  22.         self.button_add_channel.set_label(_('_Install'))
  23.  
  24.     
  25.     def run(self):
  26.         if self.item.licenseUri:
  27.             msg = self.label_proprietary.get_label()
  28.             msg += '\n\n'
  29.             msg += _("The application comes with the following license terms and conditions. Click on the 'Install' button to accept them:")
  30.             self.label_proprietary.set_markup(msg)
  31.             self.tooltips = gtk.Tooltips()
  32.             self.tooltips.set_tip(self.button_add_channel, _('Accept the license terms and install the software'))
  33.             self.browser.show()
  34.             self.browser.loadUri(self.item.licenseUri)
  35.         else:
  36.             self.button_add_channel.set_label(_('_Ok'))
  37.             self.browser.hide()
  38.         self.button_add_channel.grab_default()
  39.         return self.dialog_proprietary.run()
  40.  
  41.     
  42.     def hide(self):
  43.         self.dialog_proprietary.hide()
  44.  
  45.     
  46.     def create_proprietary_browser_view(self, s1, s2, i1, i2):
  47.         self.browser = BrowserView()
  48.         return self.browser
  49.  
  50.  
  51. if __name__ == '__main__':
  52.     import sys
  53.     
  54.     class Item(object):
  55.         pass
  56.  
  57.     item = Item()
  58.     item.licenseUri = sys.argv[1]
  59.     item.channel = sys.argv[1]
  60.     dia = DialogProprietary('../data/', None, item)
  61.     dia.run()
  62.  
  63.