Core: Update 'tweet' menu on the menu bar for mastodon sessions

This commit is contained in:
Manuel Cortez 2022-12-21 10:24:44 -06:00
parent 43ae43ce26
commit e4f2793aaf
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
4 changed files with 10 additions and 3 deletions

View File

@ -710,6 +710,8 @@ class Controller(object):
else: else:
menu_item.Enable(True) menu_item.Enable(True)
menu_item.SetItemLabel(handler.menus[m]) menu_item.SetItemLabel(handler.menus[m])
if hasattr(handler, "item_menu"):
self.view.menubar.SetMenuLabel(1, handler.item_menu)
def fix_wrong_buffer(self): def fix_wrong_buffer(self):
buf = self.get_best_buffer() buf = self.get_best_buffer()
@ -1080,8 +1082,9 @@ class Controller(object):
for i in sm.removed_sessions: for i in sm.removed_sessions:
if sessions.sessions[i].logged == True: if sessions.sessions[i].logged == True:
self.logout_account(sessions.sessions[i].session_id) self.logout_account(sessions.sessions[i].session_id)
self.destroy_buffer(sessions.sessions[i].settings["twitter"]["user_name"], sessions.sessions[i].settings["twitter"]["user_name"]) self.destroy_buffer(sessions.sessions[i].get_name(), sessions.sessions[i].get_name())
self.accounts.remove(sessions.sessions[i].settings["twitter"]["user_name"]) if sessions.sessions[i].get_name() in self.accounts:
self.accounts.remove(sessions.sessions[i].get_name())
sessions.sessions.pop(i) sessions.sessions.pop(i)
def update_profile(self, *args, **kwargs): def update_profile(self, *args, **kwargs):

View File

@ -50,6 +50,8 @@ class Handler(object):
filter=None, filter=None,
manage_filters=None manage_filters=None
) )
# Name for the "tweet" menu in the menu bar.
self.item_menu = _("&Post")
def create_buffers(self, session, createAccounts=True, controller=None): def create_buffers(self, session, createAccounts=True, controller=None):
session.get_user_info() session.get_user_info()

View File

@ -50,6 +50,8 @@ class Handler(object):
filter=_("Create a &filter"), filter=_("Create a &filter"),
manage_filters=_("&Manage filters"), manage_filters=_("&Manage filters"),
) )
# Name for the "tweet" menu in the menu bar.
self.item_menu = _("&Tweet")
def create_buffers(self, session, createAccounts=True, controller=None): def create_buffers(self, session, createAccounts=True, controller=None):
session.get_user_info() session.get_user_info()

View File

@ -81,7 +81,7 @@ class mainFrame(wx.Frame):
# Add all to the menu Bar # Add all to the menu Bar
self.menubar.Append(self.menubar_application, _(u"&Application")) self.menubar.Append(self.menubar_application, _(u"&Application"))
self.menubar.Append(self.menubar_item, _(u"&Item")) self.menubar.Append(self.menubar_item, _("&Tweet"))
self.menubar.Append(self.menubar_user, _(u"&User")) self.menubar.Append(self.menubar_user, _(u"&User"))
self.menubar.Append(self.menubar_buffer, _(u"&Buffer")) self.menubar.Append(self.menubar_buffer, _(u"&Buffer"))
self.menubar.Append(self.menubar_audio, _(u"&Audio")) self.menubar.Append(self.menubar_audio, _(u"&Audio"))