Trending topics support has been added

This commit is contained in:
2015-02-01 21:13:18 -06:00
parent e93f0f4980
commit 103b62719e
10 changed files with 203 additions and 1 deletions

View File

@@ -6,5 +6,6 @@ from favourites import favsPanel
from lists import listPanel
from panels import accountPanel, emptyPanel
from people import peoplePanel
from trends import trendsPanel
from tweet_searches import searchPanel
from user_searches import searchUsersPanel

View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
import wx
from multiplatform_widgets import widgets
class trendsPanel(wx.Panel):
def create_list(self):
""" Returns the list for put the tweets here."""
self.list = widgets.list(self, _(u"Trending topic"), style=wx.LC_REPORT|wx.LC_SINGLE_SEL|wx.LC_VRULES)
self.list.set_windows_size(0, 30)
self.list.set_size()
def __init__(self, parent, name):
super(trendsPanel, self).__init__(parent)
self.type = "trends"
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.create_list()
self.tweet = wx.Button(self, -1, _(u"Tweet"))
self.tweetTrendBtn = wx.Button(self, -1, _(u"Tweet about this trend"))
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
btnSizer.Add(self.tweet, 0, wx.ALL, 5)
btnSizer.Add(self.tweetTrendBtn, 0, wx.ALL, 5)
self.sizer.Add(btnSizer, 0, wx.ALL, 5)
self.sizer.Add(self.list.list, 0, wx.ALL, 5)
self.SetSizer(self.sizer)

View File

@@ -1 +1 @@
import baseDialog, configuration, lists, message, search, show_user, update_profile, urlList
import baseDialog, trends, configuration, lists, message, search, show_user, update_profile, urlList

View File

@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
import baseDialog
import wx
class trendingTopicsDialog(baseDialog.BaseWXDialog):
def __init__(self):
super(trendingTopicsDialog, self).__init__(None, -1)
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL)
self.SetTitle(_(u"View trending topics"))
label = wx.StaticText(panel, -1, _(u"Trending topics by"))
sizer.Add(label, 0, wx.ALL, 5)
self.country = wx.RadioButton(panel, -1, _(u"Country"), style=wx.RB_GROUP)
self.city = wx.RadioButton(panel, -1, _(u"City"))
radioSizer = wx.BoxSizer(wx.HORIZONTAL)
radioSizer.Add(label, 0, wx.ALL, 5)
radioSizer.Add(self.country, 0, wx.ALL, 5)
radioSizer.Add(self.city, 0, wx.ALL, 5)
sizer.Add(radioSizer, 0, wx.ALL, 5)
label = wx.StaticText(panel, -1, _(u"Location"))
self.location = wx.ListBox(panel, -1, choices=[], style=wx.CB_READONLY)
locationBox = wx.BoxSizer(wx.HORIZONTAL)
locationBox.Add(label, 0, wx.ALL, 5)
locationBox.Add(self.location, 0, wx.ALL, 5)
sizer.Add(locationBox, 0, wx.ALL, 5)
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
ok.SetDefault()
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Close"))
btnsizer = wx.BoxSizer()
btnsizer.Add(ok, 0, wx.ALL, 5)
btnsizer.Add(cancel, 0, wx.ALL, 5)
sizer.Add(btnsizer, 0, wx.ALL, 5)
panel.SetSizer(sizer)
self.SetClientSize(sizer.CalcMin())
def get_active(self):
if self.country.GetValue() == True:
return "country"
else:
return "city"
def get_item(self):
return self.location.GetStringSelection()
def set(self, values):
self.location.Set(values)

View File

@@ -12,9 +12,12 @@ class mainFrame(wx.Frame):
# Application menu
app = wx.Menu()
self.updateProfile = app.Append(wx.NewId(), _(u"&Update profile"))
self.updateProfile.Enable(False)
self.show_hide = app.Append(wx.NewId(), _(u"&Hide window"))
self.menuitem_search = app.Append(wx.NewId(), _(u"&Search"))
self.trends = app.Append(wx.NewId(), _(u"View &trending topics"))
self.lists = app.Append(wx.NewId(), _(u"&Lists manager"))
self.lists.Enable(True)
self.sounds_tutorial = app.Append(wx.NewId(), _(u"Sounds &tutorial"))
self.keystroke_editor = app.Append(wx.NewId(), _(u"&Edit keystrokes"))
self.account_settings = app.Append(wx.NewId(), _(u"Account se&ttings"))
@@ -42,27 +45,43 @@ class mainFrame(wx.Frame):
self.unblock = user.Append(wx.NewId(), _(u"Unb&lock"))
self.dm = user.Append(wx.NewId(), _(u"Direct me&ssage"))
self.addToList = user.Append(wx.NewId(), _(u"&Add to list"))
self.addToList.Enable(False)
self.removeFromList = user.Append(wx.NewId(), _(u"R&emove from list"))
self.removeFromList.Enable(False)
self.viewLists = user.Append(wx.NewId(), _(u"&View lists"))
self.viewLists.Enable(False)
self.details = user.Append(wx.NewId(), _(u"Show user &profile"))
self.details.Enable(False)
self.timeline = user.Append(wx.NewId(), _(u"&Timeline"))
self.timeline.Enable(False)
self.favs = user.Append(wx.NewId(), _(u"V&iew favourites"))
self.favs.Enable(False)
# buffer menu
buffer = wx.Menu()
self.mute = buffer.Append(wx.NewId(), _(u"&Mute"))
self.mute.Enable(False)
self.autoread = buffer.Append(wx.NewId(), _(u"&Autoread tweets for this buffer"))
self.autoread.Enable(False)
self.clear = buffer.Append(wx.NewId(), _(u"&Clear buffer"))
self.clear.Enable(False)
self.deleteTl = buffer.Append(wx.NewId(), _(u"&Remove buffer"))
self.deleteTl.Enable(False)
# Help Menu
help = wx.Menu()
self.doc = help.Append(-1, _(u"&Documentation"))
self.doc.Enable(False)
self.changelog = help.Append(wx.NewId(), _(u"&What's new in this version?"))
self.changelog.Enable(False)
self.check_for_updates = help.Append(wx.NewId(), _(u"&Check for updates"))
self.check_for_updates.Enable(False)
self.reportError = help.Append(wx.NewId(), _(u"&Report an error"))
self.reportError.Enable(False)
self.visit_website = help.Append(-1, _(u"TW Blue &website"))
self.visit_website.Enable(False)
self.about = help.Append(-1, _(u"About &TW Blue"))
self.about.Enable(False)
# Add all to the menu Bar
menuBar.Append(app, _(u"&Application"))