Improvements on autocomplete, now it updates its database at startup

This commit is contained in:
Manuel Cortez 2014-12-05 16:23:54 -06:00
parent bc2d448464
commit a13536233e
2 changed files with 17 additions and 1 deletions

View File

@ -35,4 +35,18 @@ class autocompletionSettings(object):
database.remove_by_buffer(2)
wx_settings.show_success_dialog()
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)

View File

@ -34,6 +34,7 @@ import urllib2
import sysTrayIcon
import switchModule
import languageHandler
from extra.autocompletionUsers import settings as autocompletionUsersSettings
import pygeocoder
from pygeolib import GeocoderError
from sessionmanager import manager
@ -355,6 +356,7 @@ class mainFrame(wx.Frame):
self.check_streams.start()
# If all it's done, then play a nice sound saying that all it's OK.
sound.player.play("ready.ogg")
autocompletionUsersSettings.execute_at_startup(window=self)
def remove_list(self, id):
for i in range(0, self.nb.GetPageCount()):