mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-17 21:56:07 -04:00
Added GUI for filter creation. #102
This commit is contained in:
@@ -1 +1 @@
|
||||
import baseDialog, trends, configuration, lists, message, search, find, show_user, update_profile, urlList, userSelection, utils
|
||||
import baseDialog, trends, configuration, lists, message, search, find, show_user, update_profile, urlList, userSelection, utils, filterDialogs
|
||||
|
45
src/wxUI/dialogs/filterDialogs.py
Normal file
45
src/wxUI/dialogs/filterDialogs.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import baseDialog
|
||||
import wx
|
||||
|
||||
class filterDialog(baseDialog.BaseWXDialog):
|
||||
def __init__(self, value=""):
|
||||
super(filterDialog, self).__init__(None, -1)
|
||||
panel = wx.Panel(self)
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.SetTitle(_(u"Create a filter for this buffer"))
|
||||
self.contains = wx.RadioButton(panel, -1, _(u"Contains"), style=wx.RB_GROUP)
|
||||
self.doesnt_contain = wx.RadioButton(panel, -1, _(u"Doesn't contain"))
|
||||
radioSizer1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
radioSizer1.Add(self.contains, 0, wx.ALL, 5)
|
||||
radioSizer1.Add(self.doesnt_contain, 0, wx.ALL, 5)
|
||||
sizer.Add(radioSizer1, 0, wx.ALL, 5)
|
||||
label = wx.StaticText(panel, -1, _(u"word"))
|
||||
self.term = wx.TextCtrl(panel, -1, value)
|
||||
dc = wx.WindowDC(self.contains)
|
||||
dc.SetFont(self.contains.GetFont())
|
||||
self.contains.SetSize(dc.GetTextExtent("0"*40))
|
||||
bsizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
bsizer.Add(label, 0, wx.ALL, 5)
|
||||
bsizer.Add(self.contains, 0, wx.ALL, 5)
|
||||
sizer.Add(bsizer, 0, wx.ALL, 5)
|
||||
self.regexp = wx.CheckBox(panel, wx.NewId(), _(u"Use this term as a regular expression"))
|
||||
sizer.Add(self.regexp, 0, wx.ALL, 5)
|
||||
self.load_language = wx.RadioButton(panel, -1, _(u"Load tweets in the following languages"), style=wx.RB_GROUP)
|
||||
self.ignore_language = wx.RadioButton(panel, -1, _(u"Ignore tweets in the following languages"))
|
||||
self.skip_language_filtering = wx.RadioButton(panel, -1, _(u"Don't filter by language"))
|
||||
self.skip_language_filtering.SetValue(True)
|
||||
radioSizer2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
radioSizer2.Add(self.load_language, 0, wx.ALL, 5)
|
||||
radioSizer2.Add(self.ignore_language, 0, wx.ALL, 5)
|
||||
radioSizer2.Add(self.skip_language_filtering, 0, wx.ALL, 5)
|
||||
sizer.Add(radioSizer2, 0, wx.ALL, 5)
|
||||
ok = wx.Button(panel, wx.ID_OK, _(u"OK"))
|
||||
ok.SetDefault()
|
||||
cancel = wx.Button(panel, wx.ID_CANCEL, _(u"Cancel"))
|
||||
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())
|
@@ -50,6 +50,7 @@ class mainFrame(wx.Frame):
|
||||
buffer = wx.Menu()
|
||||
self.update_buffer = buffer.Append(wx.NewId(), _(u"&Update buffer"))
|
||||
self.trends = buffer.Append(wx.NewId(), _(u"New &trending topics buffer..."))
|
||||
self.filter = buffer.Append(wx.NewId(), _(u"Create a filter"))
|
||||
self.find = buffer.Append(wx.NewId(), _(u"Find a string in the currently focused buffer..."))
|
||||
self.load_previous_items = buffer.Append(wx.NewId(), _(u"&Load previous items"))
|
||||
buffer.AppendSeparator()
|
||||
|
Reference in New Issue
Block a user