From ac2b9c6a1e5dc7191b86f9e625c38d77b249e7fa Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Tue, 18 Dec 2018 16:32:14 -0600 Subject: [PATCH] Added set status option --- changelog.md | 1 + src/controller/mainController.py | 11 ++++++++++- src/wxUI/commonMessages.py | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 46f62c7..cbc0502 100644 --- a/changelog.md +++ b/changelog.md @@ -15,6 +15,7 @@ * Socializer should handle connection errors when loading items in buffers and retry in 2 minutes. Also, connection errors in the chat server are handled and chat should be able to reconnect by itself. * When trying to add an audio or video to an album, if the current user does not have any album, it will display an error instead of a traceback. * Added popular and suggested songs. This will not work when using alternative tokens. +* Now it is possible to update the status message, located in your profile. * Updated Russian translations: thanks to Дарья Ратникова. ## Changes in version 0.16 (13.12.2018) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 51665f0..df27b72 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -168,6 +168,7 @@ class Controller(object): pub.subscribe(self.get_chat, "order-sent-message") widgetUtils.connect_event(self.window, widgetUtils.MENU, self.view_my_profile, menuitem=self.window.view_profile) widgetUtils.connect_event(self.window, widgetUtils.MENU, self.view_my_profile_in_browser, menuitem=self.window.open_in_browser) + widgetUtils.connect_event(self.window, widgetUtils.MENU, self.set_status, menuitem=self.window.set_status) def disconnect_events(self): log.debug("Disconnecting some events...") @@ -660,4 +661,12 @@ class Controller(object): time.sleep(60) if hasattr(self, "longpoll"): del self.longpoll - self.create_longpoll_thread(notify=True) \ No newline at end of file + self.create_longpoll_thread(notify=True) + + def set_status(self, *args, **kwargs): + dlg = wx.TextEntryDialog(self.window, _(u"Write your status message"), _(u"Set status")) + if dlg.ShowModal() == widgetUtils.OK: + result = dlg.GetValue() + info = self.session.vk.client.account.saveProfileInfo(status=result) + commonMessages.updated_status() + dlg.Destroy() \ No newline at end of file diff --git a/src/wxUI/commonMessages.py b/src/wxUI/commonMessages.py index bc8f3d0..03d881a 100644 --- a/src/wxUI/commonMessages.py +++ b/src/wxUI/commonMessages.py @@ -33,3 +33,6 @@ def no_video_albums(): def delete_audio_album(): return wx.MessageDialog(None, _(u"Do you really want to delete this Album? this will be deleted from VK too."), _(u"Attention"), style=wx.ICON_QUESTION|wx.YES_NO).ShowModal() + +def updated_status(): + return wx.MessageDialog(None, _(u"Your status message has been successfully updated."), _(u"Success")).ShowModal() \ No newline at end of file