Пример #1
0
def construct_advanced_subpanel_social(panel, SP, MSP, MSC):
    sz = wx.BoxSizer(wx.VERTICAL)
    alerts_lbl = wx.StaticText(panel, -1, _("Show Alerts:"), style = wx.ALIGN_LEFT)
    alerts_lbl.Font = textutil.CopyFont(alerts_lbl.Font, weight = wx.BOLD)

    labels = [_('Messages'),
              _('Pokes'),
              _('Shares'),
              _('Friend Requests'),
              _('Group Invitations'),
              _('Event Invitations'),
              _('Notifications')]

    sz.Add(alerts_lbl, 0, wx.BOTTOM, alerts_lbl.GetDefaultBorder())

    alerts = panel.controls['alerts'] = []

    values = getattr(SP, 'filters', {}).get('alerts', None)
    if values is None:
        values = [True] * len(labels)

    for i, label in enumerate(labels):
        chk = wx.CheckBox(panel, label = label)
        chk.Value = values[i]
        alerts.append(chk)
        default_ui.ezadd(sz, chk, 0, wx.ALL)

    fx = panel.controls['advanced_sz']
    fx.Add(sz, (fx.row, 1), (6, 4))
    fx.row += 6
    return True
Пример #2
0
def construct_basic_subpanel_social(panel, SP, MSP, MSC):
    fx = panel.controls['basic_sz']
    if SP is None:
        # new account
        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

    return True
Пример #3
0
def construct_basic_subpanel_social(panel, SP, MSP, MSC):
    fx = panel.controls['basic_sz']
    if SP is None:
        # new account
        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

    return True
Пример #4
0
def construct_advanced_subpanel_im(panel, SP, MSP, MSC):
    MSC.info.pop('more_details', None)

    hooks.first("digsby.services.edit.advanced.construct_sub.im", impl="digsby_service_editor",
                panel = panel, SP = SP, MSP = MSP, MSC = MSC)


    encryption = dict(radio = controls.RadioPanel(panel,
                                                 [_('Use TLS if Possible'),
                                                  _('Require TLS'),
                                                  _('Force SSL'),
                                                  _('No Encryption')]))

    encryption['radio'].SetValue(getattr(SP, 'encryption', MSC.info.defaults.encryption))

    sz = panel.controls['advanced_sz']

    hsz = wx.BoxSizer(wx.HORIZONTAL)

    l_sz = wx.BoxSizer(wx.VERTICAL)
    default_ui.ezadd(l_sz, encryption['radio'], flag = wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL)
    hsz.Add(l_sz, flag = wx.EXPAND | wx.LEFT, border = 10)

    r_sz = wx.BoxSizer(wx.VERTICAL)

    ignore_ssl_warnings = dict(check = wx.CheckBox(panel, -1, _("Ignore SSL Warnings")))
    ignore_ssl_warnings['check'].Value = getattr(SP, 'ignore_ssl_warnings', MSC.info.defaults.ignore_ssl_warnings)
    default_ui.ezadd(r_sz, ignore_ssl_warnings['check'], flag = wx.EXPAND | wx.ALL)

    allow_plaintext = dict(check = wx.CheckBox(panel, -1, _("Allow Plaintext Login")))
    allow_plaintext['check'].Value = getattr(SP, 'allow_plaintext', MSC.info.defaults.allow_plaintext)
    default_ui.ezadd(r_sz, allow_plaintext['check'], flag = wx.EXPAND | wx.ALL)

    hsz.Add(r_sz, flag = wx.EXPAND | wx.RIGHT, border = 0)

    default_ui.ezadd(sz, hsz, (sz.row, 0), (4, 4), flag = wx.EXPAND | wx.ALL)
    sz.row += 4

    panel.controls.update(
       encryption = encryption,
       ignore_ssl_warnings = ignore_ssl_warnings,
       allow_plaintext = allow_plaintext,
    )

    return True
Пример #5
0
def construct_advanced_subpanel_social(panel, SP, MSP, MSC):
    l_sz = wx.BoxSizer(wx.VERTICAL)
    newsfeed_lbl = wx.StaticText(panel,
                                 -1,
                                 _("Show Newsfeed:"),
                                 style=wx.ALIGN_LEFT)
    newsfeed_lbl.Font = textutil.CopyFont(newsfeed_lbl.Font, weight=wx.BOLD)

    labels = [
        _('Status Updates'),
        _('Friend Updates'),
        _('Blog/Forum Posts'),
        _('Group Updates'),
        _('Photos'),
        _('Music'),
        _('Videos'),
        _('Events'),
        _('Applications'),
    ]

    l_sz.Add(newsfeed_lbl, 0, wx.BOTTOM, newsfeed_lbl.GetDefaultBorder())

    newsfeed = panel.controls['newsfeed'] = []

    filters = getattr(SP, 'filters', {})
    values = filters.get('feed')
    if values is None:
        values = [True] * len(labels)

    for i, label in enumerate(labels):
        chk = wx.CheckBox(panel, label=label)
        chk.Value = values[i]
        newsfeed.append(chk)
        default_ui.ezadd(l_sz, chk, 0, wx.ALL)

    r_sz = wx.BoxSizer(wx.VERTICAL)
    alerts_lbl = wx.StaticText(panel,
                               -1,
                               _("Show Alerts:"),
                               style=wx.ALIGN_LEFT)
    alerts_lbl.Font = textutil.CopyFont(alerts_lbl.Font, weight=wx.BOLD)

    labels = [
        _('Blog Comments'),
        _('Blog Subscriptions'),
        _('Picture Comments'),
        _('Event Invites'),
        _('Profile Comments'),
        _('Photo Tag Approvals'),
        _('Friend Requests'),
        _('Video Comments'),
        _('Group Notifications'),
        _('Recently Added Friends'),
        _('Birthdays'),
    ]

    r_sz.Add(alerts_lbl, 0, wx.BOTTOM, alerts_lbl.GetDefaultBorder())

    alerts = panel.controls['alerts'] = []

    values = filters.get('indicators')
    if values is None:
        values = [True] * len(labels)

    for i, label in enumerate(labels):
        chk = wx.CheckBox(panel, label=label)
        chk.Value = values[i]
        alerts.append(chk)
        default_ui.ezadd(r_sz, chk, 0, wx.ALL)

    h_sz = wx.BoxSizer(wx.HORIZONTAL)
    h_sz.Add(l_sz)
    h_sz.Add(r_sz)

    fx = panel.controls['advanced_sz']
    fx.Add(h_sz, (fx.row, 0), (11, 4))

    fx.row += 11
    return True
Пример #6
0
def construct_advanced_subpanel_social(panel, SP, MSP, MSC):
    l_sz = wx.BoxSizer(wx.VERTICAL)
    leftPanel_lbl = wx.StaticText(panel, -1, _("Show Alerts:"), style = wx.ALIGN_LEFT)
    leftPanel_lbl.Font = textutil.CopyFont(leftPanel_lbl.Font, weight = wx.BOLD)

    left_labels = [
                   _('Actions'),
                   _('Birthdays'),
                   _('Cafe'),
                   _('Comments'),
                   _('Elections'),
                   _('Farm'),
                   _('Friends'),
                   _('Gifts'),
                   _('Gold'),
                   _('Groups'),
                   _('Luv'),
                   _('Meetme'),
                   _('Mob'),
    ]

    l_sz.Add(leftPanel_lbl, 0, wx.BOTTOM, leftPanel_lbl.GetDefaultBorder())

    leftPanel = panel.controls['leftPanel'] = []
    filters = getattr(SP, 'filters', [])
    values = filters[:len(left_labels)] if filters else None

    if values is None:
        values = [True] * len(left_labels)
        
    for i, label in enumerate(left_labels):
        chk = wx.CheckBox(panel, label = label)
        chk.Value = values[i]
        leftPanel.append(chk)
        default_ui.ezadd(l_sz, chk, 0, wx.ALL)
    r_sz = wx.BoxSizer(wx.VERTICAL)
    rightPanel_lbl = wx.StaticText(panel, -1, '', style = wx.ALIGN_LEFT)
    rightPanel_lbl.Font = textutil.CopyFont(rightPanel_lbl.Font, weight = wx.BOLD)
    right_labels = [
                _('Mobile Updates'),
                _('Pets'),
                _('Photo Violations'),
                _('Poker'),
                _('Profile'),
                _('Questions'),
                _('Sorority Life'),
                _('Tags'),
                _('Topics'),
                _('Unread Messages'),
                _('Videos'),
                _('Winks'),
                _('Zoosk'),
    ]

    r_sz.Add(rightPanel_lbl, 0, wx.BOTTOM, rightPanel_lbl.GetDefaultBorder())

    rightPanel = panel.controls['rightPanel'] = []

    values = filters[len(left_labels):len(left_labels)+len(right_labels)] if filters else None
    if values is None:
        values = [True] * len(right_labels)

    for i, label in enumerate(right_labels):
        chk = wx.CheckBox(panel, label = label)
        chk.Value = values[i]
        rightPanel.append(chk)
        default_ui.ezadd(r_sz, chk, 0, wx.ALL)

    h_sz = wx.BoxSizer(wx.HORIZONTAL)
    h_sz.Add(l_sz)
    h_sz.Add(r_sz)

    fx = panel.controls['advanced_sz']
    fx.Add(h_sz, (fx.row, 0), (11, 4))

    fx.row += 11
    return True
Пример #7
0
def construct_advanced_subpanel_social(panel, SP, MSP, MSC):
    l_sz = wx.BoxSizer(wx.VERTICAL)
    newsfeed_lbl = wx.StaticText(panel, -1, _("Show Newsfeed:"), style = wx.ALIGN_LEFT)
    newsfeed_lbl.Font = textutil.CopyFont(newsfeed_lbl.Font, weight = wx.BOLD)

    labels = [
        _('Status Updates'),
        _('Friend Updates'),
        _('Blog/Forum Posts'),
        _('Group Updates'),
        _('Photos'),
        _('Music'),
        _('Videos'),
        _('Events'),
        _('Applications'),
    ]

    l_sz.Add(newsfeed_lbl, 0, wx.BOTTOM, newsfeed_lbl.GetDefaultBorder())

    newsfeed = panel.controls['newsfeed'] = []

    filters = getattr(SP, 'filters', {})
    values = filters.get('feed')
    if values is None:
        values = [True] * len(labels)

    for i, label in enumerate(labels):
        chk = wx.CheckBox(panel, label = label)
        chk.Value = values[i]
        newsfeed.append(chk)
        default_ui.ezadd(l_sz, chk, 0, wx.ALL)

    r_sz = wx.BoxSizer(wx.VERTICAL)
    alerts_lbl = wx.StaticText(panel, -1, _("Show Alerts:"), style = wx.ALIGN_LEFT)
    alerts_lbl.Font = textutil.CopyFont(alerts_lbl.Font, weight = wx.BOLD)

    labels = [
        _('Blog Comments'),
        _('Blog Subscriptions'),
        _('Picture Comments'),
        _('Event Invites'),
        _('Profile Comments'),
        _('Photo Tag Approvals'),
        _('Friend Requests'),
        _('Video Comments'),
        _('Group Notifications'),
        _('Recently Added Friends'),
        _('Birthdays'),
    ]

    r_sz.Add(alerts_lbl, 0, wx.BOTTOM, alerts_lbl.GetDefaultBorder())

    alerts = panel.controls['alerts'] = []

    values = filters.get('indicators')
    if values is None:
        values = [True] * len(labels)

    for i, label in enumerate(labels):
        chk = wx.CheckBox(panel, label = label)
        chk.Value = values[i]
        alerts.append(chk)
        default_ui.ezadd(r_sz, chk, 0, wx.ALL)

    h_sz = wx.BoxSizer(wx.HORIZONTAL)
    h_sz.Add(l_sz)
    h_sz.Add(r_sz)

    fx = panel.controls['advanced_sz']
    fx.Add(h_sz, (fx.row, 0), (11, 4))

    fx.row += 11
    return True