home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / lib / gui / supportdigsby / supportoptions.pyo (.txt) < prev   
Encoding:
Python Compiled Bytecode  |  2009-02-26  |  6.8 KB  |  165 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4.  
  5. try:
  6.     _
  7. except NameError:
  8.     
  9.     _ = lambda s: s
  10.  
  11.  
  12. class SupportMechanism(object):
  13.     action_text = None
  14.     description = None
  15.     tooltip = None
  16.     action_url = None
  17.     say_thanks = False
  18.     confirm = False
  19.     confirm_text = None
  20.     confirm_title = None
  21.     confirm_default = True
  22.     
  23.     def on_action(self):
  24.         pass
  25.  
  26.  
  27.  
  28. class SearchHomepage(SupportMechanism):
  29.     action_text = _('Set')
  30.     description = _('Make Google Powered Digsby Search your homepage')
  31.     say_thanks = True
  32.     
  33.     def on_action(self):
  34.         import util.checkoptions as co
  35.         co.set_homepage_active()
  36.  
  37.  
  38.  
  39. class SearchEngine(SupportMechanism):
  40.     action_text = _('Set')
  41.     description = _('Make Google Powered Digsby Search your default search engine')
  42.     say_thanks = True
  43.     
  44.     def on_action(self):
  45.         import util.checkoptions as co
  46.         co.set_search_active()
  47.  
  48.  
  49.  
  50. class EmailInviter(SupportMechanism):
  51.     action_text = _('Invite')
  52.     description = _('Invite your friends via Email')
  53.     action_url = 'http://www.digsby.com/invite/'
  54.  
  55.  
  56. class FacebookInviter(SupportMechanism):
  57.     action_text = _('Invite')
  58.     description = _('Invite your friends via Facebook')
  59.     action_url = 'http://apps.facebook.com/digsbyim/invite.php'
  60.  
  61.  
  62. class FacebookFan(SupportMechanism):
  63.     action_text = _('Join Group')
  64.     description = _('Become a fan on Facebook')
  65.     action_url = 'http://www.facebook.com/apps/application.php?id=5895217474'
  66.  
  67.  
  68. class LinkedInFan(SupportMechanism):
  69.     action_text = _('Join Group')
  70.     description = _('Become a fan on LinkedIn')
  71.     action_url = 'http://www.linkedin.com/groups?gid=911917'
  72.  
  73.  
  74. class TwitterFollow(SupportMechanism):
  75.     action_text = _('Follow')
  76.     description = _('Follow us on Twitter')
  77.     action_url = 'http://www.twitter.com/digsby'
  78.  
  79.  
  80. class Research(SupportMechanism):
  81.     description = _('Help Digsby conduct research')
  82.     confirm = False
  83.     confirm_text = _('Helping us conduct research keeps Digsby free and ad-free. Are you sure you want to disable this option?')
  84.     confirm_title = _('Are you sure?')
  85.     confirm_default = False
  86.     
  87.     def should_confirm(self):
  88.         import common
  89.         return common.pref('research.enabled', type = bool, default = True)
  90.  
  91.     
  92.     def _get_action_text(self):
  93.         import common
  94.         if common.pref('research.enabled', type = bool, default = True):
  95.             return _('Disable')
  96.         else:
  97.             return _('Enable')
  98.  
  99.     action_text = property(_get_action_text)
  100.     
  101.     def on_action(self):
  102.         import common
  103.         common.setpref('research.enabled', not common.pref('research.enabled', type = bool, default = True))
  104.  
  105.  
  106.  
  107. class BlogSubscribe(SupportMechanism):
  108.     action_text = _('Subscribe')
  109.     description = _('Subscribe to our Blog')
  110.     action_url = 'http://blog.digsby.com/feed'
  111.  
  112.  
  113. class CreateWidget(SupportMechanism):
  114.     action_text = _('Create')
  115.     description = _('Create a Digsby widget for your blog or website')
  116.     action_url = 'http://widget.digsby.com/'
  117.  
  118.  
  119. class IncrementCounter(SupportMechanism):
  120.     
  121.     def _get_action_text(self):
  122.         return _('Set to %r') % (getattr(self, 'counter', 0) + 1)
  123.  
  124.     
  125.     def _get_description(self):
  126.         return _('Increment this number: %r') % getattr(self, 'counter', 0)
  127.  
  128.     action_text = property(_get_action_text)
  129.     description = property(_get_description)
  130.     
  131.     def on_action(self):
  132.         setattr(self, 'counter', getattr(self, 'counter', 0) + 1)
  133.  
  134.  
  135.  
  136. class TextElongonator(SupportMechanism):
  137.     action_text = 'More!'
  138.     description = 'Add dashes to this text label '
  139.     
  140.     def on_action(self):
  141.         self.description += '-'
  142.  
  143.  
  144. enabled = [
  145.     SearchHomepage,
  146.     SearchEngine,
  147.     EmailInviter,
  148.     FacebookInviter,
  149.     FacebookFan,
  150.     LinkedInFan,
  151.     TwitterFollow,
  152.     BlogSubscribe,
  153.     CreateWidget]
  154.  
  155. def get_enabled():
  156.     import common
  157.     myenabled = enabled[:]
  158.     if common.pref('support.show_research_option', type = bool, default = True):
  159.         if Research not in myenabled:
  160.             myenabled.insert(-2, Research)
  161.         
  162.     
  163.     return myenabled
  164.  
  165.