def OnMyLastWebClick(self, event): # open website lw = 'http://www.last.fm/user/' if len(self.tc_mylast_search_user.GetValue()) > 0: address = lw + self.tc_mylast_search_user.GetValue() elif options.GetSetting('lastfm-username', self.FILEDB): address = lw + options.GetSetting('lastfm-username', self.FILEDB) else: address = lw default_app_open.dopen(address)
def OnWebClick(self, event): mouse_type_id = event.GetLinkInfo().GetEvent().GetEventType() #check if it's a web link if event.GetLinkInfo().GetHref()[:4] == 'http': default_app_open.dopen(event.GetLinkInfo().GetHref()) else: if wx.EVT_LEFT_UP.typeId == mouse_type_id: self.Reply(event.GetLinkInfo().GetHref()) else: #right click prepends existing data to reply self.Reply(event.GetLinkInfo().GetHref(), True)