home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import util
- import wx
- import gui.skin as skin
- import gui.toolbox as toolbox
- import gui.textutil as textutil
- import digsby_service_editor.default_ui as default_ui
- import twitter_account_gui
-
- class TwitterAchievementsDialog(toolbox.UpgradeDialog):
- faq_link_label = _('Learn More')
- faq_link_url = 'http://wiki.digsby.com/doku.php?id=faq#q32'
-
- def __init__(self, parent, title, message):
- icon = skin.get('serviceicons.twitter', None)
- super(TwitterAchievementsDialog, 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))
-
-
-
- def construct_basic_subpanel_social(panel, SP, MSP, MSC):
- fx = panel.controls['basic_sz']
- if SP is None:
- follow_digsby = dict(check = wx.CheckBox(panel, -1, 'Follow Digsby on Twitter'))
- follow_digsby['check'].Value = True
- panel.controls['follow_digsby'] = follow_digsby
- default_ui.ezadd(fx, follow_digsby['check'], (fx.row, 1), (1, 2), flag = wx.EXPAND | wx.ALL)
- fx.row += 1
-
- do_achievements = wx.CheckBox(panel, -1, _('Post achievements to my feed'))
- help_achievements = toolbox.HelpLink(panel, 'http://wiki.digsby.com/doku.php?id=faq#q32')
- panel.controls['post_ach_all'] = dict(check = do_achievements, help = help_achievements)
- do_achievements.Value = getattr(SP, 'post_ach_all', MSC.info.defaults.post_ach_all)
- fx = panel.controls['basic_sz']
- default_ui.ezadd(fx, do_achievements, (fx.row, 1), (1, 2), flag = wx.EXPAND | wx.ALL)
- default_ui.ezadd(fx, help_achievements, (fx.row, 3), flag = wx.EXPAND | wx.ALL)
- fx.row += 1
- return True
-
-
- def construct_advanced_subpanel_social(panel, SP, MSP, MSC):
- freq_defaults = (dict,)((lambda .0: for k in .0:
- (k, MSC.info.defaults.get(k, 2)))([
- 'friends_timeline',
- 'replies',
- 'direct_messages',
- 'search_updatefreq']))
- freq_settings = (None, dict)((lambda .0: for k in .0:
- (k, getattr(SP, k, freq_defaults[k])))([
- 'friends_timeline',
- 'replies',
- 'direct_messages',
- 'search_updatefreq']))
- fake_account = util.Storage(update_frequencies = freq_settings, auto_throttle = getattr(SP, 'auto_throttle', MSC.info.defaults.get('auto_throttle', True)))
- twap = twitter_account_gui.TwitterAccountPanel(panel, fake_account)
- panel.controls.update(twitterpanel = twap)
- fx = panel.controls['advanced_sz']
- fx.Add(twap, (fx.row, 1), (1, 4))
- return True
-
-
- def extract_basic_subpanel_social(panel, info, SP, MSP, MSC):
- follow_digsby = panel.controls.get('follow_digsby', None)
- if follow_digsby is not None:
- info['do_follow_digsby'] = follow_digsby['check'].Value
-
- info['post_ach_all'] = panel.controls['post_ach_all']['check'].Value
- return True
-
-
- def extract_advanced_subpanel_social(panel, info, SP, MSP, MSC):
- info.update(panel.controls['twitterpanel'].info())
- info['informed_ach'] = True
- return True
-
-