home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from gui.pref.prefcontrols import *
- from gui.pref.prefstrings import text_conversations as _
- from gui.uberwidgets.PrefPanel import PrefCollection, PrefPanel
- from gui.uberwidgets.formattedinput import FormattedInput as IMInput
- from config import platformName
- from common import pref, setpref
- 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'))
-
- def panel(panel, sizer, newgroup, exithooks):
- spellchecker = spellchecker
- import common.spelling
- warncheck = Check('messaging.tabs.warn_on_close', 'Warn me when I attempt to close multiple conversations')(panel)
- warncheck.Enabled = get_pref('messaging.tabs.enabled')
- profile.prefs.link(('messaging.tabs.enabled',), (lambda val: wx.CallAfter(warncheck.Enable, val)), obj = warncheck)
- window_options = [
- Check('conversation_window.always_on_top', _('&Keep on top of other applications'))]
- if platformName != 'mac':
- window_options.append(Check('conversation_window.steal_focus', _('&New conversation windows automatically take focus')))
-
- window_options.extend([
- Check('messaging.tabs.enabled', _('Group multiple conversations into one tabbed window')),
- warncheck,
- Choice('messaging.tabs.icon', (('buddy', 'buddy icon'), ('service', 'service icon'), ('status', 'status icon')), _("Identify conversations with the contact's: "))])
- winops = PrefPanel(panel, PrefCollection(*window_options), _('Window Options'))
- history = Check('conversation_window.show_history', _('Show last %2(conversation_window.num_lines)d lines of history in conversation window'))(panel)
- conversation_entries = [
- CheckChoice('conversation_window.timestamp', 'conversation_window.timestamp_format', _('&Display timestamp: '), timestamp_options, allow_custom = True)]
- if 'wxMac' not in wx.PlatformInfo:
- conversation_entries.append(CheckChoice('messaging.spellcheck.enabled', 'messaging.spellcheck.engineoptions.lang', _('Enable spell checking in: '), AspellMenuEntries(spellchecker)))
-
- conversation_entries.extend([
- emoticon_checkbox(),
- Check('log.ims', _('Log IM conversations to hard drive'), callback = history.Enable),
- (history, 0, LEFT, 18)])
- conops = PrefPanel(panel, PrefCollection(*conversation_entries), _('Conversation Options'))
- textform = PrefPanel(panel, build_format_preview(panel, exithooks), _('Text Formatting'))
- sizer.AddMany([
- (winops, 0, EXPAND | BOTTOM, 6),
- (conops, 0, EXPAND | BOTTOM, 6),
- (textform, 1, EXPAND | BOTTOM, 6)])
- if 'wxMac' not in wx.PlatformInfo:
- exithooks += spellchecker.DownloadDict
-
- return panel
-
-
- def AspellMenuEntries(spellchecker):
- dicts = spellchecker.dict_info
- langs = (lambda .0: for key in .0:
- (key, dicts[key]['name_english']))(dicts)
- return sorted(langs, key = (lambda x: x[1].upper()))
-
-
- def build_format_preview(parent, exithooks):
- p = wx.Panel(parent)
- s = p.Sizer = wx.BoxSizer(wx.VERTICAL)
- t = IMInput(p, value = _('Your messages will look like this.'), singleFormat = True, prefmode = True, outlined = True, autosize = False)
- t.SetMinSize((300, 77))
- s.Add(t, 1, wx.EXPAND)
- if platformName == 'mac':
- h = wx.BoxSizer(wx.HORIZONTAL)
- h.AddStretchSpacer(1)
- h.Add(t.CreateFontButton(p), 0, EXPAND | wx.ALL, 5)
- s.Add(h, 0, wx.EXPAND)
-
- return p
-
-
- def emoticon_checkbox():
- return Check('appearance.conversations.emoticons.enabled', _('Show &emoticons in conversations'))
-
-