home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2012 January / maximum-cd-2012-01.iso / DiscContents / digsby_setup.exe / lib / plugins / myspace / msgui.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2011-10-05  |  4.5 KB  |  108 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import wx
  5. import gui.skin as skin
  6. import gui.toolbox as toolbox
  7. import gui.textutil as textutil
  8. import digsby_service_editor.default_ui as default_ui
  9.  
  10. class MySpaceAchievementsDialog(toolbox.UpgradeDialog):
  11.     faq_link_label = _('Learn More')
  12.     faq_link_url = 'http://wiki.digsby.com/doku.php?id=faq#q32'
  13.     
  14.     def __init__(self, parent, title, message):
  15.         icon = skin.get('serviceicons.myspace', None)
  16.         super(MySpaceAchievementsDialog, self).__init__(parent, title, message = message, icon = icon, ok_caption = _('Post Achievements'), cancel_caption = _('No Thanks'), link = (self.faq_link_label, self.faq_link_url))
  17.  
  18.  
  19.  
  20. def construct_basic_subpanel_social(panel, SP, MSP, MSC):
  21.     do_achievements = wx.CheckBox(panel, -1, _('Post achievements to my Activity Stream'))
  22.     help_achievements = toolbox.HelpLink(panel, 'http://wiki.digsby.com/doku.php?id=faq#q32')
  23.     panel.controls['post_ach_all'] = dict(check = do_achievements, help = help_achievements)
  24.     do_achievements.Value = getattr(SP, 'post_ach_all', MSC.info.defaults.post_ach_all)
  25.     fx = panel.controls['basic_sz']
  26.     default_ui.ezadd(fx, do_achievements, (fx.row, 1), (1, 2), flag = wx.EXPAND | wx.ALL)
  27.     default_ui.ezadd(fx, help_achievements, (fx.row, 3), flag = wx.EXPAND | wx.ALL)
  28.     fx.row += 1
  29.  
  30.  
  31. def construct_advanced_subpanel_social(panel, SP, MSP, MSC):
  32.     l_sz = wx.BoxSizer(wx.VERTICAL)
  33.     newsfeed_lbl = wx.StaticText(panel, -1, _('Show Newsfeed:'), style = wx.ALIGN_LEFT)
  34.     newsfeed_lbl.Font = textutil.CopyFont(newsfeed_lbl.Font, weight = wx.BOLD)
  35.     labels = [
  36.         _('Status Updates'),
  37.         _('Friend Updates'),
  38.         _('Blog/Forum Posts'),
  39.         _('Group Updates'),
  40.         _('Photos'),
  41.         _('Music'),
  42.         _('Videos'),
  43.         _('Events'),
  44.         _('Applications')]
  45.     l_sz.Add(newsfeed_lbl, 0, wx.BOTTOM, newsfeed_lbl.GetDefaultBorder())
  46.     newsfeed = panel.controls['newsfeed'] = []
  47.     filters = getattr(SP, 'filters', { })
  48.     values = filters.get('feed')
  49.     if values is None:
  50.         values = [
  51.             True] * len(labels)
  52.     
  53.     for i, label in enumerate(labels):
  54.         chk = wx.CheckBox(panel, label = label)
  55.         chk.Value = values[i]
  56.         newsfeed.append(chk)
  57.         default_ui.ezadd(l_sz, chk, 0, wx.ALL)
  58.     
  59.     r_sz = wx.BoxSizer(wx.VERTICAL)
  60.     alerts_lbl = wx.StaticText(panel, -1, _('Show Alerts:'), style = wx.ALIGN_LEFT)
  61.     alerts_lbl.Font = textutil.CopyFont(alerts_lbl.Font, weight = wx.BOLD)
  62.     labels = [
  63.         _('Blog Comments'),
  64.         _('Blog Subscriptions'),
  65.         _('Picture Comments'),
  66.         _('Event Invites'),
  67.         _('Profile Comments'),
  68.         _('Photo Tag Approvals'),
  69.         _('Friend Requests'),
  70.         _('Video Comments'),
  71.         _('Group Notifications'),
  72.         _('Recently Added Friends'),
  73.         _('Birthdays')]
  74.     r_sz.Add(alerts_lbl, 0, wx.BOTTOM, alerts_lbl.GetDefaultBorder())
  75.     alerts = panel.controls['alerts'] = []
  76.     values = filters.get('indicators')
  77.     if values is None:
  78.         values = [
  79.             True] * len(labels)
  80.     
  81.     for i, label in enumerate(labels):
  82.         chk = wx.CheckBox(panel, label = label)
  83.         chk.Value = values[i]
  84.         alerts.append(chk)
  85.         default_ui.ezadd(r_sz, chk, 0, wx.ALL)
  86.     
  87.     h_sz = wx.BoxSizer(wx.HORIZONTAL)
  88.     h_sz.Add(l_sz)
  89.     h_sz.Add(r_sz)
  90.     fx = panel.controls['advanced_sz']
  91.     fx.Add(h_sz, (fx.row, 0), (11, 4))
  92.     fx.row += 11
  93.     return True
  94.  
  95.  
  96. def extract_basic_subpanel_social(panel, info, SP, MSP, MSC):
  97.     info['post_ach_all'] = panel.controls['post_ach_all']['check'].Value
  98.     return True
  99.  
  100.  
  101. def extract_advanced_subpanel_social(panel, info, SP, MSP, MSC):
  102.     info['filters'] = filters = { }
  103.     filters['feed'] = [ x.Value for x in panel.controls['newsfeed'] ]
  104.     filters['indicators'] = [ x.Value for x in panel.controls['alerts'] ]
  105.     info['informed_ach'] = True
  106.     return True
  107.  
  108.