def __init__(self, options, parent, id, title, plugin=None, **kwds): self.plugin = plugin self.modified = False self.options = options args = (parent, id, title) # begin wxGlade: EditorFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.profile_book = wx.Notebook(self, -1, style=0) # Menu Bar self.profile_menu = wx.MenuBar() self.SetMenuBar(self.profile_menu) self.profile_item = wx.Menu() self.activate_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Online\tCtrl+O"), _("Allow users seeing profile"), wx.ITEM_CHECK) self.profile_item.AppendItem(self.activate_item) self.filters_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Filters...\tCtrl+F"), _("Create active filters to get notified on peers approach"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.filters_item) self.profile_item.AppendSeparator() self.export_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Export HTML ...\tCtrl+E"), _("Write profile as HTML File"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.export_item) self.save_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Save\tCtrl+S"), _("Save profile into file"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.save_item) self.quit_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Close\tCtrl+W"), _("Close profile management"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.quit_item) self.profile_menu.Append(self.profile_item, _("Action")) self.help_menu = wx.Menu() self.about_item = wx.MenuItem(self.help_menu, wx.NewId(), _("About...\tCtrl+?"), "", wx.ITEM_NORMAL) self.help_menu.AppendItem(self.about_item) self.preview_item = wx.MenuItem(self.help_menu, wx.NewId(), _("Preview...\tCtrl+P"), "", wx.ITEM_NORMAL) self.help_menu.AppendItem(self.preview_item) self.profile_menu.Append(self.help_menu, _("Info")) # Menu Bar end self.profile_statusbar = self.CreateStatusBar(1, 0) self.personal_tab = PersonalPanel(self.profile_book, -1) self.blog_tab = BlogPanel(self.profile_book, -1) self.file_tab = FilePanel(self.profile_book, -1) self.__set_properties() self.__do_layout() # end wxGlade if self.options["standalone"]: #put here special initialisation for standalone editor pass self.profile_dlg = ProfileDialog(parent, -1, plugin=self.plugin) # events self.bind_controls() # disclaimer if not skip_disclaimer(): self.on_about(None)
def __init__(self, options, parent, id, title, plugin=None, **kwds): args = (parent, id, title) # begin wxGlade: ProfileFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.profile_book = wx.Notebook(self, -1, style=0) # Menu Bar self.profile_menu = wx.MenuBar() self.SetMenuBar(self.profile_menu) self.profile_item = wx.Menu() self.activate_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Online\tCtrl+O"), _("Allow users seeing profile"), wx.ITEM_CHECK) self.profile_item.AppendItem(self.activate_item) self.export_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Export HTML ...\tCtrl+E"), _("Write profile as HTML File"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.export_item) self.profile_item.AppendSeparator() self.load_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Load... \tCtrl+L"), _("Load profile from file"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.load_item) self.save_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Save As ...\tCtrl+S"), _("Save profile into file"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.save_item) self.quit_item = wx.MenuItem(self.profile_item, wx.NewId(), _("&Close\tCtrl+W"), _("Close profile management"), wx.ITEM_NORMAL) self.profile_item.AppendItem(self.quit_item) self.profile_menu.Append(self.profile_item, _("Profile")) self.peers_item = wx.Menu() self.getblog_item = wx.MenuItem(self.peers_item, wx.NewId(), _("Get Blog..."), _("Download peer's blog"), wx.ITEM_NORMAL) self.peers_item.AppendItem(self.getblog_item) self.getfiles_item = wx.MenuItem(self.peers_item, wx.NewId(), _("Get Files..."), _("Download peer's files"), wx.ITEM_NORMAL) self.peers_item.AppendItem(self.getfiles_item) self.peers_item.AppendSeparator() self.anonymous_item = wx.MenuItem(self.peers_item, wx.NewId(), _("&Anonymous\tCtrl+A"), "", wx.ITEM_RADIO) self.peers_item.AppendItem(self.anonymous_item) self.friend_item = wx.MenuItem(self.peers_item, wx.NewId(), _("Frie&nd\tCtrl+N"), "", wx.ITEM_RADIO) self.peers_item.AppendItem(self.friend_item) self.blacklisted_item = wx.MenuItem(self.peers_item, wx.NewId(), _("&Black listed\tCtrl+B"), "", wx.ITEM_RADIO) self.peers_item.AppendItem(self.blacklisted_item) self.peers_item.AppendSeparator() self.raw_item = wx.MenuItem(self.peers_item, wx.NewId(), _("&Find...\tCtrl+F"), _("Search profile in surrounding area"), wx.ITEM_NORMAL) self.peers_item.AppendItem(self.raw_item) self.filters_item = wx.MenuItem(self.peers_item, wx.NewId(), _("Filters...\tCtrl+H"), _("Create active filters to get notified on peers approach"), wx.ITEM_NORMAL) self.peers_item.AppendItem(self.filters_item) self.profile_menu.Append(self.peers_item, _("Peers")) self.display_item = wx.Menu() self.autorefresh_item = wx.MenuItem(self.display_item, wx.NewId(), _("Auto refresh"), _("Automatically call refresh on any change in profile"), wx.ITEM_CHECK) self.display_item.AppendItem(self.autorefresh_item) self.refresh_item = wx.MenuItem(self.display_item, wx.NewId(), _("&Refresh\tCtrl+R"), "", wx.ITEM_NORMAL) self.display_item.AppendItem(self.refresh_item) self.profile_menu.Append(self.display_item, _("Display")) self.help_menu = wx.Menu() self.about_item = wx.MenuItem(self.help_menu, wx.NewId(), _("About..."), "", wx.ITEM_NORMAL) self.help_menu.AppendItem(self.about_item) self.profile_menu.Append(self.help_menu, _("Help")) # Menu Bar end self.profile_statusbar = self.CreateStatusBar(1, 0) self.preview_tab = PreviewPanel(self.profile_book, -1) self.personal_tab = PersonalPanel(self.profile_book, -1) self.custom_tab = CustomPanel(self.profile_book, -1) self.blog_tab = BlogPanel(self.profile_book, -1) self.file_tab = FilePanel(self.profile_book, -1) self.other_tab = OthersPanel(self.profile_book, -1) self.__set_properties() self.__do_layout() # end wxGlade # TODO: create dynamic option object (for standalone & display) self.options = options # quite different initialisation according to launched by navigator or not if self.options["standalone"]: self.addpeer_item = wx.MenuItem(self.peers_item, wx.NewId(), _("Import...\tCtrl+I"), _("Load a profile and add it in contact list"), wx.ITEM_NORMAL) self.peers_item.AppendItem(self.addpeer_item) self.displayprofile_item = wx.MenuItem(self.peers_item, wx.NewId(), _("Display profile..."), _("Display html preview in popup"), wx.ITEM_NORMAL) self.peers_item.AppendItem(self.displayprofile_item) # common set up self.facade = get_facade() self.plugin = plugin self.profile_dlg = UIProxy(ProfileDialog(parent, -1, plugin=self.plugin)) self.peer_dlg = UIProxy(BlogDialog(parent, -1, plugin=self.plugin)) self.file_dlg = UIProxy(FileDialog(parent, -1, plugin=self.plugin)) self.bind_controls() if not skip_disclaimer(): self.on_about(None)
def on_about(self, evt): """display about""" # not modal because would freeze the wx thread while twisted # one goes on and initialize profile about_dlg = AboutDialog(not skip_disclaimer(), self, -1) about_dlg.Show()