Added 'manage accounts' option in the application menu

This commit is contained in:
Manuel Cortez 2019-10-11 13:19:53 -05:00
parent c206a40e62
commit 63def5530f
5 changed files with 34 additions and 10 deletions

View File

@ -5,12 +5,13 @@
### New additions
* Socializer is now more tolerant to internet issues. When attempting to create a wall post, comment, topic or send a chat message, if the data is unable to be posted to VK, socializer will allow you to try to post it again, giving you the opportunity to edit or copy the text of the post in case you want to save it for later.
* Switching accounts is now supported in socializer. In the application menu, there is an option called "manage accounts" which allows you to add or remove an account. Socializer will take changes after a restart of the application. In case of having multiple accounts, every time Socializer starts, you will see a dialog from where is possible to choose the account for logging in.
* when selecting multiple audio files in audio buffers, multiple actions can be performed in all items, these actions are present in the contextual menu of the buffer (namely play, add/remove from the library and move to a different playlist). This means you can select all the audios you want and Socializer will perform the selected options in all items, making it a bit easier to operate with multiple songs.
* Now it is possible to like and see who liked a comment when displaying it individually. This applies to comments in wall posts and topics.
* Now it is possible to choose how many items Socializer will load in conversation buffers, from the General tab in the preferences dialog. The default value is 50 items, and the maximum value is 200.
* There is a new tab called buffer settings, in the preferences dialog. Settings related to how many items should be loaded in certain buffer types have been moved to this tab, so it will separate better the configuration options in the application.
* Added management of the Blacklist on VK. Users can be blocked from people buffers (friends, online, or any buffer inside friend requests). You can access the blacklist from the application menu, located in the menu bar. From there, you can unblock any previously blocked user.
* In the new timeline dialog, it is possible to create video buffers.
* In the new timeline dialog, it is possible to create video buffers by selecting the "video" radio button as buffer type.
### bugfixes

View File

@ -22,7 +22,7 @@ from mysc import restart
from mysc.repeating_timer import RepeatingTimer
from mysc.thread_utils import call_threaded
from mysc import localization
from sessionmanager import session, utils, renderers
from sessionmanager import session, utils, renderers, sessionManager
from wxUI import (mainWindow, commonMessages, menus)
from wxUI.dialogs import search as searchDialogs
from wxUI.dialogs import creation, timeline
@ -629,6 +629,7 @@ class Controller(object):
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.open_logs, menuitem=self.window.open_logs)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.open_config, menuitem=self.window.open_config)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.blacklist, menuitem=self.window.blacklist)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.manage_accounts, menuitem=self.window.accounts)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.configuration, menuitem=self.window.settings_dialog)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.new_timeline, menuitem=self.window.timeline)
widgetUtils.connect_event(self.window, widgetUtils.MENU, self.create_audio_album, menuitem=self.window.audio_album)
@ -737,6 +738,14 @@ class Controller(object):
""" Opens the blacklist presenter."""
presenter = presenters.blacklistPresenter(session=self.session, view=views.blacklistDialog(), interactor=interactors.blacklistInteractor())
def manage_accounts(self, *args, **kwargs):
accounts = sessionManager.sessionManagerController(starting=False)
accounts.view.get_response()
if hasattr(accounts, "modified"):
restart_msg = commonMessages.restart_program()
if restart_msg == widgetUtils.YES:
restart.restart_program()
def open_logs(self, *args, **kwargs):
subprocess.call(["explorer", paths.logs_path()])

View File

@ -14,10 +14,14 @@ from .config_utils import Configuration
log = logging.getLogger("sessionmanager.sessionManager")
class sessionManagerController(object):
def __init__(self):
def __init__(self, starting=True):
super(sessionManagerController, self).__init__()
log.debug("Setting up the session manager.")
self.view = view.sessionManagerWindow()
if starting:
title=_("Select an account")
else:
title = _("Manage accounts")
self.view = view.sessionManagerWindow(starting=starting, title=title)
widgetUtils.connect_event(self.view.new, widgetUtils.BUTTON_PRESSED, self.manage_new_account)
widgetUtils.connect_event(self.view.remove, widgetUtils.BUTTON_PRESSED, self.remove)
self.fill_list()
@ -50,6 +54,7 @@ class sessionManagerController(object):
name = s.settings["vk"]["user"]
self.sessions.append((location, name))
self.view.list.insert_item(False, *[name])
self.modified = True
def get_authorisation(self, c):
log.debug("Starting the authorisation process...")
@ -88,3 +93,4 @@ class sessionManagerController(object):
shutil.rmtree(path=os.path.join(paths.config_path(), selected_session[0]), ignore_errors=True)
self.sessions.remove(selected_session)
self.view.list.remove_item(self.view.list.get_selected())
self.modified = True

View File

@ -39,8 +39,8 @@ class newSessionDialog(widgetUtils.BaseDialog):
return self.passw.GetValue()
class sessionManagerWindow(widgetUtils.BaseDialog):
def __init__(self):
super(sessionManagerWindow, self).__init__(parent=None, title=_("Select an account"), size=wx.DefaultSize)
def __init__(self, title, starting=True):
super(sessionManagerWindow, self).__init__(parent=None, title=title, size=wx.DefaultSize)
panel = wx.Panel(self)
sizer = wx.BoxSizer(wx.VERTICAL)
label = wx.StaticText(panel, -1, _(u"Accounts list"), size=wx.DefaultSize)
@ -51,13 +51,20 @@ class sessionManagerWindow(widgetUtils.BaseDialog):
sizer.Add(listSizer, 0, wx.ALL, 5)
self.new = wx.Button(panel, -1, _("New account"), size=wx.DefaultSize)
self.remove = wx.Button(panel, -1, _(u"Remove account"))
ok = wx.Button(panel, wx.ID_OK, size=wx.DefaultSize)
if starting:
id_ok = wx.ID_OK
else:
id_ok = wx.ID_CANCEL
ok = wx.Button(panel, id_ok, size=wx.DefaultSize)
ok.SetDefault()
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
if starting:
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
self.SetAffirmativeId(id_ok)
buttons = wx.BoxSizer(wx.HORIZONTAL)
buttons.Add(self.new, 0, wx.ALL, 5)
buttons.Add(ok, 0, wx.ALL, 5)
buttons.Add(cancel, 0, wx.ALL, 5)
if starting:
buttons.Add(cancel, 0, wx.ALL, 5)
sizer.Add(buttons, 0, wx.ALL, 5)
panel.SetSizer(sizer)
min = sizer.CalcMin()

View File

@ -16,6 +16,7 @@ class mainWindow(wx.Frame):
self.delete_video_album = delete.Append(wx.NewId(), _("Video album"))
app_.Append(wx.NewId(), _("Delete"), delete)
self.blacklist = app_.Append(wx.NewId(), _("Blacklist"))
self.accounts = app_.Append(wx.NewId(), _("Manage accounts"))
self.settings_dialog = app_.Append(wx.NewId(), _("Preferences"))
me = wx.Menu()
profile = wx.Menu()