mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 03:38:08 -06:00
Improvements on autocomplete, now it updates its database at startup
This commit is contained in:
parent
bc2d448464
commit
a13536233e
@ -36,3 +36,17 @@ class autocompletionSettings(object):
|
|||||||
wx_settings.show_success_dialog()
|
wx_settings.show_success_dialog()
|
||||||
self.dialog.Destroy()
|
self.dialog.Destroy()
|
||||||
|
|
||||||
|
def execute_at_startup(window):
|
||||||
|
database = storage.storage()
|
||||||
|
if config.main["mysc"]["save_followers_in_autocompletion_db"] == True:
|
||||||
|
buffer = window.search_buffer("people", "followers")
|
||||||
|
for i in buffer.db.settings[buffer.name_buffer]:
|
||||||
|
database.set_user(i["screen_name"], i["name"], 1)
|
||||||
|
else:
|
||||||
|
database.remove_by_buffer(1)
|
||||||
|
if config.main["mysc"]["save_friends_in_autocompletion_db"] == True:
|
||||||
|
buffer = window.search_buffer("people", "friends")
|
||||||
|
for i in buffer.db.settings[buffer.name_buffer]:
|
||||||
|
database.set_user(i["screen_name"], i["name"], 2)
|
||||||
|
else:
|
||||||
|
database.remove_by_buffer(2)
|
@ -34,6 +34,7 @@ import urllib2
|
|||||||
import sysTrayIcon
|
import sysTrayIcon
|
||||||
import switchModule
|
import switchModule
|
||||||
import languageHandler
|
import languageHandler
|
||||||
|
from extra.autocompletionUsers import settings as autocompletionUsersSettings
|
||||||
import pygeocoder
|
import pygeocoder
|
||||||
from pygeolib import GeocoderError
|
from pygeolib import GeocoderError
|
||||||
from sessionmanager import manager
|
from sessionmanager import manager
|
||||||
@ -355,6 +356,7 @@ class mainFrame(wx.Frame):
|
|||||||
self.check_streams.start()
|
self.check_streams.start()
|
||||||
# If all it's done, then play a nice sound saying that all it's OK.
|
# If all it's done, then play a nice sound saying that all it's OK.
|
||||||
sound.player.play("ready.ogg")
|
sound.player.play("ready.ogg")
|
||||||
|
autocompletionUsersSettings.execute_at_startup(window=self)
|
||||||
|
|
||||||
def remove_list(self, id):
|
def remove_list(self, id):
|
||||||
for i in range(0, self.nb.GetPageCount()):
|
for i in range(0, self.nb.GetPageCount()):
|
||||||
|
Loading…
Reference in New Issue
Block a user