mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-05 03:12:29 -04:00
Bind manage button with code to manage autocompletion db
This commit is contained in:
parent
f01ad5abb7
commit
f9f7a32f90
@ -142,7 +142,8 @@ class accountSettingsController(globalSettingsController):
|
|||||||
|
|
||||||
def create_config(self):
|
def create_config(self):
|
||||||
self.dialog.create_general_account()
|
self.dialog.create_general_account()
|
||||||
widgetUtils.connect_event(self.dialog.general.userAutocompletionStart, widgetUtils.BUTTON_PRESSED, self.on_autocompletion_start)
|
widgetUtils.connect_event(self.dialog.general.userAutocompletionScan, widgetUtils.BUTTON_PRESSED, self.on_autocompletion_scan)
|
||||||
|
widgetUtils.connect_event(self.dialog.general.userAutocompletionManage, widgetUtils.BUTTON_PRESSED, self.on_autocompletion_manage)
|
||||||
self.dialog.set_value("general", "relative_time", self.config["general"]["relative_times"])
|
self.dialog.set_value("general", "relative_time", self.config["general"]["relative_times"])
|
||||||
self.dialog.set_value("general", "show_screen_names", self.config["general"]["show_screen_names"])
|
self.dialog.set_value("general", "show_screen_names", self.config["general"]["show_screen_names"])
|
||||||
self.dialog.set_value("general", "hide_emojis", self.config["general"]["hide_emojis"])
|
self.dialog.set_value("general", "hide_emojis", self.config["general"]["hide_emojis"])
|
||||||
@ -304,9 +305,13 @@ class accountSettingsController(globalSettingsController):
|
|||||||
def toggle_state(self,*args,**kwargs):
|
def toggle_state(self,*args,**kwargs):
|
||||||
return self.dialog.buffers.change_selected_item()
|
return self.dialog.buffers.change_selected_item()
|
||||||
|
|
||||||
def on_autocompletion_start(self, *args, **kwargs):
|
def on_autocompletion_scan(self, *args, **kwargs):
|
||||||
configuration = scan.autocompletionScan(self.buffer.session.settings, self.buffer, self.window)
|
configuration = scan.autocompletionScan(self.buffer.session.settings, self.buffer, self.window)
|
||||||
|
|
||||||
|
def on_autocompletion_manage(self, *args, **kwargs):
|
||||||
|
configuration = manage.autocompletionManage(self.buffer.session)
|
||||||
|
configuration.show_settings()
|
||||||
|
|
||||||
def add_ignored_client(self, *args, **kwargs):
|
def add_ignored_client(self, *args, **kwargs):
|
||||||
client = commonMessageDialogs.get_ignored_client()
|
client = commonMessageDialogs.get_ignored_client()
|
||||||
if client == None: return
|
if client == None: return
|
||||||
|
@ -7,14 +7,14 @@ from tweepy.errors import TweepyException
|
|||||||
from wxUI import commonMessageDialogs
|
from wxUI import commonMessageDialogs
|
||||||
from . import storage, wx_manage
|
from . import storage, wx_manage
|
||||||
|
|
||||||
class autocompletionManager(object):
|
class autocompletionManage(object):
|
||||||
def __init__(self, session):
|
def __init__(self, session):
|
||||||
""" class constructor. Manages everything related to user autocompletion.
|
""" class constructor. Manages everything related to user autocompletion.
|
||||||
|
|
||||||
:param session: Sessiom where the autocompletion management has been requested.
|
:param session: Sessiom where the autocompletion management has been requested.
|
||||||
:type session: sessions.base.Session.
|
:type session: sessions.base.Session.
|
||||||
"""
|
"""
|
||||||
super(autocompletionManager, self).__init__()
|
super(autocompletionManage, self).__init__()
|
||||||
self.session = session
|
self.session = session
|
||||||
# Instantiate database so we can perform modifications on it.
|
# Instantiate database so we can perform modifications on it.
|
||||||
self.database = storage.storage(self.session.session_id)
|
self.database = storage.storage(self.session.session_id)
|
||||||
|
@ -100,10 +100,10 @@ class generalAccount(wx.Panel, baseDialog.BaseWXDialog):
|
|||||||
super(generalAccount, self).__init__(parent)
|
super(generalAccount, self).__init__(parent)
|
||||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||||
userAutocompletionBox = wx.StaticBox(self, label=_("User autocompletion settings"))
|
userAutocompletionBox = wx.StaticBox(self, label=_("User autocompletion settings"))
|
||||||
self.userAutocompletionStart = wx.Button(self, wx.ID_ANY, _("Scan account and add friends and followers to the user autocompletion database"))
|
self.userAutocompletionScan = wx.Button(self, wx.ID_ANY, _("Scan account and add friends and followers to the user autocompletion database"))
|
||||||
self.userAutocompletionManage = wx.Button(self, wx.ID_ANY, _("Manage autocompletion database"))
|
self.userAutocompletionManage = wx.Button(self, wx.ID_ANY, _("Manage autocompletion database"))
|
||||||
autocompletionSizer = wx.StaticBoxSizer(userAutocompletionBox, wx.HORIZONTAL)
|
autocompletionSizer = wx.StaticBoxSizer(userAutocompletionBox, wx.HORIZONTAL)
|
||||||
autocompletionSizer.Add(self.userAutocompletionStart, 0, wx.ALL, 5)
|
autocompletionSizer.Add(self.userAutocompletionScan, 0, wx.ALL, 5)
|
||||||
autocompletionSizer.Add(self.userAutocompletionManage, 0, wx.ALL, 5)
|
autocompletionSizer.Add(self.userAutocompletionManage, 0, wx.ALL, 5)
|
||||||
sizer.Add(autocompletionSizer, 0, wx.ALL, 5)
|
sizer.Add(autocompletionSizer, 0, wx.ALL, 5)
|
||||||
self.relative_time = wx.CheckBox(self, wx.ID_ANY, _(U"Relative timestamps"))
|
self.relative_time = wx.CheckBox(self, wx.ID_ANY, _(U"Relative timestamps"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user