home *** CD-ROM | disk | FTP | other *** search
Wrap
# Source Generated with Decompyle++ # File: in.pyo (Python 2.5) USE_TREE_VIEW = False import copy import wx from gui.pref.prefcontrols import * from gui.controls import Button from gui.uberwidgets.PrefPanel import PrefPanel, PrefCollection from gui.notifications.notificationlist import NotifyPanel from gui.toolbox import Monitor from common import pref from config import platformName popupchoices = [ ('lowerright', _('bottom right corner')), ('lowerleft', _('bottom left corner')), ('upperright', _('top right corner')), ('upperleft', _('top left corner'))] def panel(panel, sizer, newgroup, exithooks): display_choices = [ (n, str(n + 1)) for n in xrange(Monitor.GetCount()) ] popup_panel = wx.Panel(panel) popup_sizer.Add(CheckChoice('notifications.enable_popup', 'notifications.popups.location', _('Enable &pop-up notifications in the '), popupchoices)(popup_panel), 0, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND) top = PrefPanel(panel, PrefCollection(popup_panel, Check('enable_sound', _('Enable &sounds'))), _('Notifications'), prefix = 'notifications') notifications_view = build_notification_area(panel) notifications_view.SetFocus() bottom = PrefPanel(panel, notifications_view, _('Events')) restore_default_button = Button(panel, (_('Restore Defaults'),), (lambda : restore_default_notifications(notifications_view))) if platformName == 'mac': restore_default_button.SetWindowVariant(wx.WINDOW_VARIANT_SMALL) None([ sizer.AddMany, (top, 0, wx.EXPAND | wx.ALL, 3), ((bottom, 1, wx.EXPAND | wx.ALL, 3), restore_default_button, 0, wx.BOTTOM | wx.LEFT if platformName == 'mac' else 0)]) return panel def restore_default_notifications(ctrl): if wx.YES == wx.MessageBox(_('Are you sure you want to restore the default notification set?\n\nAll of your notification settings will be lost.'), _('Restore Default Notifications'), wx.ICON_EXCLAMATION | wx.YES_NO): import common.notifications as commnot nots = profile.notifications nots.clear() nots.update(copy.deepcopy(commnot.default_notifications)) ctrl.Refresh() def build_notification_area(parent): notification_viewer = pref('notifications.editor.view', type = str, default = 'simple') if notification_viewer == 'tree': NotificationView = NotificationView import gui.notificationview return NotificationView(parent, profile.notifications) else: get_notification_info = get_notification_info import common.notifications notifypanel = NotifyPanel(parent) n = notifypanel.NotifyView n.SetNotificationInfo(get_notification_info()) n.SetUserNotifications(profile.notifications) n.UpdateSkin() return notifypanel