home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / digsby_setup.exe / lib / gui / pref / pg_text_conversations.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-02-26  |  5.0 KB  |  75 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. from gui.pref.prefcontrols import *
  5. from gui.pref.prefstrings import text_conversations as _
  6. from gui.uberwidgets.PrefPanel import PrefCollection, PrefPanel
  7. from gui.uberwidgets.formattedinput import FormattedInput as IMInput
  8. from config import platformName
  9. from common import pref, setpref
  10. timestamp_options = (('%#I:%M', '5:43'), ('%#I:%M %p', '5:43 PM'), ('%#I:%M:%S', '5:43:20'), ('%#I:%M:%S %p', '5:43:20 PM'), ('%H:%M', '17:43'), ('%H:%M:%S', '17:43:20'))
  11.  
  12. def panel(panel, sizer, newgroup, exithooks):
  13.     spellchecker = spellchecker
  14.     import common.spelling
  15.     warncheck = Check('messaging.tabs.warn_on_close', 'Warn me when I attempt to close multiple conversations')(panel)
  16.     warncheck.Enabled = get_pref('messaging.tabs.enabled')
  17.     profile.prefs.link(('messaging.tabs.enabled',), (lambda val: wx.CallAfter(warncheck.Enable, val)), obj = warncheck)
  18.     window_options = [
  19.         Check('conversation_window.always_on_top', _('&Keep on top of other applications'))]
  20.     if platformName != 'mac':
  21.         window_options.append(Check('conversation_window.steal_focus', _('&New conversation windows automatically take focus')))
  22.     
  23.     window_options.extend([
  24.         Check('messaging.tabs.enabled', _('Group multiple conversations into one tabbed window')),
  25.         warncheck,
  26.         Choice('messaging.tabs.icon', (('buddy', 'buddy icon'), ('service', 'service icon'), ('status', 'status icon')), _("Identify conversations with the contact's: "))])
  27.     winops = PrefPanel(panel, PrefCollection(*window_options), _('Window Options'))
  28.     history = Check('conversation_window.show_history', _('Show last %2(conversation_window.num_lines)d lines of history in conversation window'))(panel)
  29.     conversation_entries = [
  30.         CheckChoice('conversation_window.timestamp', 'conversation_window.timestamp_format', _('&Display timestamp: '), timestamp_options, allow_custom = True)]
  31.     if 'wxMac' not in wx.PlatformInfo:
  32.         conversation_entries.append(CheckChoice('messaging.spellcheck.enabled', 'messaging.spellcheck.engineoptions.lang', _('Enable spell checking in: '), AspellMenuEntries(spellchecker)))
  33.     
  34.     conversation_entries.extend([
  35.         emoticon_checkbox(),
  36.         Check('log.ims', _('Log IM conversations to hard drive'), callback = history.Enable),
  37.         (history, 0, LEFT, 18)])
  38.     conops = PrefPanel(panel, PrefCollection(*conversation_entries), _('Conversation Options'))
  39.     textform = PrefPanel(panel, build_format_preview(panel, exithooks), _('Text Formatting'))
  40.     sizer.AddMany([
  41.         (winops, 0, EXPAND | BOTTOM, 6),
  42.         (conops, 0, EXPAND | BOTTOM, 6),
  43.         (textform, 1, EXPAND | BOTTOM, 6)])
  44.     if 'wxMac' not in wx.PlatformInfo:
  45.         exithooks += spellchecker.DownloadDict
  46.     
  47.     return panel
  48.  
  49.  
  50. def AspellMenuEntries(spellchecker):
  51.     dicts = spellchecker.dict_info
  52.     langs = (lambda .0: for key in .0:
  53. (key, dicts[key]['name_english']))(dicts)
  54.     return sorted(langs, key = (lambda x: x[1].upper()))
  55.  
  56.  
  57. def build_format_preview(parent, exithooks):
  58.     p = wx.Panel(parent)
  59.     s = p.Sizer = wx.BoxSizer(wx.VERTICAL)
  60.     t = IMInput(p, value = _('Your messages will look like this.'), singleFormat = True, prefmode = True, outlined = True, autosize = False)
  61.     t.SetMinSize((300, 77))
  62.     s.Add(t, 1, wx.EXPAND)
  63.     if platformName == 'mac':
  64.         h = wx.BoxSizer(wx.HORIZONTAL)
  65.         h.AddStretchSpacer(1)
  66.         h.Add(t.CreateFontButton(p), 0, EXPAND | wx.ALL, 5)
  67.         s.Add(h, 0, wx.EXPAND)
  68.     
  69.     return p
  70.  
  71.  
  72. def emoticon_checkbox():
  73.     return Check('appearance.conversations.emoticons.enabled', _('Show &emoticons in conversations'))
  74.  
  75.