...
 
Commits (2)
......@@ -6,6 +6,7 @@
* Improvements in the audio player module:
* When modifying volume of the playing audio, it will decrease or increase the volume by 2% instead of 5%.
* For users with multiple soundcards, there is a new tab in the preferences dialogue of Socializer, called sound. From there, you can define what soundcard will be used for input and output.
* it is possible to select the language used in socializer from the preferences dialog. When changing the language, the application must be restarted for the changes to take effect.
* Improvements in conversation buffers:
* it is possible to retrieve more items for conversation buffers. Due to API limitations, it is possible to load up to the last 600 messages for every conversation. Take into account that the process of loading more items takes some time. You will hear a message when the process is done.
* It is possible to delete entire conversations from the buffer's tree, by using the menu key and selecting "delete conversation". The conversation will be removed from VK.
......
......@@ -18,17 +18,22 @@ class configurationInteractor(base.baseInteractor):
if dlg == widgetUtils.YES:
self.presenter.restart_application()
def set_language(self, language):
self.view.general.language.SetSelection(language)
def install(self, *args, **kwargs):
super(configurationInteractor, self).install(*args, **kwargs)
pub.subscribe(self.create_tab, self.modulename+"_create_tab")
pub.subscribe(self.set_setting, self.modulename+"_set")
pub.subscribe(self.restart, self.modulename+"_restart_program")
pub.subscribe(self.set_language, self.modulename+"_set_language")
def uninstall(self):
super(configurationInteractor, self).uninstall()
pub.unsubscribe(self.create_tab, self.modulename+"_create_tab")
pub.unsubscribe(self.set_setting, self.modulename+"_set")
pub.unsubscribe(self.restart, self.modulename+"_restart_program")
pub.unsubscribe(self.set_language, self.modulename+"_set_language")
def start(self):
self.view.realize()
......@@ -60,6 +65,7 @@ class configurationInteractor(base.baseInteractor):
self.presenter.update_setting(section="load_at_startup", setting="audio_albums", value=self.view.get_value("startup", "audio_albums"))
self.presenter.update_setting(section="load_at_startup", setting="video_albums", value=self.view.get_value("startup", "video_albums"))
self.presenter.update_setting(section="load_at_startup", setting="communities", value=self.view.get_value("startup", "communities"))
self.presenter.update_app_setting(section="app-settings", setting="language", value=self.presenter.codes[self.view.general.language.GetSelection()])
self.presenter.update_app_setting(section="sound", setting="input_device", value=self.view.get_value("sound", "input"))
self.presenter.update_app_setting(section="sound", setting="output_device", value=self.view.get_value("sound", "output"))
self.presenter.update_app_setting(section="app-settings", setting="use_proxy", value=self.view.get_value("general", "use_proxy"))
......
......@@ -82,7 +82,7 @@ def getAvailableLanguages():
"""
#Make a list of all the locales found in NVDA's locale dir
l=[x for x in os.listdir(paths.locale_path()) if not x.startswith('.')]
l=[x for x in l if os.path.isfile(paths.locale_path('%s/LC_MESSAGES/%s.po' % (x, application.short_name)))]
l=[x for x in l if os.path.isfile(os.path.join(paths.locale_path(), '%s/LC_MESSAGES/%s.po' % (x, application.short_name)))]
#Make sure that en (english) is in the list as it may not have any locale files, but is default
if 'en' not in l:
l.append('en')
......
......@@ -2,6 +2,7 @@
from __future__ import unicode_literals
import sound_lib.input, sound_lib.output
import config
import languageHandler
from mysc import restart
from . import base
......@@ -44,7 +45,12 @@ class configurationPresenter(base.basePresenter):
return "alpha"
def create_config(self):
self.send_message("create_tab", tab="general")
self.langs = languageHandler.getAvailableLanguages()
langs = [i[1] for i in self.langs]
self.codes = [i[0] for i in self.langs]
id = self.codes.index(config.app["app-settings"]["language"])
self.send_message("create_tab", tab="general", arglist=dict(languages=langs))
self.send_message("set_language", language=id)
self.send_message("set", tab="general", setting="wall_buffer_count", value=self.session.settings["buffers"]["count_for_wall_buffers"])
self.send_message("set", tab="general", setting="video_buffers_count", value=self.session.settings["buffers"]["count_for_video_buffers"])
self.send_message("set", tab="general", setting="load_images", value=self.session.settings["general"]["load_images"])
......@@ -83,7 +89,7 @@ class configurationPresenter(base.basePresenter):
raise AttributeError("The setting you specified is not present in the config file.")
# check if certain settings have been changed so we'd restart the client.
# List of app settings that require a restart after being changed.
settings_needing_restart = ["use_proxy", "input_device", "output_device"]
settings_needing_restart = ["language", "use_proxy", "input_device", "output_device"]
if value != config.app[section][setting] and setting in settings_needing_restart:
self.needs_restart = True
config.app[section][setting] = value
......
......@@ -4,7 +4,7 @@ password = string(default="")
token = string(default="")
secret = string(default="")
device_id = string(default="")
use_alternative_tokens = boolean(default=False)
use_alternative_tokens = boolean(default=True)
invited_to_group = boolean(default=False)
[general]
......
......@@ -127,8 +127,11 @@ class vkSession(object):
config_filename = os.path.join(paths.config_path(), self.session_id, "vkconfig.json")
self.vk.login(self.settings["vk"]["user"], self.settings["vk"]["password"], token=self.settings["vk"]["token"], secret=self.settings["vk"]["secret"], device_id=self.settings["vk"]["device_id"], alt_token=self.settings["vk"]["use_alternative_tokens"], filename=config_filename)
self.settings["vk"]["token"] = self.vk.session_object.token["access_token"]
self.settings["vk"]["secret"] = self.vk.session_object.secret
self.settings["vk"]["device_id"] = self.vk.session_object.device_id
try:
self.settings["vk"]["secret"] = self.vk.session_object.secret
self.settings["vk"]["device_id"] = self.vk.session_object.device_id
except AttributeError:
pass
self.settings.write()
self.logged = True
self.get_my_data()
......
......@@ -4,9 +4,14 @@ import wx
import widgetUtils
class general(wx.Panel, widgetUtils.BaseDialog):
def __init__(self, panel):
def __init__(self, panel, languages):
super(general, self).__init__(panel)
sizer = wx.BoxSizer(wx.VERTICAL)
langBox = wx.StaticBoxSizer(parent=self, orient=wx.HORIZONTAL, label=_("Language"))
self.language = wx.ListBox(langBox.GetStaticBox(), wx.NewId(), choices=languages)
self.language.SetSize(self.language.GetBestSize())
langBox.Add(self.language, 0, wx.ALL, 5)
sizer.Add(langBox, 0, wx.ALL, 5)
lbl1 = wx.StaticText(self, wx.NewId(), _("Number of items to load for newsfeed and wall buffers (maximun 100)"))
self.wall_buffer_count = wx.SpinCtrl(self, wx.NewId())
self.wall_buffer_count.SetRange(1, 100)
......@@ -115,8 +120,8 @@ class configurationDialog(widgetUtils.BaseDialog):
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.notebook = wx.Notebook(self.panel)
def create_general(self):
self.general = general(self.notebook)
def create_general(self, languages):
self.general = general(self.notebook, languages)
self.notebook.AddPage(self.general, _("General"))
self.general.SetFocus()
......